@graphcommerce/magento-customer 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) [`cc1c6e8`](https://github.com/graphcommerce-org/graphcommerce/commit/cc1c6e8c857c12f2d38d7283a250e3b77bd885f4) - The AddressCountryRegion select would show a warning if the countries weren't loaded yet. It will now show a readonly field with the country code. ([@Giovanni-Schroevers](https://github.com/Giovanni-Schroevers))
12
+
13
+ - [#2341](https://github.com/graphcommerce-org/graphcommerce/pull/2341) [`b8b621a`](https://github.com/graphcommerce-org/graphcommerce/commit/b8b621a4a7549cae4ac56fee76773443a0d55504) - The CompanyFields toggle wouldn't be valid when Private was selected and would only validate if Business was selected. ([@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
  ### Patch Changes
@@ -1,13 +1,7 @@
1
- import {
2
- EmailElement,
3
- FormAutoSubmit,
4
- TextFieldElement,
5
- emailPattern,
6
- } from '@graphcommerce/ecommerce-ui'
1
+ import { ActionCardListForm, EmailElement, FormAutoSubmit } from '@graphcommerce/ecommerce-ui'
7
2
  import { useApolloClient } from '@graphcommerce/graphql'
8
3
  import {
9
4
  ActionCard,
10
- ActionCardListForm,
11
5
  Button,
12
6
  FormActions,
13
7
  FormDiv,
@@ -1,4 +1,10 @@
1
- import { SelectElement, FieldValues, FieldPath, useWatch } from '@graphcommerce/ecommerce-ui'
1
+ import {
2
+ SelectElement,
3
+ FieldValues,
4
+ FieldPath,
5
+ useWatch,
6
+ TextFieldElement,
7
+ } from '@graphcommerce/ecommerce-ui'
2
8
  import { useQuery } from '@graphcommerce/graphql'
3
9
  import { CountryRegionsDocument } from '@graphcommerce/magento-store'
4
10
  import { FormRow, filterNonNullableKeys } from '@graphcommerce/next-ui'
@@ -35,7 +41,7 @@ export function useAddressCountryRegion<
35
41
  [country, countryList],
36
42
  )
37
43
 
38
- return { ...form, country, countryList, regionList }
44
+ return { ...form, country, countryList, regionList, loading: countryQuery.loading }
39
45
  }
40
46
 
41
47
  export function AddressCountryRegion<
@@ -43,7 +49,22 @@ export function AddressCountryRegion<
43
49
  TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,
44
50
  >(props: AddressFieldsOptions<TFieldValues, TName>) {
45
51
  const form = useAddressCountryRegion<TFieldValues, TName>(props)
46
- const { control, name, readOnly, required, countryList, regionList } = form
52
+ const { control, name, readOnly, required, countryList, regionList, loading } = form
53
+
54
+ if (loading) {
55
+ return (
56
+ <FormRow>
57
+ <TextFieldElement
58
+ label={<Trans id='Country' />}
59
+ control={control}
60
+ required={required[name.countryCode]}
61
+ name={name.countryCode}
62
+ showValid
63
+ InputProps={{ readOnly }}
64
+ />
65
+ </FormRow>
66
+ )
67
+ }
47
68
 
48
69
  return (
49
70
  <FormRow>
@@ -66,7 +87,6 @@ export function AddressCountryRegion<
66
87
  <SelectElement
67
88
  control={control}
68
89
  name={name.regionId}
69
- // SelectProps={{ native: true, displayEmpty: true }}
70
90
  variant='outlined'
71
91
  label={<Trans id='Region' />}
72
92
  required
@@ -1,11 +1,5 @@
1
- import { FieldPath, FieldValues, useWatch } from '@graphcommerce/ecommerce-ui'
2
- import {
3
- ActionCard,
4
- ActionCardListForm,
5
- ActionCardProps,
6
- FormRow,
7
- useStorefrontConfig,
8
- } from '@graphcommerce/next-ui'
1
+ import { ActionCardListForm, FieldPath, FieldValues, useWatch } from '@graphcommerce/ecommerce-ui'
2
+ import { ActionCard, ActionCardProps, FormRow, useStorefrontConfig } from '@graphcommerce/next-ui'
9
3
  import { t } from '@lingui/macro'
10
4
  import { CompanyName } from './CompanyName'
11
5
  import { CompanyVAT } from './CompanyVAT'
@@ -43,7 +37,7 @@ export function CompanyFields<
43
37
  layout='inline'
44
38
  variant='outlined'
45
39
  color='secondary'
46
- required
40
+ rules={{ validate: (value) => value !== null }}
47
41
  items={[
48
42
  { value: false, title: t`Private` },
49
43
  { value: true, title: t`Business` },
@@ -38,7 +38,6 @@ function findTelephone(data: CustomerQuery): string | undefined {
38
38
 
39
39
  export function ContactForm() {
40
40
  const form = useFormGqlMutation(ContactUsDocument, {
41
- experimental_useV2: true,
42
41
  onComplete: (result) => {
43
42
  if (result.errors) return
44
43
  form.resetField('input.comment')
@@ -27,7 +27,6 @@ export function SignUpForm(props: SignUpFormProps) {
27
27
  {
28
28
  defaultValues: { email },
29
29
  onBeforeSubmit: (values) => ({ ...values, email }),
30
- experimental_useV2: true,
31
30
  onComplete: async (result, variables) => {
32
31
  if (!result.errors && !storeConfig.data?.storeConfig?.create_account_confirmation) {
33
32
  signIn.setValue('email', variables.email)
@@ -33,7 +33,6 @@ export function useAccountSignInUpForm(props: UseFormIsEmailAvailableProps = {})
33
33
  >(
34
34
  IsEmailAvailableDocument,
35
35
  {
36
- experimental_useV2: true,
37
36
  mode: 'onBlur',
38
37
  values: { email: cachedEmail ?? '' },
39
38
  defaultValues: { requestedMode: 'signin' },
@@ -1,6 +1,4 @@
1
1
  import { QueryResult, useQuery } from '@graphcommerce/graphql'
2
- import { removeCssFlag, setCssFlag } from '@graphcommerce/next-ui'
3
- import { useEffect } from 'react'
4
2
  import {
5
3
  CustomerTokenDocument,
6
4
  CustomerTokenQuery,
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@graphcommerce/magento-customer",
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,19 +12,19 @@
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/framer-next-pages": "^9.0.0-canary.78",
18
- "@graphcommerce/framer-utils": "^9.0.0-canary.78",
19
- "@graphcommerce/graphql": "^9.0.0-canary.78",
20
- "@graphcommerce/graphql-mesh": "^9.0.0-canary.78",
21
- "@graphcommerce/image": "^9.0.0-canary.78",
22
- "@graphcommerce/magento-graphql": "^9.0.0-canary.78",
23
- "@graphcommerce/magento-store": "^9.0.0-canary.78",
24
- "@graphcommerce/next-ui": "^9.0.0-canary.78",
25
- "@graphcommerce/prettier-config-pwa": "^9.0.0-canary.78",
26
- "@graphcommerce/react-hook-form": "^9.0.0-canary.78",
27
- "@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/framer-next-pages": "^9.0.0-canary.80",
18
+ "@graphcommerce/framer-utils": "^9.0.0-canary.80",
19
+ "@graphcommerce/graphql": "^9.0.0-canary.80",
20
+ "@graphcommerce/graphql-mesh": "^9.0.0-canary.80",
21
+ "@graphcommerce/image": "^9.0.0-canary.80",
22
+ "@graphcommerce/magento-graphql": "^9.0.0-canary.80",
23
+ "@graphcommerce/magento-store": "^9.0.0-canary.80",
24
+ "@graphcommerce/next-ui": "^9.0.0-canary.80",
25
+ "@graphcommerce/prettier-config-pwa": "^9.0.0-canary.80",
26
+ "@graphcommerce/react-hook-form": "^9.0.0-canary.80",
27
+ "@graphcommerce/typescript-config-pwa": "^9.0.0-canary.80",
28
28
  "@lingui/core": "^4.2.1",
29
29
  "@lingui/macro": "^4.2.1",
30
30
  "@lingui/react": "^4.2.1",