@graphcommerce/magento-cart 4.2.1 → 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 CHANGED
@@ -1,5 +1,23 @@
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
+
3
21
  ## 4.2.1
4
22
 
5
23
  ### Patch Changes
@@ -66,7 +66,7 @@ export function CartAgreementsForm(props: CartAgreementsFormProps) {
66
66
  {agreement.mode === 'MANUAL' ? (
67
67
  <Controller
68
68
  defaultValue=''
69
- name={String(agreement.agreement_id)}
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={({
@@ -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.cartId
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.1",
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.1.2",
16
- "@graphcommerce/prettier-config-pwa": "^4.0.3",
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.19.2"
18
+ "@playwright/test": "^1.20.1"
19
19
  },
20
20
  "dependencies": {
21
- "@graphcommerce/ecommerce-ui": "^1.0.3",
22
- "@graphcommerce/framer-next-pages": "^3.1.3",
23
- "@graphcommerce/framer-scroller": "^2.1.2",
24
- "@graphcommerce/graphql": "^3.0.4",
25
- "@graphcommerce/image": "^3.1.1",
26
- "@graphcommerce/magento-customer": "^4.1.6",
27
- "@graphcommerce/magento-graphql": "^3.0.4",
28
- "@graphcommerce/magento-store": "^4.1.3",
29
- "@graphcommerce/next-ui": "^4.4.0",
30
- "@graphcommerce/react-hook-form": "^3.0.4"
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
+ }
@@ -1,6 +0,0 @@
1
- import { Page } from '@playwright/test'
2
-
3
- export async function fillCartAgreementsForm(page: Page) {
4
- const inputs = await page.$$('form[name=cartAgreements] input')
5
- await Promise.all(inputs.map((input) => input.check()))
6
- }