@graphcommerce/magento-store 10.0.4-canary.1 → 10.1.0-canary.13

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,59 @@
1
1
  # Change Log
2
2
 
3
+ ## 10.1.0-canary.13
4
+
5
+ ### Patch Changes
6
+
7
+ - [#2625](https://github.com/graphcommerce-org/graphcommerce/pull/2625) [`539b353`](https://github.com/graphcommerce-org/graphcommerce/commit/539b353d76a1d06b1c50b7135ecae64c116b8bbf) - `CustomAttributesField_to_AttributeValueInputs` was filtering out any falsy form value (`if (!value) return`), so empty strings and `false` booleans never made it into the resulting `AttributeValueInput[]`. That meant a consumer who picked the empty-string option of a SELECT attribute (e.g. a "-- None --" option used to undo a previous choice) couldn't actually clear the attribute — the mutation simply omitted it and Magento kept the old value.
8
+
9
+ Skip only when the value is `undefined` (the attribute was never touched). Pass empty strings and `false` booleans through to the mutation so the backend can interpret them as "clear this attribute". ([@paales](https://github.com/paales))
10
+
11
+ - [#2620](https://github.com/graphcommerce-org/graphcommerce/pull/2620) [`43a0ed2`](https://github.com/graphcommerce-org/graphcommerce/commit/43a0ed29a39a40c6af619fd70fb25fd800ccbf69) - `SignUpForm` now accepts `fieldsets` and `render` props (mirroring `CustomerUpdateForm`), so consumers can group dynamic customer attributes into custom labelled sections via `AttributesFormAutoLayout`. Defaults to the existing `[nameFieldset(attributes)]` / `CustomerAttributeField` behaviour, so unchanged for projects that don't supply the props.
12
+
13
+ This avoids the unstyled, untranslated `Other` fallback header that `AttributesFormAutoLayout` adds whenever attributes don't fit any registered fieldset — projects that extend the customer schema (e.g. with a `club` attribute) can now declare their own fieldset alongside `nameFieldset`.
14
+
15
+ The fallback header itself in `AttributesFormAutoLayout` is now wrapped in `<Trans>Other</Trans>` so it picks up project translations instead of rendering as a hardcoded English string.
16
+
17
+ Bug fix in `nameFieldset`: when a store doesn't register `dob`/`gender` on the registration form, the `additional` row was empty and the helper produced `grid-template-areas: "firstname lastname" ""`, which is invalid CSS and made the whole declaration fall back to the default single-column layout — firstname/lastname stacked on separate rows even at md+. Empty rows are now filtered out, so the side-by-side md layout works as intended. ([@paales](https://github.com/paales))
18
+
19
+ ## 10.1.0-canary.12
20
+
21
+ ### Patch Changes
22
+
23
+ - [#2625](https://github.com/graphcommerce-org/graphcommerce/pull/2625) [`539b353`](https://github.com/graphcommerce-org/graphcommerce/commit/539b353d76a1d06b1c50b7135ecae64c116b8bbf) - `CustomAttributesField_to_AttributeValueInputs` was filtering out any falsy form value (`if (!value) return`), so empty strings and `false` booleans never made it into the resulting `AttributeValueInput[]`. That meant a consumer who picked the empty-string option of a SELECT attribute (e.g. a "-- None --" option used to undo a previous choice) couldn't actually clear the attribute — the mutation simply omitted it and Magento kept the old value.
24
+
25
+ Skip only when the value is `undefined` (the attribute was never touched). Pass empty strings and `false` booleans through to the mutation so the backend can interpret them as "clear this attribute". ([@paales](https://github.com/paales))
26
+
27
+ ## 10.1.0-canary.11
28
+
29
+ ## 10.1.0-canary.10
30
+
31
+ ### Patch Changes
32
+
33
+ - [#2620](https://github.com/graphcommerce-org/graphcommerce/pull/2620) [`43a0ed2`](https://github.com/graphcommerce-org/graphcommerce/commit/43a0ed29a39a40c6af619fd70fb25fd800ccbf69) - `SignUpForm` now accepts `fieldsets` and `render` props (mirroring `CustomerUpdateForm`), so consumers can group dynamic customer attributes into custom labelled sections via `AttributesFormAutoLayout`. Defaults to the existing `[nameFieldset(attributes)]` / `CustomerAttributeField` behaviour, so unchanged for projects that don't supply the props.
34
+
35
+ This avoids the unstyled, untranslated `Other` fallback header that `AttributesFormAutoLayout` adds whenever attributes don't fit any registered fieldset — projects that extend the customer schema (e.g. with a `club` attribute) can now declare their own fieldset alongside `nameFieldset`.
36
+
37
+ The fallback header itself in `AttributesFormAutoLayout` is now wrapped in `<Trans>Other</Trans>` so it picks up project translations instead of rendering as a hardcoded English string.
38
+
39
+ Bug fix in `nameFieldset`: when a store doesn't register `dob`/`gender` on the registration form, the `additional` row was empty and the helper produced `grid-template-areas: "firstname lastname" ""`, which is invalid CSS and made the whole declaration fall back to the default single-column layout — firstname/lastname stacked on separate rows even at md+. Empty rows are now filtered out, so the side-by-side md layout works as intended. ([@paales](https://github.com/paales))
40
+
41
+ ## 10.1.0-canary.9
42
+
43
+ ## 10.1.0-canary.8
44
+
45
+ ## 10.1.0-canary.7
46
+
47
+ ## 10.1.0-canary.6
48
+
49
+ ## 10.1.0-canary.5
50
+
51
+ ## 10.1.0-canary.4
52
+
53
+ ## 10.1.0-canary.3
54
+
55
+ ## 10.0.4-canary.2
56
+
3
57
  ## 10.0.4-canary.1
4
58
 
5
59
  ## 10.0.4-canary.0
@@ -5,6 +5,7 @@ import {
5
5
  type SectionContainerProps,
6
6
  } from '@graphcommerce/next-ui'
7
7
  import type { Control, FieldValues } from '@graphcommerce/react-hook-form'
8
+ import { Trans } from '@lingui/react/macro'
8
9
  import { Box, type SxProps, type Theme } from '@mui/material'
9
10
  import { AttributeFormField, type AttributeFormFieldProps } from './AttributeFormField'
10
11
  import type {
@@ -54,7 +55,8 @@ export function AttributesFormAutoLayout<
54
55
  .filter(nonNullable),
55
56
  }))
56
57
 
57
- if (itemsRemaining.length > 0) byFieldSet.push({ label: 'Other', attributes: itemsRemaining })
58
+ if (itemsRemaining.length > 0)
59
+ byFieldSet.push({ label: <Trans>Other</Trans>, attributes: itemsRemaining })
58
60
 
59
61
  return byFieldSet.map((fieldSet) => {
60
62
  const key = fieldSet.attributes.map((fieldName) => fieldName.gridArea).join('-')
@@ -106,7 +106,12 @@ export function CustomAttributesField_to_AttributeValueInputs(
106
106
  const attribute_code = metadata.code
107
107
  const value = custom_attributes[metadata.code]
108
108
 
109
- if (!value) return
109
+ // Only skip when the form field was never set. Empty strings and `false`
110
+ // booleans must pass through so the backend can interpret them as
111
+ // "clear this attribute" — otherwise the consumer has no way to undo a
112
+ // previously-selected value via the form (e.g. a "-- None --" SELECT
113
+ // option whose value is the empty string).
114
+ if (value === undefined) return
110
115
 
111
116
  if (
112
117
  (metadata.__typename === 'CustomerAttributeMetadata' &&
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@graphcommerce/magento-store",
3
3
  "homepage": "https://www.graphcommerce.org/",
4
4
  "repository": "github:graphcommerce-org/graphcommerce",
5
- "version": "10.0.4-canary.1",
5
+ "version": "10.1.0-canary.13",
6
6
  "sideEffects": false,
7
7
  "prettier": "@graphcommerce/prettier-config-pwa",
8
8
  "eslintConfig": {
@@ -19,15 +19,15 @@
19
19
  "./mesh/resolvers.ts": "./mesh/resolvers.ts"
20
20
  },
21
21
  "peerDependencies": {
22
- "@graphcommerce/ecommerce-ui": "^10.0.4-canary.1",
23
- "@graphcommerce/eslint-config-pwa": "^10.0.4-canary.1",
24
- "@graphcommerce/framer-utils": "^10.0.4-canary.1",
25
- "@graphcommerce/graphql": "^10.0.4-canary.1",
26
- "@graphcommerce/graphql-mesh": "^10.0.4-canary.1",
27
- "@graphcommerce/image": "^10.0.4-canary.1",
28
- "@graphcommerce/next-ui": "^10.0.4-canary.1",
29
- "@graphcommerce/prettier-config-pwa": "^10.0.4-canary.1",
30
- "@graphcommerce/typescript-config-pwa": "^10.0.4-canary.1",
22
+ "@graphcommerce/ecommerce-ui": "^10.1.0-canary.13",
23
+ "@graphcommerce/eslint-config-pwa": "^10.1.0-canary.13",
24
+ "@graphcommerce/framer-utils": "^10.1.0-canary.13",
25
+ "@graphcommerce/graphql": "^10.1.0-canary.13",
26
+ "@graphcommerce/graphql-mesh": "^10.1.0-canary.13",
27
+ "@graphcommerce/image": "^10.1.0-canary.13",
28
+ "@graphcommerce/next-ui": "^10.1.0-canary.13",
29
+ "@graphcommerce/prettier-config-pwa": "^10.1.0-canary.13",
30
+ "@graphcommerce/typescript-config-pwa": "^10.1.0-canary.13",
31
31
  "@lingui/core": "^5",
32
32
  "@lingui/macro": "^5",
33
33
  "@lingui/react": "^5",