@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
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
import { connect } from 'react-redux';
|
|
4
|
+
import { useAppConfig, getAuthService, getSiteConfig, sendPageEvent, sendTrackEvent, useIntl } from '@openedx/frontend-base';
|
|
5
|
+
import { Icon, Tab, Tabs, } from '@openedx/paragon';
|
|
6
|
+
import { ChevronLeft } from '@openedx/paragon/icons';
|
|
7
|
+
import PropTypes from 'prop-types';
|
|
8
|
+
import { Navigate, useNavigate } from 'react-router-dom';
|
|
9
|
+
import BaseContainer from '../base-container';
|
|
10
|
+
import { clearThirdPartyAuthContextErrorMessage } from '../common-components/data/actions';
|
|
11
|
+
import { tpaProvidersSelector, } from '../common-components/data/selectors';
|
|
12
|
+
import messages from '../common-components/messages';
|
|
13
|
+
import { LOGIN_PAGE, REGISTER_PAGE } from '../data/constants';
|
|
14
|
+
import { getTpaHint, getTpaProvider, updatePathWithQueryParams, } from '../data/utils';
|
|
15
|
+
import { LoginPage } from '../login';
|
|
16
|
+
import { backupLoginForm } from '../login/data/actions';
|
|
17
|
+
import { RegistrationPage } from '../register';
|
|
18
|
+
import { backupRegistrationForm } from '../register/data/actions';
|
|
19
|
+
const Logistration = (props) => {
|
|
20
|
+
const { selectedPage, tpaProviders } = props;
|
|
21
|
+
const tpaHint = getTpaHint();
|
|
22
|
+
const { providers, secondaryProviders, } = tpaProviders;
|
|
23
|
+
const { formatMessage } = useIntl();
|
|
24
|
+
const [institutionLogin, setInstitutionLogin] = useState(false);
|
|
25
|
+
const [key, setKey] = useState('');
|
|
26
|
+
const navigate = useNavigate();
|
|
27
|
+
const disablePublicAccountCreation = useAppConfig().ALLOW_PUBLIC_ACCOUNT_CREATION === false;
|
|
28
|
+
const hideRegistrationLink = useAppConfig().SHOW_REGISTRATION_LINKS === false;
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
const authService = getAuthService();
|
|
31
|
+
if (authService) {
|
|
32
|
+
authService.getCsrfTokenService().getCsrfToken(getSiteConfig().lmsBaseUrl);
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
if (disablePublicAccountCreation) {
|
|
37
|
+
navigate(updatePathWithQueryParams(LOGIN_PAGE));
|
|
38
|
+
}
|
|
39
|
+
}, [navigate, disablePublicAccountCreation]);
|
|
40
|
+
const handleInstitutionLogin = (e) => {
|
|
41
|
+
sendTrackEvent('edx.bi.institution_login_form.toggled', { category: 'user-engagement' });
|
|
42
|
+
if (typeof e === 'string') {
|
|
43
|
+
sendPageEvent('login_and_registration', e === '/login' ? 'login' : 'register');
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
sendPageEvent('login_and_registration', e.target.dataset.eventName);
|
|
47
|
+
}
|
|
48
|
+
setInstitutionLogin(!institutionLogin);
|
|
49
|
+
};
|
|
50
|
+
const handleOnSelect = (tabKey, currentTab) => {
|
|
51
|
+
if (tabKey === currentTab) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
sendTrackEvent(`edx.bi.${tabKey.replace('/', '')}_form.toggled`, { category: 'user-engagement' });
|
|
55
|
+
props.clearThirdPartyAuthContextErrorMessage();
|
|
56
|
+
if (tabKey === LOGIN_PAGE) {
|
|
57
|
+
props.backupRegistrationForm();
|
|
58
|
+
}
|
|
59
|
+
else if (tabKey === REGISTER_PAGE) {
|
|
60
|
+
props.backupLoginForm();
|
|
61
|
+
}
|
|
62
|
+
setKey(tabKey);
|
|
63
|
+
};
|
|
64
|
+
const tabTitle = (_jsxs("div", { className: "d-flex", children: [_jsx(Icon, { src: ChevronLeft, className: "left-icon" }), _jsx("span", { className: "ml-2", children: selectedPage === LOGIN_PAGE
|
|
65
|
+
? formatMessage(messages['logistration.sign.in'])
|
|
66
|
+
: formatMessage(messages['logistration.register']) })] }));
|
|
67
|
+
const isValidTpaHint = () => {
|
|
68
|
+
const { provider } = getTpaProvider(tpaHint, providers, secondaryProviders);
|
|
69
|
+
return !!provider;
|
|
70
|
+
};
|
|
71
|
+
return (_jsx(BaseContainer, { children: _jsx("div", { children: disablePublicAccountCreation
|
|
72
|
+
? (_jsxs(_Fragment, { children: [institutionLogin && (_jsx(Tabs, { defaultActiveKey: "", id: "controlled-tab", onSelect: handleInstitutionLogin, children: _jsx(Tab, { title: tabTitle, eventKey: LOGIN_PAGE }) })), _jsxs("div", { id: "main-content", className: "main-content", children: [!institutionLogin && (_jsx("h3", { className: "mb-4.5", children: formatMessage(messages['logistration.sign.in']) })), _jsx(LoginPage, { institutionLogin: institutionLogin, handleInstitutionLogin: handleInstitutionLogin })] })] }))
|
|
73
|
+
: (_jsxs("div", { children: [institutionLogin
|
|
74
|
+
? (_jsx(Tabs, { defaultActiveKey: "", id: "controlled-tab", onSelect: handleInstitutionLogin, children: _jsx(Tab, { title: tabTitle, eventKey: selectedPage === LOGIN_PAGE ? LOGIN_PAGE : REGISTER_PAGE }) }))
|
|
75
|
+
: (!isValidTpaHint() && !hideRegistrationLink && (_jsxs(Tabs, { defaultActiveKey: selectedPage, id: "controlled-tab", onSelect: (tabKey) => handleOnSelect(tabKey, selectedPage), children: [_jsx(Tab, { title: formatMessage(messages['logistration.register']), eventKey: REGISTER_PAGE }), _jsx(Tab, { title: formatMessage(messages['logistration.sign.in']), eventKey: LOGIN_PAGE })] }))), key && (_jsx(Navigate, { to: updatePathWithQueryParams(key), replace: true })), _jsxs("div", { id: "main-content", className: "main-content", children: [!institutionLogin && !isValidTpaHint() && hideRegistrationLink && (_jsx("h3", { className: "mb-4.5", children: formatMessage(messages[selectedPage === LOGIN_PAGE ? 'logistration.sign.in' : 'logistration.register']) })), selectedPage === LOGIN_PAGE
|
|
76
|
+
? _jsx(LoginPage, { institutionLogin: institutionLogin, handleInstitutionLogin: handleInstitutionLogin })
|
|
77
|
+
: (_jsx(RegistrationPage, { institutionLogin: institutionLogin, handleInstitutionLogin: handleInstitutionLogin }))] })] })) }) }));
|
|
78
|
+
};
|
|
79
|
+
Logistration.propTypes = {
|
|
80
|
+
selectedPage: PropTypes.string,
|
|
81
|
+
backupLoginForm: PropTypes.func.isRequired,
|
|
82
|
+
backupRegistrationForm: PropTypes.func.isRequired,
|
|
83
|
+
clearThirdPartyAuthContextErrorMessage: PropTypes.func.isRequired,
|
|
84
|
+
tpaProviders: PropTypes.shape({
|
|
85
|
+
providers: PropTypes.arrayOf(PropTypes.shape({})),
|
|
86
|
+
secondaryProviders: PropTypes.arrayOf(PropTypes.shape({})),
|
|
87
|
+
}),
|
|
88
|
+
};
|
|
89
|
+
Logistration.defaultProps = {
|
|
90
|
+
tpaProviders: {
|
|
91
|
+
providers: [],
|
|
92
|
+
secondaryProviders: [],
|
|
93
|
+
},
|
|
94
|
+
};
|
|
95
|
+
Logistration.defaultProps = {
|
|
96
|
+
selectedPage: REGISTER_PAGE,
|
|
97
|
+
};
|
|
98
|
+
const mapStateToProps = state => ({
|
|
99
|
+
tpaProviders: tpaProvidersSelector(state),
|
|
100
|
+
});
|
|
101
|
+
export default connect(mapStateToProps, {
|
|
102
|
+
backupLoginForm,
|
|
103
|
+
backupRegistrationForm,
|
|
104
|
+
clearThirdPartyAuthContextErrorMessage,
|
|
105
|
+
})(Logistration);
|
|
106
|
+
//# sourceMappingURL=Logistration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Logistration.js","sourceRoot":"","sources":["../../src/logistration/Logistration.jsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,OAAO,EACL,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,aAAa,EAAE,cAAc,EAAE,OAAO,EACpF,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,IAAI,EACJ,GAAG,EACH,IAAI,GACL,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEzD,OAAO,aAAa,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,sCAAsC,EAAE,MAAM,mCAAmC,CAAC;AAC3F,OAAO,EACL,oBAAoB,GACrB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,QAAQ,MAAM,+BAA+B,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OA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IAAI,CAAC,UAAU;IAC1C,sBAAsB,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;IACjD,sCAAsC,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;IACjE,YAAY,EAAE,SAAS,CAAC,KAAK,CAAC;QAC5B,SAAS,EAAE,SAAS,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QACjD,kBAAkB,EAAE,SAAS,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;KAC3D,CAAC;CACH,CAAC;AAEF,YAAY,CAAC,YAAY,GAAG;IAC1B,YAAY,EAAE;QACZ,SAAS,EAAE,EAAE;QACb,kBAAkB,EAAE,EAAE;KACvB;CACF,CAAC;AAEF,YAAY,CAAC,YAAY,GAAG;IAC1B,YAAY,EAAE,aAAa;CAC5B,CAAC;AAEF,MAAM,eAAe,GAAG,KAAK,CAAC,EAAE,CAAC,CAAC;IAChC,YAAY,EAAE,oBAAoB,CAAC,KAAK,CAAC;CAC1C,CAAC,CAAC;AAEH,eAAe,OAAO,CACpB,eAAe,EACf;IACE,eAAe;IACf,sBAAsB;IACtB,sCAAsC;CACvC,CACF,CAAC,YAAY,CAAC,CAAC","sourcesContent":["import { useEffect, useState } from 'react';\nimport { connect } from 'react-redux';\n\nimport {\n useAppConfig, getAuthService, getSiteConfig, sendPageEvent, sendTrackEvent, useIntl\n} from '@openedx/frontend-base';\nimport {\n Icon,\n Tab,\n Tabs,\n} from '@openedx/paragon';\nimport { ChevronLeft } from '@openedx/paragon/icons';\nimport PropTypes from 'prop-types';\nimport { Navigate, useNavigate } from 'react-router-dom';\n\nimport BaseContainer from '../base-container';\nimport { clearThirdPartyAuthContextErrorMessage } from '../common-components/data/actions';\nimport {\n tpaProvidersSelector,\n} from '../common-components/data/selectors';\nimport messages from '../common-components/messages';\nimport { LOGIN_PAGE, REGISTER_PAGE } from '../data/constants';\nimport {\n getTpaHint, getTpaProvider, updatePathWithQueryParams,\n} from '../data/utils';\nimport { LoginPage } from '../login';\nimport { backupLoginForm } from '../login/data/actions';\nimport { RegistrationPage } from '../register';\nimport { backupRegistrationForm } from '../register/data/actions';\n\nconst Logistration = (props) => {\n const { selectedPage, tpaProviders } = props;\n const tpaHint = getTpaHint();\n const {\n providers, secondaryProviders,\n } = tpaProviders;\n const { formatMessage } = useIntl();\n const [institutionLogin, setInstitutionLogin] = useState(false);\n const [key, setKey] = useState('');\n const navigate = useNavigate();\n const disablePublicAccountCreation = useAppConfig().ALLOW_PUBLIC_ACCOUNT_CREATION === false;\n const hideRegistrationLink = useAppConfig().SHOW_REGISTRATION_LINKS === false;\n\n useEffect(() => {\n const authService = getAuthService();\n if (authService) {\n authService.getCsrfTokenService().getCsrfToken(getSiteConfig().lmsBaseUrl);\n }\n });\n\n useEffect(() => {\n if (disablePublicAccountCreation) {\n navigate(updatePathWithQueryParams(LOGIN_PAGE));\n }\n }, [navigate, disablePublicAccountCreation]);\n\n const handleInstitutionLogin = (e) => {\n sendTrackEvent('edx.bi.institution_login_form.toggled', { category: 'user-engagement' });\n if (typeof e === 'string') {\n sendPageEvent('login_and_registration', e === '/login' ? 'login' : 'register');\n } else {\n sendPageEvent('login_and_registration', e.target.dataset.eventName);\n }\n\n setInstitutionLogin(!institutionLogin);\n };\n\n const handleOnSelect = (tabKey, currentTab) => {\n if (tabKey === currentTab) {\n return;\n }\n sendTrackEvent(`edx.bi.${tabKey.replace('/', '')}_form.toggled`, { category: 'user-engagement' });\n props.clearThirdPartyAuthContextErrorMessage();\n if (tabKey === LOGIN_PAGE) {\n props.backupRegistrationForm();\n } else if (tabKey === REGISTER_PAGE) {\n props.backupLoginForm();\n }\n setKey(tabKey);\n };\n\n const tabTitle = (\n <div className=\"d-flex\">\n <Icon src={ChevronLeft} className=\"left-icon\" />\n <span className=\"ml-2\">\n {selectedPage === LOGIN_PAGE\n ? formatMessage(messages['logistration.sign.in'])\n : formatMessage(messages['logistration.register'])}\n </span>\n </div>\n );\n\n const isValidTpaHint = () => {\n const { provider } = getTpaProvider(tpaHint, providers, secondaryProviders);\n return !!provider;\n };\n\n return (\n <BaseContainer>\n <div>\n {disablePublicAccountCreation\n ? (\n <>\n {institutionLogin && (\n <Tabs defaultActiveKey=\"\" id=\"controlled-tab\" onSelect={handleInstitutionLogin}>\n <Tab title={tabTitle} eventKey={LOGIN_PAGE} />\n </Tabs>\n )}\n <div id=\"main-content\" className=\"main-content\">\n {!institutionLogin && (\n <h3 className=\"mb-4.5\">{formatMessage(messages['logistration.sign.in'])}</h3>\n )}\n <LoginPage institutionLogin={institutionLogin} handleInstitutionLogin={handleInstitutionLogin} />\n </div>\n </>\n )\n : (\n <div>\n {institutionLogin\n ? (\n <Tabs defaultActiveKey=\"\" id=\"controlled-tab\" onSelect={handleInstitutionLogin}>\n <Tab title={tabTitle} eventKey={selectedPage === LOGIN_PAGE ? LOGIN_PAGE : REGISTER_PAGE} />\n </Tabs>\n )\n : (!isValidTpaHint() && !hideRegistrationLink && (\n <Tabs defaultActiveKey={selectedPage} id=\"controlled-tab\" onSelect={(tabKey) => handleOnSelect(tabKey, selectedPage)}>\n <Tab title={formatMessage(messages['logistration.register'])} eventKey={REGISTER_PAGE} />\n <Tab title={formatMessage(messages['logistration.sign.in'])} eventKey={LOGIN_PAGE} />\n </Tabs>\n ))}\n {key && (\n <Navigate to={updatePathWithQueryParams(key)} replace />\n )}\n <div id=\"main-content\" className=\"main-content\">\n {!institutionLogin && !isValidTpaHint() && hideRegistrationLink && (\n <h3 className=\"mb-4.5\">\n {formatMessage(messages[selectedPage === LOGIN_PAGE ? 'logistration.sign.in' : 'logistration.register'])}\n </h3>\n )}\n {selectedPage === LOGIN_PAGE\n ? <LoginPage institutionLogin={institutionLogin} handleInstitutionLogin={handleInstitutionLogin} />\n : (\n <RegistrationPage\n institutionLogin={institutionLogin}\n handleInstitutionLogin={handleInstitutionLogin}\n />\n )}\n </div>\n </div>\n )}\n </div>\n </BaseContainer>\n );\n};\n\nLogistration.propTypes = {\n selectedPage: PropTypes.string,\n backupLoginForm: PropTypes.func.isRequired,\n backupRegistrationForm: PropTypes.func.isRequired,\n clearThirdPartyAuthContextErrorMessage: PropTypes.func.isRequired,\n tpaProviders: PropTypes.shape({\n providers: PropTypes.arrayOf(PropTypes.shape({})),\n secondaryProviders: PropTypes.arrayOf(PropTypes.shape({})),\n }),\n};\n\nLogistration.defaultProps = {\n tpaProviders: {\n providers: [],\n secondaryProviders: [],\n },\n};\n\nLogistration.defaultProps = {\n selectedPage: REGISTER_PAGE,\n};\n\nconst mapStateToProps = state => ({\n tpaProviders: tpaProvidersSelector(state),\n});\n\nexport default connect(\n mapStateToProps,\n {\n backupLoginForm,\n backupRegistrationForm,\n clearThirdPartyAuthContextErrorMessage,\n },\n)(Logistration);\n"]}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
declare const _default: import("react-redux").ConnectedComponent<{
|
|
2
|
+
(props: any): import("react/jsx-runtime").JSX.Element | null;
|
|
3
|
+
propTypes: {
|
|
4
|
+
authenticatedUser: PropTypes.Requireable<PropTypes.InferProps<{
|
|
5
|
+
username: PropTypes.Requireable<string>;
|
|
6
|
+
userId: PropTypes.Requireable<number>;
|
|
7
|
+
fullName: PropTypes.Requireable<string>;
|
|
8
|
+
}>>;
|
|
9
|
+
showError: PropTypes.Requireable<boolean>;
|
|
10
|
+
shouldRedirect: PropTypes.Requireable<boolean>;
|
|
11
|
+
submitState: PropTypes.Requireable<string>;
|
|
12
|
+
welcomePageContext: PropTypes.Requireable<PropTypes.InferProps<{
|
|
13
|
+
extended_profile: PropTypes.Requireable<(string | null | undefined)[]>;
|
|
14
|
+
fields: PropTypes.Requireable<PropTypes.InferProps<{}>>;
|
|
15
|
+
nextUrl: PropTypes.Requireable<string>;
|
|
16
|
+
}>>;
|
|
17
|
+
welcomePageContextApiStatus: PropTypes.Requireable<string>;
|
|
18
|
+
getFieldDataFromBackend: PropTypes.Validator<(...args: any[]) => any>;
|
|
19
|
+
saveUserProfile: PropTypes.Validator<(...args: any[]) => any>;
|
|
20
|
+
};
|
|
21
|
+
defaultProps: {
|
|
22
|
+
authenticatedUser: {};
|
|
23
|
+
shouldRedirect: boolean;
|
|
24
|
+
showError: boolean;
|
|
25
|
+
submitState: string;
|
|
26
|
+
welcomePageContext: {};
|
|
27
|
+
welcomePageContextApiStatus: string;
|
|
28
|
+
};
|
|
29
|
+
}, {
|
|
30
|
+
authenticatedUser?: PropTypes.InferProps<{
|
|
31
|
+
username: PropTypes.Requireable<string>;
|
|
32
|
+
userId: PropTypes.Requireable<number>;
|
|
33
|
+
fullName: PropTypes.Requireable<string>;
|
|
34
|
+
}> | null | undefined;
|
|
35
|
+
context?: import("react-redux/es/components/Context").ReactReduxContextInstance | undefined;
|
|
36
|
+
store?: import("redux").Store | undefined;
|
|
37
|
+
} | {
|
|
38
|
+
authenticatedUser?: PropTypes.InferProps<{
|
|
39
|
+
username: PropTypes.Requireable<string>;
|
|
40
|
+
userId: PropTypes.Requireable<number>;
|
|
41
|
+
fullName: PropTypes.Requireable<string>;
|
|
42
|
+
}> | null | undefined;
|
|
43
|
+
store?: import("redux").Store | undefined;
|
|
44
|
+
}>;
|
|
45
|
+
export default _default;
|
|
46
|
+
import PropTypes from 'prop-types';
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
import { connect } from 'react-redux';
|
|
4
|
+
import { AxiosJwtAuthService, configureAuth, useAppConfig, getAuthenticatedUser, getSiteConfig, getLoggingService, identifyAuthenticatedUser, sendPageEvent, sendTrackEvent, snakeCaseObject, useIntl } from '@openedx/frontend-base';
|
|
5
|
+
import { Alert, Form, Hyperlink, Spinner, StatefulButton, } from '@openedx/paragon';
|
|
6
|
+
import { Error } from '@openedx/paragon/icons';
|
|
7
|
+
import PropTypes from 'prop-types';
|
|
8
|
+
import { Helmet } from 'react-helmet';
|
|
9
|
+
import { useLocation } from 'react-router-dom';
|
|
10
|
+
import BaseContainer from '../base-container';
|
|
11
|
+
import { RedirectLogistration } from '../common-components';
|
|
12
|
+
import { getThirdPartyAuthContext } from '../common-components/data/actions';
|
|
13
|
+
import { COMPLETE_STATE, DEFAULT_REDIRECT_URL, DEFAULT_STATE, FAILURE_STATE, PENDING_STATE, } from '../data/constants';
|
|
14
|
+
import isOneTrustFunctionalCookieEnabled from '../data/oneTrust';
|
|
15
|
+
import { getAllPossibleQueryParams, isHostAvailableInQueryParams } from '../data/utils';
|
|
16
|
+
import { FormFieldRenderer } from '../field-renderer';
|
|
17
|
+
import { saveUserProfile } from './data/actions';
|
|
18
|
+
import { welcomePageContextSelector } from './data/selectors';
|
|
19
|
+
import messages from './messages';
|
|
20
|
+
import ProgressiveProfilingPageModal from './ProgressiveProfilingPageModal';
|
|
21
|
+
const ProgressiveProfiling = (props) => {
|
|
22
|
+
var _a, _b;
|
|
23
|
+
const { formatMessage } = useIntl();
|
|
24
|
+
const { getFieldDataFromBackend, submitState, showError, welcomePageContext, welcomePageContextApiStatus, } = props;
|
|
25
|
+
const { SEARCH_CATALOG_URL, AUTHN_PROGRESSIVE_PROFILING_SUPPORT_LINK } = useAppConfig();
|
|
26
|
+
const location = useLocation();
|
|
27
|
+
const registrationEmbedded = isHostAvailableInQueryParams();
|
|
28
|
+
const queryParams = getAllPossibleQueryParams();
|
|
29
|
+
const authenticatedUser = getAuthenticatedUser() || ((_a = location.state) === null || _a === void 0 ? void 0 : _a.authenticatedUser);
|
|
30
|
+
const functionalCookiesConsent = isOneTrustFunctionalCookieEnabled();
|
|
31
|
+
const [registrationResult, setRegistrationResult] = useState({ redirectUrl: '' });
|
|
32
|
+
const [formFieldData, setFormFieldData] = useState({ fields: {}, extendedProfile: [] });
|
|
33
|
+
const [values, setValues] = useState({});
|
|
34
|
+
const [showModal, setShowModal] = useState(false);
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
if (registrationEmbedded) {
|
|
37
|
+
getFieldDataFromBackend({ is_welcome_page: true, next: queryParams === null || queryParams === void 0 ? void 0 : queryParams.next });
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
configureAuth(AxiosJwtAuthService, { mockLoggingService: getLoggingService(), config: getSiteConfig() });
|
|
41
|
+
}
|
|
42
|
+
}, [registrationEmbedded, getFieldDataFromBackend, queryParams === null || queryParams === void 0 ? void 0 : queryParams.next]);
|
|
43
|
+
useEffect(() => {
|
|
44
|
+
var _a, _b, _c;
|
|
45
|
+
const registrationResponse = (_a = location.state) === null || _a === void 0 ? void 0 : _a.registrationResult;
|
|
46
|
+
if (registrationResponse) {
|
|
47
|
+
setRegistrationResult(registrationResponse);
|
|
48
|
+
setFormFieldData({
|
|
49
|
+
fields: (_b = location.state) === null || _b === void 0 ? void 0 : _b.optionalFields.fields,
|
|
50
|
+
extendedProfile: (_c = location.state) === null || _c === void 0 ? void 0 : _c.optionalFields.extended_profile,
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
}, [location.state]);
|
|
54
|
+
useEffect(() => {
|
|
55
|
+
if (registrationEmbedded && Object.keys(welcomePageContext).includes('fields')) {
|
|
56
|
+
setFormFieldData({
|
|
57
|
+
fields: welcomePageContext.fields,
|
|
58
|
+
extendedProfile: welcomePageContext.extended_profile,
|
|
59
|
+
});
|
|
60
|
+
const nextUrl = welcomePageContext.nextUrl ? welcomePageContext.nextUrl : SEARCH_CATALOG_URL;
|
|
61
|
+
setRegistrationResult({ redirectUrl: nextUrl });
|
|
62
|
+
}
|
|
63
|
+
}, [registrationEmbedded, welcomePageContext]);
|
|
64
|
+
useEffect(() => {
|
|
65
|
+
if (authenticatedUser === null || authenticatedUser === void 0 ? void 0 : authenticatedUser.userId) {
|
|
66
|
+
identifyAuthenticatedUser(authenticatedUser.userId);
|
|
67
|
+
sendPageEvent('login_and_registration', 'welcome');
|
|
68
|
+
}
|
|
69
|
+
}, [authenticatedUser]);
|
|
70
|
+
if (!authenticatedUser
|
|
71
|
+
|| !(((_b = location.state) === null || _b === void 0 ? void 0 : _b.registrationResult) || registrationEmbedded)
|
|
72
|
+
|| welcomePageContextApiStatus === FAILURE_STATE
|
|
73
|
+
|| (welcomePageContextApiStatus === COMPLETE_STATE && !Object.keys(welcomePageContext).includes('fields'))) {
|
|
74
|
+
const DASHBOARD_URL = getSiteConfig().lmsBaseUrl.concat(DEFAULT_REDIRECT_URL);
|
|
75
|
+
global.location.assign(DASHBOARD_URL);
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
78
|
+
const handleSubmit = (e) => {
|
|
79
|
+
e.preventDefault();
|
|
80
|
+
window.history.replaceState(location.state, null, '');
|
|
81
|
+
const payload = Object.assign(Object.assign({}, values), { extendedProfile: [] });
|
|
82
|
+
if (Object.keys(formFieldData.extendedProfile).length > 0) {
|
|
83
|
+
formFieldData.extendedProfile.forEach(fieldName => {
|
|
84
|
+
if (values[fieldName]) {
|
|
85
|
+
payload.extendedProfile.push({ fieldName, fieldValue: values[fieldName] });
|
|
86
|
+
}
|
|
87
|
+
delete payload[fieldName];
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
props.saveUserProfile(authenticatedUser.username, snakeCaseObject(payload));
|
|
91
|
+
sendTrackEvent('edx.bi.welcome.page.submit.clicked', {
|
|
92
|
+
isGenderSelected: !!values.gender,
|
|
93
|
+
isYearOfBirthSelected: !!values.year_of_birth,
|
|
94
|
+
isLevelOfEducationSelected: !!values.level_of_education,
|
|
95
|
+
isWorkExperienceSelected: !!values.work_experience,
|
|
96
|
+
host: (queryParams === null || queryParams === void 0 ? void 0 : queryParams.host) || '',
|
|
97
|
+
});
|
|
98
|
+
};
|
|
99
|
+
const handleSkip = (e) => {
|
|
100
|
+
e.preventDefault();
|
|
101
|
+
window.history.replaceState(location.state, null, '');
|
|
102
|
+
setShowModal(true);
|
|
103
|
+
sendTrackEvent('edx.bi.welcome.page.skip.link.clicked', {
|
|
104
|
+
host: (queryParams === null || queryParams === void 0 ? void 0 : queryParams.host) || '',
|
|
105
|
+
});
|
|
106
|
+
};
|
|
107
|
+
const onChangeHandler = (e) => {
|
|
108
|
+
if (e.target.type === 'checkbox') {
|
|
109
|
+
setValues(Object.assign(Object.assign({}, values), { [e.target.name]: e.target.checked }));
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
setValues(Object.assign(Object.assign({}, values), { [e.target.name]: e.target.value }));
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
const formFields = Object.keys(formFieldData.fields).map((fieldName) => {
|
|
116
|
+
const fieldData = formFieldData.fields[fieldName];
|
|
117
|
+
return (_jsx("span", { children: _jsx(FormFieldRenderer, { fieldData: fieldData, value: values[fieldData.name], onChangeHandler: onChangeHandler }) }, fieldData.name));
|
|
118
|
+
});
|
|
119
|
+
return (_jsxs(BaseContainer, { showWelcomeBanner: true, fullName: (authenticatedUser === null || authenticatedUser === void 0 ? void 0 : authenticatedUser.fullName) || (authenticatedUser === null || authenticatedUser === void 0 ? void 0 : authenticatedUser.name), children: [_jsx(Helmet, { children: _jsx("title", { children: formatMessage(messages['progressive.profiling.page.title'], { siteName: getSiteConfig().siteName }) }) }), _jsx(ProgressiveProfilingPageModal, { isOpen: showModal, redirectUrl: registrationResult.redirectUrl }), (props.shouldRedirect && welcomePageContext.nextUrl) && (_jsx(RedirectLogistration, { success: true, redirectUrl: registrationResult.redirectUrl })), props.shouldRedirect && (_jsx(RedirectLogistration, { success: true, redirectUrl: registrationResult.redirectUrl, educationLevel: values === null || values === void 0 ? void 0 : values.level_of_education, userId: authenticatedUser === null || authenticatedUser === void 0 ? void 0 : authenticatedUser.userId })), _jsx("div", { className: "mw-xs m-4 pp-page-content", children: registrationEmbedded && welcomePageContextApiStatus === PENDING_STATE ? (_jsx(Spinner, { animation: "border", variant: "primary", id: "tpa-spinner" })) : (_jsxs(_Fragment, { children: [_jsx("div", { children: _jsx("h2", { className: "pp-page__heading text-primary", children: formatMessage(messages['progressive.profiling.page.heading']) }) }), _jsx("hr", { className: "border-light-700 mb-4" }), showError ? (_jsxs(Alert, { id: "pp-page-errors", className: "mb-3", variant: "danger", icon: Error, children: [_jsx(Alert.Heading, { children: formatMessage(messages['welcome.page.error.heading']) }), _jsx("p", { children: formatMessage(messages['welcome.page.error.message']) })] })) : null, _jsxs(Form, { children: [formFields, (AUTHN_PROGRESSIVE_PROFILING_SUPPORT_LINK) && (_jsx("span", { className: "pp-page__support-link", children: _jsx(Hyperlink, { isInline: true, variant: "muted", destination: AUTHN_PROGRESSIVE_PROFILING_SUPPORT_LINK, target: "_blank", showLaunchIcon: false, onClick: () => (sendTrackEvent('edx.bi.welcome.page.support.link.clicked')), children: formatMessage(messages['optional.fields.information.link']) }) })), _jsxs("div", { className: "d-flex mt-4 mb-3", children: [_jsx(StatefulButton, { type: "submit", variant: "brand", className: "pp-page__button-width", state: submitState, labels: {
|
|
120
|
+
default: formatMessage(messages['optional.fields.submit.button']),
|
|
121
|
+
pending: '',
|
|
122
|
+
}, onClick: handleSubmit, onMouseDown: (e) => e.preventDefault() }), _jsx(StatefulButton, { className: "text-gray-700 font-weight-500", type: "submit", variant: "link", labels: {
|
|
123
|
+
default: formatMessage(messages['optional.fields.skip.button']),
|
|
124
|
+
}, onClick: handleSkip, onMouseDown: (e) => e.preventDefault() })] })] })] })) })] }));
|
|
125
|
+
};
|
|
126
|
+
ProgressiveProfiling.propTypes = {
|
|
127
|
+
authenticatedUser: PropTypes.shape({
|
|
128
|
+
username: PropTypes.string,
|
|
129
|
+
userId: PropTypes.number,
|
|
130
|
+
fullName: PropTypes.string,
|
|
131
|
+
}),
|
|
132
|
+
showError: PropTypes.bool,
|
|
133
|
+
shouldRedirect: PropTypes.bool,
|
|
134
|
+
submitState: PropTypes.string,
|
|
135
|
+
welcomePageContext: PropTypes.shape({
|
|
136
|
+
extended_profile: PropTypes.arrayOf(PropTypes.string),
|
|
137
|
+
fields: PropTypes.shape({}),
|
|
138
|
+
nextUrl: PropTypes.string,
|
|
139
|
+
}),
|
|
140
|
+
welcomePageContextApiStatus: PropTypes.string,
|
|
141
|
+
// Actions
|
|
142
|
+
getFieldDataFromBackend: PropTypes.func.isRequired,
|
|
143
|
+
saveUserProfile: PropTypes.func.isRequired,
|
|
144
|
+
};
|
|
145
|
+
ProgressiveProfiling.defaultProps = {
|
|
146
|
+
authenticatedUser: {},
|
|
147
|
+
shouldRedirect: false,
|
|
148
|
+
showError: false,
|
|
149
|
+
submitState: DEFAULT_STATE,
|
|
150
|
+
welcomePageContext: {},
|
|
151
|
+
welcomePageContextApiStatus: PENDING_STATE,
|
|
152
|
+
};
|
|
153
|
+
const mapStateToProps = state => {
|
|
154
|
+
const welcomePageStore = state.welcomePage;
|
|
155
|
+
return {
|
|
156
|
+
shouldRedirect: welcomePageStore.success,
|
|
157
|
+
showError: welcomePageStore.showError,
|
|
158
|
+
submitState: welcomePageStore.submitState,
|
|
159
|
+
welcomePageContext: welcomePageContextSelector(state),
|
|
160
|
+
welcomePageContextApiStatus: state.commonComponents.thirdPartyAuthApiStatus,
|
|
161
|
+
};
|
|
162
|
+
};
|
|
163
|
+
export default connect(mapStateToProps, {
|
|
164
|
+
saveUserProfile,
|
|
165
|
+
getFieldDataFromBackend: getThirdPartyAuthContext,
|
|
166
|
+
})(ProgressiveProfiling);
|
|
167
|
+
//# sourceMappingURL=ProgressiveProfiling.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProgressiveProfiling.js","sourceRoot":"","sources":["../../src/progressive-profiling/ProgressiveProfiling.jsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,OAAO,EACL,mBAAmB,EACnB,aAAa,EACb,YAAY,EACZ,oBAAoB,EACpB,aAAa,EACb,iBAAiB,EACjB,yBAAyB,EACzB,aAAa,EACb,cAAc,EACd,eAAe,EACf,OAAO,EACR,MAAM,wBA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QACxC,SAAS,EAAE,gBAAgB,CAAC,SAAS;QACrC,WAAW,EAAE,gBAAgB,CAAC,WAAW;QACzC,kBAAkB,EAAE,0BAA0B,CAAC,KAAK,CAAC;QACrD,2BAA2B,EAAE,KAAK,CAAC,gBAAgB,CAAC,uBAAuB;KAC5E,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,OAAO,CACpB,eAAe,EACf;IACE,eAAe;IACf,uBAAuB,EAAE,wBAAwB;CAClD,CACF,CAAC,oBAAoB,CAAC,CAAC","sourcesContent":["import { useEffect, useState } from 'react';\nimport { connect } from 'react-redux';\n\nimport {\n AxiosJwtAuthService,\n configureAuth,\n useAppConfig,\n getAuthenticatedUser,\n getSiteConfig,\n getLoggingService,\n identifyAuthenticatedUser,\n sendPageEvent,\n sendTrackEvent,\n snakeCaseObject,\n useIntl\n} from '@openedx/frontend-base';\nimport {\n Alert,\n Form,\n Hyperlink,\n Spinner,\n StatefulButton,\n} from '@openedx/paragon';\nimport { Error } from '@openedx/paragon/icons';\nimport PropTypes from 'prop-types';\nimport { Helmet } from 'react-helmet';\nimport { useLocation } from 'react-router-dom';\n\nimport BaseContainer from '../base-container';\nimport { RedirectLogistration } from '../common-components';\nimport { getThirdPartyAuthContext } from '../common-components/data/actions';\nimport {\n COMPLETE_STATE,\n DEFAULT_REDIRECT_URL,\n DEFAULT_STATE,\n FAILURE_STATE,\n PENDING_STATE,\n} from '../data/constants';\nimport isOneTrustFunctionalCookieEnabled from '../data/oneTrust';\nimport { getAllPossibleQueryParams, isHostAvailableInQueryParams } from '../data/utils';\nimport { FormFieldRenderer } from '../field-renderer';\nimport { saveUserProfile } from './data/actions';\nimport { welcomePageContextSelector } from './data/selectors';\nimport messages from './messages';\nimport ProgressiveProfilingPageModal from './ProgressiveProfilingPageModal';\n\nconst ProgressiveProfiling = (props) => {\n const { formatMessage } = useIntl();\n const {\n getFieldDataFromBackend,\n submitState,\n showError,\n welcomePageContext,\n welcomePageContextApiStatus,\n } = props;\n const {\n SEARCH_CATALOG_URL,\n AUTHN_PROGRESSIVE_PROFILING_SUPPORT_LINK\n } = useAppConfig();\n const location = useLocation();\n const registrationEmbedded = isHostAvailableInQueryParams();\n\n const queryParams = getAllPossibleQueryParams();\n const authenticatedUser = getAuthenticatedUser() || location.state?.authenticatedUser;\n const functionalCookiesConsent = isOneTrustFunctionalCookieEnabled();\n\n const [registrationResult, setRegistrationResult] = useState({ redirectUrl: '' });\n const [formFieldData, setFormFieldData] = useState({ fields: {}, extendedProfile: [] });\n const [values, setValues] = useState({});\n const [showModal, setShowModal] = useState(false);\n\n useEffect(() => {\n if (registrationEmbedded) {\n getFieldDataFromBackend({ is_welcome_page: true, next: queryParams?.next });\n } else {\n configureAuth(AxiosJwtAuthService, { mockLoggingService: getLoggingService(), config: getSiteConfig() });\n }\n }, [registrationEmbedded, getFieldDataFromBackend, queryParams?.next]);\n\n useEffect(() => {\n const registrationResponse = location.state?.registrationResult;\n if (registrationResponse) {\n setRegistrationResult(registrationResponse);\n setFormFieldData({\n fields: location.state?.optionalFields.fields,\n extendedProfile: location.state?.optionalFields.extended_profile,\n });\n }\n }, [location.state]);\n\n useEffect(() => {\n if (registrationEmbedded && Object.keys(welcomePageContext).includes('fields')) {\n setFormFieldData({\n fields: welcomePageContext.fields,\n extendedProfile: welcomePageContext.extended_profile,\n });\n const nextUrl = welcomePageContext.nextUrl ? welcomePageContext.nextUrl : SEARCH_CATALOG_URL;\n setRegistrationResult({ redirectUrl: nextUrl });\n }\n }, [registrationEmbedded, welcomePageContext]);\n\n useEffect(() => {\n if (authenticatedUser?.userId) {\n identifyAuthenticatedUser(authenticatedUser.userId);\n sendPageEvent('login_and_registration', 'welcome');\n }\n }, [authenticatedUser]);\n\n if (\n !authenticatedUser\n || !(location.state?.registrationResult || registrationEmbedded)\n || welcomePageContextApiStatus === FAILURE_STATE\n || (welcomePageContextApiStatus === COMPLETE_STATE && !Object.keys(welcomePageContext).includes('fields'))\n ) {\n const DASHBOARD_URL = getSiteConfig().lmsBaseUrl.concat(DEFAULT_REDIRECT_URL);\n global.location.assign(DASHBOARD_URL);\n return null;\n }\n\n const handleSubmit = (e) => {\n e.preventDefault();\n window.history.replaceState(location.state, null, '');\n const payload = { ...values, extendedProfile: [] };\n if (Object.keys(formFieldData.extendedProfile).length > 0) {\n formFieldData.extendedProfile.forEach(fieldName => {\n if (values[fieldName]) {\n payload.extendedProfile.push({ fieldName, fieldValue: values[fieldName] });\n }\n delete payload[fieldName];\n });\n }\n props.saveUserProfile(authenticatedUser.username, snakeCaseObject(payload));\n\n sendTrackEvent(\n 'edx.bi.welcome.page.submit.clicked',\n {\n isGenderSelected: !!values.gender,\n isYearOfBirthSelected: !!values.year_of_birth,\n isLevelOfEducationSelected: !!values.level_of_education,\n isWorkExperienceSelected: !!values.work_experience,\n host: queryParams?.host || '',\n },\n );\n };\n\n const handleSkip = (e) => {\n e.preventDefault();\n window.history.replaceState(location.state, null, '');\n setShowModal(true);\n sendTrackEvent(\n 'edx.bi.welcome.page.skip.link.clicked',\n {\n host: queryParams?.host || '',\n },\n );\n };\n\n const onChangeHandler = (e) => {\n if (e.target.type === 'checkbox') {\n setValues({ ...values, [e.target.name]: e.target.checked });\n } else {\n setValues({ ...values, [e.target.name]: e.target.value });\n }\n };\n\n const formFields = Object.keys(formFieldData.fields).map((fieldName) => {\n const fieldData = formFieldData.fields[fieldName];\n return (\n <span key={fieldData.name}>\n <FormFieldRenderer\n fieldData={fieldData}\n value={values[fieldData.name]}\n onChangeHandler={onChangeHandler}\n />\n </span>\n );\n });\n\n return (\n <BaseContainer showWelcomeBanner fullName={authenticatedUser?.fullName || authenticatedUser?.name}>\n <Helmet>\n <title>{formatMessage(\n messages['progressive.profiling.page.title'],\n { siteName: getSiteConfig().siteName }\n )}\n </title>\n </Helmet>\n <ProgressiveProfilingPageModal isOpen={showModal} redirectUrl={registrationResult.redirectUrl} />\n {(props.shouldRedirect && welcomePageContext.nextUrl) && (\n <RedirectLogistration\n success\n redirectUrl={registrationResult.redirectUrl}\n />\n )}\n {props.shouldRedirect && (\n <RedirectLogistration\n success\n redirectUrl={registrationResult.redirectUrl}\n educationLevel={values?.level_of_education}\n userId={authenticatedUser?.userId}\n />\n )}\n <div className=\"mw-xs m-4 pp-page-content\">\n {registrationEmbedded && welcomePageContextApiStatus === PENDING_STATE ? (\n <Spinner animation=\"border\" variant=\"primary\" id=\"tpa-spinner\" />\n ) : (\n <>\n <div>\n <h2 className=\"pp-page__heading text-primary\">{formatMessage(messages['progressive.profiling.page.heading'])}</h2>\n </div><hr className=\"border-light-700 mb-4\" />\n {showError ? (\n <Alert id=\"pp-page-errors\" className=\"mb-3\" variant=\"danger\" icon={Error}>\n <Alert.Heading>{formatMessage(messages['welcome.page.error.heading'])}</Alert.Heading>\n <p>{formatMessage(messages['welcome.page.error.message'])}</p>\n </Alert>\n ) : null}\n <Form>\n {formFields}\n {(AUTHN_PROGRESSIVE_PROFILING_SUPPORT_LINK) && (\n <span className=\"pp-page__support-link\">\n <Hyperlink\n isInline\n variant=\"muted\"\n destination={AUTHN_PROGRESSIVE_PROFILING_SUPPORT_LINK}\n target=\"_blank\"\n showLaunchIcon={false}\n onClick={() => (sendTrackEvent('edx.bi.welcome.page.support.link.clicked'))}\n >\n {formatMessage(messages['optional.fields.information.link'])}\n </Hyperlink>\n </span>\n )}\n <div className=\"d-flex mt-4 mb-3\">\n <StatefulButton\n type=\"submit\"\n variant=\"brand\"\n className=\"pp-page__button-width\"\n state={submitState}\n labels={{\n default: formatMessage(messages['optional.fields.submit.button']),\n pending: '',\n }}\n onClick={handleSubmit}\n onMouseDown={(e) => e.preventDefault()}\n />\n <StatefulButton\n className=\"text-gray-700 font-weight-500\"\n type=\"submit\"\n variant=\"link\"\n labels={{\n default: formatMessage(messages['optional.fields.skip.button']),\n }}\n onClick={handleSkip}\n onMouseDown={(e) => e.preventDefault()}\n />\n </div>\n </Form>\n </>\n )}\n\n </div>\n </BaseContainer>\n );\n};\n\nProgressiveProfiling.propTypes = {\n authenticatedUser: PropTypes.shape({\n username: PropTypes.string,\n userId: PropTypes.number,\n fullName: PropTypes.string,\n }),\n showError: PropTypes.bool,\n shouldRedirect: PropTypes.bool,\n submitState: PropTypes.string,\n welcomePageContext: PropTypes.shape({\n extended_profile: PropTypes.arrayOf(PropTypes.string),\n fields: PropTypes.shape({}),\n nextUrl: PropTypes.string,\n }),\n welcomePageContextApiStatus: PropTypes.string,\n // Actions\n getFieldDataFromBackend: PropTypes.func.isRequired,\n saveUserProfile: PropTypes.func.isRequired,\n};\n\nProgressiveProfiling.defaultProps = {\n authenticatedUser: {},\n shouldRedirect: false,\n showError: false,\n submitState: DEFAULT_STATE,\n welcomePageContext: {},\n welcomePageContextApiStatus: PENDING_STATE,\n};\n\nconst mapStateToProps = state => {\n const welcomePageStore = state.welcomePage;\n\n return {\n shouldRedirect: welcomePageStore.success,\n showError: welcomePageStore.showError,\n submitState: welcomePageStore.submitState,\n welcomePageContext: welcomePageContextSelector(state),\n welcomePageContextApiStatus: state.commonComponents.thirdPartyAuthApiStatus,\n };\n};\n\nexport default connect(\n mapStateToProps,\n {\n saveUserProfile,\n getFieldDataFromBackend: getThirdPartyAuthContext,\n },\n)(ProgressiveProfiling);\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export default ProgressiveProfilingPageModal;
|
|
2
|
+
declare function ProgressiveProfilingPageModal(props: any): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
declare namespace ProgressiveProfilingPageModal {
|
|
4
|
+
namespace propTypes {
|
|
5
|
+
let isOpen: PropTypes.Requireable<boolean>;
|
|
6
|
+
let redirectUrl: PropTypes.Validator<string>;
|
|
7
|
+
}
|
|
8
|
+
namespace defaultProps {
|
|
9
|
+
let isOpen_1: boolean;
|
|
10
|
+
export { isOpen_1 as isOpen };
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
import PropTypes from 'prop-types';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { getSiteConfig, useIntl } from '@openedx/frontend-base';
|
|
3
|
+
import { ActionRow, Button, ModalDialog } from '@openedx/paragon';
|
|
4
|
+
import PropTypes from 'prop-types';
|
|
5
|
+
import messages from './messages';
|
|
6
|
+
const ProgressiveProfilingPageModal = (props) => {
|
|
7
|
+
const { formatMessage } = useIntl();
|
|
8
|
+
const { isOpen, redirectUrl } = props;
|
|
9
|
+
const platformName = getSiteConfig().siteName;
|
|
10
|
+
const handleSubmit = (e) => {
|
|
11
|
+
e.preventDefault();
|
|
12
|
+
window.location.href = redirectUrl;
|
|
13
|
+
};
|
|
14
|
+
return (_jsxs(ModalDialog, { title: formatMessage(messages['modal.title']), isOpen: isOpen, onClose: () => { }, size: "sm", variant: "default", hasCloseButton: false, children: [_jsx(ModalDialog.Header, { children: _jsx(ModalDialog.Title, { children: formatMessage(messages['modal.title']) }) }), _jsx(ModalDialog.Body, { children: formatMessage(messages['modal.description']) }), _jsx(ModalDialog.Footer, { children: _jsx(ActionRow, { children: _jsx(Button, { onClick: handleSubmit, variant: "primary", children: formatMessage(messages['continue.to.platform'], { platformName }) }) }) })] }));
|
|
15
|
+
};
|
|
16
|
+
ProgressiveProfilingPageModal.propTypes = {
|
|
17
|
+
isOpen: PropTypes.bool,
|
|
18
|
+
redirectUrl: PropTypes.string.isRequired,
|
|
19
|
+
};
|
|
20
|
+
ProgressiveProfilingPageModal.defaultProps = {
|
|
21
|
+
isOpen: false,
|
|
22
|
+
};
|
|
23
|
+
export default ProgressiveProfilingPageModal;
|
|
24
|
+
//# sourceMappingURL=ProgressiveProfilingPageModal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProgressiveProfilingPageModal.js","sourceRoot":"","sources":["../../src/progressive-profiling/ProgressiveProfilingPageModal.jsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,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AAE,SAAS,CAAC,IAAI;IACtB,WAAW,EAAE,SAAS,CAAC,MAAM,CAAC,UAAU;CACzC,CAAC;AAEF,6BAA6B,CAAC,YAAY,GAAG;IAC3C,MAAM,EAAE,KAAK;CACd,CAAC;AAEF,eAAe,6BAA6B,CAAC","sourcesContent":["import { getSiteConfig, useIntl } from '@openedx/frontend-base';\nimport { ActionRow, Button, ModalDialog } from '@openedx/paragon';\nimport PropTypes from 'prop-types';\n\nimport messages from './messages';\n\nconst ProgressiveProfilingPageModal = (props) => {\n const { formatMessage } = useIntl();\n const { isOpen, redirectUrl } = props;\n const platformName = getSiteConfig().siteName;\n\n const handleSubmit = (e) => {\n e.preventDefault();\n window.location.href = redirectUrl;\n };\n\n return (\n <ModalDialog\n title={formatMessage(messages['modal.title'])}\n isOpen={isOpen}\n onClose={() => { }}\n size=\"sm\"\n variant=\"default\"\n hasCloseButton={false}\n >\n <ModalDialog.Header>\n <ModalDialog.Title>\n {formatMessage(messages['modal.title'])}\n </ModalDialog.Title>\n </ModalDialog.Header>\n\n <ModalDialog.Body>\n {formatMessage(messages['modal.description'])}\n </ModalDialog.Body>\n\n <ModalDialog.Footer>\n <ActionRow>\n <Button onClick={handleSubmit} variant=\"primary\">\n {formatMessage(messages['continue.to.platform'], { platformName })}\n </Button>\n </ActionRow>\n </ModalDialog.Footer>\n </ModalDialog>\n );\n};\n\nProgressiveProfilingPageModal.propTypes = {\n isOpen: PropTypes.bool,\n redirectUrl: PropTypes.string.isRequired,\n};\n\nProgressiveProfilingPageModal.defaultProps = {\n isOpen: false,\n};\n\nexport default ProgressiveProfilingPageModal;\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export const GET_FIELDS_DATA: AsyncActionType;
|
|
2
|
+
export const SAVE_USER_PROFILE: AsyncActionType;
|
|
3
|
+
export function saveUserProfile(username: any, data: any): {
|
|
4
|
+
type: string;
|
|
5
|
+
payload: {
|
|
6
|
+
username: any;
|
|
7
|
+
data: any;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
export function saveUserProfileBegin(): {
|
|
11
|
+
type: string;
|
|
12
|
+
};
|
|
13
|
+
export function saveUserProfileSuccess(): {
|
|
14
|
+
type: string;
|
|
15
|
+
};
|
|
16
|
+
export function saveUserProfileFailure(): {
|
|
17
|
+
type: string;
|
|
18
|
+
};
|
|
19
|
+
import { AsyncActionType } from '../../data/utils';
|
|
@@ -1,22 +1,18 @@
|
|
|
1
1
|
import { AsyncActionType } from '../../data/utils';
|
|
2
|
-
|
|
3
2
|
export const GET_FIELDS_DATA = new AsyncActionType('FIELD_DESCRIPTION', 'GET_FIELDS_DATA');
|
|
4
3
|
export const SAVE_USER_PROFILE = new AsyncActionType('USER_PROFILE', 'SAVE_USER_PROFILE');
|
|
5
|
-
|
|
6
4
|
// save additional user information
|
|
7
5
|
export const saveUserProfile = (username, data) => ({
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
type: SAVE_USER_PROFILE.BASE,
|
|
7
|
+
payload: { username, data },
|
|
10
8
|
});
|
|
11
|
-
|
|
12
9
|
export const saveUserProfileBegin = () => ({
|
|
13
|
-
|
|
10
|
+
type: SAVE_USER_PROFILE.BEGIN,
|
|
14
11
|
});
|
|
15
|
-
|
|
16
12
|
export const saveUserProfileSuccess = () => ({
|
|
17
|
-
|
|
13
|
+
type: SAVE_USER_PROFILE.SUCCESS,
|
|
18
14
|
});
|
|
19
|
-
|
|
20
15
|
export const saveUserProfileFailure = () => ({
|
|
21
|
-
|
|
16
|
+
type: SAVE_USER_PROFILE.FAILURE,
|
|
22
17
|
});
|
|
18
|
+
//# sourceMappingURL=actions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actions.js","sourceRoot":"","sources":["../../../src/progressive-profiling/data/actions.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEnD,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,eAAe,CAAC,mBAAmB,EAAE,iBAAiB,CAAC,CAAC;AAC3F,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,eAAe,CAAC,cAAc,EAAE,mBAAmB,CAAC,CAAC;AAE1F,mCAAmC;AACnC,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,QAAQ,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;IAClD,IAAI,EAAE,iBAAiB,CAAC,IAAI;IAC5B,OAAO,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;CAC5B,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAG,EAAE,CAAC,CAAC;IACzC,IAAI,EAAE,iBAAiB,CAAC,KAAK;CAC9B,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,EAAE,CAAC,CAAC;IAC3C,IAAI,EAAE,iBAAiB,CAAC,OAAO;CAChC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,EAAE,CAAC,CAAC;IAC3C,IAAI,EAAE,iBAAiB,CAAC,OAAO;CAChC,CAAC,CAAC","sourcesContent":["import { AsyncActionType } from '../../data/utils';\n\nexport const GET_FIELDS_DATA = new AsyncActionType('FIELD_DESCRIPTION', 'GET_FIELDS_DATA');\nexport const SAVE_USER_PROFILE = new AsyncActionType('USER_PROFILE', 'SAVE_USER_PROFILE');\n\n// save additional user information\nexport const saveUserProfile = (username, data) => ({\n type: SAVE_USER_PROFILE.BASE,\n payload: { username, data },\n});\n\nexport const saveUserProfileBegin = () => ({\n type: SAVE_USER_PROFILE.BEGIN,\n});\n\nexport const saveUserProfileSuccess = () => ({\n type: SAVE_USER_PROFILE.SUCCESS,\n});\n\nexport const saveUserProfileFailure = () => ({\n type: SAVE_USER_PROFILE.FAILURE,\n});\n"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export namespace defaultState {
|
|
2
|
+
export let extendedProfile: never[];
|
|
3
|
+
export let fieldDescriptions: {};
|
|
4
|
+
export let success: boolean;
|
|
5
|
+
export { DEFAULT_STATE as submitState };
|
|
6
|
+
export let showError: boolean;
|
|
7
|
+
}
|
|
8
|
+
export default reducer;
|
|
9
|
+
import { DEFAULT_STATE } from '../../data/constants';
|
|
10
|
+
declare function reducer(state?: {
|
|
11
|
+
extendedProfile: never[];
|
|
12
|
+
fieldDescriptions: {};
|
|
13
|
+
success: boolean;
|
|
14
|
+
submitState: string;
|
|
15
|
+
showError: boolean;
|
|
16
|
+
}, action?: {}): {
|
|
17
|
+
extendedProfile: never[];
|
|
18
|
+
fieldDescriptions: {};
|
|
19
|
+
success: boolean;
|
|
20
|
+
submitState: string;
|
|
21
|
+
showError: boolean;
|
|
22
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { SAVE_USER_PROFILE } from './actions';
|
|
2
|
+
import { DEFAULT_STATE, PENDING_STATE, } from '../../data/constants';
|
|
3
|
+
export const defaultState = {
|
|
4
|
+
extendedProfile: [],
|
|
5
|
+
fieldDescriptions: {},
|
|
6
|
+
success: false,
|
|
7
|
+
submitState: DEFAULT_STATE,
|
|
8
|
+
showError: false,
|
|
9
|
+
};
|
|
10
|
+
const reducer = (state = defaultState, action = {}) => {
|
|
11
|
+
switch (action.type) {
|
|
12
|
+
case SAVE_USER_PROFILE.BEGIN:
|
|
13
|
+
return Object.assign(Object.assign({}, state), { submitState: PENDING_STATE });
|
|
14
|
+
case SAVE_USER_PROFILE.SUCCESS:
|
|
15
|
+
return Object.assign(Object.assign({}, state), { success: true, showError: false });
|
|
16
|
+
case SAVE_USER_PROFILE.FAILURE:
|
|
17
|
+
return Object.assign(Object.assign({}, state), { submitState: DEFAULT_STATE, showError: true });
|
|
18
|
+
default:
|
|
19
|
+
return state;
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
export default reducer;
|
|
23
|
+
//# sourceMappingURL=reducers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reducers.js","sourceRoot":"","sources":["../../../src/progressive-profiling/data/reducers.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EACL,aAAa,EAAE,aAAa,GAC7B,MAAM,sBAAsB,CAAC;AAE9B,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,eAAe,EAAE,EAAE;IACnB,iBAAiB,EAAE,EAAE;IACrB,OAAO,EAAE,KAAK;IACd,WAAW,EAAE,aAAa;IAC1B,SAAS,EAAE,KAAK;CACjB,CAAC;AAEF,MAAM,OAAO,GAAG,CAAC,KAAK,GAAG,YAAY,EAAE,MAAM,GAAG,EAAE,EAAE,EAAE;IACpD,QAAQ,MAAM,CAAC,IAAI,EAAE,CAAC;QACpB,KAAK,iBAAiB,CAAC,KAAK;YAC1B,uCACK,KAAK,KACR,WAAW,EAAE,aAAa,IAC1B;QACJ,KAAK,iBAAiB,CAAC,OAAO;YAC5B,uCACK,KAAK,KACR,OAAO,EAAE,IAAI,EACb,SAAS,EAAE,KAAK,IAChB;QACJ,KAAK,iBAAiB,CAAC,OAAO;YAC5B,uCACK,KAAK,KACR,WAAW,EAAE,aAAa,EAC1B,SAAS,EAAE,IAAI,IACf;QACJ;YACE,OAAO,KAAK,CAAC;IACjB,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,OAAO,CAAC","sourcesContent":["import { SAVE_USER_PROFILE } from './actions';\nimport {\n DEFAULT_STATE, PENDING_STATE,\n} from '../../data/constants';\n\nexport const defaultState = {\n extendedProfile: [],\n fieldDescriptions: {},\n success: false,\n submitState: DEFAULT_STATE,\n showError: false,\n};\n\nconst reducer = (state = defaultState, action = {}) => {\n switch (action.type) {\n case SAVE_USER_PROFILE.BEGIN:\n return {\n ...state,\n submitState: PENDING_STATE,\n };\n case SAVE_USER_PROFILE.SUCCESS:\n return {\n ...state,\n success: true,\n showError: false,\n };\n case SAVE_USER_PROFILE.FAILURE:\n return {\n ...state,\n submitState: DEFAULT_STATE,\n showError: true,\n };\n default:\n return state;\n }\n};\n\nexport default reducer;\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export function saveUserProfileInformation(action: any): Generator<import("redux-saga/effects").PutEffect<{
|
|
2
|
+
type: string;
|
|
3
|
+
}> | import("redux-saga/effects").CallEffect<void>, void, unknown>;
|
|
4
|
+
export default function saga(): Generator<import("redux-saga/effects").ForkEffect<never>, void, unknown>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { call, put, takeEvery } from 'redux-saga/effects';
|
|
2
|
+
import { SAVE_USER_PROFILE, saveUserProfileBegin, saveUserProfileFailure, saveUserProfileSuccess, } from './actions';
|
|
3
|
+
import { patchAccount } from './service';
|
|
4
|
+
export function* saveUserProfileInformation(action) {
|
|
5
|
+
try {
|
|
6
|
+
yield put(saveUserProfileBegin());
|
|
7
|
+
yield call(patchAccount, action.payload.username, action.payload.data);
|
|
8
|
+
yield put(saveUserProfileSuccess());
|
|
9
|
+
}
|
|
10
|
+
catch (e) {
|
|
11
|
+
yield put(saveUserProfileFailure());
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export default function* saga() {
|
|
15
|
+
yield takeEvery(SAVE_USER_PROFILE.BASE, saveUserProfileInformation);
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=sagas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sagas.js","sourceRoot":"","sources":["../../../src/progressive-profiling/data/sagas.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE1D,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC,MAAM,SAAS,CAAC,CAAC,0BAA0B,CAAC,MAAM;IAChD,IAAI,CAAC;QACH,MAAM,GAAG,CAAC,oBAAoB,EAAE,CAAC,CAAC;QAClC,MAAM,IAAI,CAAC,YAAY,EAAE,MAAM,CAAC,OAAO,CAAC,QAAQ,EAAE,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAEvE,MAAM,GAAG,CAAC,sBAAsB,EAAE,CAAC,CAAC;IACtC,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,MAAM,GAAG,CAAC,sBAAsB,EAAE,CAAC,CAAC;IACtC,CAAC;AACH,CAAC;AAED,MAAM,CAAC,OAAO,SAAS,CAAC,CAAC,IAAI;IAC3B,MAAM,SAAS,CAAC,iBAAiB,CAAC,IAAI,EAAE,0BAA0B,CAAC,CAAC;AACtE,CAAC","sourcesContent":["import { call, put, takeEvery } from 'redux-saga/effects';\n\nimport {\n SAVE_USER_PROFILE,\n saveUserProfileBegin,\n saveUserProfileFailure,\n saveUserProfileSuccess,\n} from './actions';\nimport { patchAccount } from './service';\n\nexport function* saveUserProfileInformation(action) {\n try {\n yield put(saveUserProfileBegin());\n yield call(patchAccount, action.payload.username, action.payload.data);\n\n yield put(saveUserProfileSuccess());\n } catch (e) {\n yield put(saveUserProfileFailure());\n }\n}\n\nexport default function* saga() {\n yield takeEvery(SAVE_USER_PROFILE.BASE, saveUserProfileInformation);\n}\n"]}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export const storeName: "commonComponents";
|
|
2
|
+
export function commonComponentsSelector(state: any): any;
|
|
3
|
+
export const welcomePageContextSelector: ((state: any) => {
|
|
4
|
+
fields: any;
|
|
5
|
+
extended_profile: any;
|
|
6
|
+
nextUrl: any;
|
|
7
|
+
}) & {
|
|
8
|
+
clearCache: () => void;
|
|
9
|
+
resultsCount: () => number;
|
|
10
|
+
resetResultsCount: () => void;
|
|
11
|
+
} & {
|
|
12
|
+
resultFunc: (resultFuncArgs_0: any) => {
|
|
13
|
+
fields: any;
|
|
14
|
+
extended_profile: any;
|
|
15
|
+
nextUrl: any;
|
|
16
|
+
};
|
|
17
|
+
memoizedResultFunc: ((resultFuncArgs_0: any) => {
|
|
18
|
+
fields: any;
|
|
19
|
+
extended_profile: any;
|
|
20
|
+
nextUrl: any;
|
|
21
|
+
}) & {
|
|
22
|
+
clearCache: () => void;
|
|
23
|
+
resultsCount: () => number;
|
|
24
|
+
resetResultsCount: () => void;
|
|
25
|
+
};
|
|
26
|
+
lastResult: () => {
|
|
27
|
+
fields: any;
|
|
28
|
+
extended_profile: any;
|
|
29
|
+
nextUrl: any;
|
|
30
|
+
};
|
|
31
|
+
dependencies: [(state: any) => any];
|
|
32
|
+
recomputations: () => number;
|
|
33
|
+
resetRecomputations: () => void;
|
|
34
|
+
dependencyRecomputations: () => number;
|
|
35
|
+
resetDependencyRecomputations: () => void;
|
|
36
|
+
} & {
|
|
37
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
38
|
+
memoize: typeof import("reselect").weakMapMemoize;
|
|
39
|
+
};
|