@openedx/frontend-app-authn 1.0.0-alpha.4 → 1.0.0-alpha.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Main.d.ts +3 -0
- package/{src/Main.tsx → dist/Main.js} +4 -15
- package/dist/Main.js.map +1 -0
- package/dist/app.d.ts +3 -0
- package/dist/app.js +41 -0
- package/dist/app.js.map +1 -0
- package/dist/app.scss +2 -0
- package/dist/base-container/components/default-layout/LargeLayout.d.ts +2 -0
- package/dist/base-container/components/default-layout/LargeLayout.js +11 -0
- package/dist/base-container/components/default-layout/LargeLayout.js.map +1 -0
- package/dist/base-container/components/default-layout/MediumLayout.d.ts +2 -0
- package/dist/base-container/components/default-layout/MediumLayout.js +11 -0
- package/dist/base-container/components/default-layout/MediumLayout.js.map +1 -0
- package/dist/base-container/components/default-layout/SmallLayout.d.ts +2 -0
- package/dist/base-container/components/default-layout/SmallLayout.js +11 -0
- package/dist/base-container/components/default-layout/SmallLayout.js.map +1 -0
- package/dist/base-container/components/default-layout/index.d.ts +3 -0
- package/{src/base-container/components/default-layout/index.jsx → dist/base-container/components/default-layout/index.js} +1 -0
- package/dist/base-container/components/default-layout/index.js.map +1 -0
- package/dist/base-container/components/default-layout/messages.d.ts +13 -0
- package/dist/base-container/components/default-layout/messages.js +15 -0
- package/dist/base-container/components/default-layout/messages.js.map +1 -0
- package/dist/base-container/components/image-layout/ExtraSmallLayout.d.ts +2 -0
- package/dist/base-container/components/image-layout/ExtraSmallLayout.js +10 -0
- package/dist/base-container/components/image-layout/ExtraSmallLayout.js.map +1 -0
- package/dist/base-container/components/image-layout/LargeLayout.d.ts +2 -0
- package/dist/base-container/components/image-layout/LargeLayout.js +11 -0
- package/dist/base-container/components/image-layout/LargeLayout.js.map +1 -0
- package/dist/base-container/components/image-layout/MediumLayout.d.ts +2 -0
- package/dist/base-container/components/image-layout/MediumLayout.js +11 -0
- package/dist/base-container/components/image-layout/MediumLayout.js.map +1 -0
- package/dist/base-container/components/image-layout/SmallLayout.d.ts +2 -0
- package/dist/base-container/components/image-layout/SmallLayout.js +10 -0
- package/dist/base-container/components/image-layout/SmallLayout.js.map +1 -0
- package/dist/base-container/components/image-layout/index.d.ts +4 -0
- package/{src/base-container/components/image-layout/index.jsx → dist/base-container/components/image-layout/index.js} +1 -0
- package/dist/base-container/components/image-layout/index.js.map +1 -0
- package/dist/base-container/components/image-layout/messages.d.ts +13 -0
- package/dist/base-container/components/image-layout/messages.js +15 -0
- package/dist/base-container/components/image-layout/messages.js.map +1 -0
- package/dist/base-container/components/welcome-page-layout/LargeLayout.d.ts +10 -0
- package/dist/base-container/components/welcome-page-layout/LargeLayout.js +14 -0
- package/dist/base-container/components/welcome-page-layout/LargeLayout.js.map +1 -0
- package/dist/base-container/components/welcome-page-layout/MediumLayout.d.ts +10 -0
- package/dist/base-container/components/welcome-page-layout/MediumLayout.js +14 -0
- package/dist/base-container/components/welcome-page-layout/MediumLayout.js.map +1 -0
- package/dist/base-container/components/welcome-page-layout/SmallLayout.d.ts +10 -0
- package/dist/base-container/components/welcome-page-layout/SmallLayout.js +14 -0
- package/dist/base-container/components/welcome-page-layout/SmallLayout.js.map +1 -0
- package/dist/base-container/components/welcome-page-layout/index.d.ts +3 -0
- package/{src/base-container/components/welcome-page-layout/index.jsx → dist/base-container/components/welcome-page-layout/index.js} +1 -0
- package/dist/base-container/components/welcome-page-layout/index.js.map +1 -0
- package/dist/base-container/components/welcome-page-layout/messages.d.ts +18 -0
- package/dist/base-container/components/welcome-page-layout/messages.js +20 -0
- package/dist/base-container/components/welcome-page-layout/messages.js.map +1 -0
- package/dist/base-container/index.d.ts +20 -0
- package/dist/base-container/index.js +27 -0
- package/dist/base-container/index.js.map +1 -0
- package/dist/common-components/EmbeddedRegistrationRoute.d.ts +14 -0
- package/{src/common-components/EmbeddedRegistrationRoute.jsx → dist/common-components/EmbeddedRegistrationRoute.js} +9 -13
- package/dist/common-components/EmbeddedRegistrationRoute.js.map +1 -0
- package/dist/common-components/EnterpriseSSO.d.ts +29 -0
- package/dist/common-components/EnterpriseSSO.js +55 -0
- package/dist/common-components/EnterpriseSSO.js.map +1 -0
- package/dist/common-components/FormGroup.d.ts +60 -0
- package/dist/common-components/FormGroup.js +66 -0
- package/dist/common-components/FormGroup.js.map +1 -0
- package/dist/common-components/InstitutionLogistration.d.ts +34 -0
- package/dist/common-components/InstitutionLogistration.js +38 -0
- package/dist/common-components/InstitutionLogistration.js.map +1 -0
- package/dist/common-components/NotFoundPage.d.ts +2 -0
- package/dist/common-components/NotFoundPage.js +5 -0
- package/dist/common-components/NotFoundPage.js.map +1 -0
- package/dist/common-components/PasswordField.d.ts +39 -0
- package/dist/common-components/PasswordField.js +94 -0
- package/dist/common-components/PasswordField.js.map +1 -0
- package/dist/common-components/RedirectLogistration.d.ts +39 -0
- package/dist/common-components/RedirectLogistration.js +68 -0
- package/dist/common-components/RedirectLogistration.js.map +1 -0
- package/dist/common-components/RegisterFaIcons.d.ts +1 -0
- package/dist/common-components/RegisterFaIcons.js +6 -0
- package/dist/common-components/RegisterFaIcons.js.map +1 -0
- package/dist/common-components/SocialAuthProviders.d.ts +23 -0
- package/dist/common-components/SocialAuthProviders.js +42 -0
- package/dist/common-components/SocialAuthProviders.js.map +1 -0
- package/dist/common-components/ThirdPartyAuth.d.ts +42 -0
- package/dist/common-components/ThirdPartyAuth.js +56 -0
- package/dist/common-components/ThirdPartyAuth.js.map +1 -0
- package/dist/common-components/ThirdPartyAuthAlert.d.ts +15 -0
- package/dist/common-components/ThirdPartyAuthAlert.js +32 -0
- package/dist/common-components/ThirdPartyAuthAlert.js.map +1 -0
- package/dist/common-components/UnAuthOnlyRoute.d.ts +14 -0
- package/dist/common-components/UnAuthOnlyRoute.js +31 -0
- package/dist/common-components/UnAuthOnlyRoute.js.map +1 -0
- package/dist/common-components/data/actions.d.ts +26 -0
- package/{src → dist}/common-components/data/actions.js +8 -13
- package/dist/common-components/data/actions.js.map +1 -0
- package/dist/common-components/data/reducers.d.ts +62 -0
- package/dist/common-components/data/reducers.js +39 -0
- package/dist/common-components/data/reducers.js.map +1 -0
- package/dist/common-components/data/sagas.d.ts +12 -0
- package/dist/common-components/data/sagas.js +21 -0
- package/dist/common-components/data/sagas.js.map +1 -0
- package/dist/common-components/data/selectors.d.ts +98 -0
- package/dist/common-components/data/selectors.js +11 -0
- package/dist/common-components/data/selectors.js.map +1 -0
- package/dist/common-components/data/service.d.ts +5 -0
- package/dist/common-components/data/service.js +31 -0
- package/dist/common-components/data/service.js.map +1 -0
- package/dist/common-components/index.d.ts +13 -0
- package/{src/common-components/index.jsx → dist/common-components/index.js} +1 -0
- package/dist/common-components/index.js.map +1 -0
- package/dist/common-components/messages.d.ts +113 -0
- package/dist/common-components/messages.js +126 -0
- package/dist/common-components/messages.js.map +1 -0
- package/dist/constants.d.ts +1 -0
- package/{src/constants.ts → dist/constants.js} +1 -0
- package/dist/constants.js.map +1 -0
- package/dist/data/configureStore.d.ts +3 -0
- package/{src → dist}/data/configureStore.js +11 -20
- package/dist/data/configureStore.js.map +1 -0
- package/dist/data/constants.d.ts +24 -0
- package/{src → dist}/data/constants.js +4 -8
- package/dist/data/constants.js.map +1 -0
- package/dist/data/countries.d.ts +26 -0
- package/{src/data/countries.ts → dist/data/countries.js} +6 -9
- package/dist/data/countries.js.map +1 -0
- package/dist/data/oneTrust.d.ts +2 -0
- package/dist/data/oneTrust.js +3 -0
- package/dist/data/oneTrust.js.map +1 -0
- package/dist/data/reducers.d.ts +254 -0
- package/dist/data/reducers.js +17 -0
- package/dist/data/reducers.js.map +1 -0
- package/dist/data/sagas.d.ts +1 -0
- package/{src → dist}/data/sagas.js +9 -10
- package/dist/data/sagas.js.map +1 -0
- package/dist/data/utils/cookies.d.ts +1 -0
- package/dist/data/utils/cookies.js +12 -0
- package/dist/data/utils/cookies.js.map +1 -0
- package/dist/data/utils/dataUtils.d.ts +11 -0
- package/dist/data/utils/dataUtils.js +67 -0
- package/dist/data/utils/dataUtils.js.map +1 -0
- package/dist/data/utils/index.d.ts +3 -0
- package/dist/data/utils/index.js +4 -0
- package/dist/data/utils/index.js.map +1 -0
- package/dist/data/utils/reduxUtils.d.ts +15 -0
- package/dist/data/utils/reduxUtils.js +29 -0
- package/dist/data/utils/reduxUtils.js.map +1 -0
- package/dist/data/utils/useMobileResponsive.d.ts +7 -0
- package/dist/data/utils/useMobileResponsive.js +22 -0
- package/dist/data/utils/useMobileResponsive.js.map +1 -0
- package/dist/field-renderer/FieldRenderer.d.ts +34 -0
- package/dist/field-renderer/FieldRenderer.js +70 -0
- package/dist/field-renderer/FieldRenderer.js.map +1 -0
- package/dist/field-renderer/index.d.ts +1 -0
- package/{src/field-renderer/index.jsx → dist/field-renderer/index.js} +1 -0
- package/dist/field-renderer/index.js.map +1 -0
- package/dist/forgot-password/ForgotPasswordAlert.d.ts +16 -0
- package/dist/forgot-password/ForgotPasswordAlert.js +66 -0
- package/dist/forgot-password/ForgotPasswordAlert.js.map +1 -0
- package/dist/forgot-password/ForgotPasswordPage.d.ts +36 -0
- package/dist/forgot-password/ForgotPasswordPage.js +91 -0
- package/dist/forgot-password/ForgotPasswordPage.js.map +1 -0
- package/dist/forgot-password/data/actions.d.ts +30 -0
- package/{src → dist}/forgot-password/data/actions.js +10 -16
- package/dist/forgot-password/data/actions.js.map +1 -0
- package/dist/forgot-password/data/reducers.d.ts +13 -0
- package/dist/forgot-password/data/reducers.js +46 -0
- package/dist/forgot-password/data/reducers.js.map +1 -0
- package/dist/forgot-password/data/sagas.d.ts +4 -0
- package/dist/forgot-password/data/sagas.js +28 -0
- package/dist/forgot-password/data/sagas.js.map +1 -0
- package/dist/forgot-password/data/selectors.d.ts +23 -0
- package/dist/forgot-password/data/selectors.js +5 -0
- package/dist/forgot-password/data/selectors.js.map +1 -0
- package/dist/forgot-password/data/service.d.ts +1 -0
- package/dist/forgot-password/data/service.js +26 -0
- package/dist/forgot-password/data/service.js.map +1 -0
- package/dist/forgot-password/index.d.ts +5 -0
- package/{src → dist}/forgot-password/index.js +1 -0
- package/dist/forgot-password/index.js.map +1 -0
- package/dist/forgot-password/messages.d.ts +123 -0
- package/dist/forgot-password/messages.js +128 -0
- package/dist/forgot-password/messages.js.map +1 -0
- package/dist/i18n/index.d.ts +25 -0
- package/dist/i18n/index.js +26 -0
- package/dist/i18n/index.js.map +1 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/login/AccountActivationMessage.d.ts +14 -0
- package/dist/login/AccountActivationMessage.js +49 -0
- package/dist/login/AccountActivationMessage.js.map +1 -0
- package/dist/login/ChangePasswordPrompt.d.ts +18 -0
- package/dist/login/ChangePasswordPrompt.js +45 -0
- package/dist/login/ChangePasswordPrompt.js.map +1 -0
- package/dist/login/LoginFailure.d.ts +25 -0
- package/dist/login/LoginFailure.js +109 -0
- package/dist/login/LoginFailure.js.map +1 -0
- package/dist/login/LoginPage.d.ts +10 -0
- package/dist/login/LoginPage.js +216 -0
- package/dist/login/LoginPage.js.map +1 -0
- package/dist/login/data/actions.d.ts +36 -0
- package/{src → dist}/login/data/actions.js +12 -19
- package/dist/login/data/actions.js.map +1 -0
- package/dist/login/data/constants.d.ts +17 -0
- package/{src → dist}/login/data/constants.js +4 -4
- package/dist/login/data/constants.js.map +1 -0
- package/dist/login/data/reducers.d.ts +82 -0
- package/dist/login/data/reducers.js +44 -0
- package/dist/login/data/reducers.js.map +1 -0
- package/dist/login/data/sagas.d.ts +10 -0
- package/dist/login/data/sagas.js +34 -0
- package/dist/login/data/sagas.js.map +1 -0
- package/dist/login/data/service.d.ts +4 -0
- package/dist/login/data/service.js +32 -0
- package/dist/login/data/service.js.map +1 -0
- package/dist/login/index.d.ts +4 -0
- package/{src → dist}/login/index.js +1 -1
- package/dist/login/index.js.map +1 -0
- package/dist/login/messages.d.ts +198 -0
- package/dist/login/messages.js +210 -0
- package/dist/login/messages.js.map +1 -0
- package/dist/logistration/Logistration.d.ts +32 -0
- package/dist/logistration/Logistration.js +106 -0
- package/dist/logistration/Logistration.js.map +1 -0
- package/dist/progressive-profiling/ProgressiveProfiling.d.ts +46 -0
- package/dist/progressive-profiling/ProgressiveProfiling.js +167 -0
- package/dist/progressive-profiling/ProgressiveProfiling.js.map +1 -0
- package/dist/progressive-profiling/ProgressiveProfilingPageModal.d.ts +13 -0
- package/dist/progressive-profiling/ProgressiveProfilingPageModal.js +24 -0
- package/dist/progressive-profiling/ProgressiveProfilingPageModal.js.map +1 -0
- package/dist/progressive-profiling/data/actions.d.ts +19 -0
- package/{src → dist}/progressive-profiling/data/actions.js +6 -10
- package/dist/progressive-profiling/data/actions.js.map +1 -0
- package/dist/progressive-profiling/data/reducers.d.ts +22 -0
- package/dist/progressive-profiling/data/reducers.js +23 -0
- package/dist/progressive-profiling/data/reducers.js.map +1 -0
- package/dist/progressive-profiling/data/sagas.d.ts +4 -0
- package/dist/progressive-profiling/data/sagas.js +17 -0
- package/dist/progressive-profiling/data/sagas.js.map +1 -0
- package/dist/progressive-profiling/data/selectors.d.ts +39 -0
- package/{src → dist}/progressive-profiling/data/selectors.js +4 -9
- package/dist/progressive-profiling/data/selectors.js.map +1 -0
- package/dist/progressive-profiling/data/service.d.ts +1 -0
- package/dist/progressive-profiling/data/service.js +23 -0
- package/dist/progressive-profiling/data/service.js.map +1 -0
- package/dist/progressive-profiling/index.d.ts +4 -0
- package/{src → dist}/progressive-profiling/index.js +1 -1
- package/dist/progressive-profiling/index.js.map +1 -0
- package/dist/progressive-profiling/messages.d.ts +53 -0
- package/dist/progressive-profiling/messages.js +57 -0
- package/dist/progressive-profiling/messages.js.map +1 -0
- package/dist/register/RegistrationFields/CountryField/CountryField.d.ts +38 -0
- package/dist/register/RegistrationFields/CountryField/CountryField.js +95 -0
- package/dist/register/RegistrationFields/CountryField/CountryField.js.map +1 -0
- package/dist/register/RegistrationFields/CountryField/validator.d.ts +8 -0
- package/dist/register/RegistrationFields/CountryField/validator.js +29 -0
- package/dist/register/RegistrationFields/CountryField/validator.js.map +1 -0
- package/dist/register/RegistrationFields/EmailField/EmailField.d.ts +30 -0
- package/dist/register/RegistrationFields/EmailField/EmailField.js +80 -0
- package/dist/register/RegistrationFields/EmailField/EmailField.js.map +1 -0
- package/dist/register/RegistrationFields/EmailField/constants.d.ts +3 -0
- package/dist/register/RegistrationFields/EmailField/constants.js +130 -0
- package/dist/register/RegistrationFields/EmailField/constants.js.map +1 -0
- package/dist/register/RegistrationFields/EmailField/validator.d.ts +17 -0
- package/dist/register/RegistrationFields/EmailField/validator.js +107 -0
- package/dist/register/RegistrationFields/EmailField/validator.js.map +1 -0
- package/dist/register/RegistrationFields/HonorCodeField/HonorCode.d.ts +21 -0
- package/dist/register/RegistrationFields/HonorCodeField/HonorCode.js +40 -0
- package/dist/register/RegistrationFields/HonorCodeField/HonorCode.js.map +1 -0
- package/dist/register/RegistrationFields/NameField/NameField.d.ts +29 -0
- package/dist/register/RegistrationFields/NameField/NameField.js +52 -0
- package/dist/register/RegistrationFields/NameField/NameField.js.map +1 -0
- package/dist/register/RegistrationFields/NameField/validator.d.ts +5 -0
- package/{src → dist}/register/RegistrationFields/NameField/validator.js +9 -12
- package/dist/register/RegistrationFields/NameField/validator.js.map +1 -0
- package/dist/register/RegistrationFields/TermsOfServiceField/TermsOfService.d.ts +16 -0
- package/dist/register/RegistrationFields/TermsOfServiceField/TermsOfService.js +24 -0
- package/dist/register/RegistrationFields/TermsOfServiceField/TermsOfService.js.map +1 -0
- package/dist/register/RegistrationFields/UsernameField/UsernameField.d.ts +31 -0
- package/dist/register/RegistrationFields/UsernameField/UsernameField.js +113 -0
- package/dist/register/RegistrationFields/UsernameField/UsernameField.js.map +1 -0
- package/dist/register/RegistrationFields/UsernameField/validator.d.ts +4 -0
- package/dist/register/RegistrationFields/UsernameField/validator.js +15 -0
- package/dist/register/RegistrationFields/UsernameField/validator.js.map +1 -0
- package/dist/register/RegistrationFields/index.d.ts +6 -0
- package/{src → dist}/register/RegistrationFields/index.js +1 -0
- package/dist/register/RegistrationFields/index.js.map +1 -0
- package/dist/register/RegistrationPage.d.ts +18 -0
- package/dist/register/RegistrationPage.js +216 -0
- package/dist/register/RegistrationPage.js.map +1 -0
- package/dist/register/components/ConfigurableRegistrationForm.d.ts +37 -0
- package/dist/register/components/ConfigurableRegistrationForm.js +145 -0
- package/dist/register/components/ConfigurableRegistrationForm.js.map +1 -0
- package/dist/register/components/RegistrationFailure.d.ts +19 -0
- package/dist/register/components/RegistrationFailure.js +57 -0
- package/dist/register/components/RegistrationFailure.js.map +1 -0
- package/dist/register/data/actions.d.ts +80 -0
- package/{src → dist}/register/data/actions.js +26 -42
- package/dist/register/data/actions.js.map +1 -0
- package/dist/register/data/constants.d.ts +10 -0
- package/{src → dist}/register/data/constants.js +4 -4
- package/dist/register/data/constants.js.map +1 -0
- package/dist/register/data/reducers.d.ts +237 -0
- package/dist/register/data/reducers.js +86 -0
- package/dist/register/data/reducers.js.map +1 -0
- package/dist/register/data/sagas.d.ts +19 -0
- package/dist/register/data/sagas.js +45 -0
- package/dist/register/data/sagas.js.map +1 -0
- package/dist/register/data/selectors.d.ts +26 -0
- package/dist/register/data/selectors.js +25 -0
- package/dist/register/data/selectors.js.map +1 -0
- package/dist/register/data/service.d.ts +8 -0
- package/dist/register/data/service.js +46 -0
- package/dist/register/data/service.js.map +1 -0
- package/dist/register/data/utils.d.ts +6 -0
- package/dist/register/data/utils.js +128 -0
- package/dist/register/data/utils.js.map +1 -0
- package/dist/register/index.d.ts +3 -0
- package/{src → dist}/register/index.js +1 -0
- package/dist/register/index.js.map +1 -0
- package/dist/register/messages.d.ts +193 -0
- package/dist/register/messages.js +205 -0
- package/dist/register/messages.js.map +1 -0
- package/dist/reset-password/ResetPasswordFailure.d.ts +15 -0
- package/dist/reset-password/ResetPasswordFailure.js +44 -0
- package/dist/reset-password/ResetPasswordFailure.js.map +1 -0
- package/dist/reset-password/ResetPasswordPage.d.ts +32 -0
- package/dist/reset-password/ResetPasswordPage.js +150 -0
- package/dist/reset-password/ResetPasswordPage.js.map +1 -0
- package/dist/reset-password/ResetPasswordSuccess.d.ts +2 -0
- package/dist/reset-password/ResetPasswordSuccess.js +10 -0
- package/dist/reset-password/ResetPasswordSuccess.js.map +1 -0
- package/dist/reset-password/data/actions.d.ts +56 -0
- package/{src → dist}/reset-password/data/actions.js +17 -26
- package/dist/reset-password/data/actions.js.map +1 -0
- package/dist/reset-password/data/constants.d.ts +13 -0
- package/{src → dist}/reset-password/data/constants.js +6 -7
- package/dist/reset-password/data/constants.js.map +1 -0
- package/dist/reset-password/data/reducers.d.ts +19 -0
- package/dist/reset-password/data/reducers.js +25 -0
- package/dist/reset-password/data/reducers.js.map +1 -0
- package/dist/reset-password/data/sagas.d.ts +7 -0
- package/dist/reset-password/data/sagas.js +63 -0
- package/dist/reset-password/data/sagas.js.map +1 -0
- package/dist/reset-password/data/selectors.d.ts +23 -0
- package/dist/reset-password/data/selectors.js +5 -0
- package/dist/reset-password/data/selectors.js.map +1 -0
- package/dist/reset-password/data/service.d.ts +3 -0
- package/dist/reset-password/data/service.js +62 -0
- package/dist/reset-password/data/service.js.map +1 -0
- package/dist/reset-password/index.d.ts +5 -0
- package/{src → dist}/reset-password/index.js +1 -0
- package/dist/reset-password/index.js.map +1 -0
- package/dist/reset-password/messages.d.ts +83 -0
- package/dist/reset-password/messages.js +87 -0
- package/dist/reset-password/messages.js.map +1 -0
- package/dist/routes.d.ts +18 -0
- package/dist/routes.js +75 -0
- package/dist/routes.js.map +1 -0
- package/{src → dist}/sass/_base_component.scss +57 -54
- package/{src → dist}/sass/_progressive_profiling_page.scss +1 -3
- package/{src → dist}/sass/_registration.scss +7 -8
- package/{src → dist}/sass/_style.scss +40 -43
- package/package.json +17 -6
- package/src/__mocks__/file.js +0 -1
- package/src/__mocks__/svg.js +0 -1
- package/src/app.scss +0 -6
- package/src/app.ts +0 -43
- package/src/base-container/components/default-layout/DefaultLayout.test.jsx +0 -48
- package/src/base-container/components/default-layout/LargeLayout.jsx +0 -42
- package/src/base-container/components/default-layout/MediumLayout.jsx +0 -49
- package/src/base-container/components/default-layout/SmallLayout.jsx +0 -37
- package/src/base-container/components/default-layout/messages.js +0 -16
- package/src/base-container/components/image-layout/ExtraSmallLayout.jsx +0 -31
- package/src/base-container/components/image-layout/LargeLayout.jsx +0 -32
- package/src/base-container/components/image-layout/MediumLayout.jsx +0 -32
- package/src/base-container/components/image-layout/SmallLayout.jsx +0 -31
- package/src/base-container/components/image-layout/messages.js +0 -16
- package/src/base-container/components/welcome-page-layout/LargeLayout.jsx +0 -46
- package/src/base-container/components/welcome-page-layout/MediumLayout.jsx +0 -49
- package/src/base-container/components/welcome-page-layout/SmallLayout.jsx +0 -38
- package/src/base-container/components/welcome-page-layout/messages.js +0 -21
- package/src/base-container/index.jsx +0 -70
- package/src/base-container/tests/BaseContainer.test.jsx +0 -44
- package/src/common-components/EnterpriseSSO.jsx +0 -110
- package/src/common-components/FormGroup.jsx +0 -106
- package/src/common-components/InstitutionLogistration.jsx +0 -102
- package/src/common-components/NotFoundPage.jsx +0 -15
- package/src/common-components/PasswordField.jsx +0 -175
- package/src/common-components/RedirectLogistration.jsx +0 -94
- package/src/common-components/RegisterFaIcons.jsx +0 -8
- package/src/common-components/SocialAuthProviders.jsx +0 -75
- package/src/common-components/ThirdPartyAuth.jsx +0 -123
- package/src/common-components/ThirdPartyAuthAlert.jsx +0 -49
- package/src/common-components/UnAuthOnlyRoute.jsx +0 -41
- package/src/common-components/data/reducers.js +0 -63
- package/src/common-components/data/sagas.js +0 -32
- package/src/common-components/data/selectors.js +0 -28
- package/src/common-components/data/service.js +0 -23
- package/src/common-components/data/tests/reducer.test.js +0 -82
- package/src/common-components/data/tests/sagas.test.js +0 -71
- package/src/common-components/messages.jsx +0 -127
- package/src/common-components/tests/EmbeddedRegistrationRoute.test.jsx +0 -76
- package/src/common-components/tests/FormField.test.jsx +0 -289
- package/src/common-components/tests/SocialAuthProviders.test.jsx +0 -75
- package/src/common-components/tests/ThirdPartyAuthAlert.test.jsx +0 -39
- package/src/common-components/tests/UnAuthOnlyRoute.test.jsx +0 -73
- package/src/common-components/tests/__snapshots__/SocialAuthProviders.test.jsx.snap +0 -156
- package/src/common-components/tests/__snapshots__/ThirdPartyAuthAlert.test.jsx.snap +0 -53
- package/src/data/oneTrust.js +0 -3
- package/src/data/reducers.js +0 -36
- package/src/data/tests/cookies.test.js +0 -42
- package/src/data/tests/dataUtils.test.js +0 -19
- package/src/data/tests/reduxUtils.test.js +0 -14
- package/src/data/utils/cookies.js +0 -12
- package/src/data/utils/dataUtils.js +0 -81
- package/src/data/utils/index.js +0 -11
- package/src/data/utils/reduxUtils.js +0 -34
- package/src/data/utils/useMobileResponsive.js +0 -24
- package/src/field-renderer/FieldRenderer.jsx +0 -156
- package/src/field-renderer/tests/FieldRenderer.test.jsx +0 -201
- package/src/forgot-password/ForgotPasswordAlert.jsx +0 -97
- package/src/forgot-password/ForgotPasswordPage.jsx +0 -193
- package/src/forgot-password/data/reducers.js +0 -58
- package/src/forgot-password/data/sagas.js +0 -35
- package/src/forgot-password/data/selectors.js +0 -10
- package/src/forgot-password/data/service.js +0 -21
- package/src/forgot-password/data/tests/reducers.test.js +0 -34
- package/src/forgot-password/data/tests/sagas.test.js +0 -67
- package/src/forgot-password/messages.js +0 -128
- package/src/forgot-password/tests/ForgotPasswordPage.test.jsx +0 -269
- package/src/i18n/index.js +0 -25
- package/src/login/AccountActivationMessage.jsx +0 -78
- package/src/login/ChangePasswordPrompt.jsx +0 -91
- package/src/login/LoginFailure.jsx +0 -231
- package/src/login/LoginPage.jsx +0 -368
- package/src/login/data/reducers.js +0 -76
- package/src/login/data/sagas.js +0 -45
- package/src/login/data/service.js +0 -27
- package/src/login/data/tests/reducers.test.js +0 -155
- package/src/login/data/tests/sagas.test.js +0 -110
- package/src/login/messages.jsx +0 -211
- package/src/login/tests/AccountActivationMessage.test.jsx +0 -122
- package/src/login/tests/ChangePasswordPrompt.test.jsx +0 -75
- package/src/login/tests/LoginFailure.test.jsx +0 -323
- package/src/login/tests/LoginPage.test.jsx +0 -839
- package/src/logistration/Logistration.jsx +0 -189
- package/src/logistration/Logistration.test.jsx +0 -275
- package/src/progressive-profiling/ProgressiveProfiling.jsx +0 -313
- package/src/progressive-profiling/ProgressiveProfilingPageModal.jsx +0 -56
- package/src/progressive-profiling/data/reducers.js +0 -38
- package/src/progressive-profiling/data/sagas.js +0 -24
- package/src/progressive-profiling/data/service.js +0 -17
- package/src/progressive-profiling/messages.jsx +0 -57
- package/src/progressive-profiling/tests/ProgressiveProfiling.test.jsx +0 -322
- package/src/register/RegistrationFields/CountryField/CountryField.jsx +0 -164
- package/src/register/RegistrationFields/CountryField/CountryField.test.jsx +0 -204
- package/src/register/RegistrationFields/CountryField/validator.js +0 -32
- package/src/register/RegistrationFields/EmailField/EmailField.jsx +0 -140
- package/src/register/RegistrationFields/EmailField/EmailField.test.jsx +0 -236
- package/src/register/RegistrationFields/EmailField/constants.js +0 -131
- package/src/register/RegistrationFields/EmailField/validator.js +0 -126
- package/src/register/RegistrationFields/EmailField/validator.test.js +0 -39
- package/src/register/RegistrationFields/HonorCodeField/HonorCode.jsx +0 -104
- package/src/register/RegistrationFields/HonorCodeField/HonorCode.test.jsx +0 -70
- package/src/register/RegistrationFields/NameField/NameField.jsx +0 -68
- package/src/register/RegistrationFields/NameField/NameField.test.jsx +0 -146
- package/src/register/RegistrationFields/TermsOfServiceField/TermsOfService.jsx +0 -58
- package/src/register/RegistrationFields/TermsOfServiceField/TermsOfService.test.jsx +0 -55
- package/src/register/RegistrationFields/UsernameField/UsernameField.jsx +0 -162
- package/src/register/RegistrationFields/UsernameField/UsernameField.test.jsx +0 -319
- package/src/register/RegistrationFields/UsernameField/validator.js +0 -16
- package/src/register/RegistrationPage.jsx +0 -428
- package/src/register/RegistrationPage.test.jsx +0 -854
- package/src/register/components/ConfigurableRegistrationForm.jsx +0 -244
- package/src/register/components/RegistrationFailure.jsx +0 -80
- package/src/register/components/tests/ConfigurableRegistrationForm.test.jsx +0 -401
- package/src/register/components/tests/RegistrationFailure.test.jsx +0 -212
- package/src/register/components/tests/ThirdPartyAuth.test.jsx +0 -439
- package/src/register/data/reducers.js +0 -140
- package/src/register/data/sagas.js +0 -58
- package/src/register/data/selectors.js +0 -34
- package/src/register/data/service.js +0 -45
- package/src/register/data/tests/reducers.test.js +0 -277
- package/src/register/data/tests/sagas.test.js +0 -239
- package/src/register/data/tests/utils.test.js +0 -98
- package/src/register/data/utils.js +0 -153
- package/src/register/messages.jsx +0 -206
- package/src/reset-password/ResetPasswordFailure.jsx +0 -55
- package/src/reset-password/ResetPasswordPage.jsx +0 -224
- package/src/reset-password/ResetPasswordSuccess.jsx +0 -19
- package/src/reset-password/data/reducers.js +0 -44
- package/src/reset-password/data/sagas.js +0 -67
- package/src/reset-password/data/selectors.js +0 -10
- package/src/reset-password/data/service.js +0 -61
- package/src/reset-password/data/tests/sagas.test.js +0 -185
- package/src/reset-password/messages.js +0 -88
- package/src/reset-password/tests/ResetPasswordPage.test.jsx +0 -241
- package/src/routes.jsx +0 -79
- package/src/setupTest.js +0 -68
- /package/{src → dist}/base-container/components/image-layout/index.scss +0 -0
- /package/{src/index.ts → dist/index.d.ts} +0 -0
- /package/{src → dist}/sass/_forgot_password.scss +0 -0
- /package/{src → dist}/sass/_login_page.scss +0 -0
- /package/{src → dist}/sass/_reset_password.scss +0 -0
|
@@ -1,439 +0,0 @@
|
|
|
1
|
-
import { Provider } from 'react-redux';
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
configureI18n, getSiteConfig, getLocale, injectIntl, IntlProvider, mergeAppConfig
|
|
5
|
-
} from '@openedx/frontend-base';
|
|
6
|
-
import { fireEvent, render } from '@testing-library/react';
|
|
7
|
-
import { BrowserRouter as Router } from 'react-router-dom';
|
|
8
|
-
import configureStore from 'redux-mock-store';
|
|
9
|
-
|
|
10
|
-
import {
|
|
11
|
-
COMPLETE_STATE, LOGIN_PAGE, PENDING_STATE, REGISTER_PAGE,
|
|
12
|
-
} from '../../../data/constants';
|
|
13
|
-
import { appId } from '../../../constants';
|
|
14
|
-
import RegistrationPage from '../../RegistrationPage';
|
|
15
|
-
|
|
16
|
-
jest.mock('@openedx/frontend-base', () => ({
|
|
17
|
-
...jest.requireActual('@openedx/frontend-base'),
|
|
18
|
-
sendPageEvent: jest.fn(),
|
|
19
|
-
sendTrackEvent: jest.fn(),
|
|
20
|
-
getLocale: jest.fn(),
|
|
21
|
-
}));
|
|
22
|
-
|
|
23
|
-
const IntlRegistrationPage = injectIntl(RegistrationPage);
|
|
24
|
-
const mockStore = configureStore();
|
|
25
|
-
|
|
26
|
-
jest.mock('react-router-dom', () => {
|
|
27
|
-
const mockNavigation = jest.fn();
|
|
28
|
-
|
|
29
|
-
// eslint-disable-next-line react/prop-types
|
|
30
|
-
const Navigate = ({ to }) => {
|
|
31
|
-
mockNavigation(to);
|
|
32
|
-
return <div />;
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
return {
|
|
36
|
-
...jest.requireActual('react-router-dom'),
|
|
37
|
-
Navigate,
|
|
38
|
-
mockNavigate: mockNavigation,
|
|
39
|
-
};
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
describe('ThirdPartyAuth', () => {
|
|
43
|
-
mergeAppConfig(appId, {
|
|
44
|
-
PRIVACY_POLICY: 'https://privacy-policy.com',
|
|
45
|
-
TOS_AND_HONOR_CODE: 'https://tos-and-honot-code.com',
|
|
46
|
-
USER_RETENTION_COOKIE_NAME: 'authn-returning-user',
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
let props = {};
|
|
50
|
-
let store = {};
|
|
51
|
-
const registrationFormData = {
|
|
52
|
-
configurableFormFields: {
|
|
53
|
-
marketingEmailsOptIn: true,
|
|
54
|
-
},
|
|
55
|
-
formFields: {
|
|
56
|
-
name: '', email: '', username: '', password: '',
|
|
57
|
-
},
|
|
58
|
-
emailSuggestion: {
|
|
59
|
-
suggestion: '', type: '',
|
|
60
|
-
},
|
|
61
|
-
errors: {
|
|
62
|
-
name: '', email: '', username: '', password: '',
|
|
63
|
-
},
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
const reduxWrapper = children => (
|
|
67
|
-
<IntlProvider locale="en">
|
|
68
|
-
<Provider store={store}>{children}</Provider>
|
|
69
|
-
</IntlProvider>
|
|
70
|
-
);
|
|
71
|
-
|
|
72
|
-
const routerWrapper = children => (
|
|
73
|
-
<Router>
|
|
74
|
-
{children}
|
|
75
|
-
</Router>
|
|
76
|
-
);
|
|
77
|
-
|
|
78
|
-
const thirdPartyAuthContext = {
|
|
79
|
-
currentProvider: null,
|
|
80
|
-
finishAuthUrl: null,
|
|
81
|
-
providers: [],
|
|
82
|
-
secondaryProviders: [],
|
|
83
|
-
pipelineUserDetails: null,
|
|
84
|
-
countryCode: null,
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
const initialState = {
|
|
88
|
-
register: {
|
|
89
|
-
registrationResult: { success: false, redirectUrl: '' },
|
|
90
|
-
registrationError: {},
|
|
91
|
-
registrationFormData,
|
|
92
|
-
usernameSuggestions: [],
|
|
93
|
-
},
|
|
94
|
-
commonComponents: {
|
|
95
|
-
thirdPartyAuthApiStatus: null,
|
|
96
|
-
thirdPartyAuthContext,
|
|
97
|
-
fieldDescriptions: {},
|
|
98
|
-
optionalFields: {
|
|
99
|
-
fields: {},
|
|
100
|
-
extended_profile: [],
|
|
101
|
-
},
|
|
102
|
-
},
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
beforeEach(() => {
|
|
106
|
-
store = mockStore(initialState);
|
|
107
|
-
configureI18n({
|
|
108
|
-
messages: { 'es-419': {}, de: {}, 'en-us': {} },
|
|
109
|
-
});
|
|
110
|
-
props = {
|
|
111
|
-
handleInstitutionLogin: jest.fn(),
|
|
112
|
-
institutionLogin: false,
|
|
113
|
-
};
|
|
114
|
-
window.location = { search: '' };
|
|
115
|
-
});
|
|
116
|
-
|
|
117
|
-
afterEach(() => {
|
|
118
|
-
jest.clearAllMocks();
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
const ssoProvider = {
|
|
122
|
-
id: 'oa2-apple-id',
|
|
123
|
-
name: 'Apple',
|
|
124
|
-
iconClass: 'apple',
|
|
125
|
-
iconImage: 'https://openedx.devstack.lms/logo.png',
|
|
126
|
-
loginUrl: '/auth/login/apple-id/?auth_entry=login&next=/dashboard',
|
|
127
|
-
};
|
|
128
|
-
|
|
129
|
-
describe('Test Third Party Auth', () => {
|
|
130
|
-
getLocale.mockImplementation(() => ('en-us'));
|
|
131
|
-
|
|
132
|
-
const secondaryProviders = {
|
|
133
|
-
id: 'saml-test', name: 'Test University', loginUrl: '/dummy-auth', registerUrl: '/dummy_auth',
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
it('should not display password field when current provider is present', () => {
|
|
137
|
-
store = mockStore({
|
|
138
|
-
...initialState,
|
|
139
|
-
commonComponents: {
|
|
140
|
-
...initialState.commonComponents,
|
|
141
|
-
thirdPartyAuthContext: {
|
|
142
|
-
...initialState.commonComponents.thirdPartyAuthContext,
|
|
143
|
-
currentProvider: ssoProvider.name,
|
|
144
|
-
},
|
|
145
|
-
},
|
|
146
|
-
});
|
|
147
|
-
|
|
148
|
-
const { queryByLabelText } = render(
|
|
149
|
-
routerWrapper(reduxWrapper(<IntlRegistrationPage {...props} />, { store })),
|
|
150
|
-
);
|
|
151
|
-
|
|
152
|
-
const passwordField = queryByLabelText('Password');
|
|
153
|
-
|
|
154
|
-
expect(passwordField).toBeNull();
|
|
155
|
-
});
|
|
156
|
-
|
|
157
|
-
it('should render tpa button for tpa_hint id matching one of the primary providers', () => {
|
|
158
|
-
store = mockStore({
|
|
159
|
-
...initialState,
|
|
160
|
-
commonComponents: {
|
|
161
|
-
...initialState.commonComponents,
|
|
162
|
-
thirdPartyAuthContext: {
|
|
163
|
-
...initialState.commonComponents.thirdPartyAuthContext,
|
|
164
|
-
providers: [ssoProvider],
|
|
165
|
-
},
|
|
166
|
-
thirdPartyAuthApiStatus: COMPLETE_STATE,
|
|
167
|
-
},
|
|
168
|
-
});
|
|
169
|
-
|
|
170
|
-
delete window.location;
|
|
171
|
-
window.location = { href: getSiteConfig().baseUrl.concat(LOGIN_PAGE), search: `?next=/dashboard&tpa_hint=${ssoProvider.id}` };
|
|
172
|
-
|
|
173
|
-
const { container } = render(
|
|
174
|
-
routerWrapper(reduxWrapper(<IntlRegistrationPage {...props} />)),
|
|
175
|
-
);
|
|
176
|
-
const tpaButton = container.querySelector(`button#${ssoProvider.id}`);
|
|
177
|
-
|
|
178
|
-
expect(tpaButton).toBeTruthy();
|
|
179
|
-
expect(tpaButton.textContent).toEqual(ssoProvider.name);
|
|
180
|
-
expect(tpaButton.classList.contains('btn-tpa')).toBe(true);
|
|
181
|
-
expect(tpaButton.classList.contains(`btn-${ssoProvider.id}`)).toBe(true);
|
|
182
|
-
});
|
|
183
|
-
|
|
184
|
-
it('should display skeleton if tpa_hint is true and thirdPartyAuthContext is pending', () => {
|
|
185
|
-
store = mockStore({
|
|
186
|
-
...initialState,
|
|
187
|
-
commonComponents: {
|
|
188
|
-
...initialState.commonComponents,
|
|
189
|
-
thirdPartyAuthApiStatus: PENDING_STATE,
|
|
190
|
-
},
|
|
191
|
-
});
|
|
192
|
-
|
|
193
|
-
delete window.location;
|
|
194
|
-
window.location = {
|
|
195
|
-
href: getSiteConfig().baseUrl.concat(LOGIN_PAGE),
|
|
196
|
-
search: `?next=/dashboard&tpa_hint=${ssoProvider.id}`,
|
|
197
|
-
};
|
|
198
|
-
|
|
199
|
-
const { container } = render(routerWrapper(reduxWrapper(<IntlRegistrationPage {...props} />)));
|
|
200
|
-
const skeletonElement = container.querySelector('.react-loading-skeleton');
|
|
201
|
-
|
|
202
|
-
expect(skeletonElement).toBeTruthy();
|
|
203
|
-
});
|
|
204
|
-
|
|
205
|
-
it('should render icon if icon classes are missing in providers', () => {
|
|
206
|
-
ssoProvider.iconClass = null;
|
|
207
|
-
store = mockStore({
|
|
208
|
-
...initialState,
|
|
209
|
-
commonComponents: {
|
|
210
|
-
...initialState.commonComponents,
|
|
211
|
-
thirdPartyAuthContext: {
|
|
212
|
-
...initialState.commonComponents.thirdPartyAuthContext,
|
|
213
|
-
providers: [ssoProvider],
|
|
214
|
-
},
|
|
215
|
-
thirdPartyAuthApiStatus: COMPLETE_STATE,
|
|
216
|
-
},
|
|
217
|
-
});
|
|
218
|
-
|
|
219
|
-
delete window.location;
|
|
220
|
-
window.location = { href: getSiteConfig().baseUrl.concat(REGISTER_PAGE), search: `?next=/dashboard&tpa_hint=${ssoProvider.id}` };
|
|
221
|
-
ssoProvider.iconImage = null;
|
|
222
|
-
|
|
223
|
-
const { container } = render(routerWrapper(reduxWrapper(<IntlRegistrationPage {...props} />)));
|
|
224
|
-
const iconElement = container.querySelector(`button#${ssoProvider.id} div span.pgn__icon`);
|
|
225
|
-
|
|
226
|
-
expect(iconElement).toBeTruthy();
|
|
227
|
-
});
|
|
228
|
-
|
|
229
|
-
it('should render tpa button for tpa_hint id matching one of the secondary providers', () => {
|
|
230
|
-
secondaryProviders.skipHintedLogin = true;
|
|
231
|
-
store = mockStore({
|
|
232
|
-
...initialState,
|
|
233
|
-
commonComponents: {
|
|
234
|
-
...initialState.commonComponents,
|
|
235
|
-
thirdPartyAuthContext: {
|
|
236
|
-
...initialState.commonComponents.thirdPartyAuthContext,
|
|
237
|
-
secondaryProviders: [secondaryProviders],
|
|
238
|
-
},
|
|
239
|
-
thirdPartyAuthApiStatus: COMPLETE_STATE,
|
|
240
|
-
},
|
|
241
|
-
});
|
|
242
|
-
|
|
243
|
-
delete window.location;
|
|
244
|
-
window.location = { href: getSiteConfig().baseUrl.concat(REGISTER_PAGE), search: `?next=/dashboard&tpa_hint=${secondaryProviders.id}` };
|
|
245
|
-
|
|
246
|
-
render(routerWrapper(reduxWrapper(<IntlRegistrationPage {...props} />)));
|
|
247
|
-
expect(window.location.href).toEqual(getSiteConfig().lmsBaseUrl + secondaryProviders.registerUrl);
|
|
248
|
-
});
|
|
249
|
-
|
|
250
|
-
it('should render regular tpa button for invalid tpa_hint value', () => {
|
|
251
|
-
const expectedMessage = `${ssoProvider.name}`;
|
|
252
|
-
store = mockStore({
|
|
253
|
-
...initialState,
|
|
254
|
-
commonComponents: {
|
|
255
|
-
...initialState.commonComponents,
|
|
256
|
-
thirdPartyAuthContext: {
|
|
257
|
-
...initialState.commonComponents.thirdPartyAuthContext,
|
|
258
|
-
providers: [ssoProvider],
|
|
259
|
-
},
|
|
260
|
-
thirdPartyAuthApiStatus: COMPLETE_STATE,
|
|
261
|
-
},
|
|
262
|
-
});
|
|
263
|
-
|
|
264
|
-
delete window.location;
|
|
265
|
-
window.location = { href: getSiteConfig().baseUrl.concat(LOGIN_PAGE), search: '?next=/dashboard&tpa_hint=invalid' };
|
|
266
|
-
|
|
267
|
-
const { container } = render(routerWrapper(reduxWrapper(<IntlRegistrationPage {...props} />)));
|
|
268
|
-
const providerButton = container.querySelector(`button#${ssoProvider.id} span#provider-name`);
|
|
269
|
-
|
|
270
|
-
expect(providerButton.textContent).toEqual(expectedMessage);
|
|
271
|
-
});
|
|
272
|
-
|
|
273
|
-
it('should show single sign on provider button', () => {
|
|
274
|
-
store = mockStore({
|
|
275
|
-
...initialState,
|
|
276
|
-
commonComponents: {
|
|
277
|
-
...initialState.commonComponents,
|
|
278
|
-
thirdPartyAuthContext: {
|
|
279
|
-
...initialState.commonComponents.thirdPartyAuthContext,
|
|
280
|
-
providers: [ssoProvider],
|
|
281
|
-
},
|
|
282
|
-
},
|
|
283
|
-
});
|
|
284
|
-
|
|
285
|
-
const { container } = render(
|
|
286
|
-
routerWrapper(reduxWrapper(<IntlRegistrationPage {...props} />, { store })),
|
|
287
|
-
);
|
|
288
|
-
|
|
289
|
-
const buttonsWithId = container.querySelectorAll(`button#${ssoProvider.id}`);
|
|
290
|
-
|
|
291
|
-
expect(buttonsWithId.length).toEqual(1);
|
|
292
|
-
});
|
|
293
|
-
|
|
294
|
-
it('should show single sign on provider button', () => {
|
|
295
|
-
store = mockStore({
|
|
296
|
-
...initialState,
|
|
297
|
-
commonComponents: {
|
|
298
|
-
...initialState.commonComponents,
|
|
299
|
-
thirdPartyAuthContext: {
|
|
300
|
-
...initialState.commonComponents.thirdPartyAuthContext,
|
|
301
|
-
providers: [ssoProvider],
|
|
302
|
-
},
|
|
303
|
-
},
|
|
304
|
-
});
|
|
305
|
-
|
|
306
|
-
const { container } = render(
|
|
307
|
-
routerWrapper(reduxWrapper(<IntlRegistrationPage {...props} />)),
|
|
308
|
-
);
|
|
309
|
-
|
|
310
|
-
const buttonsWithId = container.querySelectorAll(`button#${ssoProvider.id}`);
|
|
311
|
-
|
|
312
|
-
expect(buttonsWithId.length).toEqual(1);
|
|
313
|
-
});
|
|
314
|
-
|
|
315
|
-
it('should display InstitutionLogistration if insitutionLogin prop is true', () => {
|
|
316
|
-
props = {
|
|
317
|
-
...props,
|
|
318
|
-
institutionLogin: true,
|
|
319
|
-
};
|
|
320
|
-
|
|
321
|
-
const { getByText } = render(routerWrapper(reduxWrapper(<IntlRegistrationPage {...props} />)));
|
|
322
|
-
const headingElement = getByText('Register with institution/campus credentials');
|
|
323
|
-
expect(headingElement).toBeTruthy();
|
|
324
|
-
});
|
|
325
|
-
|
|
326
|
-
it('should redirect to social auth provider url on SSO button click', () => {
|
|
327
|
-
const registerUrl = '/auth/login/apple-id/?auth_entry=register&next=/dashboard';
|
|
328
|
-
store = mockStore({
|
|
329
|
-
...initialState,
|
|
330
|
-
commonComponents: {
|
|
331
|
-
...initialState.commonComponents,
|
|
332
|
-
thirdPartyAuthContext: {
|
|
333
|
-
...initialState.commonComponents.thirdPartyAuthContext,
|
|
334
|
-
providers: [{
|
|
335
|
-
...ssoProvider,
|
|
336
|
-
registerUrl,
|
|
337
|
-
}],
|
|
338
|
-
},
|
|
339
|
-
},
|
|
340
|
-
});
|
|
341
|
-
|
|
342
|
-
delete window.location;
|
|
343
|
-
window.location = { href: getSiteConfig().baseUrl };
|
|
344
|
-
|
|
345
|
-
const { container } = render(
|
|
346
|
-
routerWrapper(reduxWrapper(<IntlRegistrationPage {...props} />)),
|
|
347
|
-
);
|
|
348
|
-
|
|
349
|
-
const ssoButton = container.querySelector('button#oa2-apple-id');
|
|
350
|
-
fireEvent.click(ssoButton);
|
|
351
|
-
|
|
352
|
-
expect(window.location.href).toBe(getSiteConfig().lmsBaseUrl + registerUrl);
|
|
353
|
-
});
|
|
354
|
-
|
|
355
|
-
it('should redirect to finishAuthUrl upon successful registration via SSO', () => {
|
|
356
|
-
const authCompleteUrl = '/auth/complete/google-oauth2/';
|
|
357
|
-
store = mockStore({
|
|
358
|
-
...initialState,
|
|
359
|
-
register: {
|
|
360
|
-
...initialState.register,
|
|
361
|
-
registrationResult: {
|
|
362
|
-
success: true,
|
|
363
|
-
},
|
|
364
|
-
},
|
|
365
|
-
commonComponents: {
|
|
366
|
-
...initialState.commonComponents,
|
|
367
|
-
thirdPartyAuthContext: {
|
|
368
|
-
...initialState.commonComponents.thirdPartyAuthContext,
|
|
369
|
-
finishAuthUrl: authCompleteUrl,
|
|
370
|
-
},
|
|
371
|
-
},
|
|
372
|
-
});
|
|
373
|
-
|
|
374
|
-
delete window.location;
|
|
375
|
-
window.location = { href: getSiteConfig().baseUrl };
|
|
376
|
-
|
|
377
|
-
render(routerWrapper(reduxWrapper(<IntlRegistrationPage {...props} />)));
|
|
378
|
-
expect(window.location.href).toBe(getSiteConfig().lmsBaseUrl + authCompleteUrl);
|
|
379
|
-
});
|
|
380
|
-
|
|
381
|
-
// ******** test alert messages ********
|
|
382
|
-
|
|
383
|
-
it('should match third party auth alert', () => {
|
|
384
|
-
store = mockStore({
|
|
385
|
-
...initialState,
|
|
386
|
-
commonComponents: {
|
|
387
|
-
...initialState.commonComponents,
|
|
388
|
-
thirdPartyAuthContext: {
|
|
389
|
-
...initialState.commonComponents.thirdPartyAuthContext,
|
|
390
|
-
currentProvider: 'Apple',
|
|
391
|
-
},
|
|
392
|
-
},
|
|
393
|
-
});
|
|
394
|
-
|
|
395
|
-
const expectedMessage = `${'You\'ve successfully signed into Apple! We just need a little more information before '
|
|
396
|
-
+ 'you start learning with '}${getSiteConfig().siteName}.`;
|
|
397
|
-
|
|
398
|
-
const { container } = render(routerWrapper(reduxWrapper(<IntlRegistrationPage {...props} />)));
|
|
399
|
-
const tpaAlert = container.querySelector('#tpa-alert p');
|
|
400
|
-
expect(tpaAlert.textContent).toEqual(expectedMessage);
|
|
401
|
-
});
|
|
402
|
-
|
|
403
|
-
it('should display errorMessage if third party authentication fails', () => {
|
|
404
|
-
jest.spyOn(global.Date, 'now').mockImplementation(() => 0);
|
|
405
|
-
getLocale.mockImplementation(() => ('en-us'));
|
|
406
|
-
|
|
407
|
-
store = mockStore({
|
|
408
|
-
...initialState,
|
|
409
|
-
register: {
|
|
410
|
-
...initialState.register,
|
|
411
|
-
backendCountryCode: 'PK',
|
|
412
|
-
userPipelineDataLoaded: false,
|
|
413
|
-
},
|
|
414
|
-
commonComponents: {
|
|
415
|
-
...initialState.commonComponents,
|
|
416
|
-
thirdPartyAuthApiStatus: COMPLETE_STATE,
|
|
417
|
-
thirdPartyAuthContext: {
|
|
418
|
-
...initialState.commonComponents.thirdPartyAuthContext,
|
|
419
|
-
currentProvider: null,
|
|
420
|
-
pipelineUserDetails: {},
|
|
421
|
-
errorMessage: 'An error occurred',
|
|
422
|
-
},
|
|
423
|
-
},
|
|
424
|
-
});
|
|
425
|
-
|
|
426
|
-
store.dispatch = jest.fn(store.dispatch);
|
|
427
|
-
|
|
428
|
-
const { container } = render(
|
|
429
|
-
routerWrapper(reduxWrapper(<IntlRegistrationPage {...props} />)),
|
|
430
|
-
);
|
|
431
|
-
|
|
432
|
-
const alertHeading = container.querySelector('div.alert-heading');
|
|
433
|
-
expect(alertHeading).toBeTruthy();
|
|
434
|
-
|
|
435
|
-
const alert = container.querySelector('div.alert');
|
|
436
|
-
expect(alert.textContent).toContain('An error occurred');
|
|
437
|
-
});
|
|
438
|
-
});
|
|
439
|
-
});
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
BACKUP_REGISTRATION_DATA,
|
|
3
|
-
REGISTER_CLEAR_USERNAME_SUGGESTIONS,
|
|
4
|
-
REGISTER_FORM_VALIDATIONS,
|
|
5
|
-
REGISTER_NEW_USER,
|
|
6
|
-
REGISTER_SET_COUNTRY_CODE,
|
|
7
|
-
REGISTER_SET_EMAIL_SUGGESTIONS,
|
|
8
|
-
REGISTER_SET_USER_PIPELINE_DATA_LOADED,
|
|
9
|
-
REGISTRATION_CLEAR_BACKEND_ERROR,
|
|
10
|
-
} from './actions';
|
|
11
|
-
import {
|
|
12
|
-
DEFAULT_STATE,
|
|
13
|
-
PENDING_STATE,
|
|
14
|
-
} from '../../data/constants';
|
|
15
|
-
|
|
16
|
-
export const storeName = 'register';
|
|
17
|
-
|
|
18
|
-
export const defaultState = {
|
|
19
|
-
backendCountryCode: '',
|
|
20
|
-
registrationError: {},
|
|
21
|
-
registrationResult: {},
|
|
22
|
-
registrationFormData: {
|
|
23
|
-
configurableFormFields: {
|
|
24
|
-
marketingEmailsOptIn: true,
|
|
25
|
-
},
|
|
26
|
-
formFields: {
|
|
27
|
-
name: '', email: '', username: '', password: '',
|
|
28
|
-
},
|
|
29
|
-
emailSuggestion: {
|
|
30
|
-
suggestion: '', type: '',
|
|
31
|
-
},
|
|
32
|
-
errors: {
|
|
33
|
-
name: '', email: '', username: '', password: '',
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
validations: null,
|
|
37
|
-
submitState: DEFAULT_STATE,
|
|
38
|
-
userPipelineDataLoaded: false,
|
|
39
|
-
usernameSuggestions: [],
|
|
40
|
-
validationApiRateLimited: false,
|
|
41
|
-
shouldBackupState: false,
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
const reducer = (state = defaultState, action = {}) => {
|
|
45
|
-
switch (action.type) {
|
|
46
|
-
case BACKUP_REGISTRATION_DATA.BASE:
|
|
47
|
-
return {
|
|
48
|
-
...state,
|
|
49
|
-
shouldBackupState: true,
|
|
50
|
-
};
|
|
51
|
-
case BACKUP_REGISTRATION_DATA.BEGIN:
|
|
52
|
-
return {
|
|
53
|
-
...state,
|
|
54
|
-
usernameSuggestions: state.usernameSuggestions,
|
|
55
|
-
registrationFormData: { ...action.payload },
|
|
56
|
-
userPipelineDataLoaded: state.userPipelineDataLoaded,
|
|
57
|
-
};
|
|
58
|
-
case REGISTER_NEW_USER.BEGIN:
|
|
59
|
-
return {
|
|
60
|
-
...state,
|
|
61
|
-
submitState: PENDING_STATE,
|
|
62
|
-
registrationError: {},
|
|
63
|
-
};
|
|
64
|
-
case REGISTER_NEW_USER.SUCCESS: {
|
|
65
|
-
return {
|
|
66
|
-
...state,
|
|
67
|
-
registrationResult: action.payload,
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
case REGISTER_NEW_USER.FAILURE: {
|
|
71
|
-
const { usernameSuggestions } = action.payload;
|
|
72
|
-
return {
|
|
73
|
-
...state,
|
|
74
|
-
registrationError: { ...action.payload },
|
|
75
|
-
submitState: DEFAULT_STATE,
|
|
76
|
-
validations: null,
|
|
77
|
-
usernameSuggestions: usernameSuggestions || state.usernameSuggestions,
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
case REGISTRATION_CLEAR_BACKEND_ERROR: {
|
|
81
|
-
const registrationErrorTemp = state.registrationError;
|
|
82
|
-
delete registrationErrorTemp[action.payload];
|
|
83
|
-
return {
|
|
84
|
-
...state,
|
|
85
|
-
registrationError: { ...registrationErrorTemp },
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
case REGISTER_FORM_VALIDATIONS.SUCCESS: {
|
|
89
|
-
const { usernameSuggestions, ...validationWithoutUsernameSuggestions } = action.payload.validations;
|
|
90
|
-
return {
|
|
91
|
-
...state,
|
|
92
|
-
validations: validationWithoutUsernameSuggestions,
|
|
93
|
-
usernameSuggestions: usernameSuggestions || state.usernameSuggestions,
|
|
94
|
-
};
|
|
95
|
-
}
|
|
96
|
-
case REGISTER_FORM_VALIDATIONS.FAILURE:
|
|
97
|
-
return {
|
|
98
|
-
...state,
|
|
99
|
-
validationApiRateLimited: true,
|
|
100
|
-
validations: null,
|
|
101
|
-
};
|
|
102
|
-
case REGISTER_CLEAR_USERNAME_SUGGESTIONS:
|
|
103
|
-
return {
|
|
104
|
-
...state,
|
|
105
|
-
usernameSuggestions: [],
|
|
106
|
-
};
|
|
107
|
-
case REGISTER_SET_COUNTRY_CODE: {
|
|
108
|
-
const { countryCode } = action.payload;
|
|
109
|
-
if (!state.registrationFormData.configurableFormFields.country) {
|
|
110
|
-
return {
|
|
111
|
-
...state,
|
|
112
|
-
backendCountryCode: countryCode,
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
|
-
return state;
|
|
116
|
-
}
|
|
117
|
-
case REGISTER_SET_USER_PIPELINE_DATA_LOADED: {
|
|
118
|
-
const { value } = action.payload;
|
|
119
|
-
return {
|
|
120
|
-
...state,
|
|
121
|
-
userPipelineDataLoaded: value,
|
|
122
|
-
};
|
|
123
|
-
}
|
|
124
|
-
case REGISTER_SET_EMAIL_SUGGESTIONS:
|
|
125
|
-
return {
|
|
126
|
-
...state,
|
|
127
|
-
registrationFormData: {
|
|
128
|
-
...state.registrationFormData,
|
|
129
|
-
emailSuggestion: action.payload.emailSuggestion,
|
|
130
|
-
},
|
|
131
|
-
};
|
|
132
|
-
default:
|
|
133
|
-
return {
|
|
134
|
-
...state,
|
|
135
|
-
shouldBackupState: false,
|
|
136
|
-
};
|
|
137
|
-
}
|
|
138
|
-
};
|
|
139
|
-
|
|
140
|
-
export default reducer;
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { camelCaseObject, logError, logInfo } from '@openedx/frontend-base';
|
|
2
|
-
import { call, put, takeEvery } from 'redux-saga/effects';
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
fetchRealtimeValidationsBegin,
|
|
6
|
-
fetchRealtimeValidationsFailure,
|
|
7
|
-
fetchRealtimeValidationsSuccess,
|
|
8
|
-
REGISTER_FORM_VALIDATIONS,
|
|
9
|
-
REGISTER_NEW_USER,
|
|
10
|
-
registerNewUserBegin,
|
|
11
|
-
registerNewUserFailure,
|
|
12
|
-
registerNewUserSuccess,
|
|
13
|
-
} from './actions';
|
|
14
|
-
import { INTERNAL_SERVER_ERROR } from './constants';
|
|
15
|
-
import { getFieldsValidations, registerRequest } from './service';
|
|
16
|
-
|
|
17
|
-
export function* handleNewUserRegistration(action) {
|
|
18
|
-
try {
|
|
19
|
-
yield put(registerNewUserBegin());
|
|
20
|
-
|
|
21
|
-
const { authenticatedUser, redirectUrl, success } = yield call(registerRequest, action.payload.registrationInfo);
|
|
22
|
-
|
|
23
|
-
yield put(registerNewUserSuccess(
|
|
24
|
-
camelCaseObject(authenticatedUser),
|
|
25
|
-
redirectUrl,
|
|
26
|
-
success,
|
|
27
|
-
));
|
|
28
|
-
} catch (e) {
|
|
29
|
-
const statusCodes = [400, 403, 409];
|
|
30
|
-
if (e.response && statusCodes.includes(e.response.status)) {
|
|
31
|
-
yield put(registerNewUserFailure(camelCaseObject(e.response.data)));
|
|
32
|
-
logInfo(e);
|
|
33
|
-
} else {
|
|
34
|
-
yield put(registerNewUserFailure({ errorCode: INTERNAL_SERVER_ERROR }));
|
|
35
|
-
logError(e);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export function* fetchRealtimeValidations(action) {
|
|
41
|
-
try {
|
|
42
|
-
yield put(fetchRealtimeValidationsBegin());
|
|
43
|
-
const { fieldValidations } = yield call(getFieldsValidations, action.payload.formPayload);
|
|
44
|
-
|
|
45
|
-
yield put(fetchRealtimeValidationsSuccess(camelCaseObject(fieldValidations)));
|
|
46
|
-
} catch (e) {
|
|
47
|
-
if (e.response && e.response.status === 403) {
|
|
48
|
-
yield put(fetchRealtimeValidationsFailure());
|
|
49
|
-
logInfo(e);
|
|
50
|
-
} else {
|
|
51
|
-
logError(e);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
export default function* saga() {
|
|
56
|
-
yield takeEvery(REGISTER_NEW_USER.BASE, handleNewUserRegistration);
|
|
57
|
-
yield takeEvery(REGISTER_FORM_VALIDATIONS.BASE, fetchRealtimeValidations);
|
|
58
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { createSelector } from 'reselect';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Selector for backend validations which processes the api output and generates a
|
|
5
|
-
* key value dict for field errors.
|
|
6
|
-
* @returns {{username: string}|{name: string}|*|{}|null}
|
|
7
|
-
*/
|
|
8
|
-
const getRegistrationError = state => state.register.registrationError;
|
|
9
|
-
const getValidations = state => state.register.validations;
|
|
10
|
-
|
|
11
|
-
const getBackendValidations = createSelector(
|
|
12
|
-
[getRegistrationError, getValidations],
|
|
13
|
-
(registrationError, validations) => {
|
|
14
|
-
if (validations) {
|
|
15
|
-
return validations.validationDecisions;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
if (Object.keys(registrationError).length > 0) {
|
|
19
|
-
const fields = Object.keys(registrationError).filter(
|
|
20
|
-
(fieldName) => !(fieldName in ['errorCode', 'usernameSuggestions']),
|
|
21
|
-
);
|
|
22
|
-
|
|
23
|
-
const validationDecisions = {};
|
|
24
|
-
fields.forEach(field => {
|
|
25
|
-
validationDecisions[field] = registrationError[field][0].userMessage || '';
|
|
26
|
-
});
|
|
27
|
-
return validationDecisions;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
return null;
|
|
31
|
-
}
|
|
32
|
-
);
|
|
33
|
-
|
|
34
|
-
export default getBackendValidations;
|