@graphcommerce/magento-cart 4.2.5 → 4.2.8
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 +45 -0
- package/components/ApolloCartError/ApolloCartErrorAlert.tsx +4 -2
- package/components/CartAddressMultiLine/CartAddressMultiLine.tsx +1 -1
- package/components/CartAddressSingleLine/CartAddressSingleLine.tsx +1 -1
- package/components/CartAgreementsForm/CartAgreementsForm.tsx +2 -1
- package/package.json +14 -14
- package/test/fillCartAgreementsForm.ts +1 -0
- package/typePolicies.ts +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,50 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 4.2.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`100f4c38c`](https://github.com/graphcommerce-org/graphcommerce/commit/100f4c38c8fcda4bc6e0425e38028b550b60adc2)]:
|
|
8
|
+
- @graphcommerce/graphql@3.1.1
|
|
9
|
+
- @graphcommerce/next-ui@4.6.2
|
|
10
|
+
- @graphcommerce/react-hook-form@3.1.2
|
|
11
|
+
- @graphcommerce/magento-customer@4.2.6
|
|
12
|
+
- @graphcommerce/magento-store@4.1.8
|
|
13
|
+
- @graphcommerce/ecommerce-ui@1.0.8
|
|
14
|
+
- @graphcommerce/magento-graphql@3.0.8
|
|
15
|
+
- @graphcommerce/framer-scroller@2.1.7
|
|
16
|
+
|
|
17
|
+
## 4.2.7
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- [#1412](https://github.com/graphcommerce-org/graphcommerce/pull/1412) [`d8906cf4a`](https://github.com/graphcommerce-org/graphcommerce/commit/d8906cf4afbfc234aedd91a2c581f82623267357) Thanks [@FrankHarland](https://github.com/FrankHarland)! - add missing translation components
|
|
22
|
+
|
|
23
|
+
- Updated dependencies [[`d8906cf4a`](https://github.com/graphcommerce-org/graphcommerce/commit/d8906cf4afbfc234aedd91a2c581f82623267357)]:
|
|
24
|
+
- @graphcommerce/magento-customer@4.2.5
|
|
25
|
+
|
|
26
|
+
## 4.2.6
|
|
27
|
+
|
|
28
|
+
### Patch Changes
|
|
29
|
+
|
|
30
|
+
- [#1399](https://github.com/graphcommerce-org/graphcommerce/pull/1399) [`fb277d8e1`](https://github.com/graphcommerce-org/graphcommerce/commit/fb277d8e1e3612c5e9cf890a30d19cfd1ff70542) Thanks [@paales](https://github.com/paales)! - Now using [@graphql-yoga](https://github.com/dotansimha/graphql-yoga) for GraphQL which has full support for [envelop](https://www.envelop.dev/) plugins.
|
|
31
|
+
|
|
32
|
+
* [#1399](https://github.com/graphcommerce-org/graphcommerce/pull/1399) [`fb277d8e1`](https://github.com/graphcommerce-org/graphcommerce/commit/fb277d8e1e3612c5e9cf890a30d19cfd1ff70542) Thanks [@paales](https://github.com/paales)! - Added a new @graphcommerce/cli package to generate the mesh so it can be generated _inside_ the @graphcommerce/graphql-mesh package to allow for better future extensibility.
|
|
33
|
+
|
|
34
|
+
- [#1399](https://github.com/graphcommerce-org/graphcommerce/pull/1399) [`da0ae7d02`](https://github.com/graphcommerce-org/graphcommerce/commit/da0ae7d0236e4908ba0bf0fa16656be516e841d4) Thanks [@paales](https://github.com/paales)! - Updated dependencies
|
|
35
|
+
|
|
36
|
+
- Updated dependencies [[`fb277d8e1`](https://github.com/graphcommerce-org/graphcommerce/commit/fb277d8e1e3612c5e9cf890a30d19cfd1ff70542), [`fb277d8e1`](https://github.com/graphcommerce-org/graphcommerce/commit/fb277d8e1e3612c5e9cf890a30d19cfd1ff70542), [`da0ae7d02`](https://github.com/graphcommerce-org/graphcommerce/commit/da0ae7d0236e4908ba0bf0fa16656be516e841d4)]:
|
|
37
|
+
- @graphcommerce/graphql@3.1.0
|
|
38
|
+
- @graphcommerce/magento-customer@4.2.4
|
|
39
|
+
- @graphcommerce/magento-graphql@3.0.7
|
|
40
|
+
- @graphcommerce/magento-store@4.1.7
|
|
41
|
+
- @graphcommerce/next-ui@4.6.1
|
|
42
|
+
- @graphcommerce/react-hook-form@3.1.1
|
|
43
|
+
- @graphcommerce/ecommerce-ui@1.0.7
|
|
44
|
+
- @graphcommerce/framer-next-pages@3.1.6
|
|
45
|
+
- @graphcommerce/framer-scroller@2.1.6
|
|
46
|
+
- @graphcommerce/image@3.1.5
|
|
47
|
+
|
|
3
48
|
## 4.2.5
|
|
4
49
|
|
|
5
50
|
### Patch Changes
|
|
@@ -2,7 +2,7 @@ import { ApolloErrorAlert, ApolloErrorAlertProps } from '@graphcommerce/ecommerc
|
|
|
2
2
|
import { useQuery } from '@graphcommerce/graphql'
|
|
3
3
|
import { CustomerTokenDocument } from '@graphcommerce/magento-customer'
|
|
4
4
|
import { graphqlErrorByCategory } from '@graphcommerce/magento-graphql'
|
|
5
|
-
import { t } from '@lingui/macro'
|
|
5
|
+
import { t, Trans } from '@lingui/macro'
|
|
6
6
|
import { Button } from '@mui/material'
|
|
7
7
|
import Link from 'next/link'
|
|
8
8
|
import { useClearCurrentCartId } from '../../hooks/useClearCurrentCartId'
|
|
@@ -28,7 +28,9 @@ export function ApolloCartErrorAlert(props: ApolloCartErrorAlertProps) {
|
|
|
28
28
|
action =
|
|
29
29
|
authorizationError && clear ? (
|
|
30
30
|
<Link href='/account/signin' passHref>
|
|
31
|
-
<Button>
|
|
31
|
+
<Button>
|
|
32
|
+
<Trans>Sign in</Trans>
|
|
33
|
+
</Button>
|
|
32
34
|
</Link>
|
|
33
35
|
) : (
|
|
34
36
|
action
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CountryCodeEnum } from '@graphcommerce/graphql'
|
|
1
|
+
import type { CountryCodeEnum } from '@graphcommerce/graphql-mesh'
|
|
2
2
|
import { AddressMultiLine } from '@graphcommerce/magento-customer'
|
|
3
3
|
import React from 'react'
|
|
4
4
|
import { CartAddressFragment } from '../CartAddress/CartAddress.gql'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CountryCodeEnum } from '@graphcommerce/graphql'
|
|
1
|
+
import type { CountryCodeEnum } from '@graphcommerce/graphql-mesh'
|
|
2
2
|
import { AddressSingleLine } from '@graphcommerce/magento-customer'
|
|
3
3
|
import React from 'react'
|
|
4
4
|
import { CartAddressFragment } from '../CartAddress/CartAddress.gql'
|
|
@@ -45,6 +45,7 @@ export function CartAgreementsForm(props: CartAgreementsFormProps) {
|
|
|
45
45
|
const { handleSubmit, formState, control } = form
|
|
46
46
|
|
|
47
47
|
const submit = handleSubmit((values) => {
|
|
48
|
+
// eslint-disable-next-line no-console
|
|
48
49
|
console.log(values)
|
|
49
50
|
})
|
|
50
51
|
|
|
@@ -75,7 +76,7 @@ export function CartAgreementsForm(props: CartAgreementsFormProps) {
|
|
|
75
76
|
}}
|
|
76
77
|
render={({
|
|
77
78
|
field: { onChange, value, name, ref, onBlur },
|
|
78
|
-
fieldState: { error
|
|
79
|
+
fieldState: { error },
|
|
79
80
|
}) => (
|
|
80
81
|
<FormControl
|
|
81
82
|
error={!!formState.errors[String(agreement.agreement_id)]}
|
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.8",
|
|
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.1.
|
|
16
|
-
"@graphcommerce/prettier-config-pwa": "^4.0.
|
|
15
|
+
"@graphcommerce/eslint-config-pwa": "^4.1.6",
|
|
16
|
+
"@graphcommerce/prettier-config-pwa": "^4.0.6",
|
|
17
17
|
"@graphcommerce/typescript-config-pwa": "^4.0.2",
|
|
18
|
-
"@playwright/test": "^1.
|
|
18
|
+
"@playwright/test": "^1.21.1"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@graphcommerce/ecommerce-ui": "1.0.
|
|
22
|
-
"@graphcommerce/framer-next-pages": "3.1.
|
|
23
|
-
"@graphcommerce/framer-scroller": "2.1.
|
|
24
|
-
"@graphcommerce/graphql": "3.
|
|
25
|
-
"@graphcommerce/image": "3.1.
|
|
26
|
-
"@graphcommerce/magento-customer": "4.2.
|
|
27
|
-
"@graphcommerce/magento-graphql": "3.0.
|
|
28
|
-
"@graphcommerce/magento-store": "4.1.
|
|
29
|
-
"@graphcommerce/next-ui": "4.6.
|
|
30
|
-
"@graphcommerce/react-hook-form": "3.1.
|
|
21
|
+
"@graphcommerce/ecommerce-ui": "1.0.8",
|
|
22
|
+
"@graphcommerce/framer-next-pages": "3.1.6",
|
|
23
|
+
"@graphcommerce/framer-scroller": "2.1.7",
|
|
24
|
+
"@graphcommerce/graphql": "3.1.1",
|
|
25
|
+
"@graphcommerce/image": "3.1.5",
|
|
26
|
+
"@graphcommerce/magento-customer": "4.2.6",
|
|
27
|
+
"@graphcommerce/magento-graphql": "3.0.8",
|
|
28
|
+
"@graphcommerce/magento-store": "4.1.8",
|
|
29
|
+
"@graphcommerce/next-ui": "4.6.2",
|
|
30
|
+
"@graphcommerce/react-hook-form": "3.1.2"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
33
|
"@lingui/macro": "^3.13.2",
|
|
@@ -9,6 +9,7 @@ export async function fillCartAgreementsForm(
|
|
|
9
9
|
const res = (await client.query({ query: CartAgreementsDocument })).data
|
|
10
10
|
|
|
11
11
|
for await (const agreement of res.checkoutAgreements ?? []) {
|
|
12
|
+
// eslint-disable-next-line no-continue
|
|
12
13
|
if (!agreement?.agreement_id || agreement?.mode === 'AUTO') continue
|
|
13
14
|
|
|
14
15
|
await page.locator(`input[name="agreement\\[${agreement.agreement_id}\\]"]`).click()
|
package/typePolicies.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ApolloCache, NormalizedCacheObject } from '@graphcommerce/graphql'
|
|
2
|
-
import type {
|
|
3
|
-
import { CartPrices } from '@graphcommerce/graphql
|
|
2
|
+
import type { StrictTypedTypePolicies } from '@graphcommerce/graphql'
|
|
3
|
+
import type { CartPrices, QuerycartArgs, ShippingCartAddress } from '@graphcommerce/graphql-mesh'
|
|
4
4
|
import { CartFabDocument } from './components/CartFab/CartFab.gql'
|
|
5
5
|
import { CurrentCartIdDocument } from './hooks/CurrentCartId.gql'
|
|
6
6
|
|
|
7
|
-
export const cartTypePolicies:
|
|
7
|
+
export const cartTypePolicies: StrictTypedTypePolicies = {
|
|
8
8
|
CurrentCartId: { keyFields: [] },
|
|
9
9
|
CartPrices: {
|
|
10
10
|
merge: (exiting, incomming, { mergeObjects }) => mergeObjects(exiting, incomming),
|
|
@@ -29,7 +29,7 @@ export const cartTypePolicies: TypedTypePolicies = {
|
|
|
29
29
|
fields: {
|
|
30
30
|
currentCartId: (_, { toReference }) => toReference({ __typename: 'CurrentCartId' }),
|
|
31
31
|
cart: (_, { args, toReference }) =>
|
|
32
|
-
toReference({ __typename: 'Cart', id: (args as
|
|
32
|
+
toReference({ __typename: 'Cart', id: (args as QuerycartArgs)?.cart_id }),
|
|
33
33
|
},
|
|
34
34
|
},
|
|
35
35
|
}
|