@graphcommerce/magento-cart 3.8.1 → 3.8.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 +11 -0
- package/components/ApolloCartError/ApolloCartErrorAlert.tsx +1 -1
- package/components/CartAgreementsForm/CartAgreementsForm.tsx +5 -5
- package/components/CartFab/CartFab.tsx +1 -1
- package/components/CartItemSummary/index.tsx +1 -1
- package/components/CartSummary/index.tsx +1 -1
- package/components/InlineAccount/index.tsx +2 -4
- package/hooks/useCartQuery.ts +2 -2
- package/hooks/useDisplayInclTax.ts +2 -2
- package/hooks/useMergeCustomerCart.ts +0 -1
- package/package.json +12 -12
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [3.8.2](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/magento-cart@3.8.1...@graphcommerce/magento-cart@3.8.2) (2021-12-03)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* spacing of LayoutTItle ([7afcd31](https://github.com/ho-nl/m2-pwa/commit/7afcd3163d16e902cf2ff7917f56ee6a8798f55b))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
# [3.8.0](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/magento-cart@3.7.4...@graphcommerce/magento-cart@3.8.0) (2021-12-01)
|
|
7
18
|
|
|
8
19
|
|
|
@@ -2,9 +2,9 @@ import { useQuery } from '@apollo/client'
|
|
|
2
2
|
import { CustomerTokenDocument } from '@graphcommerce/magento-customer'
|
|
3
3
|
import { graphqlErrorByCategory } from '@graphcommerce/magento-graphql'
|
|
4
4
|
import { ApolloErrorAlert, ApolloErrorAlertProps, Button } from '@graphcommerce/next-ui'
|
|
5
|
+
import { t } from '@lingui/macro'
|
|
5
6
|
import Link from 'next/link'
|
|
6
7
|
import React from 'react'
|
|
7
|
-
import { t } from '@lingui/macro'
|
|
8
8
|
import { useClearCurrentCartId } from '../../hooks/useClearCurrentCartId'
|
|
9
9
|
|
|
10
10
|
export type ApolloCartErrorAlertProps = ApolloErrorAlertProps
|
|
@@ -51,9 +51,9 @@ export default function CartAgreementsForm(props: CartAgreementsFormProps) {
|
|
|
51
51
|
|
|
52
52
|
// sort conditions so checkboxes will be placed first
|
|
53
53
|
const sortedAgreements = data?.checkoutAgreements
|
|
54
|
-
? [...data.checkoutAgreements].sort((a, b) =>
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
? [...data.checkoutAgreements].sort((a, b) =>
|
|
55
|
+
a?.mode === 'MANUAL' ? -1 : b?.mode === 'MANUAL' ? 1 : 0,
|
|
56
|
+
)
|
|
57
57
|
: []
|
|
58
58
|
|
|
59
59
|
const form = useForm({ mode: 'onChange' })
|
|
@@ -78,7 +78,7 @@ export default function CartAgreementsForm(props: CartAgreementsFormProps) {
|
|
|
78
78
|
<React.Fragment key={agreement.agreement_id}>
|
|
79
79
|
{agreement.mode === 'MANUAL' ? (
|
|
80
80
|
<Controller
|
|
81
|
-
defaultValue=
|
|
81
|
+
defaultValue=''
|
|
82
82
|
name={String(agreement.agreement_id)}
|
|
83
83
|
control={control}
|
|
84
84
|
rules={{ required: t`You have to agree in order to proceed` }}
|
|
@@ -91,7 +91,7 @@ export default function CartAgreementsForm(props: CartAgreementsFormProps) {
|
|
|
91
91
|
classes={{ root: classes.formControlRoot }}
|
|
92
92
|
>
|
|
93
93
|
<FormControlLabel
|
|
94
|
-
control={<Checkbox color='secondary' required
|
|
94
|
+
control={<Checkbox color='secondary' required />}
|
|
95
95
|
label={
|
|
96
96
|
<PageLink href={href} passHref>
|
|
97
97
|
<Link color='secondary'>{agreement.checkbox_text}</Link>
|
|
@@ -20,7 +20,7 @@ const useStyles = makeStyles(
|
|
|
20
20
|
borderRadius: '4px 4px 0 0',
|
|
21
21
|
background: theme.palette.type === 'light' ? '#FFE10820' : theme.palette.background.paper,
|
|
22
22
|
padding: theme.spacings.sm,
|
|
23
|
-
gridColumnGap: theme.spacings.
|
|
23
|
+
gridColumnGap: theme.spacings.xxl,
|
|
24
24
|
gridRowGap: theme.spacings.sm,
|
|
25
25
|
display: `grid`,
|
|
26
26
|
[theme.breakpoints.up('sm')]: {
|
|
@@ -62,9 +62,7 @@ export default function InlineAccount(props: InlineAccountProps) {
|
|
|
62
62
|
|
|
63
63
|
const { data: customerTokenData } = useQuery(CustomerTokenDocument)
|
|
64
64
|
const { data: isEmailAvailableData } = useQuery(IsEmailAvailableDocument, {
|
|
65
|
-
variables: {
|
|
66
|
-
email: cart?.email ?? '',
|
|
67
|
-
},
|
|
65
|
+
variables: { email: cart?.email ?? '' },
|
|
68
66
|
})
|
|
69
67
|
|
|
70
68
|
const { firstname, lastname } = cart?.shipping_addresses?.[0] ?? {}
|
|
@@ -73,7 +71,7 @@ export default function InlineAccount(props: InlineAccountProps) {
|
|
|
73
71
|
)
|
|
74
72
|
const canSignUp = isEmailAvailableData?.isEmailAvailable?.is_email_available === true
|
|
75
73
|
|
|
76
|
-
if (!canSignUp) return
|
|
74
|
+
if (!canSignUp) return null
|
|
77
75
|
|
|
78
76
|
return (
|
|
79
77
|
<div>
|
package/hooks/useCartQuery.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useQuery, TypedDocumentNode, QueryHookOptions } from '@apollo/client'
|
|
2
|
-
import {
|
|
2
|
+
import { usePageRouter } from '@graphcommerce/framer-next-pages'
|
|
3
3
|
import { useCurrentCartId } from './useCurrentCartId'
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -18,7 +18,7 @@ export function useCartQuery<Q, V extends { cartId: string; [index: string]: unk
|
|
|
18
18
|
) {
|
|
19
19
|
const { allowUrl = false, ...queryOptions } = options
|
|
20
20
|
|
|
21
|
-
const router =
|
|
21
|
+
const router = usePageRouter()
|
|
22
22
|
const currentCartId = useCurrentCartId()
|
|
23
23
|
const urlCartId = router.query.cartId
|
|
24
24
|
const usingUrl = allowUrl && typeof urlCartId === 'string'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { usePageRouter } from '@graphcommerce/framer-next-pages'
|
|
2
2
|
|
|
3
3
|
export function useDisplayInclTax(): boolean {
|
|
4
|
-
const { locale } =
|
|
4
|
+
const { locale } = usePageRouter()
|
|
5
5
|
const locales = (process.env.NEXT_PUBLIC_DISPLAY_INCL_TAX ?? '').split(',').map((i) => i.trim())
|
|
6
6
|
return locale ? locales.includes(locale) : false
|
|
7
7
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { useMutation, useQuery } from '@apollo/client'
|
|
2
2
|
import { CustomerTokenDocument, useExtractCustomerErrors } from '@graphcommerce/magento-customer'
|
|
3
|
-
import { graphqlErrorByCategory } from '@graphcommerce/magento-graphql'
|
|
4
3
|
import { useEffect } from 'react'
|
|
5
4
|
import { CustomerCartDocument } from './CustomerCart.gql'
|
|
6
5
|
import { UseMergeCustomerCartDocument } from './UseMergeCustomerCart.gql'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphcommerce/magento-cart",
|
|
3
|
-
"version": "3.8.
|
|
3
|
+
"version": "3.8.2",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"prettier": "@graphcommerce/prettier-config-pwa",
|
|
6
6
|
"browserslist": [
|
|
@@ -14,22 +14,22 @@
|
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
16
|
"@graphcommerce/browserslist-config-pwa": "^3.0.2",
|
|
17
|
-
"@graphcommerce/eslint-config-pwa": "^3.1.
|
|
17
|
+
"@graphcommerce/eslint-config-pwa": "^3.1.6",
|
|
18
18
|
"@graphcommerce/prettier-config-pwa": "^3.0.4",
|
|
19
19
|
"@graphcommerce/typescript-config-pwa": "^3.1.1",
|
|
20
20
|
"@playwright/test": "^1.16.2"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@apollo/client": "^3.4.16",
|
|
24
|
-
"@graphcommerce/framer-next-pages": "^2.
|
|
25
|
-
"@graphcommerce/framer-scroller": "^1.0
|
|
26
|
-
"@graphcommerce/graphql": "^2.105.
|
|
27
|
-
"@graphcommerce/image": "^2.105.
|
|
28
|
-
"@graphcommerce/magento-customer": "^3.6.
|
|
29
|
-
"@graphcommerce/magento-graphql": "^2.104.
|
|
30
|
-
"@graphcommerce/magento-store": "^3.3.
|
|
31
|
-
"@graphcommerce/next-ui": "^3.
|
|
32
|
-
"@graphcommerce/react-hook-form": "^2.104.
|
|
24
|
+
"@graphcommerce/framer-next-pages": "^2.108.0",
|
|
25
|
+
"@graphcommerce/framer-scroller": "^1.1.0",
|
|
26
|
+
"@graphcommerce/graphql": "^2.105.6",
|
|
27
|
+
"@graphcommerce/image": "^2.105.5",
|
|
28
|
+
"@graphcommerce/magento-customer": "^3.6.7",
|
|
29
|
+
"@graphcommerce/magento-graphql": "^2.104.6",
|
|
30
|
+
"@graphcommerce/magento-store": "^3.3.7",
|
|
31
|
+
"@graphcommerce/next-ui": "^3.20.0",
|
|
32
|
+
"@graphcommerce/react-hook-form": "^2.104.1",
|
|
33
33
|
"@lingui/macro": "^3.12.1",
|
|
34
34
|
"@material-ui/core": "^4.12.3",
|
|
35
35
|
"@material-ui/lab": "^4.0.0-alpha.60",
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"react": "^17.0.2",
|
|
40
40
|
"react-dom": "^17.0.2"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "8f156415c7f5a963e363f0d6d18fe5d6bbd5dba2"
|
|
43
43
|
}
|