From 06c4f75b4aa92257cd72a7f07e19eb86f509c239 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 13 Apr 2023 13:41:10 +0500 Subject: [PATCH] chore(deps): update dependency eslint-plugin-import to v2.27.5 (#811) * chore(deps): update dependency eslint-plugin-import to v2.27.5 * fix: fix eslint tests --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: attiyaishaque --- .eslintrc.js | 1 + package-lock.json | 203 +++++++++--------- package.json | 2 +- src/common-components/EnterpriseSSO.jsx | 2 +- src/common-components/Logistration.jsx | 10 +- src/common-components/PasswordField.jsx | 2 +- src/common-components/SocialAuthProviders.jsx | 2 +- src/common-components/ThirdPartyAuthAlert.jsx | 2 +- src/common-components/data/reducers.js | 2 +- src/common-components/data/sagas.js | 2 +- src/data/utils/dataUtils.test.js | 2 +- src/forgot-password/ForgotPasswordAlert.jsx | 2 +- src/forgot-password/ForgotPasswordPage.jsx | 8 +- src/forgot-password/data/reducers.js | 2 +- src/login/ChangePasswordPrompt.jsx | 2 +- src/login/LoginPage.jsx | 16 +- src/login/data/reducers.js | 2 +- .../ProgressiveProfiling.jsx | 8 +- src/progressive-profiling/data/reducers.js | 2 +- src/recommendations/RecommendationsPage.jsx | 2 +- .../tests/RecommendationsPage.test.jsx | 2 +- src/register/ConfigurableRegistrationForm.jsx | 2 +- src/register/RegistrationFailure.jsx | 2 +- src/register/RegistrationPage.jsx | 30 +-- src/register/ThirdPartyAuth.jsx | 2 +- src/register/data/reducers.js | 8 +- src/reset-password/ResetPasswordPage.jsx | 12 +- 27 files changed, 161 insertions(+), 171 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 6c2bffa2..7bd70be0 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -48,5 +48,6 @@ module.exports = createConfig('eslint', { }, ], 'function-paren-newline': 'off', + 'import/no-cycle': 'off', }, }); diff --git a/package-lock.json b/package-lock.json index ee707651..a058077f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -58,7 +58,7 @@ "babel-plugin-formatjs": "10.4.0", "enzyme": "3.11.0", "enzyme-adapter-react-16": "1.15.7", - "eslint-plugin-import": "2.26.0", + "eslint-plugin-import": "2.27.5", "glob": "7.2.3", "history": "5.3.0", "husky": "7.0.4", @@ -2486,6 +2486,15 @@ "node": ">= 8" } }, + "node_modules/@edx/frontend-build/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, "node_modules/@edx/frontend-build/node_modules/diff-sequences": { "version": "26.6.2", "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-26.6.2.tgz", @@ -2495,6 +2504,18 @@ "node": ">= 10.14.2" } }, + "node_modules/@edx/frontend-build/node_modules/doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/@edx/frontend-build/node_modules/emittery": { "version": "0.7.2", "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.7.2.tgz", @@ -2507,6 +2528,33 @@ "url": "https://github.com/sindresorhus/emittery?sponsor=1" } }, + "node_modules/@edx/frontend-build/node_modules/eslint-plugin-import": { + "version": "2.26.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.26.0.tgz", + "integrity": "sha512-hYfi3FXaM8WPLf4S1cikh/r4IxnO6zrhZbEGz2b660EJRbuxgpDS5gkCuYgGWg2xxh2rBuIr4Pvhve/7c31koA==", + "dev": true, + "dependencies": { + "array-includes": "^3.1.4", + "array.prototype.flat": "^1.2.5", + "debug": "^2.6.9", + "doctrine": "^2.1.0", + "eslint-import-resolver-node": "^0.3.6", + "eslint-module-utils": "^2.7.3", + "has": "^1.0.3", + "is-core-module": "^2.8.1", + "is-glob": "^4.0.3", + "minimatch": "^3.1.2", + "object.values": "^1.1.5", + "resolve": "^1.22.0", + "tsconfig-paths": "^3.14.1" + }, + "engines": { + "node": ">=4" + }, + "peerDependencies": { + "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8" + } + }, "node_modules/@edx/frontend-build/node_modules/execa": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/execa/-/execa-4.1.0.tgz", @@ -3103,6 +3151,12 @@ "node": ">=10" } }, + "node_modules/@edx/frontend-build/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "dev": true + }, "node_modules/@edx/frontend-build/node_modules/npm-run-path": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", @@ -7745,14 +7799,15 @@ } }, "node_modules/array.prototype.flat": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.2.5.tgz", - "integrity": "sha512-KaYU+S+ndVqyUnignHftkwc58o3uVU1jzczILJ1tN2YaIZpFIKBiP/x/j97E5MVPsaCloPbqWLB/8qCTVvT2qg==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.1.tgz", + "integrity": "sha512-roTU0KWIOmJ4DRLmwKd19Otg0/mT3qPNt0Qb3GWW8iObuZXxrjB/pzn0R3hqpRSWg4HCwqx+0vwOnWnvlOyeIA==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "es-abstract": "^1.19.0" + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4", + "es-shim-unscopables": "^1.0.0" }, "engines": { "node": ">= 0.4" @@ -11194,13 +11249,14 @@ } }, "node_modules/eslint-import-resolver-node": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.6.tgz", - "integrity": "sha512-0En0w03NRVMn9Uiyn8YRPDKvWjxCWkslUEhGNTdGx15RvPJYQ+lbOlqrlNI2vEAs4pDYK4f/HN2TbDmk5TP0iw==", + "version": "0.3.7", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.7.tgz", + "integrity": "sha512-gozW2blMLJCeFpBwugLTGyvVjNoeo1knonXAcatC6bjPBZitotxdWf7Gimr25N4c0AAOo4eOUfaG82IJPDpqCA==", "dev": true, "dependencies": { "debug": "^3.2.7", - "resolve": "^1.20.0" + "is-core-module": "^2.11.0", + "resolve": "^1.22.1" } }, "node_modules/eslint-import-resolver-node/node_modules/debug": { @@ -11213,16 +11269,20 @@ } }, "node_modules/eslint-module-utils": { - "version": "2.7.3", - "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.7.3.tgz", - "integrity": "sha512-088JEC7O3lDZM9xGe0RerkOMd0EjFl+Yvd1jPWIkMT5u3H9+HC34mWWPnqPrN13gieT9pBOO+Qt07Nb/6TresQ==", + "version": "2.7.4", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.7.4.tgz", + "integrity": "sha512-j4GT+rqzCoRKHwURX7pddtIPGySnX9Si/cgMI5ztrcqOPtk5dDEeZ34CQVPphnqkJytlc97Vuk05Um2mJ3gEQA==", "dev": true, "dependencies": { - "debug": "^3.2.7", - "find-up": "^2.1.0" + "debug": "^3.2.7" }, "engines": { "node": ">=4" + }, + "peerDependenciesMeta": { + "eslint": { + "optional": true + } } }, "node_modules/eslint-module-utils/node_modules/debug": { @@ -11234,91 +11294,26 @@ "ms": "^2.1.1" } }, - "node_modules/eslint-module-utils/node_modules/find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", - "dev": true, - "dependencies": { - "locate-path": "^2.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/eslint-module-utils/node_modules/locate-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", - "dev": true, - "dependencies": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/eslint-module-utils/node_modules/p-limit": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", - "dev": true, - "dependencies": { - "p-try": "^1.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/eslint-module-utils/node_modules/p-locate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", - "dev": true, - "dependencies": { - "p-limit": "^1.1.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/eslint-module-utils/node_modules/p-try": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/eslint-module-utils/node_modules/path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", - "dev": true, - "engines": { - "node": ">=4" - } - }, "node_modules/eslint-plugin-import": { - "version": "2.26.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.26.0.tgz", - "integrity": "sha512-hYfi3FXaM8WPLf4S1cikh/r4IxnO6zrhZbEGz2b660EJRbuxgpDS5gkCuYgGWg2xxh2rBuIr4Pvhve/7c31koA==", + "version": "2.27.5", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.27.5.tgz", + "integrity": "sha512-LmEt3GVofgiGuiE+ORpnvP+kAm3h6MLZJ4Q5HCyHADofsb4VzXFsRiWj3c0OFiV+3DWFh0qg3v9gcPlfc3zRow==", "dev": true, "dependencies": { - "array-includes": "^3.1.4", - "array.prototype.flat": "^1.2.5", - "debug": "^2.6.9", + "array-includes": "^3.1.6", + "array.prototype.flat": "^1.3.1", + "array.prototype.flatmap": "^1.3.1", + "debug": "^3.2.7", "doctrine": "^2.1.0", - "eslint-import-resolver-node": "^0.3.6", - "eslint-module-utils": "^2.7.3", + "eslint-import-resolver-node": "^0.3.7", + "eslint-module-utils": "^2.7.4", "has": "^1.0.3", - "is-core-module": "^2.8.1", + "is-core-module": "^2.11.0", "is-glob": "^4.0.3", "minimatch": "^3.1.2", - "object.values": "^1.1.5", - "resolve": "^1.22.0", + "object.values": "^1.1.6", + "resolve": "^1.22.1", + "semver": "^6.3.0", "tsconfig-paths": "^3.14.1" }, "engines": { @@ -11329,12 +11324,12 @@ } }, "node_modules/eslint-plugin-import/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "dev": true, "dependencies": { - "ms": "2.0.0" + "ms": "^2.1.1" } }, "node_modules/eslint-plugin-import/node_modules/doctrine": { @@ -11349,12 +11344,6 @@ "node": ">=0.10.0" } }, - "node_modules/eslint-plugin-import/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "dev": true - }, "node_modules/eslint-plugin-jsx-a11y": { "version": "6.6.1", "resolved": "https://registry.npmjs.org/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.6.1.tgz", @@ -22111,11 +22100,11 @@ "integrity": "sha512-Zu1xbUt3/OPwsXL46hvOOoQrap2azE7ZQbokq61BQfiXvhewsKDwhMeZjTX9sX0nvw1t/U5Audyn1I9P/m9z0A==" }, "node_modules/resolve": { - "version": "1.22.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.0.tgz", - "integrity": "sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw==", + "version": "1.22.2", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.2.tgz", + "integrity": "sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g==", "dependencies": { - "is-core-module": "^2.8.1", + "is-core-module": "^2.11.0", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" }, diff --git a/package.json b/package.json index f692b23a..aad1c5cc 100644 --- a/package.json +++ b/package.json @@ -81,7 +81,7 @@ "babel-plugin-formatjs": "10.4.0", "enzyme": "3.11.0", "enzyme-adapter-react-16": "1.15.7", - "eslint-plugin-import": "2.26.0", + "eslint-plugin-import": "2.27.5", "glob": "7.2.3", "history": "5.3.0", "husky": "7.0.4", diff --git a/src/common-components/EnterpriseSSO.jsx b/src/common-components/EnterpriseSSO.jsx index 9005c12f..e27bd1a6 100644 --- a/src/common-components/EnterpriseSSO.jsx +++ b/src/common-components/EnterpriseSSO.jsx @@ -9,8 +9,8 @@ import { faSignInAlt } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import PropTypes from 'prop-types'; -import { LOGIN_PAGE, SUPPORTED_ICON_CLASSES } from '../data/constants'; import messages from './messages'; +import { LOGIN_PAGE, SUPPORTED_ICON_CLASSES } from '../data/constants'; /** * This component renders the Single sign-on (SSO) button only for the tpa provider passed diff --git a/src/common-components/Logistration.jsx b/src/common-components/Logistration.jsx index cc8c1101..6790ae55 100644 --- a/src/common-components/Logistration.jsx +++ b/src/common-components/Logistration.jsx @@ -14,17 +14,17 @@ import { ChevronLeft } from '@edx/paragon/icons'; import PropTypes from 'prop-types'; import { Redirect } from 'react-router-dom'; +import { clearThirdPartyAuthContextErrorMessage } from './data/actions'; +import { + tpaProvidersSelector, +} from './data/selectors'; +import messages from './messages'; import { BaseComponent } from '../base-component'; import { LOGIN_PAGE, REGISTER_PAGE } from '../data/constants'; import { getTpaHint, getTpaProvider, updatePathWithQueryParams } from '../data/utils'; import { LoginPage } from '../login'; import { RegistrationPage } from '../register'; import { backupRegistrationForm } from '../register/data/actions'; -import { clearThirdPartyAuthContextErrorMessage } from './data/actions'; -import { - tpaProvidersSelector, -} from './data/selectors'; -import messages from './messages'; const Logistration = (props) => { const { selectedPage, tpaProviders } = props; diff --git a/src/common-components/PasswordField.jsx b/src/common-components/PasswordField.jsx index 33d9b297..7334680d 100644 --- a/src/common-components/PasswordField.jsx +++ b/src/common-components/PasswordField.jsx @@ -9,8 +9,8 @@ import { } from '@edx/paragon/icons'; import PropTypes from 'prop-types'; -import { LETTER_REGEX, NUMBER_REGEX } from '../data/constants'; import messages from './messages'; +import { LETTER_REGEX, NUMBER_REGEX } from '../data/constants'; const PasswordField = (props) => { const { formatMessage } = useIntl(); diff --git a/src/common-components/SocialAuthProviders.jsx b/src/common-components/SocialAuthProviders.jsx index 9d80ea3d..8a21211b 100644 --- a/src/common-components/SocialAuthProviders.jsx +++ b/src/common-components/SocialAuthProviders.jsx @@ -6,8 +6,8 @@ import { faSignInAlt } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import PropTypes from 'prop-types'; -import { LOGIN_PAGE, SUPPORTED_ICON_CLASSES } from '../data/constants'; import messages from './messages'; +import { LOGIN_PAGE, SUPPORTED_ICON_CLASSES } from '../data/constants'; const SocialAuthProviders = (props) => { const { formatMessage } = useIntl(); diff --git a/src/common-components/ThirdPartyAuthAlert.jsx b/src/common-components/ThirdPartyAuthAlert.jsx index ca24738c..9ed908c4 100644 --- a/src/common-components/ThirdPartyAuthAlert.jsx +++ b/src/common-components/ThirdPartyAuthAlert.jsx @@ -5,8 +5,8 @@ import { useIntl } from '@edx/frontend-platform/i18n'; import { Alert } from '@edx/paragon'; import PropTypes from 'prop-types'; -import { LOGIN_PAGE, REGISTER_PAGE } from '../data/constants'; import messages from './messages'; +import { LOGIN_PAGE, REGISTER_PAGE } from '../data/constants'; const ThirdPartyAuthAlert = (props) => { const { formatMessage } = useIntl(); diff --git a/src/common-components/data/reducers.js b/src/common-components/data/reducers.js index fdb4675f..1bbeb338 100644 --- a/src/common-components/data/reducers.js +++ b/src/common-components/data/reducers.js @@ -1,5 +1,5 @@ -import { COMPLETE_STATE, PENDING_STATE } from '../../data/constants'; import { THIRD_PARTY_AUTH_CONTEXT, THIRD_PARTY_AUTH_CONTEXT_CLEAR_ERROR_MSG } from './actions'; +import { COMPLETE_STATE, PENDING_STATE } from '../../data/constants'; export const defaultState = { fieldDescriptions: {}, diff --git a/src/common-components/data/sagas.js b/src/common-components/data/sagas.js index cf20f3e4..ffe0be37 100644 --- a/src/common-components/data/sagas.js +++ b/src/common-components/data/sagas.js @@ -1,7 +1,6 @@ import { logError } from '@edx/frontend-platform/logging'; import { call, put, takeEvery } from 'redux-saga/effects'; -import { setCountryFromThirdPartyAuthContext } from '../../register/data/actions'; import { getThirdPartyAuthContextBegin, getThirdPartyAuthContextFailure, @@ -11,6 +10,7 @@ import { import { getThirdPartyAuthContext, } from './service'; +import { setCountryFromThirdPartyAuthContext } from '../../register/data/actions'; export function* fetchThirdPartyAuthContext(action) { try { diff --git a/src/data/utils/dataUtils.test.js b/src/data/utils/dataUtils.test.js index 2cb2c751..21a2dec8 100644 --- a/src/data/utils/dataUtils.test.js +++ b/src/data/utils/dataUtils.test.js @@ -1,5 +1,5 @@ -import { LOGIN_PAGE } from '../constants'; import { updatePathWithQueryParams } from './dataUtils'; +import { LOGIN_PAGE } from '../constants'; describe('updatePathWithQueryParams', () => { it('should append query params into the path', () => { diff --git a/src/forgot-password/ForgotPasswordAlert.jsx b/src/forgot-password/ForgotPasswordAlert.jsx index 38a1806b..999fc425 100644 --- a/src/forgot-password/ForgotPasswordAlert.jsx +++ b/src/forgot-password/ForgotPasswordAlert.jsx @@ -6,11 +6,11 @@ import { Alert } from '@edx/paragon'; import { CheckCircle, Error } from '@edx/paragon/icons'; import PropTypes from 'prop-types'; +import messages from './messages'; import { COMPLETE_STATE, FORBIDDEN_STATE, FORM_SUBMISSION_ERROR, INTERNAL_SERVER_ERROR, } from '../data/constants'; import { PASSWORD_RESET } from '../reset-password/data/constants'; -import messages from './messages'; const ForgotPasswordAlert = (props) => { const { formatMessage } = useIntl(); diff --git a/src/forgot-password/ForgotPasswordPage.jsx b/src/forgot-password/ForgotPasswordPage.jsx index 9356d52b..d93f4ade 100644 --- a/src/forgot-password/ForgotPasswordPage.jsx +++ b/src/forgot-password/ForgotPasswordPage.jsx @@ -17,14 +17,14 @@ import PropTypes from 'prop-types'; import { Helmet } from 'react-helmet'; import { Redirect } from 'react-router-dom'; -import { BaseComponent } from '../base-component'; -import { FormGroup } from '../common-components'; -import { DEFAULT_STATE, LOGIN_PAGE, VALID_EMAIL_REGEX } from '../data/constants'; -import { updatePathWithQueryParams, windowScrollTo } from '../data/utils'; import { forgotPassword, setForgotPasswordFormData } from './data/actions'; import { forgotPasswordResultSelector } from './data/selectors'; import ForgotPasswordAlert from './ForgotPasswordAlert'; import messages from './messages'; +import { BaseComponent } from '../base-component'; +import { FormGroup } from '../common-components'; +import { DEFAULT_STATE, LOGIN_PAGE, VALID_EMAIL_REGEX } from '../data/constants'; +import { updatePathWithQueryParams, windowScrollTo } from '../data/utils'; const ForgotPasswordPage = (props) => { const platformName = getConfig().SITE_NAME; diff --git a/src/forgot-password/data/reducers.js b/src/forgot-password/data/reducers.js index 1f30ce3b..7fd62929 100644 --- a/src/forgot-password/data/reducers.js +++ b/src/forgot-password/data/reducers.js @@ -1,6 +1,6 @@ +import { FORGOT_PASSWORD, FORGOT_PASSWORD_PERSIST_FORM_DATA } from './actions'; import { INTERNAL_SERVER_ERROR, PENDING_STATE } from '../../data/constants'; import { PASSWORD_RESET_FAILURE } from '../../reset-password/data/actions'; -import { FORGOT_PASSWORD, FORGOT_PASSWORD_PERSIST_FORM_DATA } from './actions'; export const defaultState = { status: '', diff --git a/src/login/ChangePasswordPrompt.jsx b/src/login/ChangePasswordPrompt.jsx index 2ce7cfca..6a989320 100644 --- a/src/login/ChangePasswordPrompt.jsx +++ b/src/login/ChangePasswordPrompt.jsx @@ -9,10 +9,10 @@ import classNames from 'classnames'; import PropTypes from 'prop-types'; import { Link, Redirect } from 'react-router-dom'; +import messages from './messages'; import { DEFAULT_REDIRECT_URL, RESET_PAGE } from '../data/constants'; import { updatePathWithQueryParams } from '../data/utils'; import useMobileResponsive from '../data/utils/useMobileResponsive'; -import messages from './messages'; const ChangePasswordPrompt = ({ variant, redirectUrl }) => { const isMobileView = useMobileResponsive(); diff --git a/src/login/LoginPage.jsx b/src/login/LoginPage.jsx index e1d37305..1fc44d76 100644 --- a/src/login/LoginPage.jsx +++ b/src/login/LoginPage.jsx @@ -13,6 +13,14 @@ import { Helmet } from 'react-helmet'; import Skeleton from 'react-loading-skeleton'; import { Link } from 'react-router-dom'; +import AccountActivationMessage from './AccountActivationMessage'; +import { + loginRemovePasswordResetBanner, loginRequest, loginRequestFailure, loginRequestReset, setLoginFormData, +} from './data/actions'; +import { INVALID_FORM, TPA_AUTHENTICATION_FAILURE } from './data/constants'; +import { loginErrorSelector, loginFormDataSelector, loginRequestSelector } from './data/selectors'; +import LoginFailureMessage from './LoginFailure'; +import messages from './messages'; import { FormGroup, InstitutionLogistration, PasswordField, RedirectLogistration, RenderInstitutionButton, SocialAuthProviders, ThirdPartyAuthAlert, @@ -33,14 +41,6 @@ import { windowScrollTo, } from '../data/utils'; import ResetPasswordSuccess from '../reset-password/ResetPasswordSuccess'; -import AccountActivationMessage from './AccountActivationMessage'; -import { - loginRemovePasswordResetBanner, loginRequest, loginRequestFailure, loginRequestReset, setLoginFormData, -} from './data/actions'; -import { INVALID_FORM, TPA_AUTHENTICATION_FAILURE } from './data/constants'; -import { loginErrorSelector, loginFormDataSelector, loginRequestSelector } from './data/selectors'; -import LoginFailureMessage from './LoginFailure'; -import messages from './messages'; class LoginPage extends React.Component { constructor(props, context) { diff --git a/src/login/data/reducers.js b/src/login/data/reducers.js index f1f4f594..dc7069b5 100644 --- a/src/login/data/reducers.js +++ b/src/login/data/reducers.js @@ -1,6 +1,6 @@ +import { LOGIN_PERSIST_FORM_DATA, LOGIN_REMOVE_PASSWORD_RESET_BANNER, LOGIN_REQUEST } from './actions'; import { DEFAULT_STATE, PENDING_STATE } from '../../data/constants'; import { RESET_PASSWORD } from '../../reset-password'; -import { LOGIN_PERSIST_FORM_DATA, LOGIN_REMOVE_PASSWORD_RESET_BANNER, LOGIN_REQUEST } from './actions'; export const defaultState = { loginError: null, diff --git a/src/progressive-profiling/ProgressiveProfiling.jsx b/src/progressive-profiling/ProgressiveProfiling.jsx index 54e6be4c..3126d939 100644 --- a/src/progressive-profiling/ProgressiveProfiling.jsx +++ b/src/progressive-profiling/ProgressiveProfiling.jsx @@ -22,6 +22,10 @@ import { Error } from '@edx/paragon/icons'; import PropTypes from 'prop-types'; import { Helmet } from 'react-helmet'; +import { saveUserProfile } from './data/actions'; +import { welcomePageSelector } from './data/selectors'; +import messages from './messages'; +import ProgressiveProfilingPageModal from './ProgressiveProfilingPageModal'; import { BaseComponent } from '../base-component'; import { RedirectLogistration } from '../common-components'; import { @@ -33,10 +37,6 @@ import { activateRecommendationsExperiment, RECOMMENDATIONS_EXP_VARIATION, trackRecommendationViewedOptimizely, } from '../recommendations/optimizelyExperiment'; import { trackRecommendationsGroup, trackRecommendationsViewed } from '../recommendations/track'; -import { saveUserProfile } from './data/actions'; -import { welcomePageSelector } from './data/selectors'; -import messages from './messages'; -import ProgressiveProfilingPageModal from './ProgressiveProfilingPageModal'; const ProgressiveProfiling = (props) => { const { diff --git a/src/progressive-profiling/data/reducers.js b/src/progressive-profiling/data/reducers.js index cfd968e6..c087c070 100644 --- a/src/progressive-profiling/data/reducers.js +++ b/src/progressive-profiling/data/reducers.js @@ -1,7 +1,7 @@ +import { SAVE_USER_PROFILE } from './actions'; import { DEFAULT_STATE, PENDING_STATE, } from '../../data/constants'; -import { SAVE_USER_PROFILE } from './actions'; export const defaultState = { extendedProfile: [], diff --git a/src/recommendations/RecommendationsPage.jsx b/src/recommendations/RecommendationsPage.jsx index fa610585..efec84b3 100644 --- a/src/recommendations/RecommendationsPage.jsx +++ b/src/recommendations/RecommendationsPage.jsx @@ -8,13 +8,13 @@ import { import PropTypes from 'prop-types'; import { Helmet } from 'react-helmet'; -import { DEFAULT_REDIRECT_URL } from '../data/constants'; import { EDUCATION_LEVEL_MAPPING, RECOMMENDATIONS_COUNT } from './data/constants'; import getPersonalizedRecommendations from './data/service'; import { convertCourseRunKeytoCourseKey } from './data/utils'; import messages from './messages'; import RecommendationsList from './RecommendationsList'; import { trackRecommendationsViewed } from './track'; +import { DEFAULT_REDIRECT_URL } from '../data/constants'; const RecommendationsPage = (props) => { const { location } = props; diff --git a/src/recommendations/tests/RecommendationsPage.test.jsx b/src/recommendations/tests/RecommendationsPage.test.jsx index c5a3494a..bc47cd07 100644 --- a/src/recommendations/tests/RecommendationsPage.test.jsx +++ b/src/recommendations/tests/RecommendationsPage.test.jsx @@ -8,11 +8,11 @@ import { mount } from 'enzyme'; import { act } from 'react-dom/test-utils'; import configureStore from 'redux-mock-store'; +import { mockedGeneralRecommendations, mockedResponse } from './mockedData'; import { DEFAULT_REDIRECT_URL } from '../../data/constants'; import getPersonalizedRecommendations from '../data/service'; import { trackRecommendationCardClickOptimizely } from '../optimizelyExperiment'; import RecommendationsPage from '../RecommendationsPage'; -import { mockedGeneralRecommendations, mockedResponse } from './mockedData'; const IntlRecommendationsPage = injectIntl(RecommendationsPage); const mockStore = configureStore(); diff --git a/src/register/ConfigurableRegistrationForm.jsx b/src/register/ConfigurableRegistrationForm.jsx index 71812cca..844949f0 100644 --- a/src/register/ConfigurableRegistrationForm.jsx +++ b/src/register/ConfigurableRegistrationForm.jsx @@ -4,12 +4,12 @@ import { getConfig } from '@edx/frontend-platform'; import { useIntl } from '@edx/frontend-platform/i18n'; import PropTypes from 'prop-types'; -import { FormFieldRenderer } from '../field-renderer'; import { FIELDS } from './data/constants'; import { validateCountryField } from './data/utils'; import messages from './messages'; import { HonorCode, TermsOfService } from './registrationFields'; import CountryField from './registrationFields/CountryField'; +import { FormFieldRenderer } from '../field-renderer'; /** * Fields on registration page that are not the default required fields (name, email, username, password). diff --git a/src/register/RegistrationFailure.jsx b/src/register/RegistrationFailure.jsx index 21df5ef4..ba53761e 100644 --- a/src/register/RegistrationFailure.jsx +++ b/src/register/RegistrationFailure.jsx @@ -6,7 +6,6 @@ import { Alert } from '@edx/paragon'; import { Error } from '@edx/paragon/icons'; import PropTypes from 'prop-types'; -import { windowScrollTo } from '../data/utils'; import { FORBIDDEN_REQUEST, INTERNAL_SERVER_ERROR, @@ -14,6 +13,7 @@ import { TPA_SESSION_EXPIRED, } from './data/constants'; import messages from './messages'; +import { windowScrollTo } from '../data/utils'; const RegistrationFailureMessage = (props) => { const { formatMessage } = useIntl(); diff --git a/src/register/RegistrationPage.jsx b/src/register/RegistrationPage.jsx index 4f93bad2..ef049455 100644 --- a/src/register/RegistrationPage.jsx +++ b/src/register/RegistrationPage.jsx @@ -13,21 +13,6 @@ import PropTypes from 'prop-types'; import { Helmet } from 'react-helmet'; import Skeleton from 'react-loading-skeleton'; -import { - FormGroup, InstitutionLogistration, PasswordField, RedirectLogistration, ThirdPartyAuthAlert, -} from '../common-components'; -import { getThirdPartyAuthContext } from '../common-components/data/actions'; -import { - fieldDescriptionSelector, optionalFieldsSelector, thirdPartyAuthContextSelector, -} from '../common-components/data/selectors'; -import EnterpriseSSO from '../common-components/EnterpriseSSO'; -import { - COMPLETE_STATE, - DEFAULT_STATE, INVALID_NAME_REGEX, LETTER_REGEX, NUMBER_REGEX, PENDING_STATE, REGISTER_PAGE, VALID_EMAIL_REGEX, -} from '../data/constants'; -import { - getAllPossibleQueryParams, getTpaHint, getTpaProvider, setCookie, setSurveyCookie, -} from '../data/utils'; import ConfigurableRegistrationForm from './ConfigurableRegistrationForm'; import { backupRegistrationFormBegin, @@ -52,6 +37,21 @@ import messages from './messages'; import RegistrationFailure from './RegistrationFailure'; import { EmailField, UsernameField } from './registrationFields'; import ThirdPartyAuth from './ThirdPartyAuth'; +import { + FormGroup, InstitutionLogistration, PasswordField, RedirectLogistration, ThirdPartyAuthAlert, +} from '../common-components'; +import { getThirdPartyAuthContext } from '../common-components/data/actions'; +import { + fieldDescriptionSelector, optionalFieldsSelector, thirdPartyAuthContextSelector, +} from '../common-components/data/selectors'; +import EnterpriseSSO from '../common-components/EnterpriseSSO'; +import { + COMPLETE_STATE, + DEFAULT_STATE, INVALID_NAME_REGEX, LETTER_REGEX, NUMBER_REGEX, PENDING_STATE, REGISTER_PAGE, VALID_EMAIL_REGEX, +} from '../data/constants'; +import { + getAllPossibleQueryParams, getTpaHint, getTpaProvider, setCookie, setSurveyCookie, +} from '../data/utils'; const emailRegex = new RegExp(VALID_EMAIL_REGEX, 'i'); const urlRegex = new RegExp(INVALID_NAME_REGEX); diff --git a/src/register/ThirdPartyAuth.jsx b/src/register/ThirdPartyAuth.jsx index 0368b6cf..12b4540c 100644 --- a/src/register/ThirdPartyAuth.jsx +++ b/src/register/ThirdPartyAuth.jsx @@ -5,6 +5,7 @@ import { useIntl } from '@edx/frontend-platform/i18n'; import PropTypes from 'prop-types'; import Skeleton from 'react-loading-skeleton'; +import messages from './messages'; import { RenderInstitutionButton, SocialAuthProviders, @@ -12,7 +13,6 @@ import { import { PENDING_STATE, REGISTER_PAGE, } from '../data/constants'; -import messages from './messages'; /** * This component renders the Single sign-on (SSO) buttons for the providers passed. diff --git a/src/register/data/reducers.js b/src/register/data/reducers.js index ba4d51ea..f69518c9 100644 --- a/src/register/data/reducers.js +++ b/src/register/data/reducers.js @@ -1,7 +1,3 @@ -import { - DEFAULT_STATE, - PENDING_STATE, -} from '../../data/constants'; import { BACKUP_REGISTRATION_DATA, REGISTER_CLEAR_USERNAME_SUGGESTIONS, @@ -10,6 +6,10 @@ import { REGISTER_SET_COUNTRY_CODE, REGISTER_SET_USER_PIPELINE_DATA_LOADED, REGISTERATION_CLEAR_BACKEND_ERROR, } from './actions'; +import { + DEFAULT_STATE, + PENDING_STATE, +} from '../../data/constants'; export const defaultState = { backendCountryCode: '', diff --git a/src/reset-password/ResetPasswordPage.jsx b/src/reset-password/ResetPasswordPage.jsx index bc020d7a..4a78e878 100644 --- a/src/reset-password/ResetPasswordPage.jsx +++ b/src/reset-password/ResetPasswordPage.jsx @@ -16,12 +16,6 @@ import PropTypes from 'prop-types'; import { Helmet } from 'react-helmet'; import { Redirect } from 'react-router-dom'; -import { BaseComponent } from '../base-component'; -import { PasswordField } from '../common-components'; -import { - LETTER_REGEX, LOGIN_PAGE, NUMBER_REGEX, RESET_PAGE, -} from '../data/constants'; -import { getAllPossibleQueryParams, updatePathWithQueryParams, windowScrollTo } from '../data/utils'; import { resetPassword, validateToken } from './data/actions'; import { FORM_SUBMISSION_ERROR, PASSWORD_RESET_ERROR, PASSWORD_VALIDATION_ERROR, TOKEN_STATE, @@ -30,6 +24,12 @@ import { resetPasswordResultSelector } from './data/selectors'; import { validatePassword } from './data/service'; import messages from './messages'; import ResetPasswordFailure from './ResetPasswordFailure'; +import { BaseComponent } from '../base-component'; +import { PasswordField } from '../common-components'; +import { + LETTER_REGEX, LOGIN_PAGE, NUMBER_REGEX, RESET_PAGE, +} from '../data/constants'; +import { getAllPossibleQueryParams, updatePathWithQueryParams, windowScrollTo } from '../data/utils'; const ResetPasswordPage = (props) => { const { formatMessage } = useIntl();