@graphcommerce/magento-cart 7.0.0-canary.21 → 7.0.0
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 +191 -1
- package/components/ApolloCartError/ApolloCartErrorAlert.tsx +1 -1
- package/components/CartAgreementsForm/CartAgreementsForm.tsx +2 -12
- package/components/CartItemSummary/CartItemSummary.tsx +1 -1
- package/components/CartStartCheckout/CartStartCheckoutLinkOrButton.tsx +4 -2
- package/components/CartTotals/CartTotals.tsx +1 -0
- package/components/EmptyCart/EmptyCart.tsx +1 -0
- package/components/InlineAccount/InlineAccount.tsx +17 -1
- package/hooks/useFormGqlMutationCart.ts +1 -1
- package/link/createCartErrorLink.ts +2 -2
- package/package.json +18 -17
- package/test/fillCartAgreementsForm.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,196 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
## 7.0.0
|
|
3
|
+
## 7.0.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#1962](https://github.com/graphcommerce-org/graphcommerce/pull/1962) [`518b6ca24`](https://github.com/graphcommerce-org/graphcommerce/commit/518b6ca248fc94624dc06eb02de5b3eac0fc9483) - Created a new `<ValidatedPasswordElement/>` which validates according to Magento's validation groups and implement on all locations. Move remaining password fields to `<PasswordElement />` ([@carlocarels90](https://github.com/carlocarels90))
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- [#1916](https://github.com/graphcommerce-org/graphcommerce/pull/1916) [`ee2f814f4`](https://github.com/graphcommerce-org/graphcommerce/commit/ee2f814f4d91898f106036e92be4e560d638509d) - When the customer is logging in and the merge cart functionality throws an error, it would not set the current customer's cart as active, but keep the faulty cart active. ([@paales](https://github.com/paales))
|
|
12
|
+
|
|
13
|
+
- [#2031](https://github.com/graphcommerce-org/graphcommerce/pull/2031) [`4d8fc9e99`](https://github.com/graphcommerce-org/graphcommerce/commit/4d8fc9e998fc9361282833316ec9564da0644ed6) - Eslint fixes and suppress accepted warnings ([@paales](https://github.com/paales))
|
|
14
|
+
|
|
15
|
+
- [#1914](https://github.com/graphcommerce-org/graphcommerce/pull/1914) [`000556331`](https://github.com/graphcommerce-org/graphcommerce/commit/000556331f5379c71d7edca541fd0b145b7dc435) - When there is an error in the cart, disable the checkout buttons ([@paales](https://github.com/paales))
|
|
16
|
+
|
|
17
|
+
- [#1942](https://github.com/graphcommerce-org/graphcommerce/pull/1942) [`045d0a6cb`](https://github.com/graphcommerce-org/graphcommerce/commit/045d0a6cbbfc6339852c19dd21f349bb51c38fcd) - When the ApolloCartError would throw an authorization error it would link to the wrong page ([@paales](https://github.com/paales))
|
|
18
|
+
|
|
19
|
+
- [#1914](https://github.com/graphcommerce-org/graphcommerce/pull/1914) [`38d6c4888`](https://github.com/graphcommerce-org/graphcommerce/commit/38d6c488850013b36cae9f388996039219c1327e) - Errors in the cart didn't allow for recovery from the faulty state ([@paales](https://github.com/paales))
|
|
20
|
+
|
|
21
|
+
- [#1914](https://github.com/graphcommerce-org/graphcommerce/pull/1914) [`5d115a11a`](https://github.com/graphcommerce-org/graphcommerce/commit/5d115a11a417f35c3315879c785d24ae32e64663) - When a customer tries to add a product to an invalid customer cart, discard the cart and create a new cart ([@paales](https://github.com/paales))
|
|
22
|
+
|
|
23
|
+
## 6.2.0-canary.98
|
|
24
|
+
|
|
25
|
+
## 6.2.0-canary.97
|
|
26
|
+
|
|
27
|
+
## 6.2.0-canary.96
|
|
28
|
+
|
|
29
|
+
## 6.2.0-canary.95
|
|
30
|
+
|
|
31
|
+
## 6.2.0-canary.94
|
|
32
|
+
|
|
33
|
+
## 6.2.0-canary.93
|
|
34
|
+
|
|
35
|
+
## 6.2.0-canary.92
|
|
36
|
+
|
|
37
|
+
## 6.2.0-canary.91
|
|
38
|
+
|
|
39
|
+
## 6.2.0-canary.90
|
|
40
|
+
|
|
41
|
+
## 6.2.0-canary.89
|
|
42
|
+
|
|
43
|
+
### Patch Changes
|
|
44
|
+
|
|
45
|
+
- [#2031](https://github.com/graphcommerce-org/graphcommerce/pull/2031) [`4d8fc9e99`](https://github.com/graphcommerce-org/graphcommerce/commit/4d8fc9e998fc9361282833316ec9564da0644ed6) - Eslint fixes and suppress accepted warnings ([@paales](https://github.com/paales))
|
|
46
|
+
|
|
47
|
+
## 6.2.0-canary.88
|
|
48
|
+
|
|
49
|
+
## 6.2.0-canary.87
|
|
50
|
+
|
|
51
|
+
## 6.2.0-canary.86
|
|
52
|
+
|
|
53
|
+
## 6.2.0-canary.85
|
|
54
|
+
|
|
55
|
+
## 6.2.0-canary.84
|
|
56
|
+
|
|
57
|
+
## 6.2.0-canary.83
|
|
58
|
+
|
|
59
|
+
## 6.2.0-canary.82
|
|
60
|
+
|
|
61
|
+
## 6.2.0-canary.81
|
|
62
|
+
|
|
63
|
+
## 6.2.0-canary.80
|
|
64
|
+
|
|
65
|
+
## 6.2.0-canary.79
|
|
66
|
+
|
|
67
|
+
### Patch Changes
|
|
68
|
+
|
|
69
|
+
- [#2013](https://github.com/graphcommerce-org/graphcommerce/pull/2013) [`c57bdf8a4`](https://github.com/graphcommerce-org/graphcommerce/commit/c57bdf8a4ce936c3eedc4dfada3a464a113ac68a) - Updated @mui and framer-motion packages to latest versions ([@paales](https://github.com/paales))
|
|
70
|
+
|
|
71
|
+
## 6.2.0-canary.78
|
|
72
|
+
|
|
73
|
+
## 6.2.0-canary.77
|
|
74
|
+
|
|
75
|
+
## 6.2.0-canary.76
|
|
76
|
+
|
|
77
|
+
## 6.2.0-canary.75
|
|
78
|
+
|
|
79
|
+
## 6.2.0-canary.74
|
|
80
|
+
|
|
81
|
+
## 6.2.0-canary.73
|
|
82
|
+
|
|
83
|
+
## 6.2.0-canary.72
|
|
84
|
+
|
|
85
|
+
## 6.2.0-canary.71
|
|
86
|
+
|
|
87
|
+
## 6.2.0-canary.70
|
|
88
|
+
|
|
89
|
+
## 6.2.0-canary.69
|
|
90
|
+
|
|
91
|
+
## 6.2.0-canary.68
|
|
92
|
+
|
|
93
|
+
## 6.2.0-canary.67
|
|
94
|
+
|
|
95
|
+
## 6.2.0-canary.66
|
|
96
|
+
|
|
97
|
+
## 6.2.0-canary.65
|
|
98
|
+
|
|
99
|
+
## 6.2.0-canary.64
|
|
100
|
+
|
|
101
|
+
## 6.2.0-canary.63
|
|
102
|
+
|
|
103
|
+
## 6.2.0-canary.62
|
|
104
|
+
|
|
105
|
+
## 6.2.0-canary.61
|
|
106
|
+
|
|
107
|
+
## 6.2.0-canary.60
|
|
108
|
+
|
|
109
|
+
## 6.2.0-canary.59
|
|
110
|
+
|
|
111
|
+
## 6.2.0-canary.58
|
|
112
|
+
|
|
113
|
+
## 6.2.0-canary.57
|
|
114
|
+
|
|
115
|
+
## 6.2.0-canary.56
|
|
116
|
+
|
|
117
|
+
## 6.2.0-canary.55
|
|
118
|
+
|
|
119
|
+
## 6.2.0-canary.54
|
|
120
|
+
|
|
121
|
+
## 6.2.0-canary.53
|
|
122
|
+
|
|
123
|
+
## 6.2.0-canary.52
|
|
124
|
+
|
|
125
|
+
## 6.2.0-canary.51
|
|
126
|
+
|
|
127
|
+
## 6.2.0-canary.50
|
|
128
|
+
|
|
129
|
+
## 6.2.0-canary.49
|
|
130
|
+
|
|
131
|
+
## 6.2.0-canary.48
|
|
132
|
+
|
|
133
|
+
## 6.2.0-canary.47
|
|
134
|
+
|
|
135
|
+
## 6.2.0-canary.46
|
|
136
|
+
|
|
137
|
+
## 6.2.0-canary.45
|
|
138
|
+
|
|
139
|
+
### Minor Changes
|
|
140
|
+
|
|
141
|
+
- [#1962](https://github.com/graphcommerce-org/graphcommerce/pull/1962) [`518b6ca24`](https://github.com/graphcommerce-org/graphcommerce/commit/518b6ca248fc94624dc06eb02de5b3eac0fc9483) - Created a new `<ValidatedPasswordElement/>` which validates according to Magento's validation groups and implement on all locations. Move remaining password fields to `<PasswordElement />` ([@carlocarels90](https://github.com/carlocarels90))
|
|
142
|
+
|
|
143
|
+
## 6.2.0-canary.44
|
|
144
|
+
|
|
145
|
+
## 6.2.0-canary.43
|
|
146
|
+
|
|
147
|
+
## 6.2.0-canary.42
|
|
148
|
+
|
|
149
|
+
## 6.2.0-canary.41
|
|
150
|
+
|
|
151
|
+
## 6.2.0-canary.40
|
|
152
|
+
|
|
153
|
+
## 6.2.0-canary.39
|
|
154
|
+
|
|
155
|
+
## 6.2.0-canary.38
|
|
156
|
+
|
|
157
|
+
## 6.2.0-canary.37
|
|
158
|
+
|
|
159
|
+
## 6.2.0-canary.36
|
|
160
|
+
|
|
161
|
+
## 6.2.0-canary.35
|
|
162
|
+
|
|
163
|
+
## 6.2.0-canary.34
|
|
164
|
+
|
|
165
|
+
## 6.2.0-canary.33
|
|
166
|
+
|
|
167
|
+
## 6.2.0-canary.32
|
|
168
|
+
|
|
169
|
+
## 6.2.0-canary.31
|
|
170
|
+
|
|
171
|
+
## 6.2.0-canary.30
|
|
172
|
+
|
|
173
|
+
### Patch Changes
|
|
174
|
+
|
|
175
|
+
- [#1942](https://github.com/graphcommerce-org/graphcommerce/pull/1942) [`045d0a6cb`](https://github.com/graphcommerce-org/graphcommerce/commit/045d0a6cbbfc6339852c19dd21f349bb51c38fcd) - When the ApolloCartError would throw an authorization error it would link to the wrong page ([@paales](https://github.com/paales))
|
|
176
|
+
|
|
177
|
+
## 6.2.0-canary.29
|
|
178
|
+
|
|
179
|
+
## 6.2.0-canary.28
|
|
180
|
+
|
|
181
|
+
## 6.2.0-canary.27
|
|
182
|
+
|
|
183
|
+
## 6.2.0-canary.26
|
|
184
|
+
|
|
185
|
+
## 6.2.0-canary.25
|
|
186
|
+
|
|
187
|
+
## 6.2.0-canary.24
|
|
188
|
+
|
|
189
|
+
## 6.2.0-canary.23
|
|
190
|
+
|
|
191
|
+
## 6.2.0-canary.22
|
|
192
|
+
|
|
193
|
+
## 6.2.0-canary.21
|
|
4
194
|
|
|
5
195
|
## 6.2.0-canary.20
|
|
6
196
|
|
|
@@ -42,7 +42,7 @@ export function ApolloCartErrorAlert(props: ApolloCartErrorAlertProps) {
|
|
|
42
42
|
<Button onClick={clear} color='error' size='small'>
|
|
43
43
|
<Trans id='Sign out' />
|
|
44
44
|
</Button>
|
|
45
|
-
<Button href='/account/
|
|
45
|
+
<Button href='/account/signin' color='error' size='small'>
|
|
46
46
|
<Trans id='Sign in' />
|
|
47
47
|
</Button>
|
|
48
48
|
</>
|
|
@@ -2,23 +2,13 @@ import { CheckboxElement } from '@graphcommerce/ecommerce-ui'
|
|
|
2
2
|
import { useQuery } from '@graphcommerce/graphql'
|
|
3
3
|
import { extendableComponent, FormDiv } from '@graphcommerce/next-ui'
|
|
4
4
|
import {
|
|
5
|
-
Controller,
|
|
6
5
|
useForm,
|
|
7
6
|
useFormCompose,
|
|
8
7
|
UseFormComposeOptions,
|
|
9
8
|
useFormPersist,
|
|
10
9
|
} from '@graphcommerce/react-hook-form'
|
|
11
10
|
import { i18n } from '@lingui/core'
|
|
12
|
-
import {
|
|
13
|
-
Box,
|
|
14
|
-
Checkbox,
|
|
15
|
-
FormControl,
|
|
16
|
-
FormControlLabel,
|
|
17
|
-
FormHelperText,
|
|
18
|
-
Link,
|
|
19
|
-
SxProps,
|
|
20
|
-
Theme,
|
|
21
|
-
} from '@mui/material'
|
|
11
|
+
import { Box, Link, SxProps, Theme } from '@mui/material'
|
|
22
12
|
import React from 'react'
|
|
23
13
|
import { CartAgreementsDocument } from './CartAgreements.gql'
|
|
24
14
|
|
|
@@ -42,7 +32,7 @@ export function CartAgreementsForm(props: CartAgreementsFormProps) {
|
|
|
42
32
|
|
|
43
33
|
const form = useForm()
|
|
44
34
|
|
|
45
|
-
const { handleSubmit,
|
|
35
|
+
const { handleSubmit, control } = form
|
|
46
36
|
|
|
47
37
|
const submit = handleSubmit((values) => {
|
|
48
38
|
// eslint-disable-next-line no-console
|
|
@@ -83,7 +83,7 @@ export function CartItemSummary(props: OrderSummaryProps) {
|
|
|
83
83
|
>
|
|
84
84
|
<IconSvg src={iconChevronLeft} />
|
|
85
85
|
</ScrollerButton>
|
|
86
|
-
<Box className={classes.scrollerContainer} sx={{ padding: '1px' }}>
|
|
86
|
+
<Box className={classes.scrollerContainer} sx={{ padding: '1px', display: 'flex' }}>
|
|
87
87
|
<Scroller className={classes.scroller}>
|
|
88
88
|
{items?.map((item) => (
|
|
89
89
|
<React.Fragment key={item?.uid}>
|
|
@@ -9,7 +9,7 @@ export type CartStartCheckoutLinkOrButtonProps = CartStartCheckoutFragment & {
|
|
|
9
9
|
sx?: SxProps<Theme>
|
|
10
10
|
disabled?: boolean
|
|
11
11
|
onStart?: (
|
|
12
|
-
e: React.MouseEvent<HTMLButtonElement
|
|
12
|
+
e: React.MouseEvent<HTMLButtonElement & HTMLAnchorElement & HTMLSpanElement>,
|
|
13
13
|
cart: CartStartCheckoutFragment,
|
|
14
14
|
) => void
|
|
15
15
|
linkOrButtonProps?: LinkOrButtonProps
|
|
@@ -30,7 +30,9 @@ export function CartStartCheckoutLinkOrButton(props: CartStartCheckoutLinkOrButt
|
|
|
30
30
|
return (
|
|
31
31
|
<LinkOrButton
|
|
32
32
|
href='/checkout'
|
|
33
|
-
onClick={(
|
|
33
|
+
onClick={(
|
|
34
|
+
e: React.MouseEvent<HTMLButtonElement & HTMLAnchorElement & HTMLSpanElement, MouseEvent>,
|
|
35
|
+
) => {
|
|
34
36
|
onClick?.(e)
|
|
35
37
|
onStart?.(e, cart)
|
|
36
38
|
}}
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
} from '@graphcommerce/magento-customer'
|
|
7
7
|
import { Button, FormRow, extendableComponent } from '@graphcommerce/next-ui'
|
|
8
8
|
import { Trans } from '@lingui/react'
|
|
9
|
+
// eslint-disable-next-line @typescript-eslint/no-restricted-imports
|
|
9
10
|
import { Box, SxProps, TextField, Theme, Typography } from '@mui/material'
|
|
10
11
|
import React, { useState } from 'react'
|
|
11
12
|
import { useCartQuery } from '../../hooks/useCartQuery'
|
|
@@ -49,6 +50,7 @@ export function InlineAccount(props: InlineAccountProps) {
|
|
|
49
50
|
borderRadius: '4px',
|
|
50
51
|
border: `1px solid ${theme.palette.divider}`,
|
|
51
52
|
padding: theme.spacings.md,
|
|
53
|
+
marginTop: theme.spacings.sm,
|
|
52
54
|
}),
|
|
53
55
|
...(Array.isArray(sx) ? sx : [sx]),
|
|
54
56
|
]}
|
|
@@ -116,7 +118,21 @@ export function InlineAccount(props: InlineAccountProps) {
|
|
|
116
118
|
)}
|
|
117
119
|
|
|
118
120
|
{loggedIn && (
|
|
119
|
-
<Box
|
|
121
|
+
<Box
|
|
122
|
+
className={classes.innerContainer}
|
|
123
|
+
sx={(theme) => ({
|
|
124
|
+
display: 'flex',
|
|
125
|
+
justifyContent: 'space-between',
|
|
126
|
+
flexDirection: 'column',
|
|
127
|
+
alignItems: 'flex-start',
|
|
128
|
+
gap: theme.spacings.md,
|
|
129
|
+
[theme.breakpoints.up('sm')]: {
|
|
130
|
+
alignItems: 'flex-end',
|
|
131
|
+
flexDirection: 'unset',
|
|
132
|
+
gap: 0,
|
|
133
|
+
},
|
|
134
|
+
})}
|
|
135
|
+
>
|
|
120
136
|
<div>
|
|
121
137
|
<Typography variant='h4' className={classes.title}>
|
|
122
138
|
{title ?? <Trans id='Have an account?' />}
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
import { useCartIdCreate } from './useCartIdCreate'
|
|
8
8
|
|
|
9
9
|
export function useFormGqlMutationCart<
|
|
10
|
-
Q extends Record<string,
|
|
10
|
+
Q extends Record<string, unknown>,
|
|
11
11
|
V extends { cartId: string; [index: string]: unknown },
|
|
12
12
|
>(
|
|
13
13
|
document: TypedDocumentNode<Q, V>,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { fromPromise, globalApolloClient, Operation } from '@graphcommerce/graphql'
|
|
2
2
|
import { onError } from '@graphcommerce/graphql/apollo'
|
|
3
|
+
import { ErrorCategory } from '@graphcommerce/magento-graphql'
|
|
4
|
+
import type { GraphQLError } from 'graphql'
|
|
3
5
|
import { writeCartId } from '../hooks'
|
|
4
6
|
import { CreateEmptyCartDocument } from '../hooks/CreateEmptyCart.gql'
|
|
5
|
-
import { GraphQLError } from 'graphql'
|
|
6
|
-
import { ErrorCategory } from '@graphcommerce/magento-graphql'
|
|
7
7
|
|
|
8
8
|
type CartOperation = Operation & { variables: { cartId: string } }
|
|
9
9
|
function isCartOperation(operation: Operation): operation is CartOperation {
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@graphcommerce/magento-cart",
|
|
3
3
|
"homepage": "https://www.graphcommerce.org/",
|
|
4
4
|
"repository": "github:graphcommerce-org/graphcommerce",
|
|
5
|
-
"version": "7.0.0
|
|
5
|
+
"version": "7.0.0",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"prettier": "@graphcommerce/prettier-config-pwa",
|
|
8
8
|
"eslintConfig": {
|
|
@@ -12,26 +12,27 @@
|
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
|
-
"@graphcommerce/eslint-config-pwa": "7.0.0
|
|
16
|
-
"@graphcommerce/prettier-config-pwa": "7.0.0
|
|
17
|
-
"@graphcommerce/typescript-config-pwa": "7.0.0
|
|
15
|
+
"@graphcommerce/eslint-config-pwa": "7.0.0",
|
|
16
|
+
"@graphcommerce/prettier-config-pwa": "7.0.0",
|
|
17
|
+
"@graphcommerce/typescript-config-pwa": "7.0.0"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@graphcommerce/ecommerce-ui": "7.0.0
|
|
21
|
-
"@graphcommerce/framer-utils": "7.0.0
|
|
22
|
-
"@graphcommerce/framer-next-pages": "7.0.0
|
|
23
|
-
"@graphcommerce/framer-scroller": "7.0.0
|
|
24
|
-
"@graphcommerce/graphql": "7.0.0
|
|
25
|
-
"@graphcommerce/image": "7.0.0
|
|
26
|
-
"@graphcommerce/magento-customer": "7.0.0
|
|
27
|
-
"@graphcommerce/magento-graphql": "7.0.0
|
|
28
|
-
"@graphcommerce/magento-store": "7.0.0
|
|
29
|
-
"@graphcommerce/next-ui": "7.0.0
|
|
30
|
-
"@graphcommerce/react-hook-form": "7.0.0
|
|
20
|
+
"@graphcommerce/ecommerce-ui": "7.0.0",
|
|
21
|
+
"@graphcommerce/framer-utils": "7.0.0",
|
|
22
|
+
"@graphcommerce/framer-next-pages": "7.0.0",
|
|
23
|
+
"@graphcommerce/framer-scroller": "7.0.0",
|
|
24
|
+
"@graphcommerce/graphql": "7.0.0",
|
|
25
|
+
"@graphcommerce/image": "7.0.0",
|
|
26
|
+
"@graphcommerce/magento-customer": "7.0.0",
|
|
27
|
+
"@graphcommerce/magento-graphql": "7.0.0",
|
|
28
|
+
"@graphcommerce/magento-store": "7.0.0",
|
|
29
|
+
"@graphcommerce/next-ui": "7.0.0",
|
|
30
|
+
"@graphcommerce/react-hook-form": "7.0.0"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"@lingui/react": "^
|
|
34
|
-
"@lingui/core": "^
|
|
33
|
+
"@lingui/react": "^4.2.1",
|
|
34
|
+
"@lingui/core": "^4.2.1",
|
|
35
|
+
"@lingui/macro": "^4.2.1",
|
|
35
36
|
"@mui/material": "^5.10.16",
|
|
36
37
|
"framer-motion": "^10.0.0",
|
|
37
38
|
"next": "^13.2.0",
|