@os-team/profile 1.1.10 → 1.1.11

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 (42) hide show
  1. package/README.md +12 -28
  2. package/dist/cjs/components/profile/ProfileUpdatePasswordModal.js +1 -1
  3. package/dist/cjs/components/profile/ProfileUpdatePasswordModal.js.map +1 -1
  4. package/dist/cjs/components/profile/ProtectedWrapper.js +2 -6
  5. package/dist/cjs/components/profile/ProtectedWrapper.js.map +1 -1
  6. package/dist/cjs/components/profile/__generated__/ProfileDrawerSignOutMutation.graphql.js +65 -0
  7. package/dist/cjs/components/profile/__generated__/ProfileDrawerSignOutMutation.graphql.js.map +1 -0
  8. package/dist/cjs/components/profile/__generated__/ProfileDrawerUpdateAvatarMutation.graphql.js +80 -0
  9. package/dist/cjs/components/profile/__generated__/ProfileDrawerUpdateAvatarMutation.graphql.js.map +1 -0
  10. package/dist/cjs/components/profile/__generated__/ProtectedWrapperQuery.graphql.js +4 -10
  11. package/dist/cjs/components/profile/__generated__/ProtectedWrapperQuery.graphql.js.map +1 -1
  12. package/dist/esm/components/profile/ProfileUpdatePasswordModal.js +1 -1
  13. package/dist/esm/components/profile/ProfileUpdatePasswordModal.js.map +1 -1
  14. package/dist/esm/components/profile/ProtectedWrapper.js +2 -6
  15. package/dist/esm/components/profile/ProtectedWrapper.js.map +1 -1
  16. package/dist/esm/components/profile/__generated__/ProfileDrawerSignOutMutation.graphql.js +58 -0
  17. package/dist/esm/components/profile/__generated__/ProfileDrawerSignOutMutation.graphql.js.map +1 -0
  18. package/dist/esm/components/profile/__generated__/ProfileDrawerUpdateAvatarMutation.graphql.js +73 -0
  19. package/dist/esm/components/profile/__generated__/ProfileDrawerUpdateAvatarMutation.graphql.js.map +1 -0
  20. package/dist/esm/components/profile/__generated__/ProtectedWrapperQuery.graphql.js +4 -10
  21. package/dist/esm/components/profile/__generated__/ProtectedWrapperQuery.graphql.js.map +1 -1
  22. package/dist/types/src/lib/components/profile/ProfileUpdatePasswordModal.d.ts.map +1 -1
  23. package/dist/types/src/lib/components/profile/ProtectedWrapper.d.ts.map +1 -1
  24. package/dist/types/src/lib/components/profile/__generated__/ProfileDrawerSignOutMutation.graphql.d.ts +14 -0
  25. package/dist/types/src/lib/components/profile/__generated__/ProfileDrawerSignOutMutation.graphql.d.ts.map +1 -0
  26. package/dist/types/src/lib/components/profile/__generated__/ProfileDrawerUpdateAvatarMutation.graphql.d.ts +20 -0
  27. package/dist/types/src/lib/components/profile/__generated__/ProfileDrawerUpdateAvatarMutation.graphql.d.ts.map +1 -0
  28. package/dist/types/src/lib/components/profile/__generated__/ProtectedWrapperQuery.graphql.d.ts +0 -1
  29. package/dist/types/src/lib/components/profile/__generated__/ProtectedWrapperQuery.graphql.d.ts.map +1 -1
  30. package/package.json +1 -1
  31. package/dist/cjs/components/profile/SetFirstPassword.js +0 -88
  32. package/dist/cjs/components/profile/SetFirstPassword.js.map +0 -1
  33. package/dist/cjs/components/profile/__generated__/SetFirstPasswordMutation.graphql.js +0 -90
  34. package/dist/cjs/components/profile/__generated__/SetFirstPasswordMutation.graphql.js.map +0 -1
  35. package/dist/esm/components/profile/SetFirstPassword.js +0 -73
  36. package/dist/esm/components/profile/SetFirstPassword.js.map +0 -1
  37. package/dist/esm/components/profile/__generated__/SetFirstPasswordMutation.graphql.js +0 -83
  38. package/dist/esm/components/profile/__generated__/SetFirstPasswordMutation.graphql.js.map +0 -1
  39. package/dist/types/src/lib/components/profile/SetFirstPassword.d.ts +0 -4
  40. package/dist/types/src/lib/components/profile/SetFirstPassword.d.ts.map +0 -1
  41. package/dist/types/src/lib/components/profile/__generated__/SetFirstPasswordMutation.graphql.d.ts +0 -19
  42. package/dist/types/src/lib/components/profile/__generated__/SetFirstPasswordMutation.graphql.d.ts.map +0 -1
package/README.md CHANGED
@@ -52,22 +52,14 @@ Create the `public/locales/en/profile.json` file with the following content:
52
52
  "newPassword": {
53
53
  "label": "New password",
54
54
  "placeholder": "Enter a new password"
55
+ },
56
+ "passwordStrengthNames": {
57
+ "weak": "Weak",
58
+ "good": "Good",
59
+ "strong": "Strong",
60
+ "powerful": "Powerful"
55
61
  }
56
62
  },
57
- "setFirstPassword": {
58
- "button": "Continue",
59
- "success": "Password has been set",
60
- "newPassword": {
61
- "label": "Set a password",
62
- "placeholder": "Enter a new password"
63
- }
64
- },
65
- "passwordStrengthNames": {
66
- "weak": "Weak",
67
- "good": "Good",
68
- "strong": "Strong",
69
- "powerful": "Powerful"
70
- },
71
63
  "sessions": {
72
64
  "title": "Active sessions",
73
65
  "description": "Every time someone logs into your account, a new session is created, which is displayed here. Terminate all suspicious sessions.",
@@ -144,22 +136,14 @@ Create the `public/locales/ru/profile.json` file with the following content:
144
136
  "newPassword": {
145
137
  "label": "Новый пароль",
146
138
  "placeholder": "Введите новый пароль"
139
+ },
140
+ "passwordStrengthNames": {
141
+ "weak": "Слабый",
142
+ "good": "Хороший",
143
+ "strong": "Надежный",
144
+ "powerful": "Мощный"
147
145
  }
148
146
  },
149
- "setFirstPassword": {
150
- "button": "Продолжить",
151
- "success": "Пароль был установлен",
152
- "newPassword": {
153
- "label": "Задайте пароль",
154
- "placeholder": "Введите новый пароль"
155
- }
156
- },
157
- "passwordStrengthNames": {
158
- "weak": "Слабый",
159
- "good": "Хороший",
160
- "strong": "Надежный",
161
- "powerful": "Мощный"
162
- },
163
147
  "sessions": {
164
148
  "title": "Активные сеансы",
165
149
  "description": "Каждый раз, когда кто-то входит в ваш аккаунт, создается новый сеанс, который отображается здесь. Завершите все подозрительные сеансы.",
@@ -87,7 +87,7 @@ var ProfileUpdatePasswordModal = function ProfileUpdatePasswordModal(_ref) {
87
87
  }, /*#__PURE__*/_react.default.createElement(_core.InputPassword, _extends({
88
88
  placeholder: t('profile:updatePasswordModal.newPassword.placeholder'),
89
89
  showStrengthMeter: true,
90
- strengthNames: t('profile:passwordStrengthNames', {
90
+ strengthNames: t('profile:updatePasswordModal.passwordStrengthNames', {
91
91
  returnObjects: true
92
92
  })
93
93
  }, props)));
@@ -1 +1 @@
1
- {"version":3,"file":"ProfileUpdatePasswordModal.js","names":["_core","require","_form","_react","_interopRequireWildcard","_reactI18next","_hooks","_handleFormErrors","_interopRequireDefault","_FormError","_ProfileUpdatePasswordModalMutation","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_extends","assign","bind","target","i","arguments","length","source","apply","_slicedToArray","arr","_arrayWithHoles","_iterableToArrayLimit","_unsupportedIterableToArray","_nonIterableRest","TypeError","o","minLen","_arrayLikeToArray","n","toString","slice","constructor","name","Array","from","test","len","arr2","_i","Symbol","iterator","_s","_e","_x","_r","_arr","_n","_d","next","done","push","value","err","return","isArray","ProfileUpdatePasswordModal","_ref","visibility","onClose","_useTranslation","useTranslation","t","_useForm","useForm","currentPassword","password","form","Field","_useMutation","useMutation","hash","console","error","_useMutation2","commit","loading","useEffect","reset","onSubmit","useCallback","variables","input","values","getAll","onError","handleFormErrors","onCompleted","message","success","createElement","Modal","title","visible","okText","okLoading","onOk","FormProvider","Form","render","props","_ref2","FormItem","label","InputPassword","placeholder","_ref3","showStrengthMeter","strengthNames","returnObjects","_default","exports"],"sources":["../../../../src/lib/components/profile/ProfileUpdatePasswordModal.tsx"],"sourcesContent":["import { Form, FormItem, InputPassword, message, Modal } from '@os-design/core';\nimport { FormProvider, useForm } from '@os-design/form';\nimport { graphql } from 'babel-plugin-relay/macro';\nimport React, { useCallback, useEffect } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { useMutation } from 'react-relay/hooks';\nimport handleFormErrors from '../../utils/handleFormErrors';\nimport FormError from '../shared/FormError';\nimport { ProfileUpdatePasswordModalMutation } from './__generated__/ProfileUpdatePasswordModalMutation.graphql';\n\ninterface ProfileUpdatePasswordFormData {\n currentPassword: string;\n password: string;\n}\n\ninterface ProfileUpdatePasswordModalProps {\n visibility: boolean;\n onClose: () => void;\n}\n\nconst ProfileUpdatePasswordModal: React.FC<ProfileUpdatePasswordModalProps> = ({\n visibility,\n onClose,\n}) => {\n const { t } = useTranslation(['profile']);\n\n const { form, Field } = useForm<ProfileUpdatePasswordFormData>({\n currentPassword: '',\n password: '',\n });\n\n const [commit, loading] = useMutation<ProfileUpdatePasswordModalMutation>(\n graphql`\n mutation ProfileUpdatePasswordModalMutation(\n $input: UpdatePasswordInput!\n ) {\n updatePassword(input: $input) {\n id\n }\n }\n `\n );\n\n // Reset the data if the modal is visible\n useEffect(() => {\n if (visibility) form.reset();\n }, [form, visibility]);\n\n const onSubmit = useCallback(() => {\n commit({\n variables: {\n input: form.values.getAll(),\n },\n onError: (error) => handleFormErrors(form, error),\n onCompleted: () => {\n message.success(t('profile:updatePasswordModal.success'));\n onClose();\n },\n });\n }, [commit, form, onClose, t]);\n\n return (\n <Modal\n title={t('profile:updatePasswordModal.title')}\n visible={visibility}\n okText={t('profile:updatePasswordModal.button')}\n okLoading={loading}\n onOk={onSubmit}\n onClose={onClose}\n >\n <FormProvider form={form}>\n <Form>\n <Field\n name='currentPassword'\n render={(props, { error }) => (\n <FormItem\n label={t('profile:updatePasswordModal.currentPassword.label')}\n error={error}\n >\n <InputPassword\n placeholder={t(\n 'profile:updatePasswordModal.currentPassword.placeholder'\n )}\n {...props}\n />\n </FormItem>\n )}\n />\n\n <Field\n name='password'\n render={(props, { error }) => (\n <FormItem\n label={t('profile:updatePasswordModal.newPassword.label')}\n error={error}\n >\n <InputPassword\n placeholder={t(\n 'profile:updatePasswordModal.newPassword.placeholder'\n )}\n showStrengthMeter\n strengthNames={t('profile:passwordStrengthNames', {\n returnObjects: true,\n })}\n {...props}\n />\n </FormItem>\n )}\n />\n\n <FormError />\n </Form>\n </FormProvider>\n </Modal>\n );\n};\n\nexport default ProfileUpdatePasswordModal;\n"],"mappings":";;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;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FzH,MAAA,CAAAU,OAAA,CAAAqG,aAAA,CAACtB,KAAK;IACJnC,IAAI,EAAC,UAAU;IACfkE,MAAM,EAAE,SAAAA,OAACC,KAAK,EAAAM,KAAA;MAAA,IAAIjC,KAAK,GAAAiC,KAAA,CAALjC,KAAK;MAAA,oBACrB9F,MAAA,CAAAU,OAAA,CAAAqG,aAAA,CAAClH,KAAA,CAAA8H,QAAQ;QACPC,KAAK,EAAEzC,CAAC,CAAC,+CAA+C,CAAE;QAC1DW,KAAK,EAAEA;MAAM,gBAEb9F,MAAA,CAAAU,OAAA,CAAAqG,aAAA,CAAClH,KAAA,CAAAgI,aAAa,EAAA9F,QAAA;QACZ+F,WAAW,EAAE3C,CAAC,CACZ,qDACF,CAAE;QACF6C,iBAAiB;QACjBC,aAAa,EAAE9C,CAAC,CAAC,+BAA+B,EAAE;UAChD+C,aAAa,EAAE;QACjB,CAAC;MAAE,GACCT,KAAK,CACV,CACO,CAAC;IAAA;EACX,CACH,CAAC,eAEFzH,MAAA,CAAAU,OAAA,CAAAqG,aAAA,CAACzG,UAAA,CAAAI,OAAS,MAAE,CACR,CACM,CACT,CAAC;AAEZ,CAAC;AAAC,IAAAyH,QAAA,GAEatD,0BAA0B;AAAAuD,OAAA,CAAA1H,OAAA,GAAAyH,QAAA"}
1
+ {"version":3,"file":"ProfileUpdatePasswordModal.js","names":["_core","require","_form","_react","_interopRequireWildcard","_reactI18next","_hooks","_handleFormErrors","_interopRequireDefault","_FormError","_ProfileUpdatePasswordModalMutation","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_extends","assign","bind","target","i","arguments","length","source","apply","_slicedToArray","arr","_arrayWithHoles","_iterableToArrayLimit","_unsupportedIterableToArray","_nonIterableRest","TypeError","o","minLen","_arrayLikeToArray","n","toString","slice","constructor","name","Array","from","test","len","arr2","_i","Symbol","iterator","_s","_e","_x","_r","_arr","_n","_d","next","done","push","value","err","return","isArray","ProfileUpdatePasswordModal","_ref","visibility","onClose","_useTranslation","useTranslation","t","_useForm","useForm","currentPassword","password","form","Field","_useMutation","useMutation","hash","console","error","_useMutation2","commit","loading","useEffect","reset","onSubmit","useCallback","variables","input","values","getAll","onError","handleFormErrors","onCompleted","message","success","createElement","Modal","title","visible","okText","okLoading","onOk","FormProvider","Form","render","props","_ref2","FormItem","label","InputPassword","placeholder","_ref3","showStrengthMeter","strengthNames","returnObjects","_default","exports"],"sources":["../../../../src/lib/components/profile/ProfileUpdatePasswordModal.tsx"],"sourcesContent":["import { Form, FormItem, InputPassword, message, Modal } from '@os-design/core';\nimport { FormProvider, useForm } from '@os-design/form';\nimport { graphql } from 'babel-plugin-relay/macro';\nimport React, { useCallback, useEffect } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { useMutation } from 'react-relay/hooks';\nimport handleFormErrors from '../../utils/handleFormErrors';\nimport FormError from '../shared/FormError';\nimport { ProfileUpdatePasswordModalMutation } from './__generated__/ProfileUpdatePasswordModalMutation.graphql';\n\ninterface ProfileUpdatePasswordFormData {\n currentPassword: string;\n password: string;\n}\n\ninterface ProfileUpdatePasswordModalProps {\n visibility: boolean;\n onClose: () => void;\n}\n\nconst ProfileUpdatePasswordModal: React.FC<ProfileUpdatePasswordModalProps> = ({\n visibility,\n onClose,\n}) => {\n const { t } = useTranslation(['profile']);\n\n const { form, Field } = useForm<ProfileUpdatePasswordFormData>({\n currentPassword: '',\n password: '',\n });\n\n const [commit, loading] = useMutation<ProfileUpdatePasswordModalMutation>(\n graphql`\n mutation ProfileUpdatePasswordModalMutation(\n $input: UpdatePasswordInput!\n ) {\n updatePassword(input: $input) {\n id\n }\n }\n `\n );\n\n // Reset the data if the modal is visible\n useEffect(() => {\n if (visibility) form.reset();\n }, [form, visibility]);\n\n const onSubmit = useCallback(() => {\n commit({\n variables: {\n input: form.values.getAll(),\n },\n onError: (error) => handleFormErrors(form, error),\n onCompleted: () => {\n message.success(t('profile:updatePasswordModal.success'));\n onClose();\n },\n });\n }, [commit, form, onClose, t]);\n\n return (\n <Modal\n title={t('profile:updatePasswordModal.title')}\n visible={visibility}\n okText={t('profile:updatePasswordModal.button')}\n okLoading={loading}\n onOk={onSubmit}\n onClose={onClose}\n >\n <FormProvider form={form}>\n <Form>\n <Field\n name='currentPassword'\n render={(props, { error }) => (\n <FormItem\n label={t('profile:updatePasswordModal.currentPassword.label')}\n error={error}\n >\n <InputPassword\n placeholder={t(\n 'profile:updatePasswordModal.currentPassword.placeholder'\n )}\n {...props}\n />\n </FormItem>\n )}\n />\n\n <Field\n name='password'\n render={(props, { error }) => (\n <FormItem\n label={t('profile:updatePasswordModal.newPassword.label')}\n error={error}\n >\n <InputPassword\n placeholder={t(\n 'profile:updatePasswordModal.newPassword.placeholder'\n )}\n showStrengthMeter\n strengthNames={t(\n 'profile:updatePasswordModal.passwordStrengthNames',\n { returnObjects: true }\n )}\n {...props}\n />\n </FormItem>\n )}\n />\n\n <FormError />\n </Form>\n </FormProvider>\n </Modal>\n );\n};\n\nexport default ProfileUpdatePasswordModal;\n"],"mappings":";;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAEA,IAAAE,MAAA,GAAAC,uBAAA,CAAAH,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,iBAAA,GAAAC,sBAAA,CAAAP,OAAA;AACA,IAAAQ,UAAA,GAAAD,sBAAA,CAAAP,OAAA;AAA4C,IAAAS,mCAAA;AAAA,SAAAF,uBAAAG,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OA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DACF,CAAE;QACF6C,iBAAiB;QACjBC,aAAa,EAAE9C,CAAC,CACd,mDAAmD,EACnD;UAAE+C,aAAa,EAAE;QAAK,CACxB;MAAE,GACET,KAAK,CACV,CACO,CAAC;IAAA;EACX,CACH,CAAC,eAEFzH,MAAA,CAAAU,OAAA,CAAAqG,aAAA,CAACzG,UAAA,CAAAI,OAAS,MAAE,CACR,CACM,CACT,CAAC;AAEZ,CAAC;AAAC,IAAAyH,QAAA,GAEatD,0BAA0B;AAAAuD,OAAA,CAAA1H,OAAA,GAAAyH,QAAA"}
@@ -5,19 +5,18 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.default = void 0;
8
- var _utils = require("@os-design/utils");
9
8
  var _react = _interopRequireWildcard(require("react"));
10
9
  var _hooks = require("react-relay/hooks");
10
+ var _utils = require("@os-design/utils");
11
11
  var _ProfileConfigContext = _interopRequireDefault(require("./ProfileConfigContext"));
12
12
  var _ProfileContext = _interopRequireDefault(require("./ProfileContext"));
13
- var _SetFirstPassword = _interopRequireDefault(require("./SetFirstPassword"));
14
13
  var _ProtectedWrapperQuery;
15
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16
15
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
17
16
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
18
17
  var ProtectedWrapperLoader = function ProtectedWrapperLoader(_ref) {
19
18
  var children = _ref.children;
20
- var _useLazyLoadQuery = (0, _hooks.useLazyLoadQuery)(_ProtectedWrapperQuery !== void 0 ? _ProtectedWrapperQuery : (_ProtectedWrapperQuery = require("./__generated__/ProtectedWrapperQuery.graphql"), _ProtectedWrapperQuery.hash && _ProtectedWrapperQuery.hash !== "8207c248e1e225472f5f4bb3ad6fa4db" && console.error("The definition of 'ProtectedWrapperQuery' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _ProtectedWrapperQuery), {}, {
19
+ var _useLazyLoadQuery = (0, _hooks.useLazyLoadQuery)(_ProtectedWrapperQuery !== void 0 ? _ProtectedWrapperQuery : (_ProtectedWrapperQuery = require("./__generated__/ProtectedWrapperQuery.graphql"), _ProtectedWrapperQuery.hash && _ProtectedWrapperQuery.hash !== "903b234e48f53b4a44dc0b4974ebc521" && console.error("The definition of 'ProtectedWrapperQuery' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _ProtectedWrapperQuery), {}, {
21
20
  fetchPolicy: 'store-or-network'
22
21
  }),
23
22
  profile = _useLazyLoadQuery.profile;
@@ -30,9 +29,6 @@ var ProtectedWrapperLoader = function ProtectedWrapperLoader(_ref) {
30
29
  avatar: profile.avatar || undefined
31
30
  };
32
31
  }, [profile.avatar, profile.email, profile.firstName, profile.id, profile.lastName]);
33
- if (!profile.hasPassword) {
34
- return /*#__PURE__*/_react.default.createElement(_SetFirstPassword.default, null);
35
- }
36
32
  return /*#__PURE__*/_react.default.createElement(_ProfileContext.default.Provider, {
37
33
  value: profileContext
38
34
  }, children);
@@ -1 +1 @@
1
- {"version":3,"file":"ProtectedWrapper.js","names":["_utils","require","_react","_interopRequireWildcard","_hooks","_ProfileConfigContext","_interopRequireDefault","_ProfileContext","_SetFirstPassword","_ProtectedWrapperQuery","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","ProtectedWrapperLoader","_ref","children","_useLazyLoadQuery","useLazyLoadQuery","hash","console","error","fetchPolicy","profile","profileContext","useMemo","id","email","firstName","undefined","lastName","avatar","hasPassword","createElement","Provider","value","ProtectedWrapper","_ref2","bucketId","profileConfigContext","ErrorBoundary","fallback","window","location","href","_default","exports"],"sources":["../../../../src/lib/components/profile/ProtectedWrapper.tsx"],"sourcesContent":["import { ErrorBoundary } from '@os-design/utils';\nimport graphql from 'babel-plugin-relay/macro';\nimport React, { useMemo } from 'react';\nimport { useLazyLoadQuery } from 'react-relay/hooks';\nimport ProfileConfigContext from './ProfileConfigContext';\nimport ProfileContext from './ProfileContext';\nimport SetFirstPassword from './SetFirstPassword';\nimport { ProtectedWrapperQuery } from './__generated__/ProtectedWrapperQuery.graphql';\n\ninterface ProtectedWrapperLoaderProps {\n children?: React.ReactNode;\n}\n\nconst ProtectedWrapperLoader: React.FC<ProtectedWrapperLoaderProps> = ({\n children,\n}) => {\n const { profile } = useLazyLoadQuery<ProtectedWrapperQuery>(\n graphql`\n query ProtectedWrapperQuery {\n profile {\n id\n email\n firstName\n lastName\n avatar\n hasPassword\n }\n }\n `,\n {},\n { fetchPolicy: 'store-or-network' }\n );\n\n const profileContext = useMemo(\n () => ({\n id: profile.id,\n email: profile.email,\n firstName: profile.firstName || undefined,\n lastName: profile.lastName || undefined,\n avatar: profile.avatar || undefined,\n }),\n [\n profile.avatar,\n profile.email,\n profile.firstName,\n profile.id,\n profile.lastName,\n ]\n );\n\n if (!profile.hasPassword) {\n return <SetFirstPassword />;\n }\n\n return (\n <ProfileContext.Provider value={profileContext}>\n {children}\n </ProfileContext.Provider>\n );\n};\n\nexport interface ProtectedWrapperProps {\n bucketId: string;\n children?: React.ReactNode;\n}\n\nconst ProtectedWrapper: React.FC<ProtectedWrapperProps> = ({\n bucketId,\n children,\n}) => {\n const profileConfigContext = useMemo(() => ({ bucketId }), [bucketId]);\n\n return (\n <ProfileConfigContext.Provider value={profileConfigContext}>\n <ErrorBoundary\n fallback={() => {\n window.location.href = '/auth/';\n return null;\n }}\n >\n <ProtectedWrapperLoader>{children}</ProtectedWrapperLoader>\n </ErrorBoundary>\n </ProfileConfigContext.Provider>\n );\n};\n\nexport default ProtectedWrapper;\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,qBAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,eAAA,GAAAD,sBAAA,CAAAL,OAAA;AACA,IAAAO,iBAAA,GAAAF,sBAAA,CAAAL,OAAA;AAAkD,IAAAQ,sBAAA;AAAA,SAAAH,uBAAAI,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAX,wBAAAO,GAAA,EAAAI,WAAA,SAAAA,WAAA,IAAAJ,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,aAAAQ,OAAA,CAAAR,GAAA,yBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAS,KAAA,GAAAN,wBAAA,CAAAC,WAAA,OAAAK,KAAA,IAAAA,KAAA,CAAAC,GA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AACnB,sBAAsB,QAAEE,QAAiC,CAC7C,CACc,CAAC;AAEpC,CAAC;AAAC,IAAA6B,QAAA,GAEaT,gBAAgB;AAAAU,OAAA,CAAArD,OAAA,GAAAoD,QAAA"}
1
+ {"version":3,"file":"ProtectedWrapper.js","names":["_react","_interopRequireWildcard","require","_hooks","_utils","_ProfileConfigContext","_interopRequireDefault","_ProfileContext","_ProtectedWrapperQuery","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","ProtectedWrapperLoader","_ref","children","_useLazyLoadQuery","useLazyLoadQuery","hash","console","error","fetchPolicy","profile","profileContext","useMemo","id","email","firstName","undefined","lastName","avatar","createElement","Provider","value","ProtectedWrapper","_ref2","bucketId","profileConfigContext","ErrorBoundary","fallback","window","location","href","_default","exports"],"sources":["../../../../src/lib/components/profile/ProtectedWrapper.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\nimport graphql from 'babel-plugin-relay/macro';\nimport { useLazyLoadQuery } from 'react-relay/hooks';\nimport { ErrorBoundary } from '@os-design/utils';\nimport ProfileConfigContext from './ProfileConfigContext';\nimport ProfileContext from './ProfileContext';\nimport { ProtectedWrapperQuery } from './__generated__/ProtectedWrapperQuery.graphql';\n\ninterface ProtectedWrapperLoaderProps {\n children?: React.ReactNode;\n}\n\nconst ProtectedWrapperLoader: React.FC<ProtectedWrapperLoaderProps> = ({\n children,\n}) => {\n const { profile } = useLazyLoadQuery<ProtectedWrapperQuery>(\n graphql`\n query ProtectedWrapperQuery {\n profile {\n id\n email\n firstName\n lastName\n avatar\n }\n }\n `,\n {},\n { fetchPolicy: 'store-or-network' }\n );\n\n const profileContext = useMemo(\n () => ({\n id: profile.id,\n email: profile.email,\n firstName: profile.firstName || undefined,\n lastName: profile.lastName || undefined,\n avatar: profile.avatar || undefined,\n }),\n [\n profile.avatar,\n profile.email,\n profile.firstName,\n profile.id,\n profile.lastName,\n ]\n );\n\n return (\n <ProfileContext.Provider value={profileContext}>\n {children}\n </ProfileContext.Provider>\n );\n};\n\nexport interface ProtectedWrapperProps {\n bucketId: string;\n children?: React.ReactNode;\n}\n\nconst ProtectedWrapper: React.FC<ProtectedWrapperProps> = ({\n bucketId,\n children,\n}) => {\n const profileConfigContext = useMemo(() => ({ bucketId }), [bucketId]);\n\n return (\n <ProfileConfigContext.Provider value={profileConfigContext}>\n <ErrorBoundary\n fallback={() => {\n window.location.href = '/auth/';\n return null;\n }}\n >\n <ProtectedWrapperLoader>{children}</ProtectedWrapperLoader>\n </ErrorBoundary>\n </ProfileConfigContext.Provider>\n );\n};\n\nexport default ProtectedWrapper;\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,qBAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,eAAA,GAAAD,sBAAA,CAAAJ,OAAA;AAA8C,IAAAM,sBAAA;AAAA,SAAAF,uBAAAG,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAZ,wBAAAQ,GAAA,EAAAI,WAAA,SAAAA,WAAA,IAAAJ,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,aAAAQ,OAAA,CAAAR,GAAA,yBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAS,KAAA,GAAAN,wBA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T,gBAAgB;AAAAU,OAAA,CAAApD,OAAA,GAAAmD,QAAA"}
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ /**
8
+ * @generated SignedSource<<51909761cb1c71a922e242d469a3408c>>
9
+ * @lightSyntaxTransform
10
+ * @nogrep
11
+ */
12
+
13
+ /* tslint:disable */
14
+ /* eslint-disable */
15
+ // @ts-nocheck
16
+
17
+ var node = function () {
18
+ var v0 = [{
19
+ "alias": null,
20
+ "args": null,
21
+ "concreteType": "StatusPayload",
22
+ "kind": "LinkedField",
23
+ "name": "signOut",
24
+ "plural": false,
25
+ "selections": [{
26
+ "alias": null,
27
+ "args": null,
28
+ "kind": "ScalarField",
29
+ "name": "ok",
30
+ "storageKey": null
31
+ }],
32
+ "storageKey": null
33
+ }];
34
+ return {
35
+ "fragment": {
36
+ "argumentDefinitions": [],
37
+ "kind": "Fragment",
38
+ "metadata": null,
39
+ "name": "ProfileDrawerSignOutMutation",
40
+ "selections": v0 /*: any*/,
41
+ "type": "Mutation",
42
+ "abstractKey": null
43
+ },
44
+ "kind": "Request",
45
+ "operation": {
46
+ "argumentDefinitions": [],
47
+ "kind": "Operation",
48
+ "name": "ProfileDrawerSignOutMutation",
49
+ "selections": v0 /*: any*/
50
+ },
51
+
52
+ "params": {
53
+ "cacheID": "79648ed72d7cb7d656929f005dbf8371",
54
+ "id": null,
55
+ "metadata": {},
56
+ "name": "ProfileDrawerSignOutMutation",
57
+ "operationKind": "mutation",
58
+ "text": "mutation ProfileDrawerSignOutMutation {\n signOut {\n ok\n }\n}\n"
59
+ }
60
+ };
61
+ }();
62
+ node.hash = "8510e6462e8f7839ce100254080ba293";
63
+ var _default = node;
64
+ exports.default = _default;
65
+ //# sourceMappingURL=ProfileDrawerSignOutMutation.graphql.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProfileDrawerSignOutMutation.graphql.js","names":["node","v0","hash","_default","exports","default"],"sources":["../../../../../src/lib/components/profile/__generated__/ProfileDrawerSignOutMutation.graphql.ts"],"sourcesContent":["/**\n * @generated SignedSource<<51909761cb1c71a922e242d469a3408c>>\n * @lightSyntaxTransform\n * @nogrep\n */\n\n/* tslint:disable */\n/* eslint-disable */\n// @ts-nocheck\n\nimport { ConcreteRequest, Mutation } from 'relay-runtime';\nexport type ProfileDrawerSignOutMutation$variables = {};\nexport type ProfileDrawerSignOutMutation$data = {\n readonly signOut: {\n readonly ok: boolean;\n };\n};\nexport type ProfileDrawerSignOutMutation = {\n variables: ProfileDrawerSignOutMutation$variables;\n response: ProfileDrawerSignOutMutation$data;\n};\n\nconst node: ConcreteRequest = (function(){\nvar v0 = [\n {\n \"alias\": null,\n \"args\": null,\n \"concreteType\": \"StatusPayload\",\n \"kind\": \"LinkedField\",\n \"name\": \"signOut\",\n \"plural\": false,\n \"selections\": [\n {\n \"alias\": null,\n \"args\": null,\n \"kind\": \"ScalarField\",\n \"name\": \"ok\",\n \"storageKey\": null\n }\n ],\n \"storageKey\": null\n }\n];\nreturn {\n \"fragment\": {\n \"argumentDefinitions\": [],\n \"kind\": \"Fragment\",\n \"metadata\": null,\n \"name\": \"ProfileDrawerSignOutMutation\",\n \"selections\": (v0/*: any*/),\n \"type\": \"Mutation\",\n \"abstractKey\": null\n },\n \"kind\": \"Request\",\n \"operation\": {\n \"argumentDefinitions\": [],\n \"kind\": \"Operation\",\n \"name\": \"ProfileDrawerSignOutMutation\",\n \"selections\": (v0/*: any*/)\n },\n \"params\": {\n \"cacheID\": \"79648ed72d7cb7d656929f005dbf8371\",\n \"id\": null,\n \"metadata\": {},\n \"name\": \"ProfileDrawerSignOutMutation\",\n \"operationKind\": \"mutation\",\n \"text\": \"mutation ProfileDrawerSignOutMutation {\\n signOut {\\n ok\\n }\\n}\\n\"\n }\n};\n})();\n\n(node as any).hash = \"8510e6462e8f7839ce100254080ba293\";\n\nexport default node;\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAcA,IAAMA,IAAqB,GAAI,YAAU;EACzC,IAAIC,EAAE,GAAG,CACP;IACE,OAAO,EAAE,IAAI;IACb,MAAM,EAAE,IAAI;IACZ,cAAc,EAAE,eAAe;IAC/B,MAAM,EAAE,aAAa;IACrB,MAAM,EAAE,SAAS;IACjB,QAAQ,EAAE,KAAK;IACf,YAAY,EAAE,CACZ;MACE,OAAO,EAAE,IAAI;MACb,MAAM,EAAE,IAAI;MACZ,MAAM,EAAE,aAAa;MACrB,MAAM,EAAE,IAAI;MACZ,YAAY,EAAE;IAChB,CAAC,CACF;IACD,YAAY,EAAE;EAChB,CAAC,CACF;EACD,OAAO;IACL,UAAU,EAAE;MACV,qBAAqB,EAAE,EAAE;MACzB,MAAM,EAAE,UAAU;MAClB,UAAU,EAAE,IAAI;MAChB,MAAM,EAAE,8BAA8B;MACtC,YAAY,EAAGA,EAAE,UAAU;MAC3B,MAAM,EAAE,UAAU;MAClB,aAAa,EAAE;IACjB,CAAC;IACD,MAAM,EAAE,SAAS;IACjB,WAAW,EAAE;MACX,qBAAqB,EAAE,EAAE;MACzB,MAAM,EAAE,WAAW;MACnB,MAAM,EAAE,8BAA8B;MACtC,YAAY,EAAGA,EAAE;IACnB,CAAC;;IACD,QAAQ,EAAE;MACR,SAAS,EAAE,kCAAkC;MAC7C,IAAI,EAAE,IAAI;MACV,UAAU,EAAE,CAAC,CAAC;MACd,MAAM,EAAE,8BAA8B;MACtC,eAAe,EAAE,UAAU;MAC3B,MAAM,EAAE;IACV;EACF,CAAC;AACD,CAAC,CAAE,CAAC;AAEHD,IAAI,CAASE,IAAI,GAAG,kCAAkC;AAAC,IAAAC,QAAA,GAEzCH,IAAI;AAAAI,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ /**
8
+ * @generated SignedSource<<55ec946240339a8ef48835cf36146b25>>
9
+ * @lightSyntaxTransform
10
+ * @nogrep
11
+ */
12
+
13
+ /* tslint:disable */
14
+ /* eslint-disable */
15
+ // @ts-nocheck
16
+
17
+ var node = function () {
18
+ var v0 = [{
19
+ "defaultValue": null,
20
+ "kind": "LocalArgument",
21
+ "name": "input"
22
+ }],
23
+ v1 = [{
24
+ "alias": null,
25
+ "args": [{
26
+ "kind": "Variable",
27
+ "name": "input",
28
+ "variableName": "input"
29
+ }],
30
+ "concreteType": "User",
31
+ "kind": "LinkedField",
32
+ "name": "updateAvatar",
33
+ "plural": false,
34
+ "selections": [{
35
+ "alias": null,
36
+ "args": null,
37
+ "kind": "ScalarField",
38
+ "name": "id",
39
+ "storageKey": null
40
+ }, {
41
+ "alias": null,
42
+ "args": null,
43
+ "kind": "ScalarField",
44
+ "name": "avatar",
45
+ "storageKey": null
46
+ }],
47
+ "storageKey": null
48
+ }];
49
+ return {
50
+ "fragment": {
51
+ "argumentDefinitions": v0 /*: any*/,
52
+ "kind": "Fragment",
53
+ "metadata": null,
54
+ "name": "ProfileDrawerUpdateAvatarMutation",
55
+ "selections": v1 /*: any*/,
56
+ "type": "Mutation",
57
+ "abstractKey": null
58
+ },
59
+ "kind": "Request",
60
+ "operation": {
61
+ "argumentDefinitions": v0 /*: any*/,
62
+ "kind": "Operation",
63
+ "name": "ProfileDrawerUpdateAvatarMutation",
64
+ "selections": v1 /*: any*/
65
+ },
66
+
67
+ "params": {
68
+ "cacheID": "4e03df1e245723b6bb782fa62331d420",
69
+ "id": null,
70
+ "metadata": {},
71
+ "name": "ProfileDrawerUpdateAvatarMutation",
72
+ "operationKind": "mutation",
73
+ "text": "mutation ProfileDrawerUpdateAvatarMutation(\n $input: UpdateAvatarInput!\n) {\n updateAvatar(input: $input) {\n id\n avatar\n }\n}\n"
74
+ }
75
+ };
76
+ }();
77
+ node.hash = "c129cb1974b7cb9090d6c5df4e0f790d";
78
+ var _default = node;
79
+ exports.default = _default;
80
+ //# sourceMappingURL=ProfileDrawerUpdateAvatarMutation.graphql.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProfileDrawerUpdateAvatarMutation.graphql.js","names":["node","v0","v1","hash","_default","exports","default"],"sources":["../../../../../src/lib/components/profile/__generated__/ProfileDrawerUpdateAvatarMutation.graphql.ts"],"sourcesContent":["/**\n * @generated SignedSource<<55ec946240339a8ef48835cf36146b25>>\n * @lightSyntaxTransform\n * @nogrep\n */\n\n/* tslint:disable */\n/* eslint-disable */\n// @ts-nocheck\n\nimport { ConcreteRequest, Mutation } from 'relay-runtime';\nexport type UpdateAvatarInput = {\n avatar?: any | null;\n};\nexport type ProfileDrawerUpdateAvatarMutation$variables = {\n input: UpdateAvatarInput;\n};\nexport type ProfileDrawerUpdateAvatarMutation$data = {\n readonly updateAvatar: {\n readonly id: string;\n readonly avatar: string | null;\n };\n};\nexport type ProfileDrawerUpdateAvatarMutation = {\n variables: ProfileDrawerUpdateAvatarMutation$variables;\n response: ProfileDrawerUpdateAvatarMutation$data;\n};\n\nconst node: ConcreteRequest = (function(){\nvar v0 = [\n {\n \"defaultValue\": null,\n \"kind\": \"LocalArgument\",\n \"name\": \"input\"\n }\n],\nv1 = [\n {\n \"alias\": null,\n \"args\": [\n {\n \"kind\": \"Variable\",\n \"name\": \"input\",\n \"variableName\": \"input\"\n }\n ],\n \"concreteType\": \"User\",\n \"kind\": \"LinkedField\",\n \"name\": \"updateAvatar\",\n \"plural\": false,\n \"selections\": [\n {\n \"alias\": null,\n \"args\": null,\n \"kind\": \"ScalarField\",\n \"name\": \"id\",\n \"storageKey\": null\n },\n {\n \"alias\": null,\n \"args\": null,\n \"kind\": \"ScalarField\",\n \"name\": \"avatar\",\n \"storageKey\": null\n }\n ],\n \"storageKey\": null\n }\n];\nreturn {\n \"fragment\": {\n \"argumentDefinitions\": (v0/*: any*/),\n \"kind\": \"Fragment\",\n \"metadata\": null,\n \"name\": \"ProfileDrawerUpdateAvatarMutation\",\n \"selections\": (v1/*: any*/),\n \"type\": \"Mutation\",\n \"abstractKey\": null\n },\n \"kind\": \"Request\",\n \"operation\": {\n \"argumentDefinitions\": (v0/*: any*/),\n \"kind\": \"Operation\",\n \"name\": \"ProfileDrawerUpdateAvatarMutation\",\n \"selections\": (v1/*: any*/)\n },\n \"params\": {\n \"cacheID\": \"4e03df1e245723b6bb782fa62331d420\",\n \"id\": null,\n \"metadata\": {},\n \"name\": \"ProfileDrawerUpdateAvatarMutation\",\n \"operationKind\": \"mutation\",\n \"text\": \"mutation ProfileDrawerUpdateAvatarMutation(\\n $input: UpdateAvatarInput!\\n) {\\n updateAvatar(input: $input) {\\n id\\n avatar\\n }\\n}\\n\"\n }\n};\n})();\n\n(node as any).hash = \"c129cb1974b7cb9090d6c5df4e0f790d\";\n\nexport default node;\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAoBA,IAAMA,IAAqB,GAAI,YAAU;EACzC,IAAIC,EAAE,GAAG,CACP;MACE,cAAc,EAAE,IAAI;MACpB,MAAM,EAAE,eAAe;MACvB,MAAM,EAAE;IACV,CAAC,CACF;IACDC,EAAE,GAAG,CACH;MACE,OAAO,EAAE,IAAI;MACb,MAAM,EAAE,CACN;QACE,MAAM,EAAE,UAAU;QAClB,MAAM,EAAE,OAAO;QACf,cAAc,EAAE;MAClB,CAAC,CACF;MACD,cAAc,EAAE,MAAM;MACtB,MAAM,EAAE,aAAa;MACrB,MAAM,EAAE,cAAc;MACtB,QAAQ,EAAE,KAAK;MACf,YAAY,EAAE,CACZ;QACE,OAAO,EAAE,IAAI;QACb,MAAM,EAAE,IAAI;QACZ,MAAM,EAAE,aAAa;QACrB,MAAM,EAAE,IAAI;QACZ,YAAY,EAAE;MAChB,CAAC,EACD;QACE,OAAO,EAAE,IAAI;QACb,MAAM,EAAE,IAAI;QACZ,MAAM,EAAE,aAAa;QACrB,MAAM,EAAE,QAAQ;QAChB,YAAY,EAAE;MAChB,CAAC,CACF;MACD,YAAY,EAAE;IAChB,CAAC,CACF;EACD,OAAO;IACL,UAAU,EAAE;MACV,qBAAqB,EAAGD,EAAE,UAAU;MACpC,MAAM,EAAE,UAAU;MAClB,UAAU,EAAE,IAAI;MAChB,MAAM,EAAE,mCAAmC;MAC3C,YAAY,EAAGC,EAAE,UAAU;MAC3B,MAAM,EAAE,UAAU;MAClB,aAAa,EAAE;IACjB,CAAC;IACD,MAAM,EAAE,SAAS;IACjB,WAAW,EAAE;MACX,qBAAqB,EAAGD,EAAE,UAAU;MACpC,MAAM,EAAE,WAAW;MACnB,MAAM,EAAE,mCAAmC;MAC3C,YAAY,EAAGC,EAAE;IACnB,CAAC;;IACD,QAAQ,EAAE;MACR,SAAS,EAAE,kCAAkC;MAC7C,IAAI,EAAE,IAAI;MACV,UAAU,EAAE,CAAC,CAAC;MACd,MAAM,EAAE,mCAAmC;MAC3C,eAAe,EAAE,UAAU;MAC3B,MAAM,EAAE;IACV;EACF,CAAC;AACD,CAAC,CAAE,CAAC;AAEHF,IAAI,CAASG,IAAI,GAAG,kCAAkC;AAAC,IAAAC,QAAA,GAEzCJ,IAAI;AAAAK,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
  /**
8
- * @generated SignedSource<<c5d827b88445eb5271d5a60231e7c386>>
8
+ * @generated SignedSource<<c1bbe3a7739ce21cdcc0dc5de42901d2>>
9
9
  * @lightSyntaxTransform
10
10
  * @nogrep
11
11
  */
@@ -52,12 +52,6 @@ var node = function () {
52
52
  "kind": "ScalarField",
53
53
  "name": "avatar",
54
54
  "storageKey": null
55
- }, {
56
- "alias": null,
57
- "args": null,
58
- "kind": "ScalarField",
59
- "name": "hasPassword",
60
- "storageKey": null
61
55
  }],
62
56
  "storageKey": null
63
57
  }];
@@ -80,16 +74,16 @@ var node = function () {
80
74
  },
81
75
 
82
76
  "params": {
83
- "cacheID": "ca731635e8b4e4adaf87227472517278",
77
+ "cacheID": "c77ada94a5456167ef4c0c17a1fd7cd7",
84
78
  "id": null,
85
79
  "metadata": {},
86
80
  "name": "ProtectedWrapperQuery",
87
81
  "operationKind": "query",
88
- "text": "query ProtectedWrapperQuery {\n profile {\n id\n email\n firstName\n lastName\n avatar\n hasPassword\n }\n}\n"
82
+ "text": "query ProtectedWrapperQuery {\n profile {\n id\n email\n firstName\n lastName\n avatar\n }\n}\n"
89
83
  }
90
84
  };
91
85
  }();
92
- node.hash = "8207c248e1e225472f5f4bb3ad6fa4db";
86
+ node.hash = "903b234e48f53b4a44dc0b4974ebc521";
93
87
  var _default = node;
94
88
  exports.default = _default;
95
89
  //# sourceMappingURL=ProtectedWrapperQuery.graphql.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ProtectedWrapperQuery.graphql.js","names":["node","v0","hash","_default","exports","default"],"sources":["../../../../../src/lib/components/profile/__generated__/ProtectedWrapperQuery.graphql.ts"],"sourcesContent":["/**\n * @generated SignedSource<<c5d827b88445eb5271d5a60231e7c386>>\n * @lightSyntaxTransform\n * @nogrep\n */\n\n/* tslint:disable */\n/* eslint-disable */\n// @ts-nocheck\n\nimport { ConcreteRequest, Query } from 'relay-runtime';\nexport type ProtectedWrapperQuery$variables = {};\nexport type ProtectedWrapperQuery$data = {\n readonly profile: {\n readonly avatar: string | null;\n readonly email: string;\n readonly firstName: string | null;\n readonly hasPassword: boolean;\n readonly id: string;\n readonly lastName: string | null;\n };\n};\nexport type ProtectedWrapperQuery = {\n response: ProtectedWrapperQuery$data;\n variables: ProtectedWrapperQuery$variables;\n};\n\nconst node: ConcreteRequest = (function(){\nvar v0 = [\n {\n \"alias\": null,\n \"args\": null,\n \"concreteType\": \"User\",\n \"kind\": \"LinkedField\",\n \"name\": \"profile\",\n \"plural\": false,\n \"selections\": [\n {\n \"alias\": null,\n \"args\": null,\n \"kind\": \"ScalarField\",\n \"name\": \"id\",\n \"storageKey\": null\n },\n {\n \"alias\": null,\n \"args\": null,\n \"kind\": \"ScalarField\",\n \"name\": \"email\",\n \"storageKey\": null\n },\n {\n \"alias\": null,\n \"args\": null,\n \"kind\": \"ScalarField\",\n \"name\": \"firstName\",\n \"storageKey\": null\n },\n {\n \"alias\": null,\n \"args\": null,\n \"kind\": \"ScalarField\",\n \"name\": \"lastName\",\n \"storageKey\": null\n },\n {\n \"alias\": null,\n \"args\": null,\n \"kind\": \"ScalarField\",\n \"name\": \"avatar\",\n \"storageKey\": null\n },\n {\n \"alias\": null,\n \"args\": null,\n \"kind\": \"ScalarField\",\n \"name\": \"hasPassword\",\n \"storageKey\": null\n }\n ],\n \"storageKey\": null\n }\n];\nreturn {\n \"fragment\": {\n \"argumentDefinitions\": [],\n \"kind\": \"Fragment\",\n \"metadata\": null,\n \"name\": \"ProtectedWrapperQuery\",\n \"selections\": (v0/*: any*/),\n \"type\": \"Query\",\n \"abstractKey\": null\n },\n \"kind\": \"Request\",\n \"operation\": {\n \"argumentDefinitions\": [],\n \"kind\": \"Operation\",\n \"name\": \"ProtectedWrapperQuery\",\n \"selections\": (v0/*: any*/)\n },\n \"params\": {\n \"cacheID\": \"ca731635e8b4e4adaf87227472517278\",\n \"id\": null,\n \"metadata\": {},\n \"name\": \"ProtectedWrapperQuery\",\n \"operationKind\": \"query\",\n \"text\": \"query ProtectedWrapperQuery {\\n profile {\\n id\\n email\\n firstName\\n lastName\\n avatar\\n hasPassword\\n }\\n}\\n\"\n }\n};\n})();\n\n(node as any).hash = \"8207c248e1e225472f5f4bb3ad6fa4db\";\n\nexport default node;\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAmBA,IAAMA,IAAqB,GAAI,YAAU;EACzC,IAAIC,EAAE,GAAG,CACP;IACE,OAAO,EAAE,IAAI;IACb,MAAM,EAAE,IAAI;IACZ,cAAc,EAAE,MAAM;IACtB,MAAM,EAAE,aAAa;IACrB,MAAM,EAAE,SAAS;IACjB,QAAQ,EAAE,KAAK;IACf,YAAY,E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AC7C,IAAI,EAAE,IAAI;MACV,UAAU,EAAE,CAAC,CAAC;MACd,MAAM,EAAE,uBAAuB;MAC/B,eAAe,EAAE,OAAO;MACxB,MAAM,EAAE;IACV;EACF,CAAC;AACD,CAAC,CAAE,CAAC;AAEHD,IAAI,CAASE,IAAI,GAAG,kCAAkC;AAAC,IAAAC,QAAA,GAEzCH,IAAI;AAAAI,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
1
+ {"version":3,"file":"ProtectedWrapperQuery.graphql.js","names":["node","v0","hash","_default","exports","default"],"sources":["../../../../../src/lib/components/profile/__generated__/ProtectedWrapperQuery.graphql.ts"],"sourcesContent":["/**\n * @generated SignedSource<<c1bbe3a7739ce21cdcc0dc5de42901d2>>\n * @lightSyntaxTransform\n * @nogrep\n */\n\n/* tslint:disable */\n/* eslint-disable */\n// @ts-nocheck\n\nimport { ConcreteRequest, Query } from 'relay-runtime';\nexport type ProtectedWrapperQuery$variables = {};\nexport type ProtectedWrapperQuery$data = {\n readonly profile: {\n readonly avatar: string | null;\n readonly email: string;\n readonly firstName: string | null;\n readonly id: string;\n readonly lastName: string | null;\n };\n};\nexport type ProtectedWrapperQuery = {\n response: ProtectedWrapperQuery$data;\n variables: ProtectedWrapperQuery$variables;\n};\n\nconst node: ConcreteRequest = (function(){\nvar v0 = [\n {\n \"alias\": null,\n \"args\": null,\n \"concreteType\": \"User\",\n \"kind\": \"LinkedField\",\n \"name\": \"profile\",\n \"plural\": false,\n \"selections\": [\n {\n \"alias\": null,\n \"args\": null,\n \"kind\": \"ScalarField\",\n \"name\": \"id\",\n \"storageKey\": null\n },\n {\n \"alias\": null,\n \"args\": null,\n \"kind\": \"ScalarField\",\n \"name\": \"email\",\n \"storageKey\": null\n },\n {\n \"alias\": null,\n \"args\": null,\n \"kind\": \"ScalarField\",\n \"name\": \"firstName\",\n \"storageKey\": null\n },\n {\n \"alias\": null,\n \"args\": null,\n \"kind\": \"ScalarField\",\n \"name\": \"lastName\",\n \"storageKey\": null\n },\n {\n \"alias\": null,\n \"args\": null,\n \"kind\": \"ScalarField\",\n \"name\": \"avatar\",\n \"storageKey\": null\n }\n ],\n \"storageKey\": null\n }\n];\nreturn {\n \"fragment\": {\n \"argumentDefinitions\": [],\n \"kind\": \"Fragment\",\n \"metadata\": null,\n \"name\": \"ProtectedWrapperQuery\",\n \"selections\": (v0/*: any*/),\n \"type\": \"Query\",\n \"abstractKey\": null\n },\n \"kind\": \"Request\",\n \"operation\": {\n \"argumentDefinitions\": [],\n \"kind\": \"Operation\",\n \"name\": \"ProtectedWrapperQuery\",\n \"selections\": (v0/*: any*/)\n },\n \"params\": {\n \"cacheID\": \"c77ada94a5456167ef4c0c17a1fd7cd7\",\n \"id\": null,\n \"metadata\": {},\n \"name\": \"ProtectedWrapperQuery\",\n \"operationKind\": \"query\",\n \"text\": \"query ProtectedWrapperQuery {\\n profile {\\n id\\n email\\n firstName\\n lastName\\n avatar\\n }\\n}\\n\"\n }\n};\n})();\n\n(node as any).hash = \"903b234e48f53b4a44dc0b4974ebc521\";\n\nexport default node;\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAkBA,IAAMA,IAAqB,GAAI,YAAU;EACzC,IAAIC,EAAE,GAAG,CACP;IACE,OAAO,EAAE,IAAI;IACb,MAAM,EAAE,IAAI;IACZ,cAAc,EAAE,MAAM;IACtB,MAAM,EAAE,aAAa;IACrB,MAAM,EAAE,SAAS;IACjB,QAAQ,EAAE,KAAK;IACf,YAAY,EAAE,CACZ;MACE,OAAO,EAAE,IAAI;MACb,MAAM,EAAE,IAAI;MACZ,MAAM,EAAE,aAAa;MACrB,MAAM,EAAE,IAAI;MACZ,YAAY,EAAE;IAChB,CAAC,EACD;MACE,OAAO,EAAE,IAAI;MACb,MAAM,EAAE,IAAI;MACZ,MAAM,EAAE,aAAa;MACrB,MAAM,EAAE,OAAO;MACf,YAAY,EAAE;IAChB,CAAC,EACD;MACE,OAAO,EAAE,IAAI;MACb,MAAM,EAAE,IAAI;MACZ,MAAM,EAAE,aAAa;MACrB,MAAM,EAAE,WAAW;MACnB,YAAY,EAAE;IAChB,CAAC,EACD;MACE,OAAO,EAAE,IAAI;MACb,MAAM,EAAE,IAAI;MACZ,MAAM,EAAE,aAAa;MACrB,MAAM,EAAE,UAAU;MAClB,YAAY,EAAE;IAChB,CAAC,EACD;MACE,OAAO,EAAE,IAAI;MACb,MAAM,EAAE,IAAI;MACZ,MAAM,EAAE,aAAa;MACrB,MAAM,EAAE,QAAQ;MAChB,YAAY,EAAE;IAChB,CAAC,CACF;IACD,YAAY,EAAE;EAChB,CAAC,CACF;EACD,OAAO;IACL,UAAU,EAAE;MACV,qBAAqB,EAAE,EAAE;MACzB,MAAM,EAAE,UAAU;MAClB,UAAU,EAAE,IAAI;MAChB,MAAM,EAAE,uBAAuB;MAC/B,YAAY,EAAGA,EAAE,UAAU;MAC3B,MAAM,EAAE,OAAO;MACf,aAAa,EAAE;IACjB,CAAC;IACD,MAAM,EAAE,SAAS;IACjB,WAAW,EAAE;MACX,qBAAqB,EAAE,EAAE;MACzB,MAAM,EAAE,WAAW;MACnB,MAAM,EAAE,uBAAuB;MAC/B,YAAY,EAAGA,EAAE;IACnB,CAAC;;IACD,QAAQ,EAAE;MACR,SAAS,EAAE,kCAAkC;MAC7C,IAAI,EAAE,IAAI;MACV,UAAU,EAAE,CAAC,CAAC;MACd,MAAM,EAAE,uBAAuB;MAC/B,eAAe,EAAE,OAAO;MACxB,MAAM,EAAE;IACV;EACF,CAAC;AACD,CAAC,CAAE,CAAC;AAEHD,IAAI,CAASE,IAAI,GAAG,kCAAkC;AAAC,IAAAC,QAAA,GAEzCH,IAAI;AAAAI,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
@@ -68,7 +68,7 @@ const ProfileUpdatePasswordModal = ({
68
68
  }, /*#__PURE__*/React.createElement(InputPassword, _extends({
69
69
  placeholder: t('profile:updatePasswordModal.newPassword.placeholder'),
70
70
  showStrengthMeter: true,
71
- strengthNames: t('profile:passwordStrengthNames', {
71
+ strengthNames: t('profile:updatePasswordModal.passwordStrengthNames', {
72
72
  returnObjects: true
73
73
  })
74
74
  }, props)))
@@ -1 +1 @@
1
- {"version":3,"file":"ProfileUpdatePasswordModal.js","names":["Form","FormItem","InputPassword","message","Modal","FormProvider","useForm","React","useCallback","useEffect","useTranslation","useMutation","handleFormErrors","FormError","ProfileUpdatePasswordModal","visibility","onClose","t","form","Field","currentPassword","password","commit","loading","_ProfileUpdatePasswordModalMutation","require","hash","console","error","reset","onSubmit","variables","input","values","getAll","onError","onCompleted","success","createElement","title","visible","okText","okLoading","onOk","name","render","props","label","_extends","placeholder","showStrengthMeter","strengthNames","returnObjects"],"sources":["../../../../src/lib/components/profile/ProfileUpdatePasswordModal.tsx"],"sourcesContent":["import { Form, FormItem, InputPassword, message, Modal } from '@os-design/core';\nimport { FormProvider, useForm } from '@os-design/form';\nimport { graphql } from 'babel-plugin-relay/macro';\nimport React, { useCallback, useEffect } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { useMutation } from 'react-relay/hooks';\nimport handleFormErrors from '../../utils/handleFormErrors';\nimport FormError from '../shared/FormError';\nimport { ProfileUpdatePasswordModalMutation } from './__generated__/ProfileUpdatePasswordModalMutation.graphql';\n\ninterface ProfileUpdatePasswordFormData {\n currentPassword: string;\n password: string;\n}\n\ninterface ProfileUpdatePasswordModalProps {\n visibility: boolean;\n onClose: () => void;\n}\n\nconst ProfileUpdatePasswordModal: React.FC<ProfileUpdatePasswordModalProps> = ({\n visibility,\n onClose,\n}) => {\n const { t } = useTranslation(['profile']);\n\n const { form, Field } = useForm<ProfileUpdatePasswordFormData>({\n currentPassword: '',\n password: '',\n });\n\n const [commit, loading] = useMutation<ProfileUpdatePasswordModalMutation>(\n graphql`\n mutation ProfileUpdatePasswordModalMutation(\n $input: UpdatePasswordInput!\n ) {\n updatePassword(input: $input) {\n id\n }\n }\n `\n );\n\n // Reset the data if the modal is visible\n useEffect(() => {\n if (visibility) form.reset();\n }, [form, visibility]);\n\n const onSubmit = useCallback(() => {\n commit({\n variables: {\n input: form.values.getAll(),\n },\n onError: (error) => handleFormErrors(form, error),\n onCompleted: () => {\n message.success(t('profile:updatePasswordModal.success'));\n onClose();\n },\n });\n }, [commit, form, onClose, t]);\n\n return (\n <Modal\n title={t('profile:updatePasswordModal.title')}\n visible={visibility}\n okText={t('profile:updatePasswordModal.button')}\n okLoading={loading}\n onOk={onSubmit}\n onClose={onClose}\n >\n <FormProvider form={form}>\n <Form>\n <Field\n name='currentPassword'\n render={(props, { error }) => (\n <FormItem\n label={t('profile:updatePasswordModal.currentPassword.label')}\n error={error}\n >\n <InputPassword\n placeholder={t(\n 'profile:updatePasswordModal.currentPassword.placeholder'\n )}\n {...props}\n />\n </FormItem>\n )}\n />\n\n <Field\n name='password'\n render={(props, { error }) => (\n <FormItem\n label={t('profile:updatePasswordModal.newPassword.label')}\n error={error}\n >\n <InputPassword\n placeholder={t(\n 'profile:updatePasswordModal.newPassword.placeholder'\n )}\n showStrengthMeter\n strengthNames={t('profile:passwordStrengthNames', {\n returnObjects: true,\n })}\n {...props}\n />\n </FormItem>\n )}\n />\n\n <FormError />\n </Form>\n </FormProvider>\n </Modal>\n );\n};\n\nexport default ProfileUpdatePasswordModal;\n"],"mappings":";;AAAA,SAASA,IAAI,EAAEC,QAAQ,EAAEC,aAAa,EAAEC,OAAO,EAAEC,KAAK,QAAQ,iBAAiB;AAC/E,SAASC,YAAY,EAAEC,OAAO,QAAQ,iBAAiB;AAEvD,OAAOC,KAAK,IAAIC,WAAW,EAAEC,SAAS,QAAQ,OAAO;AACrD,SAASC,cAAc,QAAQ,eAAe;AAC9C,SAASC,WAAW,QAAQ,mBAAmB;AAC/C,OAAOC,gBAAgB,MAAM,8BAA8B;AAC3D,OAAOC,SAAS,MAAM,qBAAqB;AAa3C,MAAMC,0BAAqE,GAAGA,CAAC;EAC7EC,UAAU;EACVC;AACF,CAAC,KAAK;EACJ,MAAM;IAAEC;EAAE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EAAEb,QAAS;IACfd,OAAO,EAAEA;EAAQ,gBAEjBT,KAAA,CAAA+B,aAAA,CAACjC,YAAY;IAACa,IAAI,EAAEA;EAAK,gBACvBX,KAAA,CAAA+B,aAAA,CAACtC,IAAI,qBACHO,KAAA,CAAA+B,aAAA,CAACnB,KAAK;IACJyB,IAAI,EAAC,iBAAiB;IACtBC,MAAM,EAAEA,CAACC,KAAK,EAAE;MAAElB;IAAM,CAAC,kBACvBrB,KAAA,CAAA+B,aAAA,CAACrC,QAAQ;MACP8C,KAAK,EAAE9B,CAAC,CAAC,mDAAmD,CAAE;MAC9DW,KAAK,EAAEA;IAAM,gBAEbrB,KAAA,CAAA+B,aAAA,CAACpC,aAAa,EAAA8C,QAAA;MACZC,WAAW,EAAEhC,CAAC,CACZ,yDACF;IAAE,GACE6B,KAAK,CACV,CACO;EACV,CACH,CAAC,eAEFvC,KAAA,CAAA+B,aAAA,CAACnB,KAAK;IACJyB,IAAI,EAAC,UAAU;IACfC,MAAM,EAAEA,CAACC,KAAK,EAAE;MAAElB;IAAM,CAAC,kBACvBrB,KAAA,CAAA+B,aAAA,CAACrC,QAAQ;MACP8C,KAAK,EAAE9B,CAAC,CAAC,+CAA+C,CAAE;MAC1DW,KAAK,EAAEA;IAAM,gBAEbrB,KAAA,CAAA+B,aAAA,CAACpC,aAAa,EAAA8C,QAAA;MACZC,WAAW,EAAEhC,CAAC,CACZ,qDACF,CAAE;MACFiC,iBAAiB;MACjBC,aAAa,EAAElC,CAAC,CAAC,+BAA+B,EAAE;QAChDmC,aAAa,EAAE;MACjB,CAAC;IAAE,GACCN,KAAK,CACV,CACO;EACV,CACH,CAAC,eAEFvC,KAAA,CAAA+B,aAAA,CAACzB,SAAS,MAAE,CACR,CACM,CACT,CAAC;AAEZ,CAAC;AAED,eAAeC,0BAA0B"}
1
+ {"version":3,"file":"ProfileUpdatePasswordModal.js","names":["Form","FormItem","InputPassword","message","Modal","FormProvider","useForm","React","useCallback","useEffect","useTranslation","useMutation","handleFormErrors","FormError","ProfileUpdatePasswordModal","visibility","onClose","t","form","Field","currentPassword","password","commit","loading","_ProfileUpdatePasswordModalMutation","require","hash","console","error","reset","onSubmit","variables","input","values","getAll","onError","onCompleted","success","createElement","title","visible","okText","okLoading","onOk","name","render","props","label","_extends","placeholder","showStrengthMeter","strengthNames","returnObjects"],"sources":["../../../../src/lib/components/profile/ProfileUpdatePasswordModal.tsx"],"sourcesContent":["import { Form, FormItem, InputPassword, message, Modal } from '@os-design/core';\nimport { FormProvider, useForm } from '@os-design/form';\nimport { graphql } from 'babel-plugin-relay/macro';\nimport React, { useCallback, useEffect } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { useMutation } from 'react-relay/hooks';\nimport handleFormErrors from '../../utils/handleFormErrors';\nimport FormError from '../shared/FormError';\nimport { ProfileUpdatePasswordModalMutation } from './__generated__/ProfileUpdatePasswordModalMutation.graphql';\n\ninterface ProfileUpdatePasswordFormData {\n currentPassword: string;\n password: string;\n}\n\ninterface ProfileUpdatePasswordModalProps {\n visibility: boolean;\n onClose: () => void;\n}\n\nconst ProfileUpdatePasswordModal: React.FC<ProfileUpdatePasswordModalProps> = ({\n visibility,\n onClose,\n}) => {\n const { t } = useTranslation(['profile']);\n\n const { form, Field } = useForm<ProfileUpdatePasswordFormData>({\n currentPassword: '',\n password: '',\n });\n\n const [commit, loading] = useMutation<ProfileUpdatePasswordModalMutation>(\n graphql`\n mutation ProfileUpdatePasswordModalMutation(\n $input: UpdatePasswordInput!\n ) {\n updatePassword(input: $input) {\n id\n }\n }\n `\n );\n\n // Reset the data if the modal is visible\n useEffect(() => {\n if (visibility) form.reset();\n }, [form, visibility]);\n\n const onSubmit = useCallback(() => {\n commit({\n variables: {\n input: form.values.getAll(),\n },\n onError: (error) => handleFormErrors(form, error),\n onCompleted: () => {\n message.success(t('profile:updatePasswordModal.success'));\n onClose();\n },\n });\n }, [commit, form, onClose, t]);\n\n return (\n <Modal\n title={t('profile:updatePasswordModal.title')}\n visible={visibility}\n okText={t('profile:updatePasswordModal.button')}\n okLoading={loading}\n onOk={onSubmit}\n onClose={onClose}\n >\n <FormProvider form={form}>\n <Form>\n <Field\n name='currentPassword'\n render={(props, { error }) => (\n <FormItem\n label={t('profile:updatePasswordModal.currentPassword.label')}\n error={error}\n >\n <InputPassword\n placeholder={t(\n 'profile:updatePasswordModal.currentPassword.placeholder'\n )}\n {...props}\n />\n </FormItem>\n )}\n />\n\n <Field\n name='password'\n render={(props, { error }) => (\n <FormItem\n label={t('profile:updatePasswordModal.newPassword.label')}\n error={error}\n >\n <InputPassword\n placeholder={t(\n 'profile:updatePasswordModal.newPassword.placeholder'\n )}\n showStrengthMeter\n strengthNames={t(\n 'profile:updatePasswordModal.passwordStrengthNames',\n { returnObjects: true }\n )}\n {...props}\n />\n </FormItem>\n )}\n />\n\n <FormError />\n </Form>\n </FormProvider>\n </Modal>\n );\n};\n\nexport default ProfileUpdatePasswordModal;\n"],"mappings":";;AAAA,SAASA,IAAI,EAAEC,QAAQ,EAAEC,aAAa,EAAEC,OAAO,EAAEC,KAAK,QAAQ,iBAAiB;AAC/E,SAASC,YAAY,EAAEC,OAAO,QAAQ,iBAAiB;AAEvD,OAAOC,KAAK,IAAIC,WAAW,EAAEC,SAAS,QAAQ,OAAO;AACrD,SAASC,cAAc,QAAQ,eAAe;AAC9C,SAASC,WAAW,QAAQ,mBAAmB;AAC/C,OAAOC,gBAAgB,MAAM,8BAA8B;AAC3D,OAAOC,SAAS,MAAM,qBAAqB;AAa3C,MAAMC,0BAAqE,GAAGA,CAAC;EAC7EC,UAAU;EACVC;AACF,CAAC,KAAK;EACJ,MAAM;IAAEC;EAAE,CAAC,GAAGP,cAAc,CAAC,CAAC,SAAS,CAAC,CAAC;EAEzC,MAAM;IAAEQ,IAAI;IAAEC;EAAM,CAAC,GAAGb,OAAO,CAAgC;IAC7Dc,eAAe,EAAE,EAAE;IACnBC,QAAQ,EAAE;EACZ,CAAC,CAAC;EAEF,MAAM,CAACC,MAAM,EA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iBAAiB;IACtBC,MAAM,EAAEA,CAACC,KAAK,EAAE;MAAElB;IAAM,CAAC,kBACvBrB,KAAA,CAAA+B,aAAA,CAACrC,QAAQ;MACP8C,KAAK,EAAE9B,CAAC,CAAC,mDAAmD,CAAE;MAC9DW,KAAK,EAAEA;IAAM,gBAEbrB,KAAA,CAAA+B,aAAA,CAACpC,aAAa,EAAA8C,QAAA;MACZC,WAAW,EAAEhC,CAAC,CACZ,yDACF;IAAE,GACE6B,KAAK,CACV,CACO;EACV,CACH,CAAC,eAEFvC,KAAA,CAAA+B,aAAA,CAACnB,KAAK;IACJyB,IAAI,EAAC,UAAU;IACfC,MAAM,EAAEA,CAACC,KAAK,EAAE;MAAElB;IAAM,CAAC,kBACvBrB,KAAA,CAAA+B,aAAA,CAACrC,QAAQ;MACP8C,KAAK,EAAE9B,CAAC,CAAC,+CAA+C,CAAE;MAC1DW,KAAK,EAAEA;IAAM,gBAEbrB,KAAA,CAAA+B,aAAA,CAACpC,aAAa,EAAA8C,QAAA;MACZC,WAAW,EAAEhC,CAAC,CACZ,qDACF,CAAE;MACFiC,iBAAiB;MACjBC,aAAa,EAAElC,CAAC,CACd,mDAAmD,EACnD;QAAEmC,aAAa,EAAE;MAAK,CACxB;IAAE,GACEN,KAAK,CACV,CACO;EACV,CACH,CAAC,eAEFvC,KAAA,CAAA+B,aAAA,CAACzB,SAAS,MAAE,CACR,CACM,CACT,CAAC;AAEZ,CAAC;AAED,eAAeC,0BAA0B"}
@@ -1,16 +1,15 @@
1
1
  var _ProtectedWrapperQuery;
2
- import { ErrorBoundary } from '@os-design/utils';
3
2
  import React, { useMemo } from 'react';
4
3
  import { useLazyLoadQuery } from 'react-relay/hooks';
4
+ import { ErrorBoundary } from '@os-design/utils';
5
5
  import ProfileConfigContext from './ProfileConfigContext';
6
6
  import ProfileContext from './ProfileContext';
7
- import SetFirstPassword from './SetFirstPassword';
8
7
  const ProtectedWrapperLoader = ({
9
8
  children
10
9
  }) => {
11
10
  const {
12
11
  profile
13
- } = useLazyLoadQuery(_ProtectedWrapperQuery !== void 0 ? _ProtectedWrapperQuery : (_ProtectedWrapperQuery = require("./__generated__/ProtectedWrapperQuery.graphql"), _ProtectedWrapperQuery.hash && _ProtectedWrapperQuery.hash !== "8207c248e1e225472f5f4bb3ad6fa4db" && console.error("The definition of 'ProtectedWrapperQuery' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _ProtectedWrapperQuery), {}, {
12
+ } = useLazyLoadQuery(_ProtectedWrapperQuery !== void 0 ? _ProtectedWrapperQuery : (_ProtectedWrapperQuery = require("./__generated__/ProtectedWrapperQuery.graphql"), _ProtectedWrapperQuery.hash && _ProtectedWrapperQuery.hash !== "903b234e48f53b4a44dc0b4974ebc521" && console.error("The definition of 'ProtectedWrapperQuery' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _ProtectedWrapperQuery), {}, {
14
13
  fetchPolicy: 'store-or-network'
15
14
  });
16
15
  const profileContext = useMemo(() => ({
@@ -20,9 +19,6 @@ const ProtectedWrapperLoader = ({
20
19
  lastName: profile.lastName || undefined,
21
20
  avatar: profile.avatar || undefined
22
21
  }), [profile.avatar, profile.email, profile.firstName, profile.id, profile.lastName]);
23
- if (!profile.hasPassword) {
24
- return /*#__PURE__*/React.createElement(SetFirstPassword, null);
25
- }
26
22
  return /*#__PURE__*/React.createElement(ProfileContext.Provider, {
27
23
  value: profileContext
28
24
  }, children);
@@ -1 +1 @@
1
- {"version":3,"file":"ProtectedWrapper.js","names":["ErrorBoundary","React","useMemo","useLazyLoadQuery","ProfileConfigContext","ProfileContext","SetFirstPassword","ProtectedWrapperLoader","children","profile","_ProtectedWrapperQuery","require","hash","console","error","fetchPolicy","profileContext","id","email","firstName","undefined","lastName","avatar","hasPassword","createElement","Provider","value","ProtectedWrapper","bucketId","profileConfigContext","fallback","window","location","href"],"sources":["../../../../src/lib/components/profile/ProtectedWrapper.tsx"],"sourcesContent":["import { ErrorBoundary } from '@os-design/utils';\nimport graphql from 'babel-plugin-relay/macro';\nimport React, { useMemo } from 'react';\nimport { useLazyLoadQuery } from 'react-relay/hooks';\nimport ProfileConfigContext from './ProfileConfigContext';\nimport ProfileContext from './ProfileContext';\nimport SetFirstPassword from './SetFirstPassword';\nimport { ProtectedWrapperQuery } from './__generated__/ProtectedWrapperQuery.graphql';\n\ninterface ProtectedWrapperLoaderProps {\n children?: React.ReactNode;\n}\n\nconst ProtectedWrapperLoader: React.FC<ProtectedWrapperLoaderProps> = ({\n children,\n}) => {\n const { profile } = useLazyLoadQuery<ProtectedWrapperQuery>(\n graphql`\n query ProtectedWrapperQuery {\n profile {\n id\n email\n firstName\n lastName\n avatar\n hasPassword\n }\n }\n `,\n {},\n { fetchPolicy: 'store-or-network' }\n );\n\n const profileContext = useMemo(\n () => ({\n id: profile.id,\n email: profile.email,\n firstName: profile.firstName || undefined,\n lastName: profile.lastName || undefined,\n avatar: profile.avatar || undefined,\n }),\n [\n profile.avatar,\n profile.email,\n profile.firstName,\n profile.id,\n profile.lastName,\n ]\n );\n\n if (!profile.hasPassword) {\n return <SetFirstPassword />;\n }\n\n return (\n <ProfileContext.Provider value={profileContext}>\n {children}\n </ProfileContext.Provider>\n );\n};\n\nexport interface ProtectedWrapperProps {\n bucketId: string;\n children?: React.ReactNode;\n}\n\nconst ProtectedWrapper: React.FC<ProtectedWrapperProps> = ({\n bucketId,\n children,\n}) => {\n const profileConfigContext = useMemo(() => ({ bucketId }), [bucketId]);\n\n return (\n <ProfileConfigContext.Provider value={profileConfigContext}>\n <ErrorBoundary\n fallback={() => {\n window.location.href = '/auth/';\n return null;\n }}\n >\n <ProtectedWrapperLoader>{children}</ProtectedWrapperLoader>\n </ErrorBoundary>\n </ProfileConfigContext.Provider>\n );\n};\n\nexport default ProtectedWrapper;\n"],"mappings":";AAAA,SAASA,aAAa,QAAQ,kBAAkB;AAEhD,OAAOC,KAAK,IAAIC,OAAO,QAAQ,OAAO;AACtC,SAASC,gBAAgB,QAAQ,mBAAmB;AACpD,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AAC,CAAC,EAAE,CAACA,QAAQ,CAAC,CAAC;EAEtE,oBACE3B,KAAA,CAAAuB,aAAA,CAACpB,oBAAoB,CAACqB,QAAQ;IAACC,KAAK,EAAEG;EAAqB,gBACzD5B,KAAA,CAAAuB,aAAA,CAACxB,aAAa;IACZ8B,QAAQ,EAAEA,CAAA,KAAM;MACdC,MAAM,CAACC,QAAQ,CAACC,IAAI,GAAG,QAAQ;MAC/B,OAAO,IAAI;IACb;EAAE,gBAEFhC,KAAA,CAAAuB,aAAA,CAACjB,sBAAsB,QAAEC,QAAiC,CAC7C,CACc,CAAC;AAEpC,CAAC;AAED,eAAemB,gBAAgB"}
1
+ {"version":3,"file":"ProtectedWrapper.js","names":["React","useMemo","useLazyLoadQuery","ErrorBoundary","ProfileConfigContext","ProfileContext","ProtectedWrapperLoader","children","profile","_ProtectedWrapperQuery","require","hash","console","error","fetchPolicy","profileContext","id","email","firstName","undefined","lastName","avatar","createElement","Provider","value","ProtectedWrapper","bucketId","profileConfigContext","fallback","window","location","href"],"sources":["../../../../src/lib/components/profile/ProtectedWrapper.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\nimport graphql from 'babel-plugin-relay/macro';\nimport { useLazyLoadQuery } from 'react-relay/hooks';\nimport { ErrorBoundary } from '@os-design/utils';\nimport ProfileConfigContext from './ProfileConfigContext';\nimport ProfileContext from './ProfileContext';\nimport { ProtectedWrapperQuery } from './__generated__/ProtectedWrapperQuery.graphql';\n\ninterface ProtectedWrapperLoaderProps {\n children?: React.ReactNode;\n}\n\nconst ProtectedWrapperLoader: React.FC<ProtectedWrapperLoaderProps> = ({\n children,\n}) => {\n const { profile } = useLazyLoadQuery<ProtectedWrapperQuery>(\n graphql`\n query ProtectedWrapperQuery {\n profile {\n id\n email\n firstName\n lastName\n avatar\n }\n }\n `,\n {},\n { fetchPolicy: 'store-or-network' }\n );\n\n const profileContext = useMemo(\n () => ({\n id: profile.id,\n email: profile.email,\n firstName: profile.firstName || undefined,\n lastName: profile.lastName || undefined,\n avatar: profile.avatar || undefined,\n }),\n [\n profile.avatar,\n profile.email,\n profile.firstName,\n profile.id,\n profile.lastName,\n ]\n );\n\n return (\n <ProfileContext.Provider value={profileContext}>\n {children}\n </ProfileContext.Provider>\n );\n};\n\nexport interface ProtectedWrapperProps {\n bucketId: string;\n children?: React.ReactNode;\n}\n\nconst ProtectedWrapper: React.FC<ProtectedWrapperProps> = ({\n bucketId,\n children,\n}) => {\n const profileConfigContext = useMemo(() => ({ bucketId }), [bucketId]);\n\n return (\n <ProfileConfigContext.Provider value={profileConfigContext}>\n <ErrorBoundary\n fallback={() => {\n window.location.href = '/auth/';\n return null;\n }}\n >\n <ProtectedWrapperLoader>{children}</ProtectedWrapperLoader>\n </ErrorBoundary>\n </ProfileConfigContext.Provider>\n );\n};\n\nexport default ProtectedWrapper;\n"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,OAAO,QAAQ,OAAO;AAEtC,SAASC,gBAAgB,QAAQ,mBAAmB;AACpD,SAASC,aAAa,QAAQ,kBAAkB;AAChD,OAAOC,oBAAoB,MAAM,wBAAwB;AACzD,OAAOC,cAAc,MAAM,kBAAkB;AAO7C,MAAMC,sBAA6D,GAAGA,CAAC;EACrEC;AACF,CAAC,KAAK;EACJ,MAAM;IAAEC;EAAQ,CAAC,GAAGN,gBAAgB,CAAAO,sBAAA,cAAAA,sBAAA,IAAAA,sBAAA,GAAAC,OAAA,mDAAAD,sBAAA,CAAAE,IAAA,IAAAF,sBAAA,CAAAE,IAAA,2CAAAC,OAAA,CAAAC,KAAA,yJAAAJ,sBAAA,GAYlC,CAAC,CAAC,EACF;IAAEK,WAAW,EAAE;EAAmB,CACpC,CAAC;EAED,MAAMC,cAAc,GAAGd,OAAO,CAC5B,OAAO;IACLe,EAAE,EAAER,OAAO,CAACQ,EAAE;IACdC,KAAK,EAAET,OAAO,CAACS,KAAK;IACpBC,SAAS,EAAEV,OAAO,CAACU,SAAS,IAAIC,SAAS;IACzCC,QAAQ,EAAEZ,OAAO,CAACY,QAAQ,IAAID,SAAS;IACvCE,MAAM,EAAEb,OAAO,CAACa,MAAM,IAAIF;EAC5B,CAAC,CAAC,EACF,CACEX,OAAO,CAACa,MAAM,EACdb,OAAO,CAACS,KAAK,EACbT,OAAO,CAACU,SAAS,EACjBV,OAAO,CAACQ,EAAE,EACVR,OAAO,CAACY,QAAQ,CAEpB,CAAC;EAED,oBACEpB,KAAA,CAAAsB,aAAA,CAACjB,cAAc,CAACkB,QAAQ;IAACC,KAAK,EAAET;EAAe,GAC5CR,QACsB,CAAC;AAE9B,CAAC;AAOD,MAAMkB,gBAAiD,GAAGA,CAAC;EACzDC,QAAQ;EACRnB;AACF,CAAC,KAAK;EACJ,MAAMoB,oBAAoB,GAAG1B,OAAO,CAAC,OAAO;IAAEyB;EAAS,CAAC,CAAC,EAAE,CAACA,QAAQ,CAAC,CAAC;EAEtE,oBACE1B,KAAA,CAAAsB,aAAA,CAAClB,oBAAoB,CAACmB,QAAQ;IAACC,KAAK,EAAEG;EAAqB,gBACzD3B,KAAA,CAAAsB,aAAA,CAACnB,aAAa;IACZyB,QAAQ,EAAEA,CAAA,KAAM;MACdC,MAAM,CAACC,QAAQ,CAACC,IAAI,GAAG,QAAQ;MAC/B,OAAO,IAAI;IACb;EAAE,gBAEF/B,KAAA,CAAAsB,aAAA,CAAChB,sBAAsB,QAAEC,QAAiC,CAC7C,CACc,CAAC;AAEpC,CAAC;AAED,eAAekB,gBAAgB"}
@@ -0,0 +1,58 @@
1
+ /**
2
+ * @generated SignedSource<<51909761cb1c71a922e242d469a3408c>>
3
+ * @lightSyntaxTransform
4
+ * @nogrep
5
+ */
6
+
7
+ /* tslint:disable */
8
+ /* eslint-disable */
9
+ // @ts-nocheck
10
+
11
+ const node = function () {
12
+ var v0 = [{
13
+ "alias": null,
14
+ "args": null,
15
+ "concreteType": "StatusPayload",
16
+ "kind": "LinkedField",
17
+ "name": "signOut",
18
+ "plural": false,
19
+ "selections": [{
20
+ "alias": null,
21
+ "args": null,
22
+ "kind": "ScalarField",
23
+ "name": "ok",
24
+ "storageKey": null
25
+ }],
26
+ "storageKey": null
27
+ }];
28
+ return {
29
+ "fragment": {
30
+ "argumentDefinitions": [],
31
+ "kind": "Fragment",
32
+ "metadata": null,
33
+ "name": "ProfileDrawerSignOutMutation",
34
+ "selections": v0 /*: any*/,
35
+ "type": "Mutation",
36
+ "abstractKey": null
37
+ },
38
+ "kind": "Request",
39
+ "operation": {
40
+ "argumentDefinitions": [],
41
+ "kind": "Operation",
42
+ "name": "ProfileDrawerSignOutMutation",
43
+ "selections": v0 /*: any*/
44
+ },
45
+
46
+ "params": {
47
+ "cacheID": "79648ed72d7cb7d656929f005dbf8371",
48
+ "id": null,
49
+ "metadata": {},
50
+ "name": "ProfileDrawerSignOutMutation",
51
+ "operationKind": "mutation",
52
+ "text": "mutation ProfileDrawerSignOutMutation {\n signOut {\n ok\n }\n}\n"
53
+ }
54
+ };
55
+ }();
56
+ node.hash = "8510e6462e8f7839ce100254080ba293";
57
+ export default node;
58
+ //# sourceMappingURL=ProfileDrawerSignOutMutation.graphql.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProfileDrawerSignOutMutation.graphql.js","names":["node","v0","hash"],"sources":["../../../../../src/lib/components/profile/__generated__/ProfileDrawerSignOutMutation.graphql.ts"],"sourcesContent":["/**\n * @generated SignedSource<<51909761cb1c71a922e242d469a3408c>>\n * @lightSyntaxTransform\n * @nogrep\n */\n\n/* tslint:disable */\n/* eslint-disable */\n// @ts-nocheck\n\nimport { ConcreteRequest, Mutation } from 'relay-runtime';\nexport type ProfileDrawerSignOutMutation$variables = {};\nexport type ProfileDrawerSignOutMutation$data = {\n readonly signOut: {\n readonly ok: boolean;\n };\n};\nexport type ProfileDrawerSignOutMutation = {\n variables: ProfileDrawerSignOutMutation$variables;\n response: ProfileDrawerSignOutMutation$data;\n};\n\nconst node: ConcreteRequest = (function(){\nvar v0 = [\n {\n \"alias\": null,\n \"args\": null,\n \"concreteType\": \"StatusPayload\",\n \"kind\": \"LinkedField\",\n \"name\": \"signOut\",\n \"plural\": false,\n \"selections\": [\n {\n \"alias\": null,\n \"args\": null,\n \"kind\": \"ScalarField\",\n \"name\": \"ok\",\n \"storageKey\": null\n }\n ],\n \"storageKey\": null\n }\n];\nreturn {\n \"fragment\": {\n \"argumentDefinitions\": [],\n \"kind\": \"Fragment\",\n \"metadata\": null,\n \"name\": \"ProfileDrawerSignOutMutation\",\n \"selections\": (v0/*: any*/),\n \"type\": \"Mutation\",\n \"abstractKey\": null\n },\n \"kind\": \"Request\",\n \"operation\": {\n \"argumentDefinitions\": [],\n \"kind\": \"Operation\",\n \"name\": \"ProfileDrawerSignOutMutation\",\n \"selections\": (v0/*: any*/)\n },\n \"params\": {\n \"cacheID\": \"79648ed72d7cb7d656929f005dbf8371\",\n \"id\": null,\n \"metadata\": {},\n \"name\": \"ProfileDrawerSignOutMutation\",\n \"operationKind\": \"mutation\",\n \"text\": \"mutation ProfileDrawerSignOutMutation {\\n signOut {\\n ok\\n }\\n}\\n\"\n }\n};\n})();\n\n(node as any).hash = \"8510e6462e8f7839ce100254080ba293\";\n\nexport default node;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAcA,MAAMA,IAAqB,GAAI,YAAU;EACzC,IAAIC,EAAE,GAAG,CACP;IACE,OAAO,EAAE,IAAI;IACb,MAAM,EAAE,IAAI;IACZ,cAAc,EAAE,eAAe;IAC/B,MAAM,EAAE,aAAa;IACrB,MAAM,EAAE,SAAS;IACjB,QAAQ,EAAE,KAAK;IACf,YAAY,EAAE,CACZ;MACE,OAAO,EAAE,IAAI;MACb,MAAM,EAAE,IAAI;MACZ,MAAM,EAAE,aAAa;MACrB,MAAM,EAAE,IAAI;MACZ,YAAY,EAAE;IAChB,CAAC,CACF;IACD,YAAY,EAAE;EAChB,CAAC,CACF;EACD,OAAO;IACL,UAAU,EAAE;MACV,qBAAqB,EAAE,EAAE;MACzB,MAAM,EAAE,UAAU;MAClB,UAAU,EAAE,IAAI;MAChB,MAAM,EAAE,8BAA8B;MACtC,YAAY,EAAGA,EAAE,UAAU;MAC3B,MAAM,EAAE,UAAU;MAClB,aAAa,EAAE;IACjB,CAAC;IACD,MAAM,EAAE,SAAS;IACjB,WAAW,EAAE;MACX,qBAAqB,EAAE,EAAE;MACzB,MAAM,EAAE,WAAW;MACnB,MAAM,EAAE,8BAA8B;MACtC,YAAY,EAAGA,EAAE;IACnB,CAAC;;IACD,QAAQ,EAAE;MACR,SAAS,EAAE,kCAAkC;MAC7C,IAAI,EAAE,IAAI;MACV,UAAU,EAAE,CAAC,CAAC;MACd,MAAM,EAAE,8BAA8B;MACtC,eAAe,EAAE,UAAU;MAC3B,MAAM,EAAE;IACV;EACF,CAAC;AACD,CAAC,CAAE,CAAC;AAEHD,IAAI,CAASE,IAAI,GAAG,kCAAkC;AAEvD,eAAeF,IAAI"}