@graphcommerce/magento-cart 4.1.4 → 4.2.2
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 +44 -0
- package/components/CartAgreementsForm/CartAgreementsForm.tsx +1 -1
- package/components/CartFab/CartFab.tsx +3 -3
- package/components/CartStartCheckout/CartStartCheckout.tsx +8 -5
- package/hooks/useCartQuery.ts +1 -1
- package/package.json +14 -14
- package/test/fillCartAgreementsForm.ts +16 -0
- package/_playwright/fillCartAgreementsForm.ts +0 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,49 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 4.2.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#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
|
|
8
|
+
|
|
9
|
+
- 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)]:
|
|
10
|
+
- @graphcommerce/graphql@3.0.6
|
|
11
|
+
- @graphcommerce/next-ui@4.5.0
|
|
12
|
+
- @graphcommerce/ecommerce-ui@1.0.4
|
|
13
|
+
- @graphcommerce/framer-next-pages@3.1.4
|
|
14
|
+
- @graphcommerce/framer-scroller@2.1.3
|
|
15
|
+
- @graphcommerce/image@3.1.2
|
|
16
|
+
- @graphcommerce/magento-customer@4.2.0
|
|
17
|
+
- @graphcommerce/magento-graphql@3.0.5
|
|
18
|
+
- @graphcommerce/magento-store@4.1.4
|
|
19
|
+
- @graphcommerce/react-hook-form@3.0.6
|
|
20
|
+
|
|
21
|
+
## 4.2.1
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- [#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
|
|
26
|
+
|
|
27
|
+
- 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)]:
|
|
28
|
+
- @graphcommerce/framer-scroller@2.1.2
|
|
29
|
+
- @graphcommerce/next-ui@4.4.0
|
|
30
|
+
- @graphcommerce/framer-next-pages@3.1.3
|
|
31
|
+
- @graphcommerce/magento-customer@4.1.6
|
|
32
|
+
|
|
33
|
+
## 4.2.0
|
|
34
|
+
|
|
35
|
+
### Minor Changes
|
|
36
|
+
|
|
37
|
+
- [#1322](https://github.com/graphcommerce-org/graphcommerce/pull/1322) [`7a3799bfc`](https://github.com/graphcommerce-org/graphcommerce/commit/7a3799bfc107f26aa9991a91db5f228e3476f4aa) Thanks [@paales](https://github.com/paales)! - Make CartFab and MenuFab’s color, size and variant passable by props
|
|
38
|
+
|
|
39
|
+
### Patch Changes
|
|
40
|
+
|
|
41
|
+
- Updated dependencies [[`5266388ea`](https://github.com/graphcommerce-org/graphcommerce/commit/5266388eaffda41592623ef7a3ddbbe03c8e0dad), [`9b35403d9`](https://github.com/graphcommerce-org/graphcommerce/commit/9b35403d9dbb2606ac7cf3bb641a0f9cc3d8a2ba), [`0298a0de1`](https://github.com/graphcommerce-org/graphcommerce/commit/0298a0de1d13e543c4124a6a099297b4e27e2b05), [`815132ea4`](https://github.com/graphcommerce-org/graphcommerce/commit/815132ea43937b4b84b59ec9974ac593cb4eb456), [`3326742a0`](https://github.com/graphcommerce-org/graphcommerce/commit/3326742a0dceb45f0cac4741ca09dc4d4f09ad90), [`7a3799bfc`](https://github.com/graphcommerce-org/graphcommerce/commit/7a3799bfc107f26aa9991a91db5f228e3476f4aa), [`9a77f88ed`](https://github.com/graphcommerce-org/graphcommerce/commit/9a77f88ed26cbecdae9a135c3cb234a5b7ecf4df), [`1e2a07141`](https://github.com/graphcommerce-org/graphcommerce/commit/1e2a071414154600430e6dcf0513d86ab78e0b28), [`0eeaad304`](https://github.com/graphcommerce-org/graphcommerce/commit/0eeaad30461b1d5b486438f0287fa76d49429044), [`bc5213547`](https://github.com/graphcommerce-org/graphcommerce/commit/bc52135471479c83d989449dad24798112e898f4), [`3f1912f55`](https://github.com/graphcommerce-org/graphcommerce/commit/3f1912f553318d5888f8af2b841918ef4ae96a84), [`3b4d46de2`](https://github.com/graphcommerce-org/graphcommerce/commit/3b4d46de2555db9eed733c8fac574bc809d75da4), [`d91359871`](https://github.com/graphcommerce-org/graphcommerce/commit/d91359871b023a9f0d305b37353c1ee2d0912248), [`b6c68cda8`](https://github.com/graphcommerce-org/graphcommerce/commit/b6c68cda8836a1d0c78ef351899cec9ec1037385)]:
|
|
42
|
+
- @graphcommerce/next-ui@4.3.0
|
|
43
|
+
- @graphcommerce/magento-store@4.1.3
|
|
44
|
+
- @graphcommerce/framer-scroller@2.1.0
|
|
45
|
+
- @graphcommerce/magento-customer@4.1.5
|
|
46
|
+
|
|
3
47
|
## 4.1.4
|
|
4
48
|
|
|
5
49
|
### Patch 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={({
|
|
@@ -18,7 +18,7 @@ import { CartTotalQuantityFragment } from './CartTotalQuantity.gql'
|
|
|
18
18
|
export type CartFabProps = {
|
|
19
19
|
icon?: React.ReactNode
|
|
20
20
|
sx?: SxProps<Theme>
|
|
21
|
-
}
|
|
21
|
+
} & Pick<FabProps, 'color' | 'size' | 'variant'>
|
|
22
22
|
|
|
23
23
|
type CartFabContentProps = CartFabProps & CartTotalQuantityFragment
|
|
24
24
|
|
|
@@ -58,7 +58,6 @@ function CartFabContent(props: CartFabContentProps) {
|
|
|
58
58
|
<PageLink href='/cart' passHref>
|
|
59
59
|
<MotionFab
|
|
60
60
|
className={classes.cart}
|
|
61
|
-
{...fabProps}
|
|
62
61
|
aria-label={t`Cart`}
|
|
63
62
|
color='inherit'
|
|
64
63
|
size='responsive'
|
|
@@ -68,6 +67,7 @@ function CartFabContent(props: CartFabContentProps) {
|
|
|
68
67
|
backgroundColor: `${theme.palette.background.paper} !important`,
|
|
69
68
|
},
|
|
70
69
|
})}
|
|
70
|
+
{...fabProps}
|
|
71
71
|
>
|
|
72
72
|
{total_quantity > 0 ? (
|
|
73
73
|
<DesktopHeaderBadge color='primary' variant='dot' overlap='circular'>
|
|
@@ -86,7 +86,7 @@ function CartFabContent(props: CartFabContentProps) {
|
|
|
86
86
|
position: 'absolute',
|
|
87
87
|
height: '100%',
|
|
88
88
|
width: '100%',
|
|
89
|
-
boxShadow:
|
|
89
|
+
boxShadow: 6,
|
|
90
90
|
top: 0,
|
|
91
91
|
[theme.breakpoints.down('md')]: {
|
|
92
92
|
opacity: '1 !important',
|
|
@@ -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.
|
|
5
|
+
"version": "4.2.2",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"prettier": "@graphcommerce/prettier-config-pwa",
|
|
8
8
|
"eslintConfig": {
|
|
@@ -12,22 +12,22 @@
|
|
|
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.3",
|
|
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": "^1.0.
|
|
22
|
-
"@graphcommerce/framer-next-pages": "^3.1.
|
|
23
|
-
"@graphcommerce/framer-scroller": "^2.
|
|
24
|
-
"@graphcommerce/graphql": "^3.0.
|
|
25
|
-
"@graphcommerce/image": "^3.1.
|
|
26
|
-
"@graphcommerce/magento-customer": "^4.
|
|
27
|
-
"@graphcommerce/magento-graphql": "^3.0.
|
|
28
|
-
"@graphcommerce/magento-store": "^4.1.
|
|
29
|
-
"@graphcommerce/next-ui": "^4.
|
|
30
|
-
"@graphcommerce/react-hook-form": "^3.0.
|
|
21
|
+
"@graphcommerce/ecommerce-ui": "^1.0.4",
|
|
22
|
+
"@graphcommerce/framer-next-pages": "^3.1.4",
|
|
23
|
+
"@graphcommerce/framer-scroller": "^2.1.3",
|
|
24
|
+
"@graphcommerce/graphql": "^3.0.6",
|
|
25
|
+
"@graphcommerce/image": "^3.1.2",
|
|
26
|
+
"@graphcommerce/magento-customer": "^4.2.0",
|
|
27
|
+
"@graphcommerce/magento-graphql": "^3.0.5",
|
|
28
|
+
"@graphcommerce/magento-store": "^4.1.4",
|
|
29
|
+
"@graphcommerce/next-ui": "^4.5.0",
|
|
30
|
+
"@graphcommerce/react-hook-form": "^3.0.6"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
33
|
"@lingui/macro": "^3.13.2",
|
|
@@ -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
|
+
}
|