@graphcommerce/magento-customer 6.2.0-canary.35 → 6.2.0-canary.37
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 +8 -0
- package/components/SignUpForm/SignUpFormInline.tsx +24 -16
- package/package.json +13 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 6.2.0-canary.37
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#1952](https://github.com/graphcommerce-org/graphcommerce/pull/1952) [`f1fe4f598`](https://github.com/graphcommerce-org/graphcommerce/commit/f1fe4f5986cee1f7c8313152e43691ed939c8f21) - enable password fields when there is an error and user input correction is required. ([@carlocarels90](https://github.com/carlocarels90))
|
|
8
|
+
|
|
9
|
+
## 6.2.0-canary.36
|
|
10
|
+
|
|
3
11
|
## 6.2.0-canary.35
|
|
4
12
|
|
|
5
13
|
## 6.2.0-canary.34
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ApolloErrorAlert } from '@graphcommerce/ecommerce-ui'
|
|
1
2
|
import { useQuery } from '@graphcommerce/graphql'
|
|
2
3
|
import { StoreConfigDocument } from '@graphcommerce/magento-store'
|
|
3
4
|
import { Button, extendableComponent, Form, FormRow } from '@graphcommerce/next-ui'
|
|
@@ -37,19 +38,26 @@ export function SignUpFormInline({
|
|
|
37
38
|
const form = useFormGqlMutation<
|
|
38
39
|
SignUpMutation,
|
|
39
40
|
SignUpMutationVariables & { confirmPassword?: string }
|
|
40
|
-
>(
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
41
|
+
>(
|
|
42
|
+
Mutation,
|
|
43
|
+
{
|
|
44
|
+
// todo(paales): This causes dirty data to be send to the backend.
|
|
45
|
+
defaultValues: {
|
|
46
|
+
email,
|
|
47
|
+
prefix: '-',
|
|
48
|
+
firstname: firstname ?? '-',
|
|
49
|
+
lastname: lastname ?? '-',
|
|
50
|
+
},
|
|
51
|
+
onBeforeSubmit: (values) => ({ ...values, email }),
|
|
52
|
+
onComplete: (result) => {
|
|
53
|
+
if (!result.errors) onSubmitted()
|
|
54
|
+
},
|
|
47
55
|
},
|
|
48
|
-
|
|
49
|
-
|
|
56
|
+
{ errorPolicy: 'all' },
|
|
57
|
+
)
|
|
50
58
|
|
|
51
|
-
const { muiRegister, watch, handleSubmit, required, formState
|
|
52
|
-
const submitHandler = handleSubmit(
|
|
59
|
+
const { muiRegister, watch, handleSubmit, required, formState } = form
|
|
60
|
+
const submitHandler = handleSubmit(() => {})
|
|
53
61
|
const watchPassword = watch('password')
|
|
54
62
|
|
|
55
63
|
const minPasswordLength = Number(
|
|
@@ -66,11 +74,11 @@ export function SignUpFormInline({
|
|
|
66
74
|
|
|
67
75
|
return (
|
|
68
76
|
<Form onSubmit={submitHandler} noValidate className={classes.form} sx={{ padding: 0 }}>
|
|
69
|
-
<FormRow
|
|
77
|
+
<FormRow className={classes.row} sx={{ padding: 0 }}>
|
|
70
78
|
<TextField
|
|
71
79
|
variant='outlined'
|
|
72
80
|
type='password'
|
|
73
|
-
error={!!formState.errors.password || !!error
|
|
81
|
+
error={!!formState.errors.password || !!form.error}
|
|
74
82
|
label={<Trans id='Password' />}
|
|
75
83
|
autoFocus
|
|
76
84
|
autoComplete='new-password'
|
|
@@ -83,13 +91,12 @@ export function SignUpFormInline({
|
|
|
83
91
|
message: i18n._(/* i18n */ 'Password must have at least 8 characters'),
|
|
84
92
|
},
|
|
85
93
|
})}
|
|
86
|
-
helperText={error?.message}
|
|
87
94
|
disabled={formState.isSubmitting}
|
|
88
95
|
/>
|
|
89
96
|
<TextField
|
|
90
97
|
variant='outlined'
|
|
91
98
|
type='password'
|
|
92
|
-
error={!!formState.errors.confirmPassword || !!error
|
|
99
|
+
error={!!formState.errors.confirmPassword || !!form.error}
|
|
93
100
|
label={<Trans id='Confirm password' />}
|
|
94
101
|
autoComplete='new-password'
|
|
95
102
|
required
|
|
@@ -102,7 +109,7 @@ export function SignUpFormInline({
|
|
|
102
109
|
/>
|
|
103
110
|
</FormRow>
|
|
104
111
|
|
|
105
|
-
<FormRow
|
|
112
|
+
<FormRow>
|
|
106
113
|
<FormRow
|
|
107
114
|
className={classes.buttonFormRow}
|
|
108
115
|
sx={(theme) => ({
|
|
@@ -126,6 +133,7 @@ export function SignUpFormInline({
|
|
|
126
133
|
</Box>
|
|
127
134
|
</FormRow>
|
|
128
135
|
</FormRow>
|
|
136
|
+
<ApolloErrorAlert error={form.error} />
|
|
129
137
|
</Form>
|
|
130
138
|
)
|
|
131
139
|
}
|
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": "6.2.0-canary.
|
|
5
|
+
"version": "6.2.0-canary.37",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"prettier": "@graphcommerce/prettier-config-pwa",
|
|
8
8
|
"eslintConfig": {
|
|
@@ -12,20 +12,20 @@
|
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
|
-
"@graphcommerce/eslint-config-pwa": "6.2.0-canary.
|
|
16
|
-
"@graphcommerce/prettier-config-pwa": "6.2.0-canary.
|
|
17
|
-
"@graphcommerce/typescript-config-pwa": "6.2.0-canary.
|
|
15
|
+
"@graphcommerce/eslint-config-pwa": "6.2.0-canary.37",
|
|
16
|
+
"@graphcommerce/prettier-config-pwa": "6.2.0-canary.37",
|
|
17
|
+
"@graphcommerce/typescript-config-pwa": "6.2.0-canary.37"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@graphcommerce/ecommerce-ui": "6.2.0-canary.
|
|
21
|
-
"@graphcommerce/framer-utils": "6.2.0-canary.
|
|
22
|
-
"@graphcommerce/graphql": "6.2.0-canary.
|
|
23
|
-
"@graphcommerce/graphql-mesh": "6.2.0-canary.
|
|
24
|
-
"@graphcommerce/image": "6.2.0-canary.
|
|
25
|
-
"@graphcommerce/magento-graphql": "6.2.0-canary.
|
|
26
|
-
"@graphcommerce/magento-store": "6.2.0-canary.
|
|
27
|
-
"@graphcommerce/next-ui": "6.2.0-canary.
|
|
28
|
-
"@graphcommerce/react-hook-form": "6.2.0-canary.
|
|
20
|
+
"@graphcommerce/ecommerce-ui": "6.2.0-canary.37",
|
|
21
|
+
"@graphcommerce/framer-utils": "6.2.0-canary.37",
|
|
22
|
+
"@graphcommerce/graphql": "6.2.0-canary.37",
|
|
23
|
+
"@graphcommerce/graphql-mesh": "6.2.0-canary.37",
|
|
24
|
+
"@graphcommerce/image": "6.2.0-canary.37",
|
|
25
|
+
"@graphcommerce/magento-graphql": "6.2.0-canary.37",
|
|
26
|
+
"@graphcommerce/magento-store": "6.2.0-canary.37",
|
|
27
|
+
"@graphcommerce/next-ui": "6.2.0-canary.37",
|
|
28
|
+
"@graphcommerce/react-hook-form": "6.2.0-canary.37"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
31
|
"@lingui/react": "^3.13.2",
|