@graphcommerce/magento-customer 10.0.0-canary.62 → 10.0.0-canary.65
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/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,7 @@ import { Button, Form, FormActions, FormRow } from '@graphcommerce/next-ui'
|
|
|
3
3
|
import { useFormGqlMutation } from '@graphcommerce/react-hook-form'
|
|
4
4
|
import { Trans } from '@lingui/react/macro'
|
|
5
5
|
import { useRouter } from 'next/router'
|
|
6
|
+
import { useEffect } from 'react'
|
|
6
7
|
import { ApolloCustomerErrorAlert } from '../ApolloCustomerError/ApolloCustomerErrorAlert'
|
|
7
8
|
import { ValidatedPasswordElement } from '../ValidatedPasswordElement/ValidatedPasswordElement'
|
|
8
9
|
import type { ResetPasswordMutation, ResetPasswordMutationVariables } from './ResetPassword.gql'
|
|
@@ -15,6 +16,8 @@ export type ResetPasswordFormProps = {
|
|
|
15
16
|
|
|
16
17
|
export function ResetPasswordForm(props: ResetPasswordFormProps) {
|
|
17
18
|
const { token, buttonProps } = props
|
|
19
|
+
const router = useRouter()
|
|
20
|
+
const emailFromUrl = router.query.email as string | undefined
|
|
18
21
|
|
|
19
22
|
const form = useFormGqlMutation<
|
|
20
23
|
ResetPasswordMutation,
|
|
@@ -26,14 +29,20 @@ export function ResetPasswordForm(props: ResetPasswordFormProps) {
|
|
|
26
29
|
...formData,
|
|
27
30
|
resetPasswordToken: token,
|
|
28
31
|
}),
|
|
32
|
+
defaultValues: {
|
|
33
|
+
email: '',
|
|
34
|
+
},
|
|
29
35
|
},
|
|
30
36
|
{ errorPolicy: 'all' },
|
|
31
37
|
)
|
|
32
38
|
|
|
33
|
-
const
|
|
34
|
-
const { handleSubmit, data, formState, error, control } = form
|
|
39
|
+
const { handleSubmit, data, formState, error, control, setValue } = form
|
|
35
40
|
const submitHandler = handleSubmit(() => {})
|
|
36
41
|
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
if (emailFromUrl) setValue('email', emailFromUrl)
|
|
44
|
+
}, [emailFromUrl, setValue])
|
|
45
|
+
|
|
37
46
|
if (formState.isSubmitSuccessful && data && !error) {
|
|
38
47
|
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
39
48
|
router.replace(`${window.location.href.split('?')[0]}?success=1`)
|
|
@@ -48,6 +57,7 @@ export function ResetPasswordForm(props: ResetPasswordFormProps) {
|
|
|
48
57
|
variant='outlined'
|
|
49
58
|
required
|
|
50
59
|
disabled={formState.isSubmitting}
|
|
60
|
+
InputProps={{ readOnly: true }}
|
|
51
61
|
/>
|
|
52
62
|
</FormRow>
|
|
53
63
|
<FormRow>
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@graphcommerce/magento-customer",
|
|
3
3
|
"homepage": "https://www.graphcommerce.org/",
|
|
4
4
|
"repository": "github:graphcommerce-org/graphcommerce",
|
|
5
|
-
"version": "10.0.0-canary.
|
|
5
|
+
"version": "10.0.0-canary.65",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"prettier": "@graphcommerce/prettier-config-pwa",
|
|
8
8
|
"eslintConfig": {
|
|
@@ -21,19 +21,19 @@
|
|
|
21
21
|
"./plugins/magentoCustomerPrivateQueryContext": "./plugins/magentoCustomerPrivateQueryContext.ts"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
|
-
"@graphcommerce/ecommerce-ui": "^10.0.0-canary.
|
|
25
|
-
"@graphcommerce/eslint-config-pwa": "^10.0.0-canary.
|
|
26
|
-
"@graphcommerce/framer-next-pages": "^10.0.0-canary.
|
|
27
|
-
"@graphcommerce/framer-utils": "^10.0.0-canary.
|
|
28
|
-
"@graphcommerce/graphql": "^10.0.0-canary.
|
|
29
|
-
"@graphcommerce/graphql-mesh": "^10.0.0-canary.
|
|
30
|
-
"@graphcommerce/image": "^10.0.0-canary.
|
|
31
|
-
"@graphcommerce/magento-graphql": "^10.0.0-canary.
|
|
32
|
-
"@graphcommerce/magento-store": "^10.0.0-canary.
|
|
33
|
-
"@graphcommerce/next-ui": "^10.0.0-canary.
|
|
34
|
-
"@graphcommerce/prettier-config-pwa": "^10.0.0-canary.
|
|
35
|
-
"@graphcommerce/react-hook-form": "^10.0.0-canary.
|
|
36
|
-
"@graphcommerce/typescript-config-pwa": "^10.0.0-canary.
|
|
24
|
+
"@graphcommerce/ecommerce-ui": "^10.0.0-canary.65",
|
|
25
|
+
"@graphcommerce/eslint-config-pwa": "^10.0.0-canary.65",
|
|
26
|
+
"@graphcommerce/framer-next-pages": "^10.0.0-canary.65",
|
|
27
|
+
"@graphcommerce/framer-utils": "^10.0.0-canary.65",
|
|
28
|
+
"@graphcommerce/graphql": "^10.0.0-canary.65",
|
|
29
|
+
"@graphcommerce/graphql-mesh": "^10.0.0-canary.65",
|
|
30
|
+
"@graphcommerce/image": "^10.0.0-canary.65",
|
|
31
|
+
"@graphcommerce/magento-graphql": "^10.0.0-canary.65",
|
|
32
|
+
"@graphcommerce/magento-store": "^10.0.0-canary.65",
|
|
33
|
+
"@graphcommerce/next-ui": "^10.0.0-canary.65",
|
|
34
|
+
"@graphcommerce/prettier-config-pwa": "^10.0.0-canary.65",
|
|
35
|
+
"@graphcommerce/react-hook-form": "^10.0.0-canary.65",
|
|
36
|
+
"@graphcommerce/typescript-config-pwa": "^10.0.0-canary.65",
|
|
37
37
|
"@lingui/core": "^5",
|
|
38
38
|
"@lingui/macro": "^5",
|
|
39
39
|
"@lingui/react": "^5",
|