Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/data/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const RECOMMENDATIONS = '/recommendations';
export const PASSWORD_RESET_CONFIRM = '/password_reset_confirm/:token/';
export const PAGE_NOT_FOUND = '/notfound';
export const ENTERPRISE_LOGIN_URL = '/enterprise/login';
export const APP_NAME = 'authn';
export const APP_NAME = 'authn_mfe';

// Constants
export const SUPPORTED_ICON_CLASSES = ['apple', 'facebook', 'google', 'microsoft'];
Expand Down
29 changes: 22 additions & 7 deletions src/login/LoginPage.jsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
import {
useCallback, useEffect, useMemo, useState,
} from 'react';
import { useDispatch, useSelector } from 'react-redux';

Check failure on line 4 in src/login/LoginPage.jsx

View workflow job for this annotation

GitHub Actions / tests

There should be at least one empty line between import groups

import {

Check failure on line 5 in src/login/LoginPage.jsx

View workflow job for this annotation

GitHub Actions / tests

`../tracking/trackers/login` import should occur after import of `./messages`
trackForgotPasswordLinkClick, trackLoginPageViewed, trackLoginSuccess,
} from '../tracking/trackers/login';
import { setCohesionEventStates } from '../cohesion/data/actions';

Check failure on line 8 in src/login/LoginPage.jsx

View workflow job for this annotation

GitHub Actions / tests

`../cohesion/data/actions` import should occur after import of `react-router-dom`
import { ELEMENT_NAME, ELEMENT_TEXT, ELEMENT_TYPES, PAGE_TYPES } from '../cohesion/constants';

Check failure on line 9 in src/login/LoginPage.jsx

View workflow job for this annotation

GitHub Actions / tests

Expected a line break before this closing brace

Check failure on line 9 in src/login/LoginPage.jsx

View workflow job for this annotation

GitHub Actions / tests

Expected a line break after this opening brace

Check failure on line 9 in src/login/LoginPage.jsx

View workflow job for this annotation

GitHub Actions / tests

`../cohesion/constants` import should occur after import of `react-router-dom`

Check failure on line 9 in src/login/LoginPage.jsx

View workflow job for this annotation

GitHub Actions / tests

There should be at least one empty line between import groups
import { getConfig } from '@edx/frontend-platform';
import { sendPageEvent, sendTrackEvent } from '@edx/frontend-platform/analytics';
import { useIntl } from '@edx/frontend-platform/i18n';
import { Form, StatefulButton } from '@openedx/paragon';
import PropTypes from 'prop-types';
import { Helmet } from 'react-helmet';
import Skeleton from 'react-loading-skeleton';
import { Link } from 'react-router-dom';

Check failure on line 16 in src/login/LoginPage.jsx

View workflow job for this annotation

GitHub Actions / tests

There should be at least one empty line between import groups

import { removeCookie } from '../data/utils/cookies';

Check failure on line 17 in src/login/LoginPage.jsx

View workflow job for this annotation

GitHub Actions / tests

`../data/utils/cookies` import should occur after import of `./messages`
import {
FormGroup,
InstitutionLogistration,
Expand All @@ -20,7 +23,7 @@
ThirdPartyAuthAlert,
} from '../common-components';
import AccountActivationMessage from './AccountActivationMessage';
import { getThirdPartyAuthContext } from '../common-components/data/actions';

Check failure on line 26 in src/login/LoginPage.jsx

View workflow job for this annotation

GitHub Actions / tests

`../common-components/data/actions` import should occur after import of `./messages`
import { thirdPartyAuthContextSelector } from '../common-components/data/selectors';
import EnterpriseSSO from '../common-components/EnterpriseSSO';
import ThirdPartyAuth from '../common-components/ThirdPartyAuth';
Expand Down Expand Up @@ -96,7 +99,7 @@
const tpaHint = getTpaHint();

useEffect(() => {
sendPageEvent('login_and_registration', 'login');
trackLoginPageViewed();
}, []);
Comment thread
ssurendrannair marked this conversation as resolved.
Comment thread
ssurendrannair marked this conversation as resolved.
Comment thread
ssurendrannair marked this conversation as resolved.

useEffect(() => {
Expand Down Expand Up @@ -140,6 +143,13 @@
}
}, [thirdPartyErrorMessage]);

useEffect(() => {
if (loginResult.success) {
trackLoginSuccess();
removeCookie('ssoPipelineRedirectionDone');
}
Comment thread
ssurendrannair marked this conversation as resolved.
Comment thread
ssurendrannair marked this conversation as resolved.
}, [loginResult]);
Comment on lines +153 to +158
Comment thread
ssurendrannair marked this conversation as resolved.
Comment thread
ssurendrannair marked this conversation as resolved.
Comment thread
ssurendrannair marked this conversation as resolved.
Comment on lines +153 to +158

const validateFormFields = (payload) => {
const {
emailOrUsername,
Expand Down Expand Up @@ -183,6 +193,13 @@
password: formData.password,
...queryParams,
};
const eventData = {
pageType: PAGE_TYPES.SIGN_IN,
elementType: ELEMENT_TYPES.BUTTON,
webElementText: ELEMENT_TEXT.SIGN_IN,
webElementName: ELEMENT_NAME.SIGN_IN,
Comment thread
ssurendrannair marked this conversation as resolved.
};
dispatch(setCohesionEventStates(eventData));
dispatch(loginRequest(payload));
};

Expand All @@ -204,9 +221,6 @@
[name]: '',
}));
};
const trackForgotPasswordLinkClick = () => {
sendTrackEvent('edx.bi.password-reset_form.toggled', { category: 'user-engagement' });
};

const {
provider,
Expand Down Expand Up @@ -246,6 +260,7 @@
success={loginResult.success}
redirectUrl={loginResult.redirectUrl}
finishAuthUrl={finishAuthUrl}
currectProvider={currentProvider}
Comment thread
ssurendrannair marked this conversation as resolved.
Comment thread
ssurendrannair marked this conversation as resolved.
Comment on lines 266 to +270
/>
Comment on lines 266 to 271
Comment thread
ssurendrannair marked this conversation as resolved.
Comment thread
ssurendrannair marked this conversation as resolved.
<div className="mw-xs mt-3 mb-2">
<LoginFailureMessage
Expand Down
8 changes: 4 additions & 4 deletions src/logistration/Logistration.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
tpaProvidersSelector,
} from '../common-components/data/selectors';
import messages from '../common-components/messages';
import { LOGIN_PAGE, REGISTER_PAGE } from '../data/constants';
import { LOGIN_PAGE, REGISTER_PAGE, APP_NAME } from '../data/constants';
import {
getTpaHint, getTpaProvider, updatePathWithQueryParams,
} from '../data/utils';
Expand Down Expand Up @@ -63,7 +63,7 @@ const Logistration = ({
authService.getCsrfTokenService()
.getCsrfToken(getConfig().LMS_BASE_URL);
}
});
}, []);

useEffect(() => {
if (disablePublicAccountCreation) {
Expand All @@ -72,7 +72,7 @@ const Logistration = ({
}, [navigate, disablePublicAccountCreation]);

const handleInstitutionLogin = (e) => {
sendTrackEvent('edx.bi.institution_login_form.toggled', { category: 'user-engagement' });
sendTrackEvent('edx.bi.institution_login_form.toggled', { category: 'user-engagement', app_name: APP_NAME });
if (typeof e === 'string') {
sendPageEvent('login_and_registration', e === '/login' ? 'login' : 'register');
} else {
Expand All @@ -86,7 +86,7 @@ const Logistration = ({
if (tabKey === currentTab) {
return;
}
sendTrackEvent(`edx.bi.${tabKey.replace('/', '')}_form.toggled`, { category: 'user-engagement' });
sendTrackEvent(`edx.bi.${tabKey.replace('/', '')}_form.toggled`, { category: 'user-engagement', app_name: APP_NAME });
dispatch(clearThirdPartyAuthContextErrorMessage());
if (tabKey === LOGIN_PAGE) {
dispatch(backupRegistrationForm());
Expand Down
Loading