@graphcommerce/magento-cart 4.2.0 → 4.2.3
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 +48 -0
- package/components/CartAgreementsForm/CartAgreementsForm.tsx +1 -1
- package/components/CartStartCheckout/CartStartCheckout.tsx +8 -5
- package/hooks/useCartQuery.ts +1 -1
- package/package.json +16 -16
- package/test/fillCartAgreementsForm.ts +16 -0
- package/_playwright/fillCartAgreementsForm.ts +0 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,53 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 4.2.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#1378](https://github.com/graphcommerce-org/graphcommerce/pull/1378) [`b610a6e40`](https://github.com/graphcommerce-org/graphcommerce/commit/b610a6e4049e8c9e8b5d2aeff31b8e1bfc24abe5) Thanks [@paales](https://github.com/paales)! - Pin all versions internally so we can’t end up in an unfixable state for the user
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`b610a6e40`](https://github.com/graphcommerce-org/graphcommerce/commit/b610a6e4049e8c9e8b5d2aeff31b8e1bfc24abe5), [`22ff9df16`](https://github.com/graphcommerce-org/graphcommerce/commit/22ff9df1677742ae8e07d9b7e5b12fbb487580dc)]:
|
|
10
|
+
- @graphcommerce/ecommerce-ui@1.0.5
|
|
11
|
+
- @graphcommerce/framer-next-pages@3.1.5
|
|
12
|
+
- @graphcommerce/framer-scroller@2.1.4
|
|
13
|
+
- @graphcommerce/graphql@3.0.7
|
|
14
|
+
- @graphcommerce/image@3.1.3
|
|
15
|
+
- @graphcommerce/magento-customer@4.2.1
|
|
16
|
+
- @graphcommerce/magento-graphql@3.0.6
|
|
17
|
+
- @graphcommerce/magento-store@4.1.5
|
|
18
|
+
- @graphcommerce/next-ui@4.5.1
|
|
19
|
+
- @graphcommerce/react-hook-form@3.0.7
|
|
20
|
+
|
|
21
|
+
## 4.2.2
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- [#1369](https://github.com/graphcommerce-org/graphcommerce/pull/1369) [`ae6449502`](https://github.com/graphcommerce-org/graphcommerce/commit/ae64495024a455bbe5188588604368c1542840c9) Thanks [@paales](https://github.com/paales)! - Upgraded dependencies
|
|
26
|
+
|
|
27
|
+
- Updated dependencies [[`892018809`](https://github.com/graphcommerce-org/graphcommerce/commit/8920188093d0422ec50580e408dc28ac5f93e46a), [`892018809`](https://github.com/graphcommerce-org/graphcommerce/commit/8920188093d0422ec50580e408dc28ac5f93e46a), [`ae6449502`](https://github.com/graphcommerce-org/graphcommerce/commit/ae64495024a455bbe5188588604368c1542840c9), [`892018809`](https://github.com/graphcommerce-org/graphcommerce/commit/8920188093d0422ec50580e408dc28ac5f93e46a), [`892018809`](https://github.com/graphcommerce-org/graphcommerce/commit/8920188093d0422ec50580e408dc28ac5f93e46a), [`6213f0b0f`](https://github.com/graphcommerce-org/graphcommerce/commit/6213f0b0f5f53d622b993d9f7ea96cbbeb5bd670), [`892018809`](https://github.com/graphcommerce-org/graphcommerce/commit/8920188093d0422ec50580e408dc28ac5f93e46a)]:
|
|
28
|
+
- @graphcommerce/graphql@3.0.6
|
|
29
|
+
- @graphcommerce/next-ui@4.5.0
|
|
30
|
+
- @graphcommerce/ecommerce-ui@1.0.4
|
|
31
|
+
- @graphcommerce/framer-next-pages@3.1.4
|
|
32
|
+
- @graphcommerce/framer-scroller@2.1.3
|
|
33
|
+
- @graphcommerce/image@3.1.2
|
|
34
|
+
- @graphcommerce/magento-customer@4.2.0
|
|
35
|
+
- @graphcommerce/magento-graphql@3.0.5
|
|
36
|
+
- @graphcommerce/magento-store@4.1.4
|
|
37
|
+
- @graphcommerce/react-hook-form@3.0.6
|
|
38
|
+
|
|
39
|
+
## 4.2.1
|
|
40
|
+
|
|
41
|
+
### Patch Changes
|
|
42
|
+
|
|
43
|
+
- [#1360](https://github.com/graphcommerce-org/graphcommerce/pull/1360) [`829b8690b`](https://github.com/graphcommerce-org/graphcommerce/commit/829b8690bc5d0a46e596299e4120e9837a9f179c) Thanks [@paales](https://github.com/paales)! - Move margins in CartStartCheckout to parent element, for better rendering on the sheet
|
|
44
|
+
|
|
45
|
+
- Updated dependencies [[`829b8690b`](https://github.com/graphcommerce-org/graphcommerce/commit/829b8690bc5d0a46e596299e4120e9837a9f179c), [`49a2d6617`](https://github.com/graphcommerce-org/graphcommerce/commit/49a2d661712e1787fba46c6195f7b559189e23d9), [`c9f7ac026`](https://github.com/graphcommerce-org/graphcommerce/commit/c9f7ac026b49047eca05be208b515f364e21571c), [`f67da3cfb`](https://github.com/graphcommerce-org/graphcommerce/commit/f67da3cfbe2dcf5ea23519d088c5aa0074029182), [`218766869`](https://github.com/graphcommerce-org/graphcommerce/commit/218766869f7468c067a590857c942f3819f8add4), [`0e5ee7ba8`](https://github.com/graphcommerce-org/graphcommerce/commit/0e5ee7ba89698e5e711001e846ed182528060cba), [`829b8690b`](https://github.com/graphcommerce-org/graphcommerce/commit/829b8690bc5d0a46e596299e4120e9837a9f179c), [`829b8690b`](https://github.com/graphcommerce-org/graphcommerce/commit/829b8690bc5d0a46e596299e4120e9837a9f179c)]:
|
|
46
|
+
- @graphcommerce/framer-scroller@2.1.2
|
|
47
|
+
- @graphcommerce/next-ui@4.4.0
|
|
48
|
+
- @graphcommerce/framer-next-pages@3.1.3
|
|
49
|
+
- @graphcommerce/magento-customer@4.1.6
|
|
50
|
+
|
|
3
51
|
## 4.2.0
|
|
4
52
|
|
|
5
53
|
### Minor Changes
|
|
@@ -66,7 +66,7 @@ export function CartAgreementsForm(props: CartAgreementsFormProps) {
|
|
|
66
66
|
{agreement.mode === 'MANUAL' ? (
|
|
67
67
|
<Controller
|
|
68
68
|
defaultValue=''
|
|
69
|
-
name={
|
|
69
|
+
name={`agreement[${agreement.agreement_id}]`}
|
|
70
70
|
control={control}
|
|
71
71
|
rules={{ required: t`You have to agree in order to proceed` }}
|
|
72
72
|
render={({
|
|
@@ -26,7 +26,14 @@ export function CartStartCheckout(props: CartStartCheckoutProps) {
|
|
|
26
26
|
return (
|
|
27
27
|
<Box
|
|
28
28
|
className={classes.checkoutButtonContainer}
|
|
29
|
-
sx={[
|
|
29
|
+
sx={[
|
|
30
|
+
(theme) => ({
|
|
31
|
+
textAlign: 'center',
|
|
32
|
+
marginTop: theme.spacings.md,
|
|
33
|
+
marginBottom: theme.spacings.md,
|
|
34
|
+
}),
|
|
35
|
+
...(Array.isArray(sx) ? sx : [sx]),
|
|
36
|
+
]}
|
|
30
37
|
>
|
|
31
38
|
<PageLink href='/checkout' passHref>
|
|
32
39
|
<Button
|
|
@@ -36,10 +43,6 @@ export function CartStartCheckout(props: CartStartCheckoutProps) {
|
|
|
36
43
|
className={classes.checkoutButton}
|
|
37
44
|
endIcon={<IconSvg src={iconChevronRight} />}
|
|
38
45
|
disabled={!hasTotals}
|
|
39
|
-
sx={(theme) => ({
|
|
40
|
-
marginTop: theme.spacings.md,
|
|
41
|
-
marginBottom: theme.spacings.lg,
|
|
42
|
-
})}
|
|
43
46
|
>
|
|
44
47
|
<Box
|
|
45
48
|
component='span'
|
package/hooks/useCartQuery.ts
CHANGED
|
@@ -20,7 +20,7 @@ export function useCartQuery<Q, V extends { cartId: string; [index: string]: unk
|
|
|
20
20
|
|
|
21
21
|
const router = useRouter()
|
|
22
22
|
const currentCartId = useCurrentCartId()
|
|
23
|
-
const urlCartId = router.query.
|
|
23
|
+
const urlCartId = router.query.cart_id
|
|
24
24
|
const usingUrl = allowUrl && typeof urlCartId === 'string'
|
|
25
25
|
|
|
26
26
|
const cartId = usingUrl ? urlCartId : currentCartId
|
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": "4.2.
|
|
5
|
+
"version": "4.2.3",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"prettier": "@graphcommerce/prettier-config-pwa",
|
|
8
8
|
"eslintConfig": {
|
|
@@ -12,28 +12,28 @@
|
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
|
-
"@graphcommerce/eslint-config-pwa": "^4.
|
|
16
|
-
"@graphcommerce/prettier-config-pwa": "^4.0.
|
|
15
|
+
"@graphcommerce/eslint-config-pwa": "^4.1.4",
|
|
16
|
+
"@graphcommerce/prettier-config-pwa": "^4.0.5",
|
|
17
17
|
"@graphcommerce/typescript-config-pwa": "^4.0.2",
|
|
18
|
-
"@playwright/test": "^1.
|
|
18
|
+
"@playwright/test": "^1.20.1"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@graphcommerce/ecommerce-ui": "
|
|
22
|
-
"@graphcommerce/framer-next-pages": "
|
|
23
|
-
"@graphcommerce/framer-scroller": "
|
|
24
|
-
"@graphcommerce/graphql": "
|
|
25
|
-
"@graphcommerce/image": "
|
|
26
|
-
"@graphcommerce/magento-customer": "
|
|
27
|
-
"@graphcommerce/magento-graphql": "
|
|
28
|
-
"@graphcommerce/magento-store": "
|
|
29
|
-
"@graphcommerce/next-ui": "
|
|
30
|
-
"@graphcommerce/react-hook-form": "
|
|
21
|
+
"@graphcommerce/ecommerce-ui": "1.0.5",
|
|
22
|
+
"@graphcommerce/framer-next-pages": "3.1.5",
|
|
23
|
+
"@graphcommerce/framer-scroller": "2.1.4",
|
|
24
|
+
"@graphcommerce/graphql": "3.0.7",
|
|
25
|
+
"@graphcommerce/image": "3.1.3",
|
|
26
|
+
"@graphcommerce/magento-customer": "4.2.1",
|
|
27
|
+
"@graphcommerce/magento-graphql": "3.0.6",
|
|
28
|
+
"@graphcommerce/magento-store": "4.1.5",
|
|
29
|
+
"@graphcommerce/next-ui": "4.5.1",
|
|
30
|
+
"@graphcommerce/react-hook-form": "3.0.7"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
33
|
"@lingui/macro": "^3.13.2",
|
|
34
|
-
"@mui/material": "
|
|
34
|
+
"@mui/material": "5.5.3",
|
|
35
35
|
"framer-motion": "^6.2.4",
|
|
36
|
-
"next": "
|
|
36
|
+
"next": "12.1.2",
|
|
37
37
|
"react": "^17.0.2",
|
|
38
38
|
"react-dom": "^17.0.2"
|
|
39
39
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ApolloClient, NormalizedCacheObject } from '@graphcommerce/graphql'
|
|
2
|
+
import { Page } from '@playwright/test'
|
|
3
|
+
import { CartAgreementsDocument } from '../components/CartAgreementsForm/CartAgreements.gql'
|
|
4
|
+
|
|
5
|
+
export async function fillCartAgreementsForm(
|
|
6
|
+
page: Page,
|
|
7
|
+
client: ApolloClient<NormalizedCacheObject>,
|
|
8
|
+
) {
|
|
9
|
+
const res = (await client.query({ query: CartAgreementsDocument })).data
|
|
10
|
+
|
|
11
|
+
for await (const agreement of res.checkoutAgreements ?? []) {
|
|
12
|
+
if (!agreement?.agreement_id || agreement?.mode === 'AUTO') continue
|
|
13
|
+
|
|
14
|
+
await page.locator(`input[name="agreement\\[${agreement.agreement_id}\\]"]`).click()
|
|
15
|
+
}
|
|
16
|
+
}
|