**) Fix TPA Alert messages

**) Fix TPA options incorrect text

VAN-297
This commit is contained in:
Adeel Khan
2021-01-31 00:58:25 +05:00
parent 48a3480f4e
commit 9333da2df7
4 changed files with 6 additions and 26 deletions

View File

@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
import { FormattedMessage } from '@edx/frontend-platform/i18n';
import { Alert } from '@edx/paragon';
import { LOGIN_PAGE } from '../data/constants';
import { LOGIN_PAGE, REGISTER_PAGE } from '../data/constants';
const ThirdPartyAuthAlert = (props) => {
const { currentProvider, referrer, platformName } = props;
@@ -29,7 +29,7 @@ const ThirdPartyAuthAlert = (props) => {
);
}
return <Alert id="tpa-alert" className="alert-success mt-n2">{ message }</Alert>;
return <Alert id="tpa-alert" className={referrer === REGISTER_PAGE ? 'alert-success mt-n2' : 'alert-warning mt-n2'}>{ message }</Alert>;
};
ThirdPartyAuthAlert.defaultProps = {

View File

@@ -2,7 +2,7 @@
exports[`ThirdPartyAuthAlert should match login page third party auth alert message snapshot 1`] = `
<div
className="fade alert-success mt-n2 alert show"
className="fade alert-warning mt-n2 alert show"
id="tpa-alert"
role="alert"
>
@@ -14,7 +14,7 @@ exports[`ThirdPartyAuthAlert should match login page third party auth alert mess
exports[`ThirdPartyAuthAlert should match register page third party auth alert message snapshot 1`] = `
<div
className="fade alert-success mt-n2 alert show"
className="fade alert-warning mt-n2 alert show"
id="tpa-alert"
role="alert"
>

View File

@@ -579,7 +579,7 @@ class RegistrationPage extends React.Component {
<ThirdPartyAuthAlert
currentProvider={currentProvider}
platformName={this.props.thirdPartyAuthContext.platformName}
referrer="register"
referrer={REGISTER_PAGE}
/>
)}
<div className="text-left">
@@ -717,7 +717,7 @@ class RegistrationPage extends React.Component {
{intl.formatMessage(messages['create.an.account.using'])}
</span>
</div>
) : <span className="mt-4 text-left">{intl.formatMessage(messages['create.an.account.using'])}</span>}
) : null}
{this.renderThirdPartyAuth(providers,
secondaryProviders,
currentProvider,

View File

@@ -200,11 +200,6 @@ exports[`./RegistrationPage.js should display no password field when current pro
Create Account
</span>
</button>
<span
className="mt-4 text-left"
>
or create an account using
</span>
</form>
</div>
</div>
@@ -696,11 +691,6 @@ exports[`./RegistrationPage.js should match default section snapshot 1`] = `
Create Account
</span>
</button>
<span
className="mt-4 text-left"
>
or create an account using
</span>
</form>
</div>
</div>
@@ -948,11 +938,6 @@ exports[`./RegistrationPage.js should match pending button state snapshot 1`] =
Create Account
</span>
</button>
<span
className="mt-4 text-left"
>
or create an account using
</span>
</form>
</div>
</div>
@@ -1201,11 +1186,6 @@ exports[`./RegistrationPage.js should show error message on 409 1`] = `
Create Account
</span>
</button>
<span
className="mt-4 text-left"
>
or create an account using
</span>
</form>
</div>
</div>