@graphcommerce/magento-cart-payment-method 3.3.3 → 3.4.0

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,45 @@
1
1
  # Change Log
2
2
 
3
+ ## 3.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#1544](https://github.com/graphcommerce-org/graphcommerce/pull/1544) [`5f927ebdc`](https://github.com/graphcommerce-org/graphcommerce/commit/5f927ebdc6f0331833e02b96e4f169bfe475ac6b) Thanks [@mikekeehnen](https://github.com/mikekeehnen)! - Fixed hydration errors on account, cart and wishlist
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [[`5f927ebdc`](https://github.com/graphcommerce-org/graphcommerce/commit/5f927ebdc6f0331833e02b96e4f169bfe475ac6b), [`c87a28e7d`](https://github.com/graphcommerce-org/graphcommerce/commit/c87a28e7dad87bffd0bd125ad5fdca65aaa389cc), [`c756f42e5`](https://github.com/graphcommerce-org/graphcommerce/commit/c756f42e503761a497e4a5a7a02d02141df231c3)]:
12
+ - @graphcommerce/graphql@3.4.0
13
+ - @graphcommerce/magento-cart@4.5.0
14
+ - @graphcommerce/react-hook-form@3.3.0
15
+ - @graphcommerce/next-ui@4.12.0
16
+ - @graphcommerce/magento-store@4.2.15
17
+ - @graphcommerce/framer-scroller@2.1.21
18
+
19
+ ## 3.3.5
20
+
21
+ ### Patch Changes
22
+
23
+ - [#1538](https://github.com/graphcommerce-org/graphcommerce/pull/1538) [`fe4baa42d`](https://github.com/graphcommerce-org/graphcommerce/commit/fe4baa42db0081ed960d62aef688bd36a7ac974f) Thanks [@paales](https://github.com/paales)! - add missing translations
24
+
25
+ - Updated dependencies [[`fe4baa42d`](https://github.com/graphcommerce-org/graphcommerce/commit/fe4baa42db0081ed960d62aef688bd36a7ac974f)]:
26
+ - @graphcommerce/magento-cart@4.4.8
27
+ - @graphcommerce/next-ui@4.11.2
28
+ - @graphcommerce/framer-scroller@2.1.20
29
+ - @graphcommerce/magento-store@4.2.14
30
+
31
+ ## 3.3.4
32
+
33
+ ### Patch Changes
34
+
35
+ - [#1529](https://github.com/graphcommerce-org/graphcommerce/pull/1529) [`d5e012462`](https://github.com/graphcommerce-org/graphcommerce/commit/d5e012462dda18a61aa20eca8dc57e26cc4c7931) Thanks [@paales](https://github.com/paales)! - When a payment method had multiple childs it would select all children at once.
36
+
37
+ - Updated dependencies [[`11bca2d2f`](https://github.com/graphcommerce-org/graphcommerce/commit/11bca2d2f7dbb7c5e2827c04eb0db43d4099f2fd)]:
38
+ - @graphcommerce/next-ui@4.11.1
39
+ - @graphcommerce/framer-scroller@2.1.19
40
+ - @graphcommerce/magento-cart@4.4.7
41
+ - @graphcommerce/magento-store@4.2.13
42
+
3
43
  ## 3.3.3
4
44
 
5
45
  ### Patch Changes
@@ -111,10 +111,10 @@ export function PaymentMethodActionCardListForm(props: PaymentMethodActionCardLi
111
111
  <ActionCardListForm<PaymentOptionsProps & ActionCardItemBase>
112
112
  control={control}
113
113
  name='paymentMethod'
114
- errorMessage='Please select a shipping address'
114
+ errorMessage='Please select a payment method'
115
115
  items={methods.map((method) => ({
116
116
  ...method,
117
- value: method.code,
117
+ value: `${method.code}___${method.child}`,
118
118
  step,
119
119
  Container: FormDiv,
120
120
  }))}
@@ -13,18 +13,18 @@ export function PaymentMethodPlaceOrderNoop(props: PaymentPlaceOrderProps) {
13
13
  const { step, code } = props
14
14
  const clearCurrentCartId = useClearCurrentCartId()
15
15
 
16
- const cartId = useCurrentCartId()
16
+ const { currentCartId } = useCurrentCartId()
17
17
  const form = useFormGqlMutationCart(PaymentMethodPlaceOrderNoopDocument)
18
18
 
19
19
  const { handleSubmit, data, error } = form
20
20
  const { push } = useRouter()
21
21
 
22
22
  useEffect(() => {
23
- if (!data?.placeOrder?.order || error || !cartId) return
23
+ if (!data?.placeOrder?.order || error || !currentCartId) return
24
24
  clearCurrentCartId()
25
25
  // eslint-disable-next-line @typescript-eslint/no-floating-promises
26
- push({ pathname: '/checkout/success', query: { cart_id: cartId } })
27
- }, [cartId, clearCurrentCartId, data?.placeOrder?.order, error, push])
26
+ push({ pathname: '/checkout/success', query: { cart_id: currentCartId } })
27
+ }, [clearCurrentCartId, currentCartId, data?.placeOrder?.order, error, push])
28
28
 
29
29
  const submit = handleSubmit(() => {})
30
30
 
@@ -125,7 +125,7 @@ export function PaymentMethodToggles(props: PaymentMethodTogglesProps) {
125
125
  defaultValue=''
126
126
  control={control}
127
127
  name='paymentMethod'
128
- rules={{ required: i18n._(/* i18n */ `Please select a payment method`) }}
128
+ rules={{ required: i18n._(/* i18n */ 'Please select a payment method') }}
129
129
  render={({ field: { onChange, value, name, onBlur } }) => (
130
130
  <Scroller
131
131
  className={classes.scrollerRoot}
@@ -15,7 +15,7 @@ export type CartLockState = {
15
15
  * Todo: Block all operations on the cart while the cart is being blocked.
16
16
  */
17
17
  export function useCartLock<E extends CartLockState>() {
18
- const currentCartId = useCurrentCartId()
18
+ const { currentCartId } = useCurrentCartId()
19
19
  const [justLocked, setJustLocked] = useState(false)
20
20
  const [queryState, setRouterQuery] = useUrlQuery<E>()
21
21
 
@@ -26,7 +26,7 @@ export function useCartLock<E extends CartLockState>() {
26
26
  locked: '1',
27
27
  cart_id: currentCartId,
28
28
  ...params,
29
- } as E)
29
+ } as unknown as E)
30
30
  }
31
31
 
32
32
  const unlock = (params: Omit<E, 'locked' | 'cart_id' | 'method'>) => {
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.3",
5
+ "version": "3.4.0",
6
6
  "sideEffects": false,
7
7
  "prettier": "@graphcommerce/prettier-config-pwa",
8
8
  "eslintConfig": {
@@ -15,18 +15,18 @@
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.2",
18
+ "@graphcommerce/magento-cart-shipping-address": "3.2.5",
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.18",
24
- "@graphcommerce/graphql": "3.3.0",
23
+ "@graphcommerce/framer-scroller": "2.1.21",
24
+ "@graphcommerce/graphql": "3.4.0",
25
25
  "@graphcommerce/image": "3.1.7",
26
- "@graphcommerce/magento-cart": "4.4.6",
27
- "@graphcommerce/magento-store": "4.2.12",
28
- "@graphcommerce/next-ui": "4.11.0",
29
- "@graphcommerce/react-hook-form": "3.2.2"
26
+ "@graphcommerce/magento-cart": "4.5.0",
27
+ "@graphcommerce/magento-store": "4.2.15",
28
+ "@graphcommerce/next-ui": "4.12.0",
29
+ "@graphcommerce/react-hook-form": "3.3.0"
30
30
  },
31
31
  "peerDependencies": {
32
32
  "@lingui/react": "^3.13.2",