@graphcommerce/magento-cart-shipping-address 9.0.0-canary.78 → 9.0.0-canary.80

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,19 @@
1
1
  # Change Log
2
2
 
3
+ ## 9.0.0-canary.80
4
+
5
+ ### Minor Changes
6
+
7
+ - [#2341](https://github.com/graphcommerce-org/graphcommerce/pull/2341) [`1d6512d`](https://github.com/graphcommerce-org/graphcommerce/commit/1d6512d4118cfb46602aa1f2432c3566fdb3261d) - Rename experimental_useV2 prop to deprecated_useV1 in useFromGql and enable it by default ([@Giovanni-Schroevers](https://github.com/Giovanni-Schroevers))
8
+
9
+ ### Patch Changes
10
+
11
+ - [#2341](https://github.com/graphcommerce-org/graphcommerce/pull/2341) [`3043f94`](https://github.com/graphcommerce-org/graphcommerce/commit/3043f945c4caa2931c46f1f9ad940fd80b07e999) - In the shipping step show errors with a ApolloCartErrorSnackbar instead of a ApolloCartErrorAlert ([@Giovanni-Schroevers](https://github.com/Giovanni-Schroevers))
12
+
13
+ - [#2341](https://github.com/graphcommerce-org/graphcommerce/pull/2341) [`3101681`](https://github.com/graphcommerce-org/graphcommerce/commit/3101681180e1a5a0cfba1bb89d72deb02cafdbbf) - When saving a shipping address it would always save the company after it was once saved. ([@Giovanni-Schroevers](https://github.com/Giovanni-Schroevers))
14
+
15
+ ## 9.0.0-canary.79
16
+
3
17
  ## 9.0.0-canary.78
4
18
 
5
19
  ## 9.0.0-canary.77
@@ -1,6 +1,7 @@
1
+ import { ActionCardItemRenderProps } from '@graphcommerce/ecommerce-ui'
1
2
  import { CustomerAddressFragment } from '@graphcommerce/magento-customer/components/CreateCustomerAddressForm/CustomerAddress.gql'
2
3
  import { useFindCountry } from '@graphcommerce/magento-store'
3
- import { ActionCard, IconSvg, iconHome, ActionCardItemRenderProps } from '@graphcommerce/next-ui'
4
+ import { ActionCard, IconSvg, iconHome } from '@graphcommerce/next-ui'
4
5
  import { Trans } from '@lingui/react'
5
6
  import { Button } from '@mui/material'
6
7
  import { useRouter } from 'next/router'
@@ -1,4 +1,5 @@
1
1
  import {
2
+ ActionCardListForm,
2
3
  FormAutoSubmit,
3
4
  FormPersist,
4
5
  TextFieldElement,
@@ -12,7 +13,7 @@ import {
12
13
  useFormGqlMutationCart,
13
14
  } from '@graphcommerce/magento-cart'
14
15
  import { CustomerDocument } from '@graphcommerce/magento-customer'
15
- import { ActionCardListForm, FormRow, filterNonNullableKeys } from '@graphcommerce/next-ui'
16
+ import { FormRow, filterNonNullableKeys } from '@graphcommerce/next-ui'
16
17
  import { i18n } from '@lingui/core'
17
18
  import { Trans } from '@lingui/macro'
18
19
  import { Box, SxProps, Theme } from '@mui/material'
@@ -83,8 +84,8 @@ export function CustomerAddressForm(props: CustomerAddressListProps) {
83
84
  customer_address_id: number | null
84
85
  }
85
86
  >(Mutation, {
86
- experimental_useV2: true,
87
87
  defaultValues: { customer_address_id: cartAddressId },
88
+ skipUnchanged: true,
88
89
  onBeforeSubmit: (vars) => {
89
90
  const { customer_address_id } = vars
90
91
  if (customer_address_id === -1) return false
@@ -16,10 +16,10 @@ import {
16
16
  import { CartAddressFragment } from '@graphcommerce/magento-cart/components/CartAddress/CartAddress.gql'
17
17
  import {
18
18
  AddressFields,
19
+ CompanyFields,
19
20
  CustomerDocument,
20
21
  NameFields,
21
22
  useCustomerQuery,
22
- CompanyFields,
23
23
  } from '@graphcommerce/magento-customer'
24
24
  import { CountryRegionsDocument, StoreConfigDocument } from '@graphcommerce/magento-store'
25
25
  import { Form, FormRow } from '@graphcommerce/next-ui'
@@ -104,13 +104,17 @@ export const ShippingAddressForm = React.memo<ShippingAddressFormProps>((props)
104
104
  isCompany: Boolean(currentAddress?.company || currentAddress?.vat_id),
105
105
  customerNote: '',
106
106
  },
107
- mode: 'onChange',
108
- experimental_useV2: true,
107
+ skipUnchanged: true,
109
108
  onBeforeSubmit: (variables) => {
110
109
  const regionId = countries
111
110
  ?.find((country) => country?.two_letter_abbreviation === variables.countryCode)
112
111
  ?.available_regions?.find((region) => region?.id === variables.regionId)?.id
113
112
 
113
+ if (!variables.isCompany) {
114
+ variables.company = ''
115
+ variables.vatId = ''
116
+ }
117
+
114
118
  return {
115
119
  ...variables,
116
120
  telephone: variables.telephone || '000 - 000 0000',
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": "9.0.0-canary.78",
5
+ "version": "9.0.0-canary.80",
6
6
  "sideEffects": false,
7
7
  "prettier": "@graphcommerce/prettier-config-pwa",
8
8
  "eslintConfig": {
@@ -12,17 +12,17 @@
12
12
  }
13
13
  },
14
14
  "peerDependencies": {
15
- "@graphcommerce/ecommerce-ui": "^9.0.0-canary.78",
16
- "@graphcommerce/eslint-config-pwa": "^9.0.0-canary.78",
17
- "@graphcommerce/graphql": "^9.0.0-canary.78",
18
- "@graphcommerce/graphql-mesh": "^9.0.0-canary.78",
19
- "@graphcommerce/image": "^9.0.0-canary.78",
20
- "@graphcommerce/magento-cart": "^9.0.0-canary.78",
21
- "@graphcommerce/magento-customer": "^9.0.0-canary.78",
22
- "@graphcommerce/magento-store": "^9.0.0-canary.78",
23
- "@graphcommerce/next-ui": "^9.0.0-canary.78",
24
- "@graphcommerce/prettier-config-pwa": "^9.0.0-canary.78",
25
- "@graphcommerce/typescript-config-pwa": "^9.0.0-canary.78",
15
+ "@graphcommerce/ecommerce-ui": "^9.0.0-canary.80",
16
+ "@graphcommerce/eslint-config-pwa": "^9.0.0-canary.80",
17
+ "@graphcommerce/graphql": "^9.0.0-canary.80",
18
+ "@graphcommerce/graphql-mesh": "^9.0.0-canary.80",
19
+ "@graphcommerce/image": "^9.0.0-canary.80",
20
+ "@graphcommerce/magento-cart": "^9.0.0-canary.80",
21
+ "@graphcommerce/magento-customer": "^9.0.0-canary.80",
22
+ "@graphcommerce/magento-store": "^9.0.0-canary.80",
23
+ "@graphcommerce/next-ui": "^9.0.0-canary.80",
24
+ "@graphcommerce/prettier-config-pwa": "^9.0.0-canary.80",
25
+ "@graphcommerce/typescript-config-pwa": "^9.0.0-canary.80",
26
26
  "@lingui/core": "^4.2.1",
27
27
  "@lingui/macro": "^4.2.1",
28
28
  "@lingui/react": "^4.2.1",