@openedx/frontend-app-authn 1.0.0-alpha.6 → 1.0.0-alpha.7

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.
Files changed (254) hide show
  1. package/dist/Main.js +1 -3
  2. package/dist/Main.js.map +1 -1
  3. package/dist/common-components/EmbeddedRegistrationRoute.js +2 -2
  4. package/dist/common-components/EmbeddedRegistrationRoute.js.map +1 -1
  5. package/dist/common-components/EnterpriseSSO.js +6 -3
  6. package/dist/common-components/EnterpriseSSO.js.map +1 -1
  7. package/dist/common-components/PasswordField.d.ts +17 -9
  8. package/dist/common-components/PasswordField.js +10 -6
  9. package/dist/common-components/PasswordField.js.map +1 -1
  10. package/dist/common-components/RedirectLogistration.js +7 -3
  11. package/dist/common-components/RedirectLogistration.js.map +1 -1
  12. package/dist/common-components/SocialAuthProviders.d.ts +2 -2
  13. package/dist/common-components/SocialAuthProviders.js +5 -4
  14. package/dist/common-components/SocialAuthProviders.js.map +1 -1
  15. package/dist/common-components/ThirdPartyAuth.js +3 -2
  16. package/dist/common-components/ThirdPartyAuth.js.map +1 -1
  17. package/dist/common-components/ThirdPartyAuthAlert.d.ts +2 -2
  18. package/dist/common-components/ThirdPartyAuthAlert.js +4 -4
  19. package/dist/common-components/ThirdPartyAuthAlert.js.map +1 -1
  20. package/dist/common-components/UnAuthOnlyRoute.js +5 -4
  21. package/dist/common-components/UnAuthOnlyRoute.js.map +1 -1
  22. package/dist/common-components/components/ThirdPartyAuthContext.d.ts +31 -0
  23. package/dist/common-components/components/ThirdPartyAuthContext.js +84 -0
  24. package/dist/common-components/components/ThirdPartyAuthContext.js.map +1 -0
  25. package/dist/common-components/data/api.d.ts +6 -0
  26. package/dist/common-components/data/api.js +26 -0
  27. package/dist/common-components/data/api.js.map +1 -0
  28. package/dist/common-components/data/apiHook.d.ts +9 -0
  29. package/dist/common-components/data/apiHook.js +14 -0
  30. package/dist/common-components/data/apiHook.js.map +1 -0
  31. package/dist/common-components/data/queryKeys.d.ts +4 -0
  32. package/dist/common-components/data/queryKeys.js +6 -0
  33. package/dist/common-components/data/queryKeys.js.map +1 -0
  34. package/dist/common-components/index.d.ts +0 -3
  35. package/dist/common-components/index.js +0 -3
  36. package/dist/common-components/index.js.map +1 -1
  37. package/dist/constants.d.ts +13 -0
  38. package/dist/constants.js +15 -0
  39. package/dist/constants.js.map +1 -1
  40. package/dist/data/constants.d.ts +0 -8
  41. package/dist/data/constants.js +0 -9
  42. package/dist/data/constants.js.map +1 -1
  43. package/dist/data/utils/dataUtils.d.ts +1 -0
  44. package/dist/data/utils/dataUtils.js +14 -0
  45. package/dist/data/utils/dataUtils.js.map +1 -1
  46. package/dist/data/utils/index.d.ts +1 -2
  47. package/dist/data/utils/index.js +1 -2
  48. package/dist/data/utils/index.js.map +1 -1
  49. package/dist/forgot-password/ForgotPasswordPage.d.ts +2 -36
  50. package/dist/forgot-password/ForgotPasswordPage.js +45 -44
  51. package/dist/forgot-password/ForgotPasswordPage.js.map +1 -1
  52. package/dist/forgot-password/data/api.d.ts +2 -0
  53. package/dist/forgot-password/data/{service.js → api.js} +13 -14
  54. package/dist/forgot-password/data/api.js.map +1 -0
  55. package/dist/forgot-password/data/apiHook.d.ts +16 -0
  56. package/dist/forgot-password/data/apiHook.js +26 -0
  57. package/dist/forgot-password/data/apiHook.js.map +1 -0
  58. package/dist/forgot-password/index.d.ts +0 -4
  59. package/dist/forgot-password/index.js +0 -4
  60. package/dist/forgot-password/index.js.map +1 -1
  61. package/dist/forgot-password/messages.js +1 -1
  62. package/dist/forgot-password/messages.js.map +1 -1
  63. package/dist/login/ChangePasswordPrompt.js +11 -5
  64. package/dist/login/ChangePasswordPrompt.js.map +1 -1
  65. package/dist/login/LoginPage.d.ts +12 -10
  66. package/dist/login/LoginPage.js +85 -127
  67. package/dist/login/LoginPage.js.map +1 -1
  68. package/dist/login/components/LoginContext.d.ts +21 -0
  69. package/dist/login/components/LoginContext.js +28 -0
  70. package/dist/login/components/LoginContext.js.map +1 -0
  71. package/dist/login/data/api.d.ts +2 -0
  72. package/dist/login/data/api.js +27 -0
  73. package/dist/login/data/api.js.map +1 -0
  74. package/dist/login/data/apiHook.d.ts +13 -0
  75. package/dist/login/data/apiHook.js +57 -0
  76. package/dist/login/data/apiHook.js.map +1 -0
  77. package/dist/login/index.d.ts +0 -3
  78. package/dist/login/index.js +0 -3
  79. package/dist/login/index.js.map +1 -1
  80. package/dist/logistration/Logistration.d.ts +5 -32
  81. package/dist/logistration/Logistration.js +28 -54
  82. package/dist/logistration/Logistration.js.map +1 -1
  83. package/dist/progressive-profiling/ProgressiveProfiling.d.ts +2 -46
  84. package/dist/progressive-profiling/ProgressiveProfiling.js +47 -71
  85. package/dist/progressive-profiling/ProgressiveProfiling.js.map +1 -1
  86. package/dist/progressive-profiling/ProgressiveProfilingPageModal.js +8 -1
  87. package/dist/progressive-profiling/ProgressiveProfilingPageModal.js.map +1 -1
  88. package/dist/progressive-profiling/components/ProgressiveProfilingContext.d.ts +18 -0
  89. package/dist/progressive-profiling/components/ProgressiveProfilingContext.js +52 -0
  90. package/dist/progressive-profiling/components/ProgressiveProfilingContext.js.map +1 -0
  91. package/dist/progressive-profiling/data/api.d.ts +2 -0
  92. package/dist/progressive-profiling/data/{service.js → api.js} +11 -12
  93. package/dist/progressive-profiling/data/api.js.map +1 -0
  94. package/dist/progressive-profiling/data/apiHook.d.ts +10 -0
  95. package/dist/progressive-profiling/data/apiHook.js +36 -0
  96. package/dist/progressive-profiling/data/apiHook.js.map +1 -0
  97. package/dist/progressive-profiling/index.d.ts +0 -2
  98. package/dist/progressive-profiling/index.js +0 -2
  99. package/dist/progressive-profiling/index.js.map +1 -1
  100. package/dist/register/RegistrationFields/CountryField/CountryField.d.ts +1 -1
  101. package/dist/register/RegistrationFields/CountryField/CountryField.js +5 -7
  102. package/dist/register/RegistrationFields/CountryField/CountryField.js.map +1 -1
  103. package/dist/register/RegistrationFields/EmailField/EmailField.js +17 -9
  104. package/dist/register/RegistrationFields/EmailField/EmailField.js.map +1 -1
  105. package/dist/register/RegistrationFields/NameField/NameField.js +14 -7
  106. package/dist/register/RegistrationFields/NameField/NameField.js.map +1 -1
  107. package/dist/register/RegistrationFields/NameField/validator.d.ts +1 -0
  108. package/dist/register/RegistrationFields/NameField/validator.js +4 -0
  109. package/dist/register/RegistrationFields/NameField/validator.js.map +1 -1
  110. package/dist/register/RegistrationFields/UsernameField/UsernameField.js +20 -14
  111. package/dist/register/RegistrationFields/UsernameField/UsernameField.js.map +1 -1
  112. package/dist/register/RegistrationPage.d.ts +1 -1
  113. package/dist/register/RegistrationPage.js +102 -59
  114. package/dist/register/RegistrationPage.js.map +1 -1
  115. package/dist/register/components/RegisterContext.d.ts +8 -0
  116. package/dist/register/components/RegisterContext.js +167 -0
  117. package/dist/register/components/RegisterContext.js.map +1 -0
  118. package/dist/register/components/RegistrationFailure.js +4 -1
  119. package/dist/register/components/RegistrationFailure.js.map +1 -1
  120. package/dist/register/data/api.d.ts +9 -0
  121. package/dist/register/data/api.js +45 -0
  122. package/dist/register/data/api.js.map +1 -0
  123. package/dist/register/data/apiHook.d.ts +33 -0
  124. package/dist/register/data/apiHook.js +66 -0
  125. package/dist/register/data/apiHook.js.map +1 -0
  126. package/dist/register/data/constants.d.ts +1 -0
  127. package/dist/register/data/constants.js +1 -0
  128. package/dist/register/data/constants.js.map +1 -1
  129. package/dist/register/index.d.ts +0 -2
  130. package/dist/register/index.js +0 -3
  131. package/dist/register/index.js.map +1 -1
  132. package/dist/register/messages.d.ts +10 -0
  133. package/dist/register/messages.js +10 -0
  134. package/dist/register/messages.js.map +1 -1
  135. package/dist/register/types.d.ts +74 -0
  136. package/dist/register/types.js +2 -0
  137. package/dist/register/types.js.map +1 -0
  138. package/dist/reset-password/ResetPasswordPage.d.ts +2 -32
  139. package/dist/reset-password/ResetPasswordPage.js +90 -58
  140. package/dist/reset-password/ResetPasswordPage.js.map +1 -1
  141. package/dist/reset-password/data/api.d.ts +4 -0
  142. package/dist/reset-password/data/api.js +57 -0
  143. package/dist/reset-password/data/api.js.map +1 -0
  144. package/dist/reset-password/data/apiHook.d.ts +31 -0
  145. package/dist/reset-password/data/apiHook.js +74 -0
  146. package/dist/reset-password/data/apiHook.js.map +1 -0
  147. package/dist/reset-password/index.d.ts +0 -4
  148. package/dist/reset-password/index.js +0 -4
  149. package/dist/reset-password/index.js.map +1 -1
  150. package/dist/routes.d.ts +1 -0
  151. package/dist/routes.js +15 -14
  152. package/dist/routes.js.map +1 -1
  153. package/dist/sass/_registration.scss +8 -10
  154. package/dist/slots/LoginComponentSlot/index.d.ts +12 -0
  155. package/dist/slots/LoginComponentSlot/index.js +11 -0
  156. package/dist/slots/LoginComponentSlot/index.js.map +1 -0
  157. package/package.json +18 -14
  158. package/dist/common-components/data/actions.d.ts +0 -26
  159. package/dist/common-components/data/actions.js +0 -22
  160. package/dist/common-components/data/actions.js.map +0 -1
  161. package/dist/common-components/data/reducers.d.ts +0 -62
  162. package/dist/common-components/data/reducers.js +0 -39
  163. package/dist/common-components/data/reducers.js.map +0 -1
  164. package/dist/common-components/data/sagas.d.ts +0 -12
  165. package/dist/common-components/data/sagas.js +0 -21
  166. package/dist/common-components/data/sagas.js.map +0 -1
  167. package/dist/common-components/data/selectors.d.ts +0 -98
  168. package/dist/common-components/data/selectors.js +0 -11
  169. package/dist/common-components/data/selectors.js.map +0 -1
  170. package/dist/common-components/data/service.d.ts +0 -5
  171. package/dist/common-components/data/service.js +0 -31
  172. package/dist/common-components/data/service.js.map +0 -1
  173. package/dist/data/configureStore.d.ts +0 -3
  174. package/dist/data/configureStore.js +0 -24
  175. package/dist/data/configureStore.js.map +0 -1
  176. package/dist/data/reducers.d.ts +0 -254
  177. package/dist/data/reducers.js +0 -17
  178. package/dist/data/reducers.js.map +0 -1
  179. package/dist/data/sagas.d.ts +0 -1
  180. package/dist/data/sagas.js +0 -18
  181. package/dist/data/sagas.js.map +0 -1
  182. package/dist/data/utils/reduxUtils.d.ts +0 -15
  183. package/dist/data/utils/reduxUtils.js +0 -29
  184. package/dist/data/utils/reduxUtils.js.map +0 -1
  185. package/dist/forgot-password/data/actions.d.ts +0 -30
  186. package/dist/forgot-password/data/actions.js +0 -26
  187. package/dist/forgot-password/data/actions.js.map +0 -1
  188. package/dist/forgot-password/data/reducers.d.ts +0 -13
  189. package/dist/forgot-password/data/reducers.js +0 -46
  190. package/dist/forgot-password/data/reducers.js.map +0 -1
  191. package/dist/forgot-password/data/sagas.d.ts +0 -4
  192. package/dist/forgot-password/data/sagas.js +0 -28
  193. package/dist/forgot-password/data/sagas.js.map +0 -1
  194. package/dist/forgot-password/data/selectors.d.ts +0 -23
  195. package/dist/forgot-password/data/selectors.js +0 -5
  196. package/dist/forgot-password/data/selectors.js.map +0 -1
  197. package/dist/forgot-password/data/service.d.ts +0 -1
  198. package/dist/forgot-password/data/service.js.map +0 -1
  199. package/dist/login/data/actions.d.ts +0 -36
  200. package/dist/login/data/actions.js +0 -32
  201. package/dist/login/data/actions.js.map +0 -1
  202. package/dist/login/data/reducers.d.ts +0 -82
  203. package/dist/login/data/reducers.js +0 -44
  204. package/dist/login/data/reducers.js.map +0 -1
  205. package/dist/login/data/sagas.d.ts +0 -10
  206. package/dist/login/data/sagas.js +0 -34
  207. package/dist/login/data/sagas.js.map +0 -1
  208. package/dist/login/data/service.d.ts +0 -4
  209. package/dist/login/data/service.js +0 -32
  210. package/dist/login/data/service.js.map +0 -1
  211. package/dist/progressive-profiling/data/actions.d.ts +0 -19
  212. package/dist/progressive-profiling/data/actions.js +0 -18
  213. package/dist/progressive-profiling/data/actions.js.map +0 -1
  214. package/dist/progressive-profiling/data/reducers.d.ts +0 -22
  215. package/dist/progressive-profiling/data/reducers.js +0 -23
  216. package/dist/progressive-profiling/data/reducers.js.map +0 -1
  217. package/dist/progressive-profiling/data/sagas.d.ts +0 -4
  218. package/dist/progressive-profiling/data/sagas.js +0 -17
  219. package/dist/progressive-profiling/data/sagas.js.map +0 -1
  220. package/dist/progressive-profiling/data/selectors.d.ts +0 -39
  221. package/dist/progressive-profiling/data/selectors.js +0 -9
  222. package/dist/progressive-profiling/data/selectors.js.map +0 -1
  223. package/dist/progressive-profiling/data/service.d.ts +0 -1
  224. package/dist/progressive-profiling/data/service.js.map +0 -1
  225. package/dist/register/data/actions.d.ts +0 -80
  226. package/dist/register/data/actions.js +0 -69
  227. package/dist/register/data/actions.js.map +0 -1
  228. package/dist/register/data/reducers.d.ts +0 -237
  229. package/dist/register/data/reducers.js +0 -86
  230. package/dist/register/data/reducers.js.map +0 -1
  231. package/dist/register/data/sagas.d.ts +0 -19
  232. package/dist/register/data/sagas.js +0 -45
  233. package/dist/register/data/sagas.js.map +0 -1
  234. package/dist/register/data/selectors.d.ts +0 -26
  235. package/dist/register/data/selectors.js +0 -25
  236. package/dist/register/data/selectors.js.map +0 -1
  237. package/dist/register/data/service.d.ts +0 -8
  238. package/dist/register/data/service.js +0 -46
  239. package/dist/register/data/service.js.map +0 -1
  240. package/dist/reset-password/data/actions.d.ts +0 -56
  241. package/dist/reset-password/data/actions.js +0 -41
  242. package/dist/reset-password/data/actions.js.map +0 -1
  243. package/dist/reset-password/data/reducers.d.ts +0 -19
  244. package/dist/reset-password/data/reducers.js +0 -25
  245. package/dist/reset-password/data/reducers.js.map +0 -1
  246. package/dist/reset-password/data/sagas.d.ts +0 -7
  247. package/dist/reset-password/data/sagas.js +0 -63
  248. package/dist/reset-password/data/sagas.js.map +0 -1
  249. package/dist/reset-password/data/selectors.d.ts +0 -23
  250. package/dist/reset-password/data/selectors.js +0 -5
  251. package/dist/reset-password/data/selectors.js.map +0 -1
  252. package/dist/reset-password/data/service.d.ts +0 -3
  253. package/dist/reset-password/data/service.js +0 -62
  254. package/dist/reset-password/data/service.js.map +0 -1
@@ -1,32 +0,0 @@
1
- import { AsyncActionType } from '../../data/utils';
2
- export const BACKUP_LOGIN_DATA = new AsyncActionType('LOGIN', 'BACKUP_LOGIN_DATA');
3
- export const LOGIN_REQUEST = new AsyncActionType('LOGIN', 'REQUEST');
4
- export const DISMISS_PASSWORD_RESET_BANNER = 'DISMISS_PASSWORD_RESET_BANNER';
5
- // Backup login form data
6
- export const backupLoginForm = () => ({
7
- type: BACKUP_LOGIN_DATA.BASE,
8
- });
9
- export const backupLoginFormBegin = (data) => ({
10
- type: BACKUP_LOGIN_DATA.BEGIN,
11
- payload: Object.assign({}, data),
12
- });
13
- // Login
14
- export const loginRequest = creds => ({
15
- type: LOGIN_REQUEST.BASE,
16
- payload: { creds },
17
- });
18
- export const loginRequestBegin = () => ({
19
- type: LOGIN_REQUEST.BEGIN,
20
- });
21
- export const loginRequestSuccess = (redirectUrl, success) => ({
22
- type: LOGIN_REQUEST.SUCCESS,
23
- payload: { redirectUrl, success },
24
- });
25
- export const loginRequestFailure = (loginError) => ({
26
- type: LOGIN_REQUEST.FAILURE,
27
- payload: { loginError },
28
- });
29
- export const dismissPasswordResetBanner = () => ({
30
- type: DISMISS_PASSWORD_RESET_BANNER,
31
- });
32
- //# sourceMappingURL=actions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"actions.js","sourceRoot":"","sources":["../../../src/login/data/actions.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEnD,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,eAAe,CAAC,OAAO,EAAE,mBAAmB,CAAC,CAAC;AACnF,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,eAAe,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;AACrE,MAAM,CAAC,MAAM,6BAA6B,GAAG,+BAA+B,CAAC;AAE7E,yBAAyB;AACzB,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,EAAE,CAAC,CAAC;IACpC,IAAI,EAAE,iBAAiB,CAAC,IAAI;CAC7B,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IAC7C,IAAI,EAAE,iBAAiB,CAAC,KAAK;IAC7B,OAAO,oBAAO,IAAI,CAAE;CACrB,CAAC,CAAC;AAEH,QAAQ;AACR,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,CAAC,EAAE,CAAC,CAAC;IACpC,IAAI,EAAE,aAAa,CAAC,IAAI;IACxB,OAAO,EAAE,EAAE,KAAK,EAAE;CACnB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,EAAE,CAAC,CAAC;IACtC,IAAI,EAAE,aAAa,CAAC,KAAK;CAC1B,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,WAAW,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC;IAC5D,IAAI,EAAE,aAAa,CAAC,OAAO;IAC3B,OAAO,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE;CAClC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;IAClD,IAAI,EAAE,aAAa,CAAC,OAAO;IAC3B,OAAO,EAAE,EAAE,UAAU,EAAE;CACxB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,0BAA0B,GAAG,GAAG,EAAE,CAAC,CAAC;IAC/C,IAAI,EAAE,6BAA6B;CACpC,CAAC,CAAC","sourcesContent":["import { AsyncActionType } from '../../data/utils';\n\nexport const BACKUP_LOGIN_DATA = new AsyncActionType('LOGIN', 'BACKUP_LOGIN_DATA');\nexport const LOGIN_REQUEST = new AsyncActionType('LOGIN', 'REQUEST');\nexport const DISMISS_PASSWORD_RESET_BANNER = 'DISMISS_PASSWORD_RESET_BANNER';\n\n// Backup login form data\nexport const backupLoginForm = () => ({\n type: BACKUP_LOGIN_DATA.BASE,\n});\n\nexport const backupLoginFormBegin = (data) => ({\n type: BACKUP_LOGIN_DATA.BEGIN,\n payload: { ...data },\n});\n\n// Login\nexport const loginRequest = creds => ({\n type: LOGIN_REQUEST.BASE,\n payload: { creds },\n});\n\nexport const loginRequestBegin = () => ({\n type: LOGIN_REQUEST.BEGIN,\n});\n\nexport const loginRequestSuccess = (redirectUrl, success) => ({\n type: LOGIN_REQUEST.SUCCESS,\n payload: { redirectUrl, success },\n});\n\nexport const loginRequestFailure = (loginError) => ({\n type: LOGIN_REQUEST.FAILURE,\n payload: { loginError },\n});\n\nexport const dismissPasswordResetBanner = () => ({\n type: DISMISS_PASSWORD_RESET_BANNER,\n});\n"]}
@@ -1,82 +0,0 @@
1
- export namespace defaultState {
2
- export let loginErrorCode: string;
3
- export let loginErrorContext: {};
4
- export let loginResult: {};
5
- export namespace loginFormData {
6
- namespace formFields {
7
- let emailOrUsername: string;
8
- let password: string;
9
- }
10
- namespace errors {
11
- let emailOrUsername_1: string;
12
- export { emailOrUsername_1 as emailOrUsername };
13
- let password_1: string;
14
- export { password_1 as password };
15
- }
16
- }
17
- export let shouldBackupState: boolean;
18
- export let showResetPasswordSuccessBanner: boolean;
19
- export { DEFAULT_STATE as submitState };
20
- }
21
- export default reducer;
22
- import { DEFAULT_STATE } from '../../data/constants';
23
- declare function reducer(state?: {
24
- loginErrorCode: string;
25
- loginErrorContext: {};
26
- loginResult: {};
27
- loginFormData: {
28
- formFields: {
29
- emailOrUsername: string;
30
- password: string;
31
- };
32
- errors: {
33
- emailOrUsername: string;
34
- password: string;
35
- };
36
- };
37
- shouldBackupState: boolean;
38
- showResetPasswordSuccessBanner: boolean;
39
- submitState: string;
40
- }, action?: {}): {
41
- loginFormData: any;
42
- loginErrorCode: string;
43
- loginErrorContext: {};
44
- loginResult: {};
45
- shouldBackupState: boolean;
46
- showResetPasswordSuccessBanner: boolean;
47
- submitState: string;
48
- } | {
49
- loginResult: any;
50
- loginErrorCode: string;
51
- loginErrorContext: {};
52
- loginFormData: {
53
- formFields: {
54
- emailOrUsername: string;
55
- password: string;
56
- };
57
- errors: {
58
- emailOrUsername: string;
59
- password: string;
60
- };
61
- };
62
- shouldBackupState: boolean;
63
- showResetPasswordSuccessBanner: boolean;
64
- submitState: string;
65
- } | {
66
- loginErrorCode: any;
67
- loginErrorContext: any;
68
- submitState: string;
69
- loginResult: {};
70
- loginFormData: {
71
- formFields: {
72
- emailOrUsername: string;
73
- password: string;
74
- };
75
- errors: {
76
- emailOrUsername: string;
77
- password: string;
78
- };
79
- };
80
- shouldBackupState: boolean;
81
- showResetPasswordSuccessBanner: boolean;
82
- };
@@ -1,44 +0,0 @@
1
- import { BACKUP_LOGIN_DATA, DISMISS_PASSWORD_RESET_BANNER, LOGIN_REQUEST, } from './actions';
2
- import { DEFAULT_STATE, PENDING_STATE } from '../../data/constants';
3
- import { RESET_PASSWORD } from '../../reset-password';
4
- export const defaultState = {
5
- loginErrorCode: '',
6
- loginErrorContext: {},
7
- loginResult: {},
8
- loginFormData: {
9
- formFields: {
10
- emailOrUsername: '', password: '',
11
- },
12
- errors: {
13
- emailOrUsername: '', password: '',
14
- },
15
- },
16
- shouldBackupState: false,
17
- showResetPasswordSuccessBanner: false,
18
- submitState: DEFAULT_STATE,
19
- };
20
- const reducer = (state = defaultState, action = {}) => {
21
- switch (action.type) {
22
- case BACKUP_LOGIN_DATA.BASE:
23
- return Object.assign(Object.assign({}, state), { shouldBackupState: true });
24
- case BACKUP_LOGIN_DATA.BEGIN:
25
- return Object.assign(Object.assign({}, defaultState), { loginFormData: Object.assign({}, action.payload) });
26
- case LOGIN_REQUEST.BEGIN:
27
- return Object.assign(Object.assign({}, state), { showResetPasswordSuccessBanner: false, submitState: PENDING_STATE });
28
- case LOGIN_REQUEST.SUCCESS:
29
- return Object.assign(Object.assign({}, state), { loginResult: action.payload });
30
- case LOGIN_REQUEST.FAILURE: {
31
- const { email, loginError, redirectUrl } = action.payload;
32
- return Object.assign(Object.assign({}, state), { loginErrorCode: loginError.errorCode, loginErrorContext: Object.assign(Object.assign({}, loginError.context), { email, redirectUrl }), submitState: DEFAULT_STATE });
33
- }
34
- case RESET_PASSWORD.SUCCESS:
35
- return Object.assign(Object.assign({}, state), { showResetPasswordSuccessBanner: true });
36
- case DISMISS_PASSWORD_RESET_BANNER: {
37
- return Object.assign(Object.assign({}, state), { showResetPasswordSuccessBanner: false });
38
- }
39
- default:
40
- return Object.assign({}, state);
41
- }
42
- };
43
- export default reducer;
44
- //# sourceMappingURL=reducers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"reducers.js","sourceRoot":"","sources":["../../../src/login/data/reducers.js"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,6BAA6B,EAC7B,aAAa,GACd,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,cAAc,EAAE,EAAE;IAClB,iBAAiB,EAAE,EAAE;IACrB,WAAW,EAAE,EAAE;IACf,aAAa,EAAE;QACb,UAAU,EAAE;YACV,eAAe,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE;SAClC;QACD,MAAM,EAAE;YACN,eAAe,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE;SAClC;KACF;IACD,iBAAiB,EAAE,KAAK;IACxB,8BAA8B,EAAE,KAAK;IACrC,WAAW,EAAE,aAAa;CAC3B,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,IAAI;YACzB,uCACK,KAAK,KACR,iBAAiB,EAAE,IAAI,IACvB;QACJ,KAAK,iBAAiB,CAAC,KAAK;YAC1B,uCACK,YAAY,KACf,aAAa,oBAAO,MAAM,CAAC,OAAO,KAClC;QACJ,KAAK,aAAa,CAAC,KAAK;YACtB,uCACK,KAAK,KACR,8BAA8B,EAAE,KAAK,EACrC,WAAW,EAAE,aAAa,IAC1B;QACJ,KAAK,aAAa,CAAC,OAAO;YACxB,uCACK,KAAK,KACR,WAAW,EAAE,MAAM,CAAC,OAAO,IAC3B;QACJ,KAAK,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC;YAC3B,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC;YAC1D,uCACK,KAAK,KACR,cAAc,EAAE,UAAU,CAAC,SAAS,EACpC,iBAAiB,kCAAO,UAAU,CAAC,OAAO,KAAE,KAAK,EAAE,WAAW,KAC9D,WAAW,EAAE,aAAa,IAC1B;QACJ,CAAC;QACD,KAAK,cAAc,CAAC,OAAO;YACzB,uCACK,KAAK,KACR,8BAA8B,EAAE,IAAI,IACpC;QACJ,KAAK,6BAA6B,CAAC,CAAC,CAAC;YACnC,uCACK,KAAK,KACR,8BAA8B,EAAE,KAAK,IACrC;QACJ,CAAC;QACD;YACE,yBACK,KAAK,EACR;IACN,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,OAAO,CAAC","sourcesContent":["import {\n BACKUP_LOGIN_DATA,\n DISMISS_PASSWORD_RESET_BANNER,\n LOGIN_REQUEST,\n} from './actions';\nimport { DEFAULT_STATE, PENDING_STATE } from '../../data/constants';\nimport { RESET_PASSWORD } from '../../reset-password';\n\nexport const defaultState = {\n loginErrorCode: '',\n loginErrorContext: {},\n loginResult: {},\n loginFormData: {\n formFields: {\n emailOrUsername: '', password: '',\n },\n errors: {\n emailOrUsername: '', password: '',\n },\n },\n shouldBackupState: false,\n showResetPasswordSuccessBanner: false,\n submitState: DEFAULT_STATE,\n};\n\nconst reducer = (state = defaultState, action = {}) => {\n switch (action.type) {\n case BACKUP_LOGIN_DATA.BASE:\n return {\n ...state,\n shouldBackupState: true,\n };\n case BACKUP_LOGIN_DATA.BEGIN:\n return {\n ...defaultState,\n loginFormData: { ...action.payload },\n };\n case LOGIN_REQUEST.BEGIN:\n return {\n ...state,\n showResetPasswordSuccessBanner: false,\n submitState: PENDING_STATE,\n };\n case LOGIN_REQUEST.SUCCESS:\n return {\n ...state,\n loginResult: action.payload,\n };\n case LOGIN_REQUEST.FAILURE: {\n const { email, loginError, redirectUrl } = action.payload;\n return {\n ...state,\n loginErrorCode: loginError.errorCode,\n loginErrorContext: { ...loginError.context, email, redirectUrl },\n submitState: DEFAULT_STATE,\n };\n }\n case RESET_PASSWORD.SUCCESS:\n return {\n ...state,\n showResetPasswordSuccessBanner: true,\n };\n case DISMISS_PASSWORD_RESET_BANNER: {\n return {\n ...state,\n showResetPasswordSuccessBanner: false,\n };\n }\n default:\n return {\n ...state,\n };\n }\n};\n\nexport default reducer;\n"]}
@@ -1,10 +0,0 @@
1
- export function handleLoginRequest(action: any): Generator<import("redux-saga/effects").PutEffect<{
2
- type: string;
3
- }> | import("redux-saga/effects").CallEffect<{
4
- redirectUrl: any;
5
- success: any;
6
- }>, void, {
7
- redirectUrl: any;
8
- success: any;
9
- }>;
10
- export default function saga(): Generator<import("redux-saga/effects").ForkEffect<never>, void, unknown>;
@@ -1,34 +0,0 @@
1
- import { camelCaseObject, logError, logInfo } from '@openedx/frontend-base';
2
- import { call, put, takeEvery } from 'redux-saga/effects';
3
- import { LOGIN_REQUEST, loginRequestBegin, loginRequestFailure, loginRequestSuccess, } from './actions';
4
- import { FORBIDDEN_REQUEST, INTERNAL_SERVER_ERROR } from './constants';
5
- import { loginRequest, } from './service';
6
- export function* handleLoginRequest(action) {
7
- try {
8
- yield put(loginRequestBegin());
9
- const { redirectUrl, success } = yield call(loginRequest, action.payload.creds);
10
- yield put(loginRequestSuccess(redirectUrl, success));
11
- }
12
- catch (e) {
13
- const statusCodes = [400];
14
- if (e.response) {
15
- const { status } = e.response;
16
- if (statusCodes.includes(status)) {
17
- yield put(loginRequestFailure(camelCaseObject(e.response.data)));
18
- logInfo(e);
19
- }
20
- else if (status === 403) {
21
- yield put(loginRequestFailure({ errorCode: FORBIDDEN_REQUEST }));
22
- logInfo(e);
23
- }
24
- else {
25
- yield put(loginRequestFailure({ errorCode: INTERNAL_SERVER_ERROR }));
26
- logError(e);
27
- }
28
- }
29
- }
30
- }
31
- export default function* saga() {
32
- yield takeEvery(LOGIN_REQUEST.BASE, handleLoginRequest);
33
- }
34
- //# sourceMappingURL=sagas.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sagas.js","sourceRoot":"","sources":["../../../src/login/data/sagas.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAC5E,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE1D,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACvE,OAAO,EACL,YAAY,GACb,MAAM,WAAW,CAAC;AAEnB,MAAM,SAAS,CAAC,CAAC,kBAAkB,CAAC,MAAM;IACxC,IAAI,CAAC;QACH,MAAM,GAAG,CAAC,iBAAiB,EAAE,CAAC,CAAC;QAE/B,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,GAAG,MAAM,IAAI,CAAC,YAAY,EAAE,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAEhF,MAAM,GAAG,CAAC,mBAAmB,CAC3B,WAAW,EACX,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,MAAM,WAAW,GAAG,CAAC,GAAG,CAAC,CAAC;QAC1B,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC;YACf,MAAM,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC,QAAQ,CAAC;YAC9B,IAAI,WAAW,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;gBACjC,MAAM,GAAG,CAAC,mBAAmB,CAAC,eAAe,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;gBACjE,OAAO,CAAC,CAAC,CAAC,CAAC;YACb,CAAC;iBAAM,IAAI,MAAM,KAAK,GAAG,EAAE,CAAC;gBAC1B,MAAM,GAAG,CAAC,mBAAmB,CAAC,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAAC,CAAC,CAAC;gBACjE,OAAO,CAAC,CAAC,CAAC,CAAC;YACb,CAAC;iBAAM,CAAC;gBACN,MAAM,GAAG,CAAC,mBAAmB,CAAC,EAAE,SAAS,EAAE,qBAAqB,EAAE,CAAC,CAAC,CAAC;gBACrE,QAAQ,CAAC,CAAC,CAAC,CAAC;YACd,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC;AAED,MAAM,CAAC,OAAO,SAAS,CAAC,CAAC,IAAI;IAC3B,MAAM,SAAS,CAAC,aAAa,CAAC,IAAI,EAAE,kBAAkB,CAAC,CAAC;AAC1D,CAAC","sourcesContent":["import { camelCaseObject, logError, logInfo } from '@openedx/frontend-base';\nimport { call, put, takeEvery } from 'redux-saga/effects';\n\nimport {\n LOGIN_REQUEST,\n loginRequestBegin,\n loginRequestFailure,\n loginRequestSuccess,\n} from './actions';\nimport { FORBIDDEN_REQUEST, INTERNAL_SERVER_ERROR } from './constants';\nimport {\n loginRequest,\n} from './service';\n\nexport function* handleLoginRequest(action) {\n try {\n yield put(loginRequestBegin());\n\n const { redirectUrl, success } = yield call(loginRequest, action.payload.creds);\n\n yield put(loginRequestSuccess(\n redirectUrl,\n success,\n ));\n } catch (e) {\n const statusCodes = [400];\n if (e.response) {\n const { status } = e.response;\n if (statusCodes.includes(status)) {\n yield put(loginRequestFailure(camelCaseObject(e.response.data)));\n logInfo(e);\n } else if (status === 403) {\n yield put(loginRequestFailure({ errorCode: FORBIDDEN_REQUEST }));\n logInfo(e);\n } else {\n yield put(loginRequestFailure({ errorCode: INTERNAL_SERVER_ERROR }));\n logError(e);\n }\n }\n }\n}\n\nexport default function* saga() {\n yield takeEvery(LOGIN_REQUEST.BASE, handleLoginRequest);\n}\n"]}
@@ -1,4 +0,0 @@
1
- export function loginRequest(creds: any): Promise<{
2
- redirectUrl: any;
3
- success: any;
4
- }>;
@@ -1,32 +0,0 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- import { getAuthenticatedHttpClient, getSiteConfig, getUrlByRouteRole } from '@openedx/frontend-base';
11
- import * as QueryString from 'query-string';
12
- export function loginRequest(creds) {
13
- return __awaiter(this, void 0, void 0, function* () {
14
- var _a, _b;
15
- const requestConfig = {
16
- headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
17
- isPublic: true,
18
- };
19
- const { data } = yield getAuthenticatedHttpClient()
20
- .post(`${getSiteConfig().lmsBaseUrl}/api/user/v2/account/login_session/`, QueryString.stringify(creds), requestConfig)
21
- .catch((e) => {
22
- throw (e);
23
- });
24
- const defaultRedirectUrl = getUrlByRouteRole('org.openedx.frontend.role.dashboard');
25
- const redirectUrl = (_a = data.redirect_url) !== null && _a !== void 0 ? _a : defaultRedirectUrl;
26
- return {
27
- redirectUrl,
28
- success: (_b = data.success) !== null && _b !== void 0 ? _b : false,
29
- };
30
- });
31
- }
32
- //# sourceMappingURL=service.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"service.js","sourceRoot":"","sources":["../../../src/login/data/service.js"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,0BAA0B,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AACtG,OAAO,KAAK,WAAW,MAAM,cAAc,CAAC;AAE5C,MAAM,UAAgB,YAAY,CAAC,KAAK;;;QACtC,MAAM,aAAa,GAAG;YACpB,OAAO,EAAE,EAAE,cAAc,EAAE,mCAAmC,EAAE;YAChE,QAAQ,EAAE,IAAI;SACf,CAAC;QAEF,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,0BAA0B,EAAE;aAChD,IAAI,CACH,GAAG,aAAa,EAAE,CAAC,UAAU,qCAAqC,EAClE,WAAW,CAAC,SAAS,CAAC,KAAK,CAAC,EAC5B,aAAa,CACd;aACA,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE;YACX,MAAM,CAAC,CAAC,CAAC,CAAC;QACZ,CAAC,CAAC,CAAC;QAEL,MAAM,kBAAkB,GAAG,iBAAiB,CAAC,qCAAqC,CAAC,CAAC;QACpF,MAAM,WAAW,GAAG,MAAA,IAAI,CAAC,YAAY,mCAAI,kBAAkB,CAAC;QAE5D,OAAO;YACL,WAAW;YACX,OAAO,EAAE,MAAA,IAAI,CAAC,OAAO,mCAAI,KAAK;SAC/B,CAAC;IACJ,CAAC;CAAA","sourcesContent":["import { getAuthenticatedHttpClient, getSiteConfig, getUrlByRouteRole } from '@openedx/frontend-base';\nimport * as QueryString from 'query-string';\n\nexport async function loginRequest(creds) {\n const requestConfig = {\n headers: { 'Content-Type': 'application/x-www-form-urlencoded' },\n isPublic: true,\n };\n\n const { data } = await getAuthenticatedHttpClient()\n .post(\n `${getSiteConfig().lmsBaseUrl}/api/user/v2/account/login_session/`,\n QueryString.stringify(creds),\n requestConfig,\n )\n .catch((e) => {\n throw (e);\n });\n\n const defaultRedirectUrl = getUrlByRouteRole('org.openedx.frontend.role.dashboard');\n const redirectUrl = data.redirect_url ?? defaultRedirectUrl;\n\n return {\n redirectUrl,\n success: data.success ?? false,\n };\n}\n"]}
@@ -1,19 +0,0 @@
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,18 +0,0 @@
1
- import { AsyncActionType } from '../../data/utils';
2
- export const GET_FIELDS_DATA = new AsyncActionType('FIELD_DESCRIPTION', 'GET_FIELDS_DATA');
3
- export const SAVE_USER_PROFILE = new AsyncActionType('USER_PROFILE', 'SAVE_USER_PROFILE');
4
- // save additional user information
5
- export const saveUserProfile = (username, data) => ({
6
- type: SAVE_USER_PROFILE.BASE,
7
- payload: { username, data },
8
- });
9
- export const saveUserProfileBegin = () => ({
10
- type: SAVE_USER_PROFILE.BEGIN,
11
- });
12
- export const saveUserProfileSuccess = () => ({
13
- type: SAVE_USER_PROFILE.SUCCESS,
14
- });
15
- export const saveUserProfileFailure = () => ({
16
- type: SAVE_USER_PROFILE.FAILURE,
17
- });
18
- //# sourceMappingURL=actions.js.map
@@ -1 +0,0 @@
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"]}
@@ -1,22 +0,0 @@
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
- };
@@ -1,23 +0,0 @@
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
@@ -1 +0,0 @@
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"]}
@@ -1,4 +0,0 @@
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>;
@@ -1,17 +0,0 @@
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
@@ -1 +0,0 @@
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"]}
@@ -1,39 +0,0 @@
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
- };
@@ -1,9 +0,0 @@
1
- import { createSelector } from 'reselect';
2
- export const storeName = 'commonComponents';
3
- export const commonComponentsSelector = state => (Object.assign({}, state[storeName]));
4
- export const welcomePageContextSelector = createSelector(commonComponentsSelector, commonComponents => ({
5
- fields: commonComponents.optionalFields.fields,
6
- extended_profile: commonComponents.optionalFields.extended_profile,
7
- nextUrl: commonComponents.thirdPartyAuthContext.welcomePageRedirectUrl,
8
- }));
9
- //# sourceMappingURL=selectors.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"selectors.js","sourceRoot":"","sources":["../../../src/progressive-profiling/data/selectors.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE1C,MAAM,CAAC,MAAM,SAAS,GAAG,kBAAkB,CAAC;AAE5C,MAAM,CAAC,MAAM,wBAAwB,GAAG,KAAK,CAAC,EAAE,CAAC,mBAAM,KAAK,CAAC,SAAS,CAAC,EAAG,CAAC;AAE3E,MAAM,CAAC,MAAM,0BAA0B,GAAG,cAAc,CACtD,wBAAwB,EACxB,gBAAgB,CAAC,EAAE,CAAC,CAAC;IACnB,MAAM,EAAE,gBAAgB,CAAC,cAAc,CAAC,MAAM;IAC9C,gBAAgB,EAAE,gBAAgB,CAAC,cAAc,CAAC,gBAAgB;IAClE,OAAO,EAAE,gBAAgB,CAAC,qBAAqB,CAAC,sBAAsB;CACvE,CAAC,CACH,CAAC","sourcesContent":["import { createSelector } from 'reselect';\n\nexport const storeName = 'commonComponents';\n\nexport const commonComponentsSelector = state => ({ ...state[storeName] });\n\nexport const welcomePageContextSelector = createSelector(\n commonComponentsSelector,\n commonComponents => ({\n fields: commonComponents.optionalFields.fields,\n extended_profile: commonComponents.optionalFields.extended_profile,\n nextUrl: commonComponents.thirdPartyAuthContext.welcomePageRedirectUrl,\n }),\n);\n"]}
@@ -1 +0,0 @@
1
- export function patchAccount(username: any, commitValues: any): Promise<void>;
@@ -1 +0,0 @@
1
- {"version":3,"file":"service.js","sourceRoot":"","sources":["../../../src/progressive-profiling/data/service.js"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,0BAA0B,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEnF,MAAM,UAAgB,YAAY,CAAC,QAAQ,EAAE,YAAY;;QACvD,MAAM,aAAa,GAAG;YACpB,OAAO,EAAE,EAAE,cAAc,EAAE,8BAA8B,EAAE;SAC5D,CAAC;QAEF,MAAM,0BAA0B,EAAE;aAC/B,KAAK,CACJ,GAAG,aAAa,EAAE,CAAC,UAAU,yBAAyB,QAAQ,EAAE,EAChE,YAAY,EACZ,aAAa,CACd;aACA,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;YACf,MAAM,CAAC,KAAK,CAAC,CAAC;QAChB,CAAC,CAAC,CAAC;IACP,CAAC;CAAA","sourcesContent":["import { getAuthenticatedHttpClient, getSiteConfig } from '@openedx/frontend-base';\n\nexport async function patchAccount(username, commitValues) {\n const requestConfig = {\n headers: { 'Content-Type': 'application/merge-patch+json' },\n };\n\n await getAuthenticatedHttpClient()\n .patch(\n `${getSiteConfig().lmsBaseUrl}/api/user/v1/accounts/${username}`,\n commitValues,\n requestConfig,\n )\n .catch((error) => {\n throw (error);\n });\n}\n"]}
@@ -1,80 +0,0 @@
1
- export const BACKUP_REGISTRATION_DATA: AsyncActionType;
2
- export const REGISTER_FORM_VALIDATIONS: AsyncActionType;
3
- export const REGISTER_NEW_USER: AsyncActionType;
4
- export const REGISTER_CLEAR_USERNAME_SUGGESTIONS: "REGISTRATION_CLEAR_USERNAME_SUGGESTIONS";
5
- export const REGISTRATION_CLEAR_BACKEND_ERROR: "REGISTRATION_CLEAR_BACKEND_ERROR";
6
- export const REGISTER_SET_COUNTRY_CODE: "REGISTER_SET_COUNTRY_CODE";
7
- export const REGISTER_SET_USER_PIPELINE_DATA_LOADED: "REGISTER_SET_USER_PIPELINE_DATA_LOADED";
8
- export const REGISTER_SET_EMAIL_SUGGESTIONS: "REGISTER_SET_EMAIL_SUGGESTIONS";
9
- export function backupRegistrationForm(): {
10
- type: string;
11
- };
12
- export function backupRegistrationFormBegin(data: any): {
13
- type: string;
14
- payload: any;
15
- };
16
- export function fetchRealtimeValidations(formPayload: any): {
17
- type: string;
18
- payload: {
19
- formPayload: any;
20
- };
21
- };
22
- export function fetchRealtimeValidationsBegin(): {
23
- type: string;
24
- };
25
- export function fetchRealtimeValidationsSuccess(validations: any): {
26
- type: string;
27
- payload: {
28
- validations: any;
29
- };
30
- };
31
- export function fetchRealtimeValidationsFailure(): {
32
- type: string;
33
- };
34
- export function setEmailSuggestionInStore(emailSuggestion: any): {
35
- type: string;
36
- payload: {
37
- emailSuggestion: any;
38
- };
39
- };
40
- export function registerNewUser(registrationInfo: any): {
41
- type: string;
42
- payload: {
43
- registrationInfo: any;
44
- };
45
- };
46
- export function registerNewUserBegin(): {
47
- type: string;
48
- };
49
- export function registerNewUserSuccess(authenticatedUser: any, redirectUrl: any, success: any): {
50
- type: string;
51
- payload: {
52
- authenticatedUser: any;
53
- redirectUrl: any;
54
- success: any;
55
- };
56
- };
57
- export function registerNewUserFailure(error: any): {
58
- type: string;
59
- payload: any;
60
- };
61
- export function clearUsernameSuggestions(): {
62
- type: string;
63
- };
64
- export function clearRegistrationBackendError(fieldName: any): {
65
- type: string;
66
- payload: any;
67
- };
68
- export function setCountryFromThirdPartyAuthContext(countryCode: any): {
69
- type: string;
70
- payload: {
71
- countryCode: any;
72
- };
73
- };
74
- export function setUserPipelineDataLoaded(value: any): {
75
- type: string;
76
- payload: {
77
- value: any;
78
- };
79
- };
80
- import { AsyncActionType } from '../../data/utils';
@@ -1,69 +0,0 @@
1
- import { AsyncActionType } from '../../data/utils';
2
- export const BACKUP_REGISTRATION_DATA = new AsyncActionType('REGISTRATION', 'BACKUP_REGISTRATION_DATA');
3
- export const REGISTER_FORM_VALIDATIONS = new AsyncActionType('REGISTRATION', 'GET_FORM_VALIDATIONS');
4
- export const REGISTER_NEW_USER = new AsyncActionType('REGISTRATION', 'REGISTER_NEW_USER');
5
- export const REGISTER_CLEAR_USERNAME_SUGGESTIONS = 'REGISTRATION_CLEAR_USERNAME_SUGGESTIONS';
6
- export const REGISTRATION_CLEAR_BACKEND_ERROR = 'REGISTRATION_CLEAR_BACKEND_ERROR';
7
- export const REGISTER_SET_COUNTRY_CODE = 'REGISTER_SET_COUNTRY_CODE';
8
- export const REGISTER_SET_USER_PIPELINE_DATA_LOADED = 'REGISTER_SET_USER_PIPELINE_DATA_LOADED';
9
- export const REGISTER_SET_EMAIL_SUGGESTIONS = 'REGISTER_SET_EMAIL_SUGGESTIONS';
10
- // Backup registration form
11
- export const backupRegistrationForm = () => ({
12
- type: BACKUP_REGISTRATION_DATA.BASE,
13
- });
14
- export const backupRegistrationFormBegin = (data) => ({
15
- type: BACKUP_REGISTRATION_DATA.BEGIN,
16
- payload: Object.assign({}, data),
17
- });
18
- // Validate fields from the backend
19
- export const fetchRealtimeValidations = (formPayload) => ({
20
- type: REGISTER_FORM_VALIDATIONS.BASE,
21
- payload: { formPayload },
22
- });
23
- export const fetchRealtimeValidationsBegin = () => ({
24
- type: REGISTER_FORM_VALIDATIONS.BEGIN,
25
- });
26
- export const fetchRealtimeValidationsSuccess = (validations) => ({
27
- type: REGISTER_FORM_VALIDATIONS.SUCCESS,
28
- payload: { validations },
29
- });
30
- export const fetchRealtimeValidationsFailure = () => ({
31
- type: REGISTER_FORM_VALIDATIONS.FAILURE,
32
- });
33
- // Set email field frontend validations
34
- export const setEmailSuggestionInStore = (emailSuggestion) => ({
35
- type: REGISTER_SET_EMAIL_SUGGESTIONS,
36
- payload: { emailSuggestion },
37
- });
38
- // Register
39
- export const registerNewUser = registrationInfo => ({
40
- type: REGISTER_NEW_USER.BASE,
41
- payload: { registrationInfo },
42
- });
43
- export const registerNewUserBegin = () => ({
44
- type: REGISTER_NEW_USER.BEGIN,
45
- });
46
- export const registerNewUserSuccess = (authenticatedUser, redirectUrl, success) => ({
47
- type: REGISTER_NEW_USER.SUCCESS,
48
- payload: { authenticatedUser, redirectUrl, success },
49
- });
50
- export const registerNewUserFailure = (error) => ({
51
- type: REGISTER_NEW_USER.FAILURE,
52
- payload: Object.assign({}, error),
53
- });
54
- export const clearUsernameSuggestions = () => ({
55
- type: REGISTER_CLEAR_USERNAME_SUGGESTIONS,
56
- });
57
- export const clearRegistrationBackendError = (fieldName) => ({
58
- type: REGISTRATION_CLEAR_BACKEND_ERROR,
59
- payload: fieldName,
60
- });
61
- export const setCountryFromThirdPartyAuthContext = (countryCode) => ({
62
- type: REGISTER_SET_COUNTRY_CODE,
63
- payload: { countryCode },
64
- });
65
- export const setUserPipelineDataLoaded = (value) => ({
66
- type: REGISTER_SET_USER_PIPELINE_DATA_LOADED,
67
- payload: { value },
68
- });
69
- //# sourceMappingURL=actions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"actions.js","sourceRoot":"","sources":["../../../src/register/data/actions.js"],"names":[],"mappings":"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","sourcesContent":["import { AsyncActionType } from '../../data/utils';\n\nexport const BACKUP_REGISTRATION_DATA = new AsyncActionType('REGISTRATION', 'BACKUP_REGISTRATION_DATA');\nexport const REGISTER_FORM_VALIDATIONS = new AsyncActionType('REGISTRATION', 'GET_FORM_VALIDATIONS');\nexport const REGISTER_NEW_USER = new AsyncActionType('REGISTRATION', 'REGISTER_NEW_USER');\nexport const REGISTER_CLEAR_USERNAME_SUGGESTIONS = 'REGISTRATION_CLEAR_USERNAME_SUGGESTIONS';\nexport const REGISTRATION_CLEAR_BACKEND_ERROR = 'REGISTRATION_CLEAR_BACKEND_ERROR';\nexport const REGISTER_SET_COUNTRY_CODE = 'REGISTER_SET_COUNTRY_CODE';\nexport const REGISTER_SET_USER_PIPELINE_DATA_LOADED = 'REGISTER_SET_USER_PIPELINE_DATA_LOADED';\nexport const REGISTER_SET_EMAIL_SUGGESTIONS = 'REGISTER_SET_EMAIL_SUGGESTIONS';\n\n// Backup registration form\nexport const backupRegistrationForm = () => ({\n type: BACKUP_REGISTRATION_DATA.BASE,\n});\n\nexport const backupRegistrationFormBegin = (data) => ({\n type: BACKUP_REGISTRATION_DATA.BEGIN,\n payload: { ...data },\n});\n\n// Validate fields from the backend\nexport const fetchRealtimeValidations = (formPayload) => ({\n type: REGISTER_FORM_VALIDATIONS.BASE,\n payload: { formPayload },\n});\n\nexport const fetchRealtimeValidationsBegin = () => ({\n type: REGISTER_FORM_VALIDATIONS.BEGIN,\n});\n\nexport const fetchRealtimeValidationsSuccess = (validations) => ({\n type: REGISTER_FORM_VALIDATIONS.SUCCESS,\n payload: { validations },\n});\n\nexport const fetchRealtimeValidationsFailure = () => ({\n type: REGISTER_FORM_VALIDATIONS.FAILURE,\n});\n\n// Set email field frontend validations\nexport const setEmailSuggestionInStore = (emailSuggestion) => ({\n type: REGISTER_SET_EMAIL_SUGGESTIONS,\n payload: { emailSuggestion },\n});\n\n// Register\nexport const registerNewUser = registrationInfo => ({\n type: REGISTER_NEW_USER.BASE,\n payload: { registrationInfo },\n});\n\nexport const registerNewUserBegin = () => ({\n type: REGISTER_NEW_USER.BEGIN,\n});\n\nexport const registerNewUserSuccess = (authenticatedUser, redirectUrl, success) => ({\n type: REGISTER_NEW_USER.SUCCESS,\n payload: { authenticatedUser, redirectUrl, success },\n\n});\n\nexport const registerNewUserFailure = (error) => ({\n type: REGISTER_NEW_USER.FAILURE,\n payload: { ...error },\n});\n\nexport const clearUsernameSuggestions = () => ({\n type: REGISTER_CLEAR_USERNAME_SUGGESTIONS,\n});\n\nexport const clearRegistrationBackendError = (fieldName) => ({\n type: REGISTRATION_CLEAR_BACKEND_ERROR,\n payload: fieldName,\n});\n\nexport const setCountryFromThirdPartyAuthContext = (countryCode) => ({\n type: REGISTER_SET_COUNTRY_CODE,\n payload: { countryCode },\n});\n\nexport const setUserPipelineDataLoaded = (value) => ({\n type: REGISTER_SET_USER_PIPELINE_DATA_LOADED,\n payload: { value },\n});\n"]}