@os-team/profile 1.0.32 → 1.0.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/profile/ProfileConfigContext.js +1 -1
- package/dist/cjs/components/profile/ProfileContext.js +1 -1
- package/dist/cjs/components/profile/ProfileDrawer.js +1 -1
- package/dist/cjs/components/profile/ProfileUpdateNameModal.js +12 -9
- package/dist/cjs/components/profile/ProfileUpdateNameModal.js.map +1 -1
- package/dist/cjs/components/profile/ProfileUpdatePasswordModal.js +12 -9
- package/dist/cjs/components/profile/ProfileUpdatePasswordModal.js.map +1 -1
- package/dist/cjs/components/profile/ProtectedWrapper.js +28 -19
- package/dist/cjs/components/profile/ProtectedWrapper.js.map +1 -1
- package/dist/cjs/components/profile/UserAvatar.js +1 -1
- package/dist/cjs/components/profile/__generated__/ProfileDrawerSignOutMutation.graphql.js +7 -9
- package/dist/cjs/components/profile/__generated__/ProfileDrawerSignOutMutation.graphql.js.map +1 -1
- package/dist/cjs/components/profile/__generated__/ProfileDrawerUpdateAvatarMutation.graphql.js +7 -12
- package/dist/cjs/components/profile/__generated__/ProfileDrawerUpdateAvatarMutation.graphql.js.map +1 -1
- package/dist/cjs/components/profile/__generated__/ProfileUpdateNameModalMutation.graphql.js +7 -13
- package/dist/cjs/components/profile/__generated__/ProfileUpdateNameModalMutation.graphql.js.map +1 -1
- package/dist/cjs/components/profile/__generated__/ProfileUpdatePasswordModalMutation.graphql.js +7 -11
- package/dist/cjs/components/profile/__generated__/ProfileUpdatePasswordModalMutation.graphql.js.map +1 -1
- package/dist/cjs/components/profile/__generated__/ProtectedWrapperQuery.graphql.js +7 -13
- package/dist/cjs/components/profile/__generated__/ProtectedWrapperQuery.graphql.js.map +1 -1
- package/dist/cjs/components/session/SessionDrawer.js +1 -1
- package/dist/cjs/components/session/SessionDrawerContent.js +9 -7
- package/dist/cjs/components/session/SessionDrawerContent.js.map +1 -1
- package/dist/cjs/components/session/SessionList.js +1 -1
- package/dist/cjs/components/session/SessionListItem.js +1 -1
- package/dist/cjs/components/session/__generated__/SessionDrawerContentQuery.graphql.js +7 -34
- package/dist/cjs/components/session/__generated__/SessionDrawerContentQuery.graphql.js.map +1 -1
- package/dist/cjs/components/session/__generated__/SessionListDestroyAllOtherSessionsMutation.graphql.js +7 -9
- package/dist/cjs/components/session/__generated__/SessionListDestroyAllOtherSessionsMutation.graphql.js.map +1 -1
- package/dist/cjs/components/session/__generated__/SessionListItemDestroySessionMutation.graphql.js +7 -11
- package/dist/cjs/components/session/__generated__/SessionListItemDestroySessionMutation.graphql.js.map +1 -1
- package/dist/cjs/components/session/__generated__/SessionListItem_session.graphql.js +7 -1
- package/dist/cjs/components/session/__generated__/SessionListItem_session.graphql.js.map +1 -1
- package/dist/cjs/components/session/__generated__/SessionListRefetchQuery.graphql.js +7 -34
- package/dist/cjs/components/session/__generated__/SessionListRefetchQuery.graphql.js.map +1 -1
- package/dist/cjs/components/session/__generated__/SessionList_sessions.graphql.js +7 -5
- package/dist/cjs/components/session/__generated__/SessionList_sessions.graphql.js.map +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/esm/components/profile/ProfileDrawer.js +9 -3
- package/dist/esm/components/profile/ProfileDrawer.js.map +1 -1
- package/dist/esm/components/profile/ProfileUpdateNameModal.js +10 -9
- package/dist/esm/components/profile/ProfileUpdateNameModal.js.map +1 -1
- package/dist/esm/components/profile/ProfileUpdatePasswordModal.js +10 -9
- package/dist/esm/components/profile/ProfileUpdatePasswordModal.js.map +1 -1
- package/dist/esm/components/profile/ProtectedWrapper.js +24 -25
- package/dist/esm/components/profile/ProtectedWrapper.js.map +1 -1
- package/dist/esm/components/profile/__generated__/ProfileDrawerSignOutMutation.graphql.js +7 -9
- package/dist/esm/components/profile/__generated__/ProfileDrawerSignOutMutation.graphql.js.map +1 -1
- package/dist/esm/components/profile/__generated__/ProfileDrawerUpdateAvatarMutation.graphql.js +7 -12
- package/dist/esm/components/profile/__generated__/ProfileDrawerUpdateAvatarMutation.graphql.js.map +1 -1
- package/dist/esm/components/profile/__generated__/ProfileUpdateNameModalMutation.graphql.js +7 -13
- package/dist/esm/components/profile/__generated__/ProfileUpdateNameModalMutation.graphql.js.map +1 -1
- package/dist/esm/components/profile/__generated__/ProfileUpdatePasswordModalMutation.graphql.js +7 -11
- package/dist/esm/components/profile/__generated__/ProfileUpdatePasswordModalMutation.graphql.js.map +1 -1
- package/dist/esm/components/profile/__generated__/ProtectedWrapperQuery.graphql.js +7 -13
- package/dist/esm/components/profile/__generated__/ProtectedWrapperQuery.graphql.js.map +1 -1
- package/dist/esm/components/session/SessionDrawerContent.js +7 -5
- package/dist/esm/components/session/SessionDrawerContent.js.map +1 -1
- package/dist/esm/components/session/SessionList.js +2 -2
- package/dist/esm/components/session/SessionList.js.map +1 -1
- package/dist/esm/components/session/__generated__/SessionDrawerContentQuery.graphql.js +7 -34
- package/dist/esm/components/session/__generated__/SessionDrawerContentQuery.graphql.js.map +1 -1
- package/dist/esm/components/session/__generated__/SessionListDestroyAllOtherSessionsMutation.graphql.js +7 -9
- package/dist/esm/components/session/__generated__/SessionListDestroyAllOtherSessionsMutation.graphql.js.map +1 -1
- package/dist/esm/components/session/__generated__/SessionListItemDestroySessionMutation.graphql.js +7 -11
- package/dist/esm/components/session/__generated__/SessionListItemDestroySessionMutation.graphql.js.map +1 -1
- package/dist/esm/components/session/__generated__/SessionListItem_session.graphql.js +7 -1
- package/dist/esm/components/session/__generated__/SessionListItem_session.graphql.js.map +1 -1
- package/dist/esm/components/session/__generated__/SessionListRefetchQuery.graphql.js +7 -34
- package/dist/esm/components/session/__generated__/SessionListRefetchQuery.graphql.js.map +1 -1
- package/dist/esm/components/session/__generated__/SessionList_sessions.graphql.js +8 -3
- package/dist/esm/components/session/__generated__/SessionList_sessions.graphql.js.map +1 -1
- package/dist/esm/components/shared/ErrorResult.js +3 -1
- package/dist/esm/components/shared/ErrorResult.js.map +1 -1
- package/dist/types/components/profile/ProfileUpdateNameModal.d.ts.map +1 -1
- package/dist/types/components/profile/ProfileUpdatePasswordModal.d.ts.map +1 -1
- package/dist/types/components/profile/ProtectedWrapper.d.ts.map +1 -1
- package/dist/types/components/profile/__generated__/ProfileDrawerSignOutMutation.graphql.d.ts +5 -5
- package/dist/types/components/profile/__generated__/ProfileDrawerSignOutMutation.graphql.d.ts.map +1 -1
- package/dist/types/components/profile/__generated__/ProfileDrawerUpdateAvatarMutation.graphql.d.ts +6 -6
- package/dist/types/components/profile/__generated__/ProfileDrawerUpdateAvatarMutation.graphql.d.ts.map +1 -1
- package/dist/types/components/profile/__generated__/ProfileUpdateNameModalMutation.graphql.d.ts +5 -5
- package/dist/types/components/profile/__generated__/ProfileUpdateNameModalMutation.graphql.d.ts.map +1 -1
- package/dist/types/components/profile/__generated__/ProfileUpdatePasswordModalMutation.graphql.d.ts +5 -5
- package/dist/types/components/profile/__generated__/ProfileUpdatePasswordModalMutation.graphql.d.ts.map +1 -1
- package/dist/types/components/profile/__generated__/ProtectedWrapperQuery.graphql.d.ts +5 -5
- package/dist/types/components/profile/__generated__/ProtectedWrapperQuery.graphql.d.ts.map +1 -1
- package/dist/types/components/session/SessionDrawerContent.d.ts.map +1 -1
- package/dist/types/components/session/__generated__/SessionDrawerContentQuery.graphql.d.ts +6 -6
- package/dist/types/components/session/__generated__/SessionDrawerContentQuery.graphql.d.ts.map +1 -1
- package/dist/types/components/session/__generated__/SessionListDestroyAllOtherSessionsMutation.graphql.d.ts +5 -5
- package/dist/types/components/session/__generated__/SessionListDestroyAllOtherSessionsMutation.graphql.d.ts.map +1 -1
- package/dist/types/components/session/__generated__/SessionListItemDestroySessionMutation.graphql.d.ts +5 -5
- package/dist/types/components/session/__generated__/SessionListItemDestroySessionMutation.graphql.d.ts.map +1 -1
- package/dist/types/components/session/__generated__/SessionListItem_session.graphql.d.ts +4 -5
- package/dist/types/components/session/__generated__/SessionListItem_session.graphql.d.ts.map +1 -1
- package/dist/types/components/session/__generated__/SessionListRefetchQuery.graphql.d.ts +6 -6
- package/dist/types/components/session/__generated__/SessionListRefetchQuery.graphql.d.ts.map +1 -1
- package/dist/types/components/session/__generated__/SessionList_sessions.graphql.d.ts +5 -6
- package/dist/types/components/session/__generated__/SessionList_sessions.graphql.d.ts.map +1 -1
- package/package.json +59 -61
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/lib/components/profile/ProfileDrawer.tsx"],"names":["React","useCallback","useMemo","useRef","useState","Drawer","message","ThemeSwitcher","styled","clr","useTranslation","useMutation","useProfile","UserAvatar","ProfileButton","ProfileUpdateNameModal","ProfileUpdatePasswordModal","StyledDrawer","AvatarContainer","div","UserContent","FullName","p","theme","sizes","large","Email","inputColorPlaceholder","ActionsContainer","Footer","HiddenInput","input","profileDrawerUpdateAvatarMutation","DeleteAvatarButton","t","commit","loading","handler","variables","avatar","onError","error","source","errors","onCompleted","success","UpdateAvatarButton","hasAvatar","fileInputRef","e","target","files","file","uploadables","current","value","click","UpdateNameButton","hasName","modalVisibility","setModalVisibility","ChangePasswordButton","SignOutButton","window","location","href","ProfileDrawer","actions","children","rest","email","firstName","lastName","fullName","filter","i","join"],"mappings":";;;;AAAA,OAAOA,KAAP,IAAgBC,WAAhB,EAA6BC,OAA7B,EAAsCC,MAAtC,EAA8CC,QAA9C,QAA8D,OAA9D;AACA,SAASC,MAAT,EAA8BC,OAA9B,EAAuCC,aAAvC,QAA4D,iBAA5D;AACA,OAAOC,MAAP,MAAmB,iBAAnB;AACA,SAASC,GAAT,QAAoB,oBAApB;AACA,SAASC,cAAT,QAA+B,eAA/B;AAEA,SAASC,WAAT,QAA4B,mBAA5B;AACA,SAASC,UAAT,QAA2B,kBAA3B;AACA,OAAOC,UAAP,MAAuB,cAAvB;AACA,OAAOC,aAAP,MAA0B,iBAA1B;AACA,OAAOC,sBAAP,MAAmC,0BAAnC;AACA,OAAOC,0BAAP,MAAuC,8BAAvC;AAYA,MAAMC,YAAY,GAAGT,MAAM,CAACH,MAAD,CAAS;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AAAoBC,IAAAA,QAApB;AAA8BjC,IAAAA;AAA9B,MAAyC3B,UAAU,EAAzD;AAEA,QAAM6D,QAAQ,GAAGvE,OAAO,CACtB,MAAM,CAACqE,SAAD,EAAYC,QAAZ,EAAsBE,MAAtB,CAA8BC,CAAD,IAAOA,CAApC,EAAuCC,IAAvC,CAA4C,GAA5C,CADgB,EAEtB,CAACL,SAAD,EAAYC,QAAZ,CAFsB,CAAxB;AAKA,sBACE,oBAAC,YAAD;AAAc,IAAA,SAAS,EAAC,OAAxB;AAAgC,IAAA,KAAK,EAAC;AAAtC,KAAiDH,IAAjD,gBACE,oBAAC,eAAD,qBACE,oBAAC,UAAD;AAAY,IAAA,IAAI,EAAC;AAAjB,IADF,eAEE,oBAAC,WAAD,QACGI,QAAQ,iBAAI,oBAAC,QAAD,QAAWA,QAAX,CADf,eAEE,oBAAC,KAAD,QAAQH,KAAR,CAFF,CAFF,CADF,eASE,oBAAC,gBAAD,QACG/B,MAAM,iBAAI,oBAAC,kBAAD,OADb,eAGE,oBAAC,kBAAD;AAAoB,IAAA,SAAS,EAAE,CAAC,CAACA;AAAjC,IAHF,eAIE,oBAAC,gBAAD;AAAkB,IAAA,OAAO,EAAE,CAAC,CAACkC;AAA7B,IAJF,eAKE,oBAAC,oBAAD,OALF,EAOGN,OAPH,eASE,oBAAC,aAAD,OATF,EAWGC,QAXH,CATF,eAuBE,oBAAC,MAAD,qBACE,oBAAC,aAAD,OADF,CAvBF,CADF;AA6BD,CAzCD;;AA2CA,eAAeF,aAAf","sourcesContent":["import React, { useCallback, useMemo, useRef, useState } from 'react';\nimport { Drawer, DrawerProps, message, ThemeSwitcher } from '@os-design/core';\nimport styled from '@emotion/styled';\nimport { clr } from '@os-design/theming';\nimport { useTranslation } from 'react-i18next';\nimport { graphql } from 'babel-plugin-relay/macro';\nimport { useMutation } from 'react-relay/hooks';\nimport { useProfile } from './ProfileContext';\nimport UserAvatar from './UserAvatar';\nimport ProfileButton from './ProfileButton';\nimport ProfileUpdateNameModal from './ProfileUpdateNameModal';\nimport ProfileUpdatePasswordModal from './ProfileUpdatePasswordModal';\nimport { ProfileDrawerSignOutMutation } from './__generated__/ProfileDrawerSignOutMutation.graphql';\nimport { ProfileDrawerUpdateAvatarMutation } from './__generated__/ProfileDrawerUpdateAvatarMutation.graphql';\n\nexport interface ProfileDrawerProps extends DrawerProps {\n /**\n * Additional actions placed under the avatar.\n * @default undefined\n */\n actions?: React.ReactNode;\n}\n\nconst StyledDrawer = styled(Drawer)`\n display: flex;\n flex-direction: column;\n padding: 2em 1em;\n`;\n\nconst AvatarContainer = styled.div`\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n`;\n\nconst UserContent = styled.div`\n margin-top: 1em;\n`;\n\nconst FullName = styled.div`\n font-size: ${(p) => p.theme.sizes.large}em;\n font-weight: 500;\n text-align: center;\n line-height: 1.2;\n`;\n\nconst Email = styled.div`\n color: ${(p) => clr(p.theme.inputColorPlaceholder)};\n margin-top: 0.2em;\n text-align: center;\n`;\n\nconst ActionsContainer = styled.div`\n margin-top: 1.5em;\n`;\n\nconst Footer = styled.div`\n display: flex;\n justify-content: center;\n margin-top: auto;\n padding-top: 1.5em;\n`;\n\nconst HiddenInput = styled.input`\n display: none;\n`;\n\nconst profileDrawerUpdateAvatarMutation = graphql`\n mutation ProfileDrawerUpdateAvatarMutation($input: UpdateAvatarInput!) {\n updateAvatar(input: $input) {\n id\n avatar\n }\n }\n`;\n\nconst DeleteAvatarButton: React.FC = () => {\n const { t } = useTranslation('profile');\n\n const [commit, loading] = useMutation<ProfileDrawerUpdateAvatarMutation>(\n profileDrawerUpdateAvatarMutation\n );\n\n const handler = useCallback(() => {\n commit({\n variables: {\n input: { avatar: null },\n },\n onError: (error) => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n message.error((error as any).source?.errors?.[0]?.message);\n },\n onCompleted: () => {\n message.success(t('profile:updated'));\n },\n });\n }, [commit, t]);\n\n return (\n <ProfileButton loading={loading} onClick={handler}>\n {t('profile:deleteAvatar')}\n </ProfileButton>\n );\n};\n\ninterface UpdateAvatarButtonProps {\n hasAvatar: boolean;\n}\n\nconst UpdateAvatarButton: React.FC<UpdateAvatarButtonProps> = ({\n hasAvatar,\n}) => {\n const { t } = useTranslation('profile');\n const fileInputRef = useRef<HTMLInputElement>(null);\n\n const [commit, loading] = useMutation<ProfileDrawerUpdateAvatarMutation>(\n profileDrawerUpdateAvatarMutation\n );\n\n const handler = useCallback(\n (e) => {\n const target = e.target as HTMLInputElement | null;\n if (!target) return;\n\n const { files } = target;\n if (!files) return;\n\n const file = files[0];\n\n commit({\n variables: {\n input: {},\n },\n uploadables: { avatar: file },\n onError: (error) => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n message.error((error as any).source?.errors?.[0]?.message);\n },\n onCompleted: () => {\n message.success(t('profile:updated'));\n },\n });\n },\n [commit, t]\n );\n\n return (\n <>\n <ProfileButton\n loading={loading}\n onClick={() => {\n if (!fileInputRef.current) return;\n fileInputRef.current.value = '';\n fileInputRef.current.click();\n }}\n >\n {t(`profile:${hasAvatar ? 'changeAvatar' : 'setAvatar'}`)}\n </ProfileButton>\n\n <HiddenInput\n type='file'\n accept='image/jpeg,image/png,image/webp'\n onChange={handler}\n ref={fileInputRef}\n />\n </>\n );\n};\n\ninterface UpdateNameButtonProps {\n hasName: boolean;\n}\n\nconst UpdateNameButton: React.FC<UpdateNameButtonProps> = ({ hasName }) => {\n const { t } = useTranslation('profile');\n const [modalVisibility, setModalVisibility] = useState(false);\n\n return (\n <>\n <ProfileButton onClick={() => setModalVisibility(true)}>\n {t(`profile:${hasName ? 'changeName' : 'setName'}`)}\n </ProfileButton>\n\n <ProfileUpdateNameModal\n visibility={modalVisibility}\n onClose={() => setModalVisibility(false)}\n />\n </>\n );\n};\n\nconst ChangePasswordButton: React.FC = () => {\n const { t } = useTranslation('profile');\n const [modalVisibility, setModalVisibility] = useState(false);\n\n return (\n <>\n <ProfileButton onClick={() => setModalVisibility(true)}>\n {t('profile:changePassword')}\n </ProfileButton>\n\n <ProfileUpdatePasswordModal\n visibility={modalVisibility}\n onClose={() => setModalVisibility(false)}\n />\n </>\n );\n};\n\nconst SignOutButton: React.FC = () => {\n const { t } = useTranslation('profile');\n\n const [commit, loading] = useMutation<ProfileDrawerSignOutMutation>(graphql`\n mutation ProfileDrawerSignOutMutation {\n signOut {\n ok\n }\n }\n `);\n\n const handler = useCallback(() => {\n commit({\n variables: {},\n onError: (error) => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n message.error((error as any).source?.errors?.[0]?.message);\n },\n onCompleted: () => {\n window.location.href = '/auth/';\n },\n });\n }, [commit]);\n\n return (\n <ProfileButton danger loading={loading} onClick={handler}>\n {t('profile:signOut')}\n </ProfileButton>\n );\n};\n\nconst ProfileDrawer: React.FC<ProfileDrawerProps> = ({\n actions,\n children,\n ...rest\n}) => {\n const { email, firstName, lastName, avatar } = useProfile();\n\n const fullName = useMemo(\n () => [firstName, lastName].filter((i) => i).join(' '),\n [firstName, lastName]\n );\n\n return (\n <StyledDrawer placement='right' width='15em' {...rest}>\n <AvatarContainer>\n <UserAvatar size='10em' />\n <UserContent>\n {fullName && <FullName>{fullName}</FullName>}\n <Email>{email}</Email>\n </UserContent>\n </AvatarContainer>\n\n <ActionsContainer>\n {avatar && <DeleteAvatarButton />}\n\n <UpdateAvatarButton hasAvatar={!!avatar} />\n <UpdateNameButton hasName={!!fullName} />\n <ChangePasswordButton />\n\n {actions}\n\n <SignOutButton />\n\n {children}\n </ActionsContainer>\n\n <Footer>\n <ThemeSwitcher />\n </Footer>\n </StyledDrawer>\n );\n};\n\nexport default ProfileDrawer;\n"],"file":"ProfileDrawer.js"}
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/components/profile/ProfileDrawer.tsx"],"names":["React","useCallback","useMemo","useRef","useState","Drawer","message","ThemeSwitcher","styled","clr","useTranslation","useMutation","useProfile","UserAvatar","ProfileButton","ProfileUpdateNameModal","ProfileUpdatePasswordModal","StyledDrawer","AvatarContainer","div","UserContent","FullName","p","theme","sizes","large","Email","inputColorPlaceholder","ActionsContainer","Footer","HiddenInput","input","profileDrawerUpdateAvatarMutation","DeleteAvatarButton","t","commit","loading","handler","variables","avatar","onError","error","source","errors","onCompleted","success","UpdateAvatarButton","hasAvatar","fileInputRef","e","target","files","file","uploadables","current","value","click","UpdateNameButton","hasName","modalVisibility","setModalVisibility","ChangePasswordButton","SignOutButton","window","location","href","ProfileDrawer","actions","children","rest","email","firstName","lastName","fullName","filter","i","join"],"mappings":";;;;AAAA,OAAOA,KAAP,IAAgBC,WAAhB,EAA6BC,OAA7B,EAAsCC,MAAtC,EAA8CC,QAA9C,QAA8D,OAA9D;AACA,SAASC,MAAT,EAA8BC,OAA9B,EAAuCC,aAAvC,QAA4D,iBAA5D;AACA,OAAOC,MAAP,MAAmB,iBAAnB;AACA,SAASC,GAAT,QAAoB,oBAApB;AACA,SAASC,cAAT,QAA+B,eAA/B;AAEA,SAASC,WAAT,QAA4B,mBAA5B;AACA,SAASC,UAAT,QAA2B,kBAA3B;AACA,OAAOC,UAAP,MAAuB,cAAvB;AACA,OAAOC,aAAP,MAA0B,iBAA1B;AACA,OAAOC,sBAAP,MAAmC,0BAAnC;AACA,OAAOC,0BAAP,MAAuC,8BAAvC;AAYA,MAAMC,YAAY,GAAGT,MAAM,CAACH,MAAD,CAAS;AACpC;AACA;AACA;AACA,CAJA;AAMA,MAAMa,eAAe,GAAGV,MAAM,CAACW,GAAI;AACnC;AACA;AACA;AACA;AACA,CALA;AAOA,MAAMC,WAAW,GAAGZ,MAAM,CAACW,GAAI;AAC/B;AACA,CAFA;AAIA,MAAME,QAAQ,GAAGb,MAAM,CAACW,GAAI;AAC5B,eAAgBG,CAAD,IAAOA,CAAC,CAACC,KAAF,CAAQC,KAAR,CAAcC,KAAM;AAC1C;AACA;AACA;AACA,CALA;AAOA,MAAMC,KAAK,GAAGlB,MAAM,CAACW,GAAI;AACzB,WAAYG,CAAD,IAAOb,GA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AKA,sBACE,oBAAC,YAAD;AAAc,IAAA,SAAS,EAAC,OAAxB;AAAgC,IAAA,KAAK,EAAC;AAAtC,KAAiDH,IAAjD,gBACE,oBAAC,eAAD,qBACE,oBAAC,UAAD;AAAY,IAAA,IAAI,EAAC;AAAjB,IADF,eAEE,oBAAC,WAAD,QACGI,QAAQ,iBAAI,oBAAC,QAAD,QAAWA,QAAX,CADf,eAEE,oBAAC,KAAD,QAAQH,KAAR,CAFF,CAFF,CADF,eASE,oBAAC,gBAAD,QACG/B,MAAM,iBAAI,oBAAC,kBAAD,OADb,eAGE,oBAAC,kBAAD;AAAoB,IAAA,SAAS,EAAE,CAAC,CAACA;AAAjC,IAHF,eAIE,oBAAC,gBAAD;AAAkB,IAAA,OAAO,EAAE,CAAC,CAACkC;AAA7B,IAJF,eAKE,oBAAC,oBAAD,OALF,EAOGN,OAPH,eASE,oBAAC,aAAD,OATF,EAWGC,QAXH,CATF,eAuBE,oBAAC,MAAD,qBACE,oBAAC,aAAD,OADF,CAvBF,CADF;AA6BD,CAzCD;;AA2CA,eAAeF,aAAf","sourcesContent":["import React, { useCallback, useMemo, useRef, useState } from 'react';\nimport { Drawer, DrawerProps, message, ThemeSwitcher } from '@os-design/core';\nimport styled from '@emotion/styled';\nimport { clr } from '@os-design/theming';\nimport { useTranslation } from 'react-i18next';\nimport { graphql } from 'babel-plugin-relay/macro';\nimport { useMutation } from 'react-relay/hooks';\nimport { useProfile } from './ProfileContext';\nimport UserAvatar from './UserAvatar';\nimport ProfileButton from './ProfileButton';\nimport ProfileUpdateNameModal from './ProfileUpdateNameModal';\nimport ProfileUpdatePasswordModal from './ProfileUpdatePasswordModal';\nimport { ProfileDrawerSignOutMutation } from './__generated__/ProfileDrawerSignOutMutation.graphql';\nimport { ProfileDrawerUpdateAvatarMutation } from './__generated__/ProfileDrawerUpdateAvatarMutation.graphql';\n\nexport interface ProfileDrawerProps extends DrawerProps {\n /**\n * Additional actions placed under the avatar.\n * @default undefined\n */\n actions?: React.ReactNode;\n}\n\nconst StyledDrawer = styled(Drawer)`\n display: flex;\n flex-direction: column;\n padding: 2em 1em;\n`;\n\nconst AvatarContainer = styled.div`\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n`;\n\nconst UserContent = styled.div`\n margin-top: 1em;\n`;\n\nconst FullName = styled.div`\n font-size: ${(p) => p.theme.sizes.large}em;\n font-weight: 500;\n text-align: center;\n line-height: 1.2;\n`;\n\nconst Email = styled.div`\n color: ${(p) => clr(p.theme.inputColorPlaceholder)};\n margin-top: 0.2em;\n text-align: center;\n`;\n\nconst ActionsContainer = styled.div`\n margin-top: 1.5em;\n`;\n\nconst Footer = styled.div`\n display: flex;\n justify-content: center;\n margin-top: auto;\n padding-top: 1.5em;\n`;\n\nconst HiddenInput = styled.input`\n display: none;\n`;\n\nconst profileDrawerUpdateAvatarMutation = graphql`\n mutation ProfileDrawerUpdateAvatarMutation($input: UpdateAvatarInput!) {\n updateAvatar(input: $input) {\n id\n avatar\n }\n }\n`;\n\nconst DeleteAvatarButton: React.FC = () => {\n const { t } = useTranslation('profile');\n\n const [commit, loading] = useMutation<ProfileDrawerUpdateAvatarMutation>(\n profileDrawerUpdateAvatarMutation\n );\n\n const handler = useCallback(() => {\n commit({\n variables: {\n input: { avatar: null },\n },\n onError: (error) => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n message.error((error as any).source?.errors?.[0]?.message);\n },\n onCompleted: () => {\n message.success(t('profile:updated'));\n },\n });\n }, [commit, t]);\n\n return (\n <ProfileButton loading={loading} onClick={handler}>\n {t('profile:deleteAvatar')}\n </ProfileButton>\n );\n};\n\ninterface UpdateAvatarButtonProps {\n hasAvatar: boolean;\n}\n\nconst UpdateAvatarButton: React.FC<UpdateAvatarButtonProps> = ({\n hasAvatar,\n}) => {\n const { t } = useTranslation('profile');\n const fileInputRef = useRef<HTMLInputElement>(null);\n\n const [commit, loading] = useMutation<ProfileDrawerUpdateAvatarMutation>(\n profileDrawerUpdateAvatarMutation\n );\n\n const handler = useCallback(\n (e) => {\n const target = e.target as HTMLInputElement | null;\n if (!target) return;\n\n const { files } = target;\n if (!files) return;\n\n const file = files[0];\n\n commit({\n variables: {\n input: {},\n },\n uploadables: { avatar: file },\n onError: (error) => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n message.error((error as any).source?.errors?.[0]?.message);\n },\n onCompleted: () => {\n message.success(t('profile:updated'));\n },\n });\n },\n [commit, t]\n );\n\n return (\n <>\n <ProfileButton\n loading={loading}\n onClick={() => {\n if (!fileInputRef.current) return;\n fileInputRef.current.value = '';\n fileInputRef.current.click();\n }}\n >\n {t(`profile:${hasAvatar ? 'changeAvatar' : 'setAvatar'}`)}\n </ProfileButton>\n\n <HiddenInput\n type='file'\n accept='image/jpeg,image/png,image/webp'\n onChange={handler}\n ref={fileInputRef}\n />\n </>\n );\n};\n\ninterface UpdateNameButtonProps {\n hasName: boolean;\n}\n\nconst UpdateNameButton: React.FC<UpdateNameButtonProps> = ({ hasName }) => {\n const { t } = useTranslation('profile');\n const [modalVisibility, setModalVisibility] = useState(false);\n\n return (\n <>\n <ProfileButton onClick={() => setModalVisibility(true)}>\n {t(`profile:${hasName ? 'changeName' : 'setName'}`)}\n </ProfileButton>\n\n <ProfileUpdateNameModal\n visibility={modalVisibility}\n onClose={() => setModalVisibility(false)}\n />\n </>\n );\n};\n\nconst ChangePasswordButton: React.FC = () => {\n const { t } = useTranslation('profile');\n const [modalVisibility, setModalVisibility] = useState(false);\n\n return (\n <>\n <ProfileButton onClick={() => setModalVisibility(true)}>\n {t('profile:changePassword')}\n </ProfileButton>\n\n <ProfileUpdatePasswordModal\n visibility={modalVisibility}\n onClose={() => setModalVisibility(false)}\n />\n </>\n );\n};\n\nconst SignOutButton: React.FC = () => {\n const { t } = useTranslation('profile');\n\n const [commit, loading] = useMutation<ProfileDrawerSignOutMutation>(graphql`\n mutation ProfileDrawerSignOutMutation {\n signOut {\n ok\n }\n }\n `);\n\n const handler = useCallback(() => {\n commit({\n variables: {},\n onError: (error) => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n message.error((error as any).source?.errors?.[0]?.message);\n },\n onCompleted: () => {\n window.location.href = '/auth/';\n },\n });\n }, [commit]);\n\n return (\n <ProfileButton danger loading={loading} onClick={handler}>\n {t('profile:signOut')}\n </ProfileButton>\n );\n};\n\nconst ProfileDrawer: React.FC<ProfileDrawerProps> = ({\n actions,\n children,\n ...rest\n}) => {\n const { email, firstName, lastName, avatar } = useProfile();\n\n const fullName = useMemo(\n () => [firstName, lastName].filter((i) => i).join(' '),\n [firstName, lastName]\n );\n\n return (\n <StyledDrawer placement='right' width='15em' {...rest}>\n <AvatarContainer>\n <UserAvatar size='10em' />\n <UserContent>\n {fullName && <FullName>{fullName}</FullName>}\n <Email>{email}</Email>\n </UserContent>\n </AvatarContainer>\n\n <ActionsContainer>\n {avatar && <DeleteAvatarButton />}\n\n <UpdateAvatarButton hasAvatar={!!avatar} />\n <UpdateNameButton hasName={!!fullName} />\n <ChangePasswordButton />\n\n {actions}\n\n <SignOutButton />\n\n {children}\n </ActionsContainer>\n\n <Footer>\n <ThemeSwitcher />\n </Footer>\n </StyledDrawer>\n );\n};\n\nexport default ProfileDrawer;\n"],"file":"ProfileDrawer.js"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var _ProfileUpdateNameModalMutation;
|
|
2
2
|
|
|
3
|
-
import React, { useCallback, useEffect, useState } from 'react';
|
|
3
|
+
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
4
4
|
import { message, Modal } from '@os-design/core';
|
|
5
5
|
import { useTranslation } from 'react-i18next';
|
|
6
6
|
import { handleFormErrors, FormContext } from '@os-team/form-utils';
|
|
@@ -54,6 +54,14 @@ const ProfileUpdateNameModal = ({
|
|
|
54
54
|
}
|
|
55
55
|
});
|
|
56
56
|
}, [commit, data, onClose, t]);
|
|
57
|
+
const formContext = useMemo(() => ({
|
|
58
|
+
data,
|
|
59
|
+
setData,
|
|
60
|
+
fieldErrors,
|
|
61
|
+
setFieldErrors,
|
|
62
|
+
formError,
|
|
63
|
+
setFormError
|
|
64
|
+
}), [data, fieldErrors, formError]);
|
|
57
65
|
return /*#__PURE__*/React.createElement(Modal, {
|
|
58
66
|
title: t('profile:updateNameModal.title'),
|
|
59
67
|
visible: visibility,
|
|
@@ -62,14 +70,7 @@ const ProfileUpdateNameModal = ({
|
|
|
62
70
|
onOk: onSubmit,
|
|
63
71
|
onClose: onClose
|
|
64
72
|
}, /*#__PURE__*/React.createElement(FormContext.Provider, {
|
|
65
|
-
value:
|
|
66
|
-
data,
|
|
67
|
-
setData,
|
|
68
|
-
fieldErrors,
|
|
69
|
-
setFieldErrors,
|
|
70
|
-
formError,
|
|
71
|
-
setFormError
|
|
72
|
-
}
|
|
73
|
+
value: formContext
|
|
73
74
|
}, /*#__PURE__*/React.createElement(ProfileUpdateNameForm, null)));
|
|
74
75
|
};
|
|
75
76
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/lib/components/profile/ProfileUpdateNameModal.tsx"],"names":["React","useCallback","useEffect","useState","message","Modal","useTranslation","handleFormErrors","FormContext","useMutation","ProfileUpdateNameForm","useProfile","ProfileUpdateNameModal","visibility","onClose","t","firstName","lastName","fieldErrors","setFieldErrors","formError","setFormError","data","setData","commit","loading","onSubmit","variables","input","onError","error","onCompleted","undefined","success"],"mappings":";;AAAA,OAAOA,KAAP,IAAgBC,WAAhB,EAA6BC,SAA7B,EAAwCC,
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/components/profile/ProfileUpdateNameModal.tsx"],"names":["React","useCallback","useEffect","useMemo","useState","message","Modal","useTranslation","handleFormErrors","FormContext","useMutation","ProfileUpdateNameForm","useProfile","ProfileUpdateNameModal","visibility","onClose","t","firstName","lastName","fieldErrors","setFieldErrors","formError","setFormError","data","setData","commit","loading","onSubmit","variables","input","onError","error","onCompleted","undefined","success","formContext"],"mappings":";;AAAA,OAAOA,KAAP,IAAgBC,WAAh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AA,MAAM,CAAC;AACLG,MAAAA,SAAS,EAAE;AACTC,QAAAA,KAAK,EAAEN;AADE,OADN;AAILO,MAAAA,OAAO,EAAGC,KAAD,IAAW;AAClBvB,QAAAA,gBAAgB,CAACuB,KAAD,EAAQ;AAAEX,UAAAA,cAAF;AAAkBE,UAAAA;AAAlB,SAAR,CAAhB;AACD,OANI;AAOLU,MAAAA,WAAW,EAAE,MAAM;AACjBZ,QAAAA,cAAc,CAAC,EAAD,CAAd;AACAE,QAAAA,YAAY,CAACW,SAAD,CAAZ;AACA5B,QAAAA,OAAO,CAAC6B,OAAR,CAAgBlB,CAAC,CAAC,iBAAD,CAAjB;AACAD,QAAAA,OAAO;AACR;AAZI,KAAD,CAAN;AAcD,GAf2B,EAezB,CAACU,MAAD,EAASF,IAAT,EAAeR,OAAf,EAAwBC,CAAxB,CAfyB,CAA5B;AAiBA,QAAMmB,WAAW,GAAGhC,OAAO,CACzB,OAAO;AACLoB,IAAAA,IADK;AAELC,IAAAA,OAFK;AAGLL,IAAAA,WAHK;AAILC,IAAAA,cAJK;AAKLC,IAAAA,SALK;AAMLC,IAAAA;AANK,GAAP,CADyB,EASzB,CAACC,IAAD,EAAOJ,WAAP,EAAoBE,SAApB,CATyB,CAA3B;AAYA,sBACE,oBAAC,KAAD;AACE,IAAA,KAAK,EAAEL,CAAC,CAAC,+BAAD,CADV;AAEE,IAAA,OAAO,EAAEF,UAFX;AAGE,IAAA,MAAM,EAAEE,CAAC,CAAC,gBAAD,CAHX;AAIE,IAAA,SAAS,EAAEU,OAJb;AAKE,IAAA,IAAI,EAAEC,QALR;AAME,IAAA,OAAO,EAAEZ;AANX,kBAQE,oBAAC,WAAD,CAAa,QAAb;AAAsB,IAAA,KAAK,EAAEoB;AAA7B,kBACE,oBAAC,qBAAD,OADF,CARF,CADF;AAcD,CA9ED;;AAgFA,eAAetB,sBAAf","sourcesContent":["import React, { useCallback, useEffect, useMemo, useState } from 'react';\nimport { message, Modal } from '@os-design/core';\nimport { useTranslation } from 'react-i18next';\nimport { Constraint, handleFormErrors, FormContext } from '@os-team/form-utils';\nimport { graphql } from 'babel-plugin-relay/macro';\nimport { useMutation } from 'react-relay/hooks';\nimport ProfileUpdateNameForm, {\n ProfileUpdateNameFormData,\n} from './ProfileUpdateNameForm';\nimport { useProfile } from './ProfileContext';\nimport { ProfileUpdateNameModalMutation } from './__generated__/ProfileUpdateNameModalMutation.graphql';\n\ninterface ProfileUpdateNameModalProps {\n visibility: boolean;\n onClose: () => void;\n}\n\nconst ProfileUpdateNameModal: React.FC<ProfileUpdateNameModalProps> = ({\n visibility,\n onClose,\n}) => {\n const { t } = useTranslation('profile');\n const { firstName, lastName } = useProfile();\n\n const [fieldErrors, setFieldErrors] = useState<Record<string, Constraint>>(\n {}\n );\n const [formError, setFormError] = useState<string | undefined>();\n const [data, setData] = useState<ProfileUpdateNameFormData>({\n firstName: firstName || '',\n lastName: lastName || '',\n });\n\n const [commit, loading] = useMutation<ProfileUpdateNameModalMutation>(graphql`\n mutation ProfileUpdateNameModalMutation($input: UpdateProfileInput!) {\n updateProfile(input: $input) {\n firstName\n lastName\n }\n }\n `);\n\n // Reset the data if the modal is visible\n useEffect(() => {\n if (visibility) {\n setData({\n firstName: firstName || '',\n lastName: lastName || '',\n });\n }\n }, [firstName, lastName, visibility]);\n\n const onSubmit = useCallback(() => {\n commit({\n variables: {\n input: data,\n },\n onError: (error) => {\n handleFormErrors(error, { setFieldErrors, setFormError });\n },\n onCompleted: () => {\n setFieldErrors({});\n setFormError(undefined);\n message.success(t('profile:updated'));\n onClose();\n },\n });\n }, [commit, data, onClose, t]);\n\n const formContext = useMemo(\n () => ({\n data,\n setData,\n fieldErrors,\n setFieldErrors,\n formError,\n setFormError,\n }),\n [data, fieldErrors, formError]\n );\n\n return (\n <Modal\n title={t('profile:updateNameModal.title')}\n visible={visibility}\n okText={t('profile:update')}\n okLoading={loading}\n onOk={onSubmit}\n onClose={onClose}\n >\n <FormContext.Provider value={formContext}>\n <ProfileUpdateNameForm />\n </FormContext.Provider>\n </Modal>\n );\n};\n\nexport default ProfileUpdateNameModal;\n"],"file":"ProfileUpdateNameModal.js"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var _ProfileUpdatePasswordModalMutation;
|
|
2
2
|
|
|
3
|
-
import React, { useCallback, useEffect, useState } from 'react';
|
|
3
|
+
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
4
4
|
import { message, Modal } from '@os-design/core';
|
|
5
5
|
import { useMutation } from 'react-relay/hooks';
|
|
6
6
|
import { useTranslation } from 'react-i18next';
|
|
@@ -49,6 +49,14 @@ const ProfileUpdatePasswordModal = ({
|
|
|
49
49
|
}
|
|
50
50
|
});
|
|
51
51
|
}, [commit, data, onClose, t]);
|
|
52
|
+
const formContext = useMemo(() => ({
|
|
53
|
+
data,
|
|
54
|
+
setData,
|
|
55
|
+
fieldErrors,
|
|
56
|
+
setFieldErrors,
|
|
57
|
+
formError,
|
|
58
|
+
setFormError
|
|
59
|
+
}), [data, fieldErrors, formError]);
|
|
52
60
|
return /*#__PURE__*/React.createElement(Modal, {
|
|
53
61
|
title: t('profile:updatePasswordModal.title'),
|
|
54
62
|
visible: visibility,
|
|
@@ -57,14 +65,7 @@ const ProfileUpdatePasswordModal = ({
|
|
|
57
65
|
onOk: onSubmit,
|
|
58
66
|
onClose: onClose
|
|
59
67
|
}, /*#__PURE__*/React.createElement(FormContext.Provider, {
|
|
60
|
-
value:
|
|
61
|
-
data,
|
|
62
|
-
setData,
|
|
63
|
-
fieldErrors,
|
|
64
|
-
setFieldErrors,
|
|
65
|
-
formError,
|
|
66
|
-
setFormError
|
|
67
|
-
}
|
|
68
|
+
value: formContext
|
|
68
69
|
}, /*#__PURE__*/React.createElement(ProfileUpdatePasswordForm, null)));
|
|
69
70
|
};
|
|
70
71
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/lib/components/profile/ProfileUpdatePasswordModal.tsx"],"names":["React","useCallback","useEffect","useState","message","Modal","useMutation","useTranslation","handleFormErrors","FormContext","ProfileUpdatePasswordForm","ProfileUpdatePasswordModal","visibility","onClose","t","fieldErrors","setFieldErrors","formError","setFormError","data","setData","currentPassword","password","commit","loading","onSubmit","variables","input","onError","error","onCompleted","undefined","success"],"mappings":";;AAAA,OAAOA,KAAP,IAAgBC,WAAhB,EAA6BC,SAA7B,EAAwCC,
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/components/profile/ProfileUpdatePasswordModal.tsx"],"names":["React","useCallback","useEffect","useMemo","useState","message","Modal","useMutation","useTranslation","handleFormErrors","FormContext","ProfileUpdatePasswordForm","ProfileUpdatePasswordModal","visibility","onClose","t","fieldErrors","setFieldErrors","formError","setFormError","data","setData","currentPassword","password","commit","loading","onSubmit","variables","input","onError","error","onCompleted","undefined","success","formContext"],"mappings":";;AAAA,OAAOA,KAAP,IAAgBC,WAAhB,EAA6BC,SAA7B,EAAwCC,OAAxC,EAAiDC,QAAjD,QAAiE,OAAjE;AACA,SAASC,OAAT,EAAkBC,KAAlB,QAA+B,iBAA/B;AAEA,SAASC,WAAT,QAA4B,mBAA5B;AACA,SAASC,cAAT,QAA+B,eAA/B;AACA,SAAqBC,gBAArB,EAAuCC,WAAvC,QAA0D,qBAA1D;AACA,OAAOC,yBAAP,MAEO,6BAFP;;AAUA,MAAMC,0BAAqE,GAAG,CAAC;AAC7EC,EAAAA,UAD6E;AAE7EC,EAAAA;AAF6E,CAAD,KAGxE;AACJ,QAAM;AAAEC,IAAAA;AAAF,MAAQP,cAAc,CAAC,SAAD,CAA5B;AAEA,QAAM,CAACQ,WAAD,EAAcC,cAAd,IAAgCb,QAAQ,CAC5C,EAD4C,CAA9C;AAGA,QAAM,CAACc,SAAD,EAAYC,YAAZ,IAA4Bf,QAAQ,EAA1C;AACA,QAAM,CAACgB,IAAD,EAAOC,OAAP,IAAkBjB,QAAQ,CAAgC;AAC9DkB,IAAAA,eAAe,EAAE,EAD6C;AAE9DC,IAAAA,QAAQ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EF,UAFX;AAGE,IAAA,MAAM,EAAEE,CAAC,CAAC,oCAAD,CAHX;AAIE,IAAA,SAAS,EAAEU,OAJb;AAKE,IAAA,IAAI,EAAEC,QALR;AAME,IAAA,OAAO,EAAEZ;AANX,kBAQE,oBAAC,WAAD,CAAa,QAAb;AAAsB,IAAA,KAAK,EAAEoB;AAA7B,kBACE,oBAAC,yBAAD,OADF,CARF,CADF;AAcD,CA/ED;;AAiFA,eAAetB,0BAAf","sourcesContent":["import React, { useCallback, useEffect, useMemo, useState } from 'react';\nimport { message, Modal } from '@os-design/core';\nimport { graphql } from 'babel-plugin-relay/macro';\nimport { useMutation } from 'react-relay/hooks';\nimport { useTranslation } from 'react-i18next';\nimport { Constraint, handleFormErrors, FormContext } from '@os-team/form-utils';\nimport ProfileUpdatePasswordForm, {\n ProfileUpdatePasswordFormData,\n} from './ProfileUpdatePasswordForm';\nimport { ProfileUpdatePasswordModalMutation } from './__generated__/ProfileUpdatePasswordModalMutation.graphql';\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 [fieldErrors, setFieldErrors] = useState<Record<string, Constraint>>(\n {}\n );\n const [formError, setFormError] = useState<string | undefined>();\n const [data, setData] = useState<ProfileUpdatePasswordFormData>({\n currentPassword: '',\n password: '',\n });\n\n const [commit, loading] =\n useMutation<ProfileUpdatePasswordModalMutation>(graphql`\n mutation ProfileUpdatePasswordModalMutation(\n $input: UpdatePasswordInput!\n ) {\n updatePassword(input: $input) {\n id\n }\n }\n `);\n\n // Reset the data if the modal is visible\n useEffect(() => {\n if (visibility) {\n setData({\n currentPassword: '',\n password: '',\n });\n }\n }, [visibility]);\n\n const onSubmit = useCallback(() => {\n commit({\n variables: {\n input: data,\n },\n onError: (error) => {\n handleFormErrors(error, { setFieldErrors, setFormError });\n },\n onCompleted: () => {\n setFieldErrors({});\n setFormError(undefined);\n message.success(t('profile:updatePasswordModal.success'));\n onClose();\n },\n });\n }, [commit, data, onClose, t]);\n\n const formContext = useMemo(\n () => ({\n data,\n setData,\n fieldErrors,\n setFieldErrors,\n formError,\n setFormError,\n }),\n [data, fieldErrors, formError]\n );\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 <FormContext.Provider value={formContext}>\n <ProfileUpdatePasswordForm />\n </FormContext.Provider>\n </Modal>\n );\n};\n\nexport default ProfileUpdatePasswordModal;\n"],"file":"ProfileUpdatePasswordModal.js"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var _ProtectedWrapperQuery;
|
|
2
2
|
|
|
3
|
-
import React from 'react';
|
|
3
|
+
import React, { useMemo } from 'react';
|
|
4
4
|
import { useLazyLoadQuery } from 'react-relay/hooks';
|
|
5
5
|
import { ErrorBoundary } from '@os-design/utils';
|
|
6
6
|
import ProfileConfigContext from './ProfileConfigContext';
|
|
@@ -9,40 +9,39 @@ import ProfileContext from './ProfileContext';
|
|
|
9
9
|
const ProtectedWrapperLoader = ({
|
|
10
10
|
children
|
|
11
11
|
}) => {
|
|
12
|
-
const
|
|
12
|
+
const {
|
|
13
|
+
profile
|
|
14
|
+
} = 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), {}, {
|
|
13
15
|
fetchPolicy: 'store-or-network'
|
|
14
16
|
});
|
|
15
|
-
const {
|
|
16
|
-
id,
|
|
17
|
-
email,
|
|
18
|
-
firstName,
|
|
19
|
-
lastName,
|
|
20
|
-
avatar
|
|
21
|
-
}
|
|
17
|
+
const profileContext = useMemo(() => ({
|
|
18
|
+
id: profile.id,
|
|
19
|
+
email: profile.email,
|
|
20
|
+
firstName: profile.firstName || undefined,
|
|
21
|
+
lastName: profile.lastName || undefined,
|
|
22
|
+
avatar: profile.avatar || undefined
|
|
23
|
+
}), [profile.avatar, profile.email, profile.firstName, profile.id, profile.lastName]);
|
|
22
24
|
return /*#__PURE__*/React.createElement(ProfileContext.Provider, {
|
|
23
|
-
value:
|
|
24
|
-
id,
|
|
25
|
-
email,
|
|
26
|
-
firstName: firstName || undefined,
|
|
27
|
-
lastName: lastName || undefined,
|
|
28
|
-
avatar: avatar || undefined
|
|
29
|
-
}
|
|
25
|
+
value: profileContext
|
|
30
26
|
}, children);
|
|
31
27
|
};
|
|
32
28
|
|
|
33
29
|
const ProtectedWrapper = ({
|
|
34
30
|
bucketId,
|
|
35
31
|
children
|
|
36
|
-
}) =>
|
|
37
|
-
|
|
32
|
+
}) => {
|
|
33
|
+
const profileConfigContext = useMemo(() => ({
|
|
38
34
|
bucketId
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
35
|
+
}), [bucketId]);
|
|
36
|
+
return /*#__PURE__*/React.createElement(ProfileConfigContext.Provider, {
|
|
37
|
+
value: profileConfigContext
|
|
38
|
+
}, /*#__PURE__*/React.createElement(ErrorBoundary, {
|
|
39
|
+
fallback: () => {
|
|
40
|
+
window.location.href = '/auth/';
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
}, /*#__PURE__*/React.createElement(ProtectedWrapperLoader, null, children)));
|
|
44
|
+
};
|
|
46
45
|
|
|
47
46
|
export default ProtectedWrapper;
|
|
48
47
|
//# sourceMappingURL=ProtectedWrapper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/lib/components/profile/ProtectedWrapper.tsx"],"names":["React","useLazyLoadQuery","ErrorBoundary","ProfileConfigContext","ProfileContext","ProtectedWrapperLoader","children","
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/components/profile/ProtectedWrapper.tsx"],"names":["React","useMemo","useLazyLoadQuery","ErrorBoundary","ProfileConfigContext","ProfileContext","ProtectedWrapperLoader","children","profile","fetchPolicy","profileContext","id","email","firstName","undefined","lastName","avatar","ProtectedWrapper","bucketId","profileConfigContext","window","location","href"],"mappings":";;AAAA,OAAOA,KAAP,IAAgBC,OAAhB,QAA+B,OAA/B;AAEA,SAASC,gBAAT,QAAiC,mBAAjC;AACA,SAASC,aAAT,QAA8B,kBAA9B;AACA,OAAOC,oBAAP,MAAiC,wBAAjC;AACA,OAAOC,cAAP,MAA2B,kBAA3B;;AAGA,MAAMC,sBAAgC,GAAG,CAAC;AAAEC,EAAAA;AAAF,CAAD,KAAkB;AACzD,QAAM;AAAEC,IAAAA;AAAF,MAAcN,gBAAgB,sbAYlC,EAZkC,EAalC;AAAEO,IAAAA,WAAW,EAAE;AAAf,GAbkC,CAApC;AAgBA,QAAMC,cAAc,GAAGT,OAAO,CAC5B,OAAO;AACLU,IAAAA,EAAE,EAAEH,OAAO,CAACG,EADP;AAELC,IAAAA,KAAK,EAAEJ,OAAO,CAACI,KAFV;AAGLC,IAAAA,SAAS,EAAEL,OAAO,CAACK,SAAR,IAAqBC,SAH3B;AAILC,IAAAA,QAAQ,EAAEP,OAAO,CAACO,QAAR,IAAoBD,SAJzB;AAKLE,IAAAA,MAAM,EAAER,OAAO,CAACQ,MAAR,IAAkBF;AALrB,GAAP,CAD4B,EAQ5B,CACEN,OAAO,CAACQ,MADV,EAEER,OAAO,CAACI,KAFV,EAGEJ,OAAO,CAACK,SAHV,EAIEL,OAAO,CAACG,EAJV,EAKEH,OAAO,CAACO,QALV,CAR4B,CAA9B;AAiBA,sBACE,oBAAC,cAAD,CAAgB,QAAhB;AAAyB,IAAA,KAAK,EAAEL;AAAhC,KACGH,QADH,CADF;AAKD,CAvCD;;AA6CA,MAAMU,gBAAiD,GAAG,CAAC;AACzDC,EAAAA,QADyD;AAEzDX,EAAAA;AAFyD,CAAD,KAGpD;AACJ,QAAMY,oBAAoB,GAAGlB,OAAO,CAAC,OAAO;AAAEiB,IAAAA;AAAF,GAAP,CAAD,EAAuB,CAACA,QAAD,CAAvB,CAApC;AAEA,sBACE,oBAAC,oBAAD,CAAsB,QAAtB;AAA+B,IAAA,KAAK,EAAEC;AAAtC,kBACE,oBAAC,aAAD;AACE,IAAA,QAAQ,EAAE,MAAM;AACdC,MAAAA,MAAM,CAACC,QAAP,CAAgBC,IAAhB,GAAuB,QAAvB;AACA,aAAO,IAAP;AACD;AAJH,kBAME,oBAAC,sBAAD,QAAyBf,QAAzB,CANF,CADF,CADF;AAYD,CAlBD;;AAoBA,eAAeU,gBAAf","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\nconst ProtectedWrapperLoader: React.FC = ({ children }) => {\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}\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"],"file":"ProtectedWrapper.js"}
|
|
@@ -1,15 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @generated SignedSource<<51909761cb1c71a922e242d469a3408c>>
|
|
3
|
+
* @lightSyntaxTransform
|
|
4
|
+
* @nogrep
|
|
5
|
+
*/
|
|
6
|
+
|
|
1
7
|
/* tslint:disable */
|
|
2
8
|
|
|
3
9
|
/* eslint-disable */
|
|
4
10
|
// @ts-nocheck
|
|
5
|
-
|
|
6
|
-
/*
|
|
7
|
-
mutation ProfileDrawerSignOutMutation {
|
|
8
|
-
signOut {
|
|
9
|
-
ok
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
*/
|
|
13
11
|
const node = function () {
|
|
14
12
|
var v0 = [{
|
|
15
13
|
"alias": null,
|
|
@@ -59,6 +57,6 @@ const node = function () {
|
|
|
59
57
|
};
|
|
60
58
|
}();
|
|
61
59
|
|
|
62
|
-
node.hash =
|
|
60
|
+
node.hash = "8510e6462e8f7839ce100254080ba293";
|
|
63
61
|
export default node;
|
|
64
62
|
//# sourceMappingURL=ProfileDrawerSignOutMutation.graphql.js.map
|
package/dist/esm/components/profile/__generated__/ProfileDrawerSignOutMutation.graphql.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/lib/components/profile/__generated__/ProfileDrawerSignOutMutation.graphql.ts"],"names":["node","v0","hash"],"mappings":"AAAA
|
|
1
|
+
{"version":3,"sources":["../../../../../src/lib/components/profile/__generated__/ProfileDrawerSignOutMutation.graphql.ts"],"names":["node","v0","hash"],"mappings":"AAAA;AACA;AACA;AACA;AACA;;AAEA;;AACA;AACA;AAcA,MAAMA,IAAqB,GAAI,YAAU;AACzC,MAAIC,EAAE,GAAG,CACP;AACE,aAAS,IADX;AAEE,YAAQ,IAFV;AAGE,oBAAgB,eAHlB;AAIE,YAAQ,aAJV;AAKE,YAAQ,SALV;AAME,cAAU,KANZ;AAOE,kBAAc,CACZ;AACE,eAAS,IADX;AAEE,cAAQ,IAFV;AAGE,cAAQ,aAHV;AAIE,cAAQ,IAJV;AAKE,oBAAc;AALhB,KADY,CAPhB;AAgBE,kBAAc;AAhBhB,GADO,CAAT;AAoBA,SAAO;AACL,gBAAY;AACV,6BAAuB,EADb;AAEV,cAAQ,UAFE;AAGV,kBAAY,IAHF;AAIV,cAAQ,8BAJE;AAKV,oBAAeA;AAAE;AALP;AAMV,cAAQ,UANE;AAOV,qBAAe;AAPL,KADP;AAUL,YAAQ,SAVH;AAWL,iBAAa;AACX,6BAAuB,EADZ;AAEX,cAAQ,WAFG;AAGX,cAAQ,8BAHG;AAIX,oBAAeA;AAAE;;AAJN,KAXR;AAiBL,cAAU;AACR,iBAAW,kCADH;AAER,YAAM,IAFE;AAGR,kBAAY,EAHJ;AAIR,cAAQ,8BAJA;AAKR,uBAAiB,UALT;AAMR,cAAQ;AANA;AAjBL,GAAP;AA0BC,CA/C6B,EAA9B;;AAiDCD,IAAD,CAAcE,IAAd,GAAqB,kCAArB;AAEA,eAAeF,IAAf","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"],"file":"ProfileDrawerSignOutMutation.graphql.js"}
|
package/dist/esm/components/profile/__generated__/ProfileDrawerUpdateAvatarMutation.graphql.js
CHANGED
|
@@ -1,18 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @generated SignedSource<<55ec946240339a8ef48835cf36146b25>>
|
|
3
|
+
* @lightSyntaxTransform
|
|
4
|
+
* @nogrep
|
|
5
|
+
*/
|
|
6
|
+
|
|
1
7
|
/* tslint:disable */
|
|
2
8
|
|
|
3
9
|
/* eslint-disable */
|
|
4
10
|
// @ts-nocheck
|
|
5
|
-
|
|
6
|
-
/*
|
|
7
|
-
mutation ProfileDrawerUpdateAvatarMutation(
|
|
8
|
-
$input: UpdateAvatarInput!
|
|
9
|
-
) {
|
|
10
|
-
updateAvatar(input: $input) {
|
|
11
|
-
id
|
|
12
|
-
avatar
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
*/
|
|
16
11
|
const node = function () {
|
|
17
12
|
var v0 = [{
|
|
18
13
|
"defaultValue": null,
|
|
@@ -81,6 +76,6 @@ const node = function () {
|
|
|
81
76
|
};
|
|
82
77
|
}();
|
|
83
78
|
|
|
84
|
-
node.hash =
|
|
79
|
+
node.hash = "c129cb1974b7cb9090d6c5df4e0f790d";
|
|
85
80
|
export default node;
|
|
86
81
|
//# sourceMappingURL=ProfileDrawerUpdateAvatarMutation.graphql.js.map
|
package/dist/esm/components/profile/__generated__/ProfileDrawerUpdateAvatarMutation.graphql.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/lib/components/profile/__generated__/ProfileDrawerUpdateAvatarMutation.graphql.ts"],"names":["node","v0","v1","hash"],"mappings":"AAAA
|
|
1
|
+
{"version":3,"sources":["../../../../../src/lib/components/profile/__generated__/ProfileDrawerUpdateAvatarMutation.graphql.ts"],"names":["node","v0","v1","hash"],"mappings":"AAAA;AACA;AACA;AACA;AACA;;AAEA;;AACA;AACA;AAoBA,MAAMA,IAAqB,GAAI,YAAU;AACzC,MAAIC,EAAE,GAAG,CACP;AACE,oBAAgB,IADlB;AAEE,YAAQ,eAFV;AAGE,YAAQ;AAHV,GADO,CAAT;AAAA,MAOAC,EAAE,GAAG,CACH;AACE,aAAS,IADX;AAEE,YAAQ,CACN;AACE,cAAQ,UADV;AAEE,cAAQ,OAFV;AAGE,sBAAgB;AAHlB,KADM,CAFV;AASE,oBAAgB,MATlB;AAUE,YAAQ,aAVV;AAWE,YAAQ,cAXV;AAYE,cAAU,KAZZ;AAaE,kBAAc,CACZ;AACE,eAAS,IADX;AAEE,cAAQ,IAFV;AAGE,cAAQ,aAHV;AAIE,cAAQ,IAJV;AAKE,oBAAc;AALhB,KADY,EAQZ;AACE,eAAS,IADX;AAEE,cAAQ,IAFV;AAGE,cAAQ,aAHV;AAIE,cAAQ,QAJV;AAKE,oBAAc;AALhB,KARY,CAbhB;AA6BE,kBAAc;AA7BhB,GADG,CAPL;AAwCA,SAAO;AACL,gBAAY;AACV,6BAAwBD;AAAE;AADhB;AAEV,cAAQ,UAFE;AAGV,kBAAY,IAHF;AAIV,cAAQ,mCAJE;AAKV,oBAAeC;AAAE;AALP;AAMV,cAAQ,UANE;AAOV,qBAAe;AAPL,KADP;AAUL,YAAQ,SAVH;AAWL,iBAAa;AACX,6BAAwBD;AAAE;AADf;AAEX,cAAQ,WAFG;AAGX,cAAQ,mCAHG;AAIX,oBAAeC;AAAE;;AAJN,KAXR;AAiBL,cAAU;AACR,iBAAW,kCADH;AAER,YAAM,IAFE;AAGR,kBAAY,EAHJ;AAIR,cAAQ,mCAJA;AAKR,uBAAiB,UALT;AAMR,cAAQ;AANA;AAjBL,GAAP;AA0BC,CAnE6B,EAA9B;;AAqECF,IAAD,CAAcG,IAAd,GAAqB,kCAArB;AAEA,eAAeH,IAAf","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"],"file":"ProfileDrawerUpdateAvatarMutation.graphql.js"}
|
|
@@ -1,19 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @generated SignedSource<<e5bc57bac6e609f80cce512a9176bef8>>
|
|
3
|
+
* @lightSyntaxTransform
|
|
4
|
+
* @nogrep
|
|
5
|
+
*/
|
|
6
|
+
|
|
1
7
|
/* tslint:disable */
|
|
2
8
|
|
|
3
9
|
/* eslint-disable */
|
|
4
10
|
// @ts-nocheck
|
|
5
|
-
|
|
6
|
-
/*
|
|
7
|
-
mutation ProfileUpdateNameModalMutation(
|
|
8
|
-
$input: UpdateProfileInput!
|
|
9
|
-
) {
|
|
10
|
-
updateProfile(input: $input) {
|
|
11
|
-
firstName
|
|
12
|
-
lastName
|
|
13
|
-
id
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
*/
|
|
17
11
|
const node = function () {
|
|
18
12
|
var v0 = [{
|
|
19
13
|
"defaultValue": null,
|
|
@@ -107,6 +101,6 @@ const node = function () {
|
|
|
107
101
|
};
|
|
108
102
|
}();
|
|
109
103
|
|
|
110
|
-
node.hash =
|
|
104
|
+
node.hash = "7264a05b6738d5417df9f1dc462486aa";
|
|
111
105
|
export default node;
|
|
112
106
|
//# sourceMappingURL=ProfileUpdateNameModalMutation.graphql.js.map
|
package/dist/esm/components/profile/__generated__/ProfileUpdateNameModalMutation.graphql.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/lib/components/profile/__generated__/ProfileUpdateNameModalMutation.graphql.ts"],"names":["node","v0","v1","v2","v3","hash"],"mappings":"AAAA
|
|
1
|
+
{"version":3,"sources":["../../../../../src/lib/components/profile/__generated__/ProfileUpdateNameModalMutation.graphql.ts"],"names":["node","v0","v1","v2","v3","hash"],"mappings":"AAAA;AACA;AACA;AACA;AACA;;AAEA;;AACA;AACA;AAqBA,MAAMA,IAAqB,GAAI,YAAU;AACzC,MAAIC,EAAE,GAAG,CACP;AACE,oBAAgB,IADlB;AAEE,YAAQ,eAFV;AAGE,YAAQ;AAHV,GADO,CAAT;AAAA,MAOAC,EAAE,GAAG,CACH;AACE,YAAQ,UADV;AAEE,YAAQ,OAFV;AAGE,oBAAgB;AAHlB,GADG,CAPL;AAAA,MAcAC,EAAE,GAAG;AACH,aAAS,IADN;AAEH,YAAQ,IAFL;AAGH,YAAQ,aAHL;AA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":["/**\n * @generated SignedSource<<e5bc57bac6e609f80cce512a9176bef8>>\n * @lightSyntaxTransform\n * @nogrep\n */\n\n/* tslint:disable */\n/* eslint-disable */\n// @ts-nocheck\n\nimport { ConcreteRequest, Mutation } from 'relay-runtime';\nexport type UpdateProfileInput = {\n firstName?: string | null;\n lastName?: string | null;\n};\nexport type ProfileUpdateNameModalMutation$variables = {\n input: UpdateProfileInput;\n};\nexport type ProfileUpdateNameModalMutation$data = {\n readonly updateProfile: {\n readonly firstName: string | null;\n readonly lastName: string | null;\n };\n};\nexport type ProfileUpdateNameModalMutation = {\n variables: ProfileUpdateNameModalMutation$variables;\n response: ProfileUpdateNameModalMutation$data;\n};\n\nconst node: ConcreteRequest = (function(){\nvar v0 = [\n {\n \"defaultValue\": null,\n \"kind\": \"LocalArgument\",\n \"name\": \"input\"\n }\n],\nv1 = [\n {\n \"kind\": \"Variable\",\n \"name\": \"input\",\n \"variableName\": \"input\"\n }\n],\nv2 = {\n \"alias\": null,\n \"args\": null,\n \"kind\": \"ScalarField\",\n \"name\": \"firstName\",\n \"storageKey\": null\n},\nv3 = {\n \"alias\": null,\n \"args\": null,\n \"kind\": \"ScalarField\",\n \"name\": \"lastName\",\n \"storageKey\": null\n};\nreturn {\n \"fragment\": {\n \"argumentDefinitions\": (v0/*: any*/),\n \"kind\": \"Fragment\",\n \"metadata\": null,\n \"name\": \"ProfileUpdateNameModalMutation\",\n \"selections\": [\n {\n \"alias\": null,\n \"args\": (v1/*: any*/),\n \"concreteType\": \"User\",\n \"kind\": \"LinkedField\",\n \"name\": \"updateProfile\",\n \"plural\": false,\n \"selections\": [\n (v2/*: any*/),\n (v3/*: any*/)\n ],\n \"storageKey\": null\n }\n ],\n \"type\": \"Mutation\",\n \"abstractKey\": null\n },\n \"kind\": \"Request\",\n \"operation\": {\n \"argumentDefinitions\": (v0/*: any*/),\n \"kind\": \"Operation\",\n \"name\": \"ProfileUpdateNameModalMutation\",\n \"selections\": [\n {\n \"alias\": null,\n \"args\": (v1/*: any*/),\n \"concreteType\": \"User\",\n \"kind\": \"LinkedField\",\n \"name\": \"updateProfile\",\n \"plural\": false,\n \"selections\": [\n (v2/*: any*/),\n (v3/*: any*/),\n {\n \"alias\": null,\n \"args\": null,\n \"kind\": \"ScalarField\",\n \"name\": \"id\",\n \"storageKey\": null\n }\n ],\n \"storageKey\": null\n }\n ]\n },\n \"params\": {\n \"cacheID\": \"f70f0aaabf917dc446c3a71cf7b4f25f\",\n \"id\": null,\n \"metadata\": {},\n \"name\": \"ProfileUpdateNameModalMutation\",\n \"operationKind\": \"mutation\",\n \"text\": \"mutation ProfileUpdateNameModalMutation(\\n $input: UpdateProfileInput!\\n) {\\n updateProfile(input: $input) {\\n firstName\\n lastName\\n id\\n }\\n}\\n\"\n }\n};\n})();\n\n(node as any).hash = \"7264a05b6738d5417df9f1dc462486aa\";\n\nexport default node;\n"],"file":"ProfileUpdateNameModalMutation.graphql.js"}
|
package/dist/esm/components/profile/__generated__/ProfileUpdatePasswordModalMutation.graphql.js
CHANGED
|
@@ -1,17 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @generated SignedSource<<e5f3e57776e8511542aafb556fc45a4f>>
|
|
3
|
+
* @lightSyntaxTransform
|
|
4
|
+
* @nogrep
|
|
5
|
+
*/
|
|
6
|
+
|
|
1
7
|
/* tslint:disable */
|
|
2
8
|
|
|
3
9
|
/* eslint-disable */
|
|
4
10
|
// @ts-nocheck
|
|
5
|
-
|
|
6
|
-
/*
|
|
7
|
-
mutation ProfileUpdatePasswordModalMutation(
|
|
8
|
-
$input: UpdatePasswordInput!
|
|
9
|
-
) {
|
|
10
|
-
updatePassword(input: $input) {
|
|
11
|
-
id
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
*/
|
|
15
11
|
const node = function () {
|
|
16
12
|
var v0 = [{
|
|
17
13
|
"defaultValue": null,
|
|
@@ -74,6 +70,6 @@ const node = function () {
|
|
|
74
70
|
};
|
|
75
71
|
}();
|
|
76
72
|
|
|
77
|
-
node.hash =
|
|
73
|
+
node.hash = "efa37ccbe82fbace709f7e3992643c05";
|
|
78
74
|
export default node;
|
|
79
75
|
//# sourceMappingURL=ProfileUpdatePasswordModalMutation.graphql.js.map
|
package/dist/esm/components/profile/__generated__/ProfileUpdatePasswordModalMutation.graphql.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/lib/components/profile/__generated__/ProfileUpdatePasswordModalMutation.graphql.ts"],"names":["node","v0","v1","hash"],"mappings":"AAAA
|
|
1
|
+
{"version":3,"sources":["../../../../../src/lib/components/profile/__generated__/ProfileUpdatePasswordModalMutation.graphql.ts"],"names":["node","v0","v1","hash"],"mappings":"AAAA;AACA;AACA;AACA;AACA;;AAEA;;AACA;AACA;AAoBA,MAAMA,IAAqB,GAAI,YAAU;AACzC,MAAIC,EAAE,GAAG,CACP;AACE,oBAAgB,IADlB;AAEE,YAAQ,eAFV;AAGE,YAAQ;AAHV,GADO,CAAT;AAAA,MAOAC,EAAE,GAAG,CACH;AACE,aAAS,IADX;AAEE,YAAQ,CACN;AACE,cAAQ,UADV;AAEE,cAAQ,OAFV;AAGE,sBAAgB;AAHlB,KADM,CAFV;AASE,oBAAgB,MATlB;AAUE,YAAQ,aAVV;AAWE,YAAQ,gBAXV;AAYE,cAAU,KAZZ;AAaE,kBAAc,CACZ;AACE,eAAS,IADX;AAEE,cAAQ,IAFV;AAGE,cAAQ,aAHV;AAIE,cAAQ,IAJV;AAKE,oBAAc;AALhB,KADY,CAbhB;AAsBE,kBAAc;AAtBhB,GADG,CAPL;AAiCA,SAAO;AACL,gBAAY;AACV,6BAAwBD;AAAE;AADhB;AAEV,cAAQ,UAFE;AAGV,kBAAY,IAHF;AAIV,cAAQ,oCAJE;AAKV,oBAAeC;AAAE;AALP;AAMV,cAAQ,UANE;AAOV,qBAAe;AAPL,KADP;AAUL,YAAQ,SAVH;AAWL,iBAAa;AACX,6BAAwBD;AAAE;AADf;AAEX,cAAQ,WAFG;AAGX,cAAQ,oCAHG;AAIX,oBAAeC;AAAE;;AAJN,KAXR;AAiBL,cAAU;AACR,iBAAW,kCADH;AAER,YAAM,IAFE;AAGR,kBAAY,EAHJ;AAIR,cAAQ,oCAJA;AAKR,uBAAiB,UALT;AAMR,cAAQ;AANA;AAjBL,GAAP;AA0BC,CA5D6B,EAA9B;;AA8DCF,IAAD,CAAcG,IAAd,GAAqB,kCAArB;AAEA,eAAeH,IAAf","sourcesContent":["/**\n * @generated SignedSource<<e5f3e57776e8511542aafb556fc45a4f>>\n * @lightSyntaxTransform\n * @nogrep\n */\n\n/* tslint:disable */\n/* eslint-disable */\n// @ts-nocheck\n\nimport { ConcreteRequest, Mutation } from 'relay-runtime';\nexport type UpdatePasswordInput = {\n password: string;\n currentPassword: string;\n};\nexport type ProfileUpdatePasswordModalMutation$variables = {\n input: UpdatePasswordInput;\n};\nexport type ProfileUpdatePasswordModalMutation$data = {\n readonly updatePassword: {\n readonly id: string;\n };\n};\nexport type ProfileUpdatePasswordModalMutation = {\n variables: ProfileUpdatePasswordModalMutation$variables;\n response: ProfileUpdatePasswordModalMutation$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\": \"updatePassword\",\n \"plural\": false,\n \"selections\": [\n {\n \"alias\": null,\n \"args\": null,\n \"kind\": \"ScalarField\",\n \"name\": \"id\",\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\": \"ProfileUpdatePasswordModalMutation\",\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\": \"ProfileUpdatePasswordModalMutation\",\n \"selections\": (v1/*: any*/)\n },\n \"params\": {\n \"cacheID\": \"64308136a7a18e3fb1ab2d16aa93add7\",\n \"id\": null,\n \"metadata\": {},\n \"name\": \"ProfileUpdatePasswordModalMutation\",\n \"operationKind\": \"mutation\",\n \"text\": \"mutation ProfileUpdatePasswordModalMutation(\\n $input: UpdatePasswordInput!\\n) {\\n updatePassword(input: $input) {\\n id\\n }\\n}\\n\"\n }\n};\n})();\n\n(node as any).hash = \"efa37ccbe82fbace709f7e3992643c05\";\n\nexport default node;\n"],"file":"ProfileUpdatePasswordModalMutation.graphql.js"}
|
|
@@ -1,19 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @generated SignedSource<<829abca3cb2e3ac7eea412c1b0ff18a5>>
|
|
3
|
+
* @lightSyntaxTransform
|
|
4
|
+
* @nogrep
|
|
5
|
+
*/
|
|
6
|
+
|
|
1
7
|
/* tslint:disable */
|
|
2
8
|
|
|
3
9
|
/* eslint-disable */
|
|
4
10
|
// @ts-nocheck
|
|
5
|
-
|
|
6
|
-
/*
|
|
7
|
-
query ProtectedWrapperQuery {
|
|
8
|
-
profile {
|
|
9
|
-
id
|
|
10
|
-
email
|
|
11
|
-
firstName
|
|
12
|
-
lastName
|
|
13
|
-
avatar
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
*/
|
|
17
11
|
const node = function () {
|
|
18
12
|
var v0 = [{
|
|
19
13
|
"alias": null,
|
|
@@ -87,6 +81,6 @@ const node = function () {
|
|
|
87
81
|
};
|
|
88
82
|
}();
|
|
89
83
|
|
|
90
|
-
node.hash =
|
|
84
|
+
node.hash = "903b234e48f53b4a44dc0b4974ebc521";
|
|
91
85
|
export default node;
|
|
92
86
|
//# sourceMappingURL=ProtectedWrapperQuery.graphql.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/lib/components/profile/__generated__/ProtectedWrapperQuery.graphql.ts"],"names":["node","v0","hash"],"mappings":"AAAA
|
|
1
|
+
{"version":3,"sources":["../../../../../src/lib/components/profile/__generated__/ProtectedWrapperQuery.graphql.ts"],"names":["node","v0","hash"],"mappings":"AAAA;AACA;AACA;AACA;AACA;;AAEA;;AACA;AACA;AAkBA,MAAMA,IAAqB,GAAI,YAAU;AACzC,MAAIC,EAAE,GAAG,CACP;AACE,aAAS,IADX;AAEE,YAAQ,IAFV;AAGE,oBAAgB,MAHlB;AAIE,YAAQ,aAJV;AAKE,YAAQ,SALV;AAME,cAAU,KANZ;AAOE,kBAAc,CACZ;AACE,eAAS,IADX;AAEE,cAAQ,IAFV;AAGE,cAAQ,aAHV;AAIE,cAAQ,IAJV;AAKE,oBAAc;AALhB,KADY,EAQZ;AACE,eAAS,IADX;AAEE,cAAQ,IAFV;AAGE,cAAQ,aAHV;AAIE,cAAQ,OAJV;AAKE,oBAAc;AALhB,KARY,EAeZ;AACE,eAAS,IADX;AAEE,cAAQ,IAFV;AAGE,cAAQ,aAHV;AAIE,cAAQ,WAJV;AAKE,oBAAc;AALhB,KAfY,EAsBZ;AACE,eAAS,IADX;AAEE,cAAQ,IAFV;AAGE,cAAQ,aAHV;AAIE,cAAQ,UAJV;AAKE,oBAAc;AALhB,KAtBY,EA6BZ;AACE,eAAS,IADX;AAEE,cAAQ,IAFV;AAGE,cAAQ,aAHV;AAIE,cAAQ,QAJV;AAKE,oBAAc;AALhB,KA7BY,CAPhB;AA4CE,kBAAc;AA5ChB,GADO,CAAT;AAgDA,SAAO;AACL,gBAAY;AACV,6BAAuB,EADb;AAEV,cAAQ,UAFE;AAGV,kBAAY,IAHF;AAIV,cAAQ,uBAJE;AAKV,oBAAeA;AAAE;AALP;AAMV,cAAQ,OANE;AAOV,qBAAe;AAPL,KADP;AAUL,YAAQ,SAVH;AAWL,iBAAa;AACX,6BAAuB,EADZ;AAEX,cAAQ,WAFG;AAGX,cAAQ,uBAHG;AAIX,oBAAeA;AAAE;;AAJN,KAXR;AAiBL,cAAU;AACR,iBAAW,kCADH;AAER,YAAM,IAFE;AAGR,kBAAY,EAHJ;AAIR,cAAQ,uBAJA;AAKR,uBAAiB,OALT;AAMR,cAAQ;AANA;AAjBL,GAAP;AA0BC,CA3E6B,EAA9B;;AA6ECD,IAAD,CAAcE,IAAd,GAAqB,kCAArB;AAEA,eAAeF,IAAf","sourcesContent":["/**\n * @generated SignedSource<<829abca3cb2e3ac7eea412c1b0ff18a5>>\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 id: string;\n readonly email: string;\n readonly firstName: string | null;\n readonly lastName: string | null;\n readonly avatar: string | null;\n };\n};\nexport type ProtectedWrapperQuery = {\n variables: ProtectedWrapperQuery$variables;\n response: ProtectedWrapperQuery$data;\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"],"file":"ProtectedWrapperQuery.graphql.js"}
|