Skip to content

Commit

Permalink
fix: fixed account activation error message (#1384)
Browse files Browse the repository at this point in the history
  • Loading branch information
ayesha-waris authored Nov 29, 2024
1 parent 76a5a5d commit 354c73b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 14 deletions.
12 changes: 5 additions & 7 deletions src/login/AccountActivationMessage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';

import { getConfig } from '@edx/frontend-platform';
import { FormattedMessage, useIntl } from '@edx/frontend-platform/i18n';
import { Alert } from '@openedx/paragon';
import { Alert, Hyperlink } from '@openedx/paragon';
import { CheckCircle, Error } from '@openedx/paragon/icons';
import PropTypes from 'prop-types';

Expand Down Expand Up @@ -36,19 +36,17 @@ const AccountActivationMessage = ({ messageType }) => {
break;
}
case ACCOUNT_ACTIVATION_MESSAGE.ERROR: {
const supportLink = (
<Alert.Link href={getConfig().ACTIVATION_EMAIL_SUPPORT_LINK}>
{formatMessage(messages['account.activation.support.link'])}
</Alert.Link>
const supportEmail = (
<Hyperlink isInline destination={`mailto:${getConfig().INFO_EMAIL}`}>{getConfig().INFO_EMAIL}</Hyperlink>
);

heading = formatMessage(messages[`account.${activationOrConfirmation}.error.message.title`]);
activationMessage = (
<FormattedMessage
id="account.activation.error.message"
defaultMessage="Something went wrong, please {supportLink} to resolve this issue."
defaultMessage="Something went wrong, please contact {supportEmail} to resolve this issue."
description="Account activation error message"
values={{ supportLink }}
values={{ supportEmail }}
/>
);
break;
Expand Down
5 changes: 0 additions & 5 deletions src/login/messages.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,6 @@ const messages = defineMessages({
defaultMessage: 'Your account could not be activated',
description: 'Account Activation error message title',
},
'account.activation.support.link': {
id: 'account.activation.support.link',
defaultMessage: 'contact support',
description: 'Link text used in account activation error message to go to learner help center',
},
// Email Confirmation Strings
'account.confirmation.success.message.title': {
id: 'account.confirmation.success.message.title',
Expand Down
4 changes: 2 additions & 2 deletions src/login/tests/AccountActivationMessage.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ describe('AccountActivationMessage', () => {
);

const expectedMessage = 'Your account could not be activated'
+ 'Something went wrong, please contact support to resolve this issue.';
+ 'Something went wrong, please contact to resolve this issue.';

expect(screen.getByText(
'',
Expand Down Expand Up @@ -121,7 +121,7 @@ describe('EmailConfirmationMessage', () => {
</IntlProvider>,
);
const expectedMessage = 'Your email could not be confirmed'
+ 'Something went wrong, please contact support to resolve this issue.';
+ 'Something went wrong, please contact to resolve this issue.';
expect(screen.getByText(
'',
{ selector: '#account-activation-message' },
Expand Down

0 comments on commit 354c73b

Please sign in to comment.