Remove course key

This commit is contained in:
Bianca Severino
2020-12-09 16:29:07 -05:00
parent 14160eaeb3
commit 19d5411402
3 changed files with 2 additions and 24 deletions

View File

@@ -64,7 +64,6 @@ export async function submitIdVerification(verificationData) {
facePhotoFile: 'face_image',
idPhotoFile: 'photo_id_image',
idPhotoName: 'full_name',
courseRunKey: 'course_key',
};
const postData = {};
// Don't include blank/null/undefined values.

View File

@@ -10,17 +10,11 @@ import messages from '../IdVerification.messages';
function SubmittedPanel(props) {
const { userId } = useContext(IdVerificationContext);
const [returnUrl, setReturnUrl] = useState('dashboard');
const [returnText, setReturnText] = useState('id.verification.return.dashboard');
const panelSlug = 'submitted';
// If the user accessed IDV through a course,
// link back to that course rather than the dashboard
useEffect(() => {
if (sessionStorage.getItem('courseRunKey')) {
setReturnUrl(`courses/${sessionStorage.getItem('courseRunKey')}`);
setReturnText('id.verification.return.course');
}
sendTrackEvent('edx.id_verification.submitted', {
category: 'id_verification',
user_id: userId,
@@ -37,10 +31,10 @@ function SubmittedPanel(props) {
</p>
<a
className="btn btn-primary"
href={`${getConfig().LMS_BASE_URL}/${returnUrl}`}
href={`${getConfig().LMS_BASE_URL}/dashboard`}
data-testid="return-button"
>
{props.intl.formatMessage(messages[returnText])}
{props.intl.formatMessage(messages['id.verification.return.dashboard'])}
</a>
</BasePanel>
);

View File

@@ -47,19 +47,4 @@ describe('SubmittedPanel', () => {
const button = await screen.findByTestId('return-button');
expect(button).toHaveTextContent(/Return to Your Dashboard/);
});
it('links to course with courseRunKey', async () => {
Storage.prototype.getItem = jest.fn(() => 'courseRunKey');
await act(async () => render((
<Router history={history}>
<IntlProvider locale="en">
<IdVerificationContext.Provider value={contextValue}>
<IntlSubmittedPanel {...defaultProps} />
</IdVerificationContext.Provider>
</IntlProvider>
</Router>
)));
const button = await screen.findByTestId('return-button');
expect(button).toHaveTextContent(/Return to Course/);
});
});