@graphcommerce/magento-cart-payment-method 3.3.2 → 3.3.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 CHANGED
@@ -1,5 +1,18 @@
1
1
  # Change Log
2
2
 
3
+ ## 3.3.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1524](https://github.com/graphcommerce-org/graphcommerce/pull/1524) [`dae4551b7`](https://github.com/graphcommerce-org/graphcommerce/commit/dae4551b7b8181adc3405fb1ce88eae56495a8a9) Thanks [@paales](https://github.com/paales)! - make sure we are correctly rendering children when the payment method is a childmethod
8
+
9
+ - Updated dependencies [[`d140fca34`](https://github.com/graphcommerce-org/graphcommerce/commit/d140fca3463b73e761e23fd1d9216305727f0c1a), [`9ec0338df`](https://github.com/graphcommerce-org/graphcommerce/commit/9ec0338dfe34d37b0f2c24e36ffa6ed13ea1145e), [`735b78672`](https://github.com/graphcommerce-org/graphcommerce/commit/735b786724d5401cbe6e88f2515e121a1a0945b2)]:
10
+ - @graphcommerce/magento-cart@4.4.6
11
+ - @graphcommerce/next-ui@4.11.0
12
+ - @graphcommerce/magento-store@4.2.12
13
+ - @graphcommerce/graphql@3.3.0
14
+ - @graphcommerce/framer-scroller@2.1.18
15
+
3
16
  ## 3.3.2
4
17
 
5
18
  ### Patch Changes
@@ -27,10 +27,14 @@ function PaymentMethodActionCard(
27
27
  sx?: SxProps<Theme>
28
28
  },
29
29
  ) {
30
- const { onReset, code, step, Container, sx = [] } = props
30
+ const { onReset, code, step, child, Container, sx = [] } = props
31
31
  const { selectedMethod, selectedModule, modules } = usePaymentMethodContext()
32
32
 
33
- const selectedAndOptions = selectedMethod?.code === code && selectedModule?.PaymentOptions
33
+ const selectedAndOptions =
34
+ selectedMethod?.code === code &&
35
+ selectedMethod.child === child &&
36
+ selectedModule?.PaymentOptions
37
+
34
38
  const Card = modules[code]?.PaymentActionCard ?? DefaultPaymentActionCard
35
39
 
36
40
  return (
@@ -82,6 +86,7 @@ export function PaymentMethodActionCardListForm(props: PaymentMethodActionCardLi
82
86
  useFormPersist({ form, name: 'PaymentMethodActionCardList' })
83
87
  useFormCompose({ form, step: 1, submit, key: 'PaymentMethodActionCardList' })
84
88
 
89
+ // todo: Do not useEffect to set value, usePaymentMethodContext should calculate these values.
85
90
  useEffect(() => {
86
91
  const [code, child] = paymentMethod?.split('___') ?? ['']
87
92
  if (code === selectedMethod?.code) return
@@ -103,20 +108,17 @@ export function PaymentMethodActionCardListForm(props: PaymentMethodActionCardLi
103
108
  if (!methods || methods.length < 1) return null
104
109
 
105
110
  return (
106
- <Form onSubmit={submit} noValidate>
107
- <ActionCardListForm<PaymentOptionsProps & ActionCardItemBase>
108
- control={control}
109
- name='paymentMethod'
110
- errorMessage='Please select a shipping address'
111
- items={methods.map((method) => ({
112
- ...method,
113
- value: method.code,
114
- step,
115
- Container: FormDiv,
116
- }))}
117
- render={PaymentMethodActionCard}
118
- />
119
- {/* <ApolloCartErrorAlert error={error} /> */}
120
- </Form>
111
+ <ActionCardListForm<PaymentOptionsProps & ActionCardItemBase>
112
+ control={control}
113
+ name='paymentMethod'
114
+ errorMessage='Please select a shipping address'
115
+ items={methods.map((method) => ({
116
+ ...method,
117
+ value: method.code,
118
+ step,
119
+ Container: FormDiv,
120
+ }))}
121
+ render={PaymentMethodActionCard}
122
+ />
121
123
  )
122
124
  }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@graphcommerce/magento-cart-payment-method",
3
3
  "homepage": "https://www.graphcommerce.org/",
4
4
  "repository": "github:graphcommerce-org/graphcommerce",
5
- "version": "3.3.2",
5
+ "version": "3.3.3",
6
6
  "sideEffects": false,
7
7
  "prettier": "@graphcommerce/prettier-config-pwa",
8
8
  "eslintConfig": {
@@ -15,17 +15,17 @@
15
15
  "@graphcommerce/eslint-config-pwa": "^4.1.8",
16
16
  "@graphcommerce/prettier-config-pwa": "^4.0.6",
17
17
  "@graphcommerce/typescript-config-pwa": "^4.0.3",
18
- "@graphcommerce/magento-cart-shipping-address": "3.2.1",
18
+ "@graphcommerce/magento-cart-shipping-address": "3.2.2",
19
19
  "@playwright/test": "^1.21.1",
20
20
  "type-fest": "^2.12.2"
21
21
  },
22
22
  "dependencies": {
23
- "@graphcommerce/framer-scroller": "2.1.17",
24
- "@graphcommerce/graphql": "3.2.1",
23
+ "@graphcommerce/framer-scroller": "2.1.18",
24
+ "@graphcommerce/graphql": "3.3.0",
25
25
  "@graphcommerce/image": "3.1.7",
26
- "@graphcommerce/magento-cart": "4.4.5",
27
- "@graphcommerce/magento-store": "4.2.11",
28
- "@graphcommerce/next-ui": "4.10.0",
26
+ "@graphcommerce/magento-cart": "4.4.6",
27
+ "@graphcommerce/magento-store": "4.2.12",
28
+ "@graphcommerce/next-ui": "4.11.0",
29
29
  "@graphcommerce/react-hook-form": "3.2.2"
30
30
  },
31
31
  "peerDependencies": {