@graphcommerce/magento-cart 3.5.13 → 3.5.14
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.
|
@@ -70,61 +70,52 @@ export default function CartAgreementsForm(props: CartAgreementsFormProps) {
|
|
|
70
70
|
<form noValidate onSubmit={submit} name='cartAgreements'>
|
|
71
71
|
<div className={classes.formInner}>
|
|
72
72
|
{data?.checkoutAgreements &&
|
|
73
|
-
sortedAgreements?.map(
|
|
74
|
-
(agreement)
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
>
|
|
92
|
-
<FormControlLabel
|
|
93
|
-
control={<Checkbox color='secondary' required={true} />}
|
|
94
|
-
label={
|
|
95
|
-
<PageLink
|
|
96
|
-
href={`/legal/view/${agreement.name
|
|
97
|
-
?.toLowerCase()
|
|
98
|
-
.replaceAll(' ', '-')}`}
|
|
99
|
-
passHref
|
|
100
|
-
>
|
|
101
|
-
<Link color='secondary'>{agreement.checkbox_text}</Link>
|
|
102
|
-
</PageLink>
|
|
103
|
-
}
|
|
104
|
-
checked={!!value}
|
|
105
|
-
inputRef={ref}
|
|
106
|
-
onBlur={onBlur}
|
|
107
|
-
name={name}
|
|
108
|
-
onChange={(e) => onChange(e as React.ChangeEvent<HTMLInputElement>)}
|
|
109
|
-
/>
|
|
110
|
-
{error?.message && <FormHelperText>{error.message}</FormHelperText>}
|
|
111
|
-
</FormControl>
|
|
112
|
-
)}
|
|
113
|
-
/>
|
|
114
|
-
</>
|
|
115
|
-
) : (
|
|
116
|
-
<div className={classes.manualCheck}>
|
|
117
|
-
<PageLink
|
|
118
|
-
href={`/legal/view/${agreement.name?.toLowerCase().replaceAll(' ', '-')}`}
|
|
119
|
-
passHref
|
|
73
|
+
sortedAgreements?.map((agreement) => {
|
|
74
|
+
if (!agreement) return null
|
|
75
|
+
const href = `/checkout/terms/${agreement.name?.toLowerCase().replace(/\s+/g, '-')}`
|
|
76
|
+
return (
|
|
77
|
+
<React.Fragment key={agreement.agreement_id}>
|
|
78
|
+
{agreement.mode === 'MANUAL' ? (
|
|
79
|
+
<Controller
|
|
80
|
+
defaultValue={''}
|
|
81
|
+
name={String(agreement.agreement_id)}
|
|
82
|
+
control={control}
|
|
83
|
+
rules={{ required: 'You have to agree in order to proceed' }}
|
|
84
|
+
render={({
|
|
85
|
+
field: { onChange, value, name, ref, onBlur },
|
|
86
|
+
fieldState: { error },
|
|
87
|
+
}) => (
|
|
88
|
+
<FormControl
|
|
89
|
+
error={!!formState.errors[String(agreement.agreement_id)]}
|
|
90
|
+
classes={{ root: classes.formControlRoot }}
|
|
120
91
|
>
|
|
121
|
-
<
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
92
|
+
<FormControlLabel
|
|
93
|
+
control={<Checkbox color='secondary' required={true} />}
|
|
94
|
+
label={
|
|
95
|
+
<PageLink href={href} passHref>
|
|
96
|
+
<Link color='secondary'>{agreement.checkbox_text}</Link>
|
|
97
|
+
</PageLink>
|
|
98
|
+
}
|
|
99
|
+
checked={!!value}
|
|
100
|
+
inputRef={ref}
|
|
101
|
+
onBlur={onBlur}
|
|
102
|
+
name={name}
|
|
103
|
+
onChange={(e) => onChange(e as React.ChangeEvent<HTMLInputElement>)}
|
|
104
|
+
/>
|
|
105
|
+
{error?.message && <FormHelperText>{error.message}</FormHelperText>}
|
|
106
|
+
</FormControl>
|
|
107
|
+
)}
|
|
108
|
+
/>
|
|
109
|
+
) : (
|
|
110
|
+
<div className={classes.manualCheck}>
|
|
111
|
+
<PageLink href={href} passHref>
|
|
112
|
+
<Link color='secondary'>{agreement.checkbox_text}</Link>
|
|
113
|
+
</PageLink>
|
|
114
|
+
</div>
|
|
115
|
+
)}
|
|
116
|
+
</React.Fragment>
|
|
117
|
+
)
|
|
118
|
+
})}
|
|
128
119
|
</div>
|
|
129
120
|
</form>
|
|
130
121
|
</FormDiv>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphcommerce/magento-cart",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.14",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"prettier": "@graphcommerce/prettier-config-pwa",
|
|
6
6
|
"browserslist": [
|
|
@@ -24,10 +24,10 @@
|
|
|
24
24
|
"@graphcommerce/framer-scroller": "^1.0.3",
|
|
25
25
|
"@graphcommerce/graphql": "^2.105.4",
|
|
26
26
|
"@graphcommerce/image": "^2.105.3",
|
|
27
|
-
"@graphcommerce/magento-customer": "^3.4.
|
|
27
|
+
"@graphcommerce/magento-customer": "^3.4.14",
|
|
28
28
|
"@graphcommerce/magento-graphql": "^2.104.4",
|
|
29
|
-
"@graphcommerce/magento-store": "^3.2.
|
|
30
|
-
"@graphcommerce/next-ui": "^3.14.
|
|
29
|
+
"@graphcommerce/magento-store": "^3.2.13",
|
|
30
|
+
"@graphcommerce/next-ui": "^3.14.5",
|
|
31
31
|
"@graphcommerce/react-hook-form": "^2.103.1",
|
|
32
32
|
"@graphql-typed-document-node/core": "^3.1.0",
|
|
33
33
|
"@material-ui/core": "^4.12.3",
|
|
@@ -38,5 +38,5 @@
|
|
|
38
38
|
"react": "^17.0.2",
|
|
39
39
|
"react-dom": "^17.0.2"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "15fd80e36ef6ebee46e0255872504a72288854de"
|
|
42
42
|
}
|