@graphcommerce/magento-cart-shipping-address 8.0.6 → 8.0.7

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,13 +1,20 @@
1
1
  # Change Log
2
2
 
3
+ ## 8.0.7
4
+
5
+ ### Patch Changes
6
+
7
+ - [#2343](https://github.com/graphcommerce-org/graphcommerce/pull/2343) [`c527bb7`](https://github.com/graphcommerce-org/graphcommerce/commit/c527bb7e8d0f15f546bcc347969f365657410baa) - Fixed shipping address not getting set for logged-in customers with default address ([@paales](https://github.com/paales))
8
+
9
+ - [#2343](https://github.com/graphcommerce-org/graphcommerce/pull/2343) [`c527bb7`](https://github.com/graphcommerce-org/graphcommerce/commit/c527bb7e8d0f15f546bcc347969f365657410baa) - Fixed CustomerAddressForm resetting to a saved address when trying to use a new address ([@paales](https://github.com/paales))
10
+
3
11
  ## 8.0.6
4
12
 
5
13
  ## 8.0.5
6
14
 
7
15
  ### Patch Changes
8
16
 
9
- - [#2237](https://github.com/graphcommerce-org/graphcommerce/pull/2237) [`8d385fb`](https://github.com/graphcommerce-org/graphcommerce/commit/8d385fb83751c97ea62621a163989eddfd1a2f22) - When the checkout address is saved, the billing address would diverge from the shipping address in some cases. In other cases it wouldn't be set at all or would be set to the shipping address.
10
- ([@bramvanderholst](https://github.com/bramvanderholst))
17
+ - [#2237](https://github.com/graphcommerce-org/graphcommerce/pull/2237) [`8d385fb`](https://github.com/graphcommerce-org/graphcommerce/commit/8d385fb83751c97ea62621a163989eddfd1a2f22) - When the checkout address is saved, the billing address would diverge from the shipping address in some cases. In other cases it wouldn't be set at all or would be set to the shipping address. ([@bramvanderholst](https://github.com/bramvanderholst))
11
18
 
12
19
  ## 8.0.5-canary.10
13
20
 
@@ -25,8 +32,7 @@
25
32
 
26
33
  ### Patch Changes
27
34
 
28
- - [#2237](https://github.com/graphcommerce-org/graphcommerce/pull/2237) [`8d385fb`](https://github.com/graphcommerce-org/graphcommerce/commit/8d385fb83751c97ea62621a163989eddfd1a2f22) - When the checkout address is saved, the billing address would diverge from the shipping address in some cases. In other cases it wouldn't be set at all or would be set to the shipping address.
29
- ([@bramvanderholst](https://github.com/bramvanderholst))
35
+ - [#2237](https://github.com/graphcommerce-org/graphcommerce/pull/2237) [`8d385fb`](https://github.com/graphcommerce-org/graphcommerce/commit/8d385fb83751c97ea62621a163989eddfd1a2f22) - When the checkout address is saved, the billing address would diverge from the shipping address in some cases. In other cases it wouldn't be set at all or would be set to the shipping address. ([@bramvanderholst](https://github.com/bramvanderholst))
30
36
 
31
37
  ## 8.0.5-canary.3
32
38
 
@@ -46,11 +52,9 @@
46
52
 
47
53
  ### Patch Changes
48
54
 
49
- - [#2205](https://github.com/graphcommerce-org/graphcommerce/pull/2205) [`d67c89d`](https://github.com/graphcommerce-org/graphcommerce/commit/d67c89d464a60f0e2618dab670b63a39f6291341) - Deprecate the allowUrl option for useCartQuery, it was already enabled by default and should never be set to false.
50
- ([@paales](https://github.com/paales))
55
+ - [#2205](https://github.com/graphcommerce-org/graphcommerce/pull/2205) [`d67c89d`](https://github.com/graphcommerce-org/graphcommerce/commit/d67c89d464a60f0e2618dab670b63a39f6291341) - Deprecate the allowUrl option for useCartQuery, it was already enabled by default and should never be set to false. ([@paales](https://github.com/paales))
51
56
 
52
- - [#2206](https://github.com/graphcommerce-org/graphcommerce/pull/2206) [`646db64`](https://github.com/graphcommerce-org/graphcommerce/commit/646db640ec09c1c82584f5543ab487a44ab8d260) - Solves an issue where the billing address of a logged in customer would not set set when a shipping address was already set
53
- ([@paales](https://github.com/paales))
57
+ - [#2206](https://github.com/graphcommerce-org/graphcommerce/pull/2206) [`646db64`](https://github.com/graphcommerce-org/graphcommerce/commit/646db640ec09c1c82584f5543ab487a44ab8d260) - Solves an issue where the billing address of a logged in customer would not set set when a shipping address was already set ([@paales](https://github.com/paales))
54
58
 
55
59
  ## 8.0.3-canary.6
56
60
 
@@ -62,15 +66,13 @@
62
66
 
63
67
  ### Patch Changes
64
68
 
65
- - [#2206](https://github.com/graphcommerce-org/graphcommerce/pull/2206) [`646db64`](https://github.com/graphcommerce-org/graphcommerce/commit/646db640ec09c1c82584f5543ab487a44ab8d260) - Solves an issue where the billing address of a logged in customer would not set set when a shipping address was already set
66
- ([@paales](https://github.com/paales))
69
+ - [#2206](https://github.com/graphcommerce-org/graphcommerce/pull/2206) [`646db64`](https://github.com/graphcommerce-org/graphcommerce/commit/646db640ec09c1c82584f5543ab487a44ab8d260) - Solves an issue where the billing address of a logged in customer would not set set when a shipping address was already set ([@paales](https://github.com/paales))
67
70
 
68
71
  ## 8.0.3-canary.2
69
72
 
70
73
  ### Patch Changes
71
74
 
72
- - [#2205](https://github.com/graphcommerce-org/graphcommerce/pull/2205) [`d67c89d`](https://github.com/graphcommerce-org/graphcommerce/commit/d67c89d464a60f0e2618dab670b63a39f6291341) - Deprecate the allowUrl option for useCartQuery, it was already enabled by default and should never be set to false.
73
- ([@paales](https://github.com/paales))
75
+ - [#2205](https://github.com/graphcommerce-org/graphcommerce/pull/2205) [`d67c89d`](https://github.com/graphcommerce-org/graphcommerce/commit/d67c89d464a60f0e2618dab670b63a39f6291341) - Deprecate the allowUrl option for useCartQuery, it was already enabled by default and should never be set to false. ([@paales](https://github.com/paales))
74
76
 
75
77
  ## 8.0.3-canary.1
76
78
 
@@ -102,11 +104,9 @@
102
104
 
103
105
  ### Patch Changes
104
106
 
105
- - [#2115](https://github.com/graphcommerce-org/graphcommerce/pull/2115) [`105a1af`](https://github.com/graphcommerce-org/graphcommerce/commit/105a1af8b820de8873e430ae398f1922d39a9110) - Disabled ripple animations on all ActionCard ‘Select’ and ‘Change’ so the rendering is more subtle during checkout.
106
- ([@Jessevdpoel](https://github.com/Jessevdpoel))
107
+ - [#2115](https://github.com/graphcommerce-org/graphcommerce/pull/2115) [`105a1af`](https://github.com/graphcommerce-org/graphcommerce/commit/105a1af8b820de8873e430ae398f1922d39a9110) - Disabled ripple animations on all ActionCard ‘Select’ and ‘Change’ so the rendering is more subtle during checkout. ([@Jessevdpoel](https://github.com/Jessevdpoel))
107
108
 
108
- - [#2118](https://github.com/graphcommerce-org/graphcommerce/pull/2118) [`0cdaad2`](https://github.com/graphcommerce-org/graphcommerce/commit/0cdaad28fb9a20fb5b0b1d339f197b938aa3595a) - Fixed bug where if the customer created a new address during checkout it would not be persisted when navigating back from the payment step.
109
- ([@Jessevdpoel](https://github.com/Jessevdpoel))
109
+ - [#2118](https://github.com/graphcommerce-org/graphcommerce/pull/2118) [`0cdaad2`](https://github.com/graphcommerce-org/graphcommerce/commit/0cdaad28fb9a20fb5b0b1d339f197b938aa3595a) - Fixed bug where if the customer created a new address during checkout it would not be persisted when navigating back from the payment step. ([@Jessevdpoel](https://github.com/Jessevdpoel))
110
110
 
111
111
  ## 8.0.0-canary.100
112
112
 
@@ -1422,31 +1422,31 @@
1422
1422
  All occurences of `<Trans>` and `t` need to be replaced:
1423
1423
 
1424
1424
  ```tsx
1425
- import { Trans, t } from "@lingui/macro";
1425
+ import { Trans, t } from '@lingui/macro'
1426
1426
 
1427
1427
  function MyComponent() {
1428
- const foo = "bar";
1428
+ const foo = 'bar'
1429
1429
  return (
1430
1430
  <div aria-label={t`Account ${foo}`}>
1431
1431
  <Trans>My Translation {foo}</Trans>
1432
1432
  </div>
1433
- );
1433
+ )
1434
1434
  }
1435
1435
  ```
1436
1436
 
1437
1437
  Needs to be replaced with:
1438
1438
 
1439
1439
  ```tsx
1440
- import { Trans } from "@lingui/react";
1441
- import { i18n } from "@lingui/core";
1440
+ import { Trans } from '@lingui/react'
1441
+ import { i18n } from '@lingui/core'
1442
1442
 
1443
1443
  function MyComponent() {
1444
- const foo = "bar";
1444
+ const foo = 'bar'
1445
1445
  return (
1446
1446
  <div aria-label={i18n._(/* i18n */ `Account {foo}`, { foo })}>
1447
- <Trans key="My Translation {foo}" values={{ foo }}></Trans>
1447
+ <Trans key='My Translation {foo}' values={{ foo }}></Trans>
1448
1448
  </div>
1449
- );
1449
+ )
1450
1450
  }
1451
1451
  ```
1452
1452
 
@@ -14,7 +14,7 @@ import { CustomerDocument } from '@graphcommerce/magento-customer'
14
14
  import { ActionCardListForm, filterNonNullableKeys } from '@graphcommerce/next-ui'
15
15
  import { i18n } from '@lingui/core'
16
16
  import { Box, SxProps, Theme } from '@mui/material'
17
- import React, { useMemo } from 'react'
17
+ import React, { useEffect } from 'react'
18
18
  import { findCustomerAddressFromCartAddress } from '../../utils/findCustomerAddressFromCartAddress'
19
19
  import { GetAddressesDocument } from '../ShippingAddressForm/GetAddresses.gql'
20
20
  import { CustomerAddressActionCard } from './CustomerAddressActionCard'
@@ -105,20 +105,26 @@ export function CustomerAddressForm(props: CustomerAddressListProps) {
105
105
  const { handleSubmit, error, control, setValue, watch } = form
106
106
  const formAddressId = watch('customer_address_id')
107
107
 
108
- useMemo(() => {
108
+ useEffect(() => {
109
109
  if (mode === 'both' || mode === 'shipping') {
110
- if (!cartAddressId && defaultShippingId) {
111
- // console.log('shippingAddress.customer_address_id', defaultShippingId)
110
+ if (!cartAddressId && !cartShipping && defaultShippingId) {
112
111
  setValue('customer_address_id', defaultShippingId, { shouldValidate: true })
113
112
  }
114
113
  }
115
114
  if (mode === 'billing') {
116
- if (!cartAddressId && defaultBillingId) {
117
- // console.log('billingAddress.customer_address_id', defaultBillingId)
115
+ if (!cartAddressId && !cartBilling && defaultBillingId) {
118
116
  setValue('customer_address_id', defaultBillingId, { shouldValidate: true })
119
117
  }
120
118
  }
121
- }, [cartAddressId, defaultBillingId, defaultShippingId, mode, setValue])
119
+ }, [
120
+ cartAddressId,
121
+ cartBilling,
122
+ cartShipping,
123
+ defaultBillingId,
124
+ defaultShippingId,
125
+ mode,
126
+ setValue,
127
+ ])
122
128
 
123
129
  const submit = handleSubmit(() => {})
124
130
 
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@graphcommerce/magento-cart-shipping-address",
3
3
  "homepage": "https://www.graphcommerce.org/",
4
4
  "repository": "github:graphcommerce-org/graphcommerce",
5
- "version": "8.0.6",
5
+ "version": "8.0.7",
6
6
  "sideEffects": false,
7
7
  "prettier": "@graphcommerce/prettier-config-pwa",
8
8
  "eslintConfig": {
@@ -12,16 +12,16 @@
12
12
  }
13
13
  },
14
14
  "peerDependencies": {
15
- "@graphcommerce/ecommerce-ui": "^8.0.6",
16
- "@graphcommerce/eslint-config-pwa": "^8.0.6",
17
- "@graphcommerce/graphql": "^8.0.6",
18
- "@graphcommerce/image": "^8.0.6",
19
- "@graphcommerce/magento-cart": "^8.0.6",
20
- "@graphcommerce/magento-customer": "^8.0.6",
21
- "@graphcommerce/magento-store": "^8.0.6",
22
- "@graphcommerce/next-ui": "^8.0.6",
23
- "@graphcommerce/prettier-config-pwa": "^8.0.6",
24
- "@graphcommerce/typescript-config-pwa": "^8.0.6",
15
+ "@graphcommerce/ecommerce-ui": "^8.0.7",
16
+ "@graphcommerce/eslint-config-pwa": "^8.0.7",
17
+ "@graphcommerce/graphql": "^8.0.7",
18
+ "@graphcommerce/image": "^8.0.7",
19
+ "@graphcommerce/magento-cart": "^8.0.7",
20
+ "@graphcommerce/magento-customer": "^8.0.7",
21
+ "@graphcommerce/magento-store": "^8.0.7",
22
+ "@graphcommerce/next-ui": "^8.0.7",
23
+ "@graphcommerce/prettier-config-pwa": "^8.0.7",
24
+ "@graphcommerce/typescript-config-pwa": "^8.0.7",
25
25
  "@lingui/core": "^4.2.1",
26
26
  "@lingui/macro": "^4.2.1",
27
27
  "@lingui/react": "^4.2.1",