@graphcommerce/magento-cart 10.0.0-canary.66 → 10.0.0-canary.67

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,11 @@
1
1
  # Change Log
2
2
 
3
+ ## 10.0.0-canary.67
4
+
5
+ ### Patch Changes
6
+
7
+ - [#2540](https://github.com/graphcommerce-org/graphcommerce/pull/2540) [`36e2bac`](https://github.com/graphcommerce-org/graphcommerce/commit/36e2bacb4fe765ce1fcd24dc36736e90bb17a7dc) - Add billingAddress permission (EDITABLE | READONLY) that controls whether the end user can update their billing address in the account section and checkout. ([@Giovanni-Schroevers](https://github.com/Giovanni-Schroevers))
8
+
3
9
  ## 10.0.0-canary.66
4
10
 
5
11
  ## 10.0.0-canary.65
@@ -1,4 +1,5 @@
1
1
  import { useHistoryLink } from '@graphcommerce/framer-next-pages'
2
+ import { useBillingAddressPermission } from '@graphcommerce/magento-customer'
2
3
  import { breakpointVal, extendableComponent, SectionContainer } from '@graphcommerce/next-ui'
3
4
  import { Trans } from '@lingui/react/macro'
4
5
  import type { SxProps, Theme } from '@mui/material'
@@ -27,6 +28,8 @@ export function CartSummary(props: CartSummaryProps) {
27
28
  href: '/checkout',
28
29
  })
29
30
 
31
+ const billingAddressReadonly = useBillingAddressPermission() === 'READONLY'
32
+
30
33
  if (!data?.cart) return null
31
34
 
32
35
  const { email, shipping_addresses, billing_address, is_virtual } = data.cart
@@ -137,7 +140,7 @@ export function CartSummary(props: CartSummaryProps) {
137
140
  labelLeft={<Trans>Billing address</Trans>}
138
141
  sx={{ '& .SectionHeader-root': { marginTop: 0, paddingBottom: '8px' } }}
139
142
  labelRight={
140
- editable ? (
143
+ editable && !billingAddressReadonly ? (
141
144
  <Link
142
145
  href='/checkout/edit/billing-address'
143
146
  color='secondary'
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@graphcommerce/magento-cart",
3
3
  "homepage": "https://www.graphcommerce.org/",
4
4
  "repository": "github:graphcommerce-org/graphcommerce",
5
- "version": "10.0.0-canary.66",
5
+ "version": "10.0.0-canary.67",
6
6
  "sideEffects": false,
7
7
  "prettier": "@graphcommerce/prettier-config-pwa",
8
8
  "eslintConfig": {
@@ -20,20 +20,20 @@
20
20
  "./plugins/useSignInFormMergeCart": "./plugins/useSignInFormMergeCart.ts"
21
21
  },
22
22
  "peerDependencies": {
23
- "@graphcommerce/ecommerce-ui": "^10.0.0-canary.66",
24
- "@graphcommerce/eslint-config-pwa": "^10.0.0-canary.66",
25
- "@graphcommerce/framer-next-pages": "^10.0.0-canary.66",
26
- "@graphcommerce/framer-scroller": "^10.0.0-canary.66",
27
- "@graphcommerce/framer-utils": "^10.0.0-canary.66",
28
- "@graphcommerce/graphql": "^10.0.0-canary.66",
29
- "@graphcommerce/image": "^10.0.0-canary.66",
30
- "@graphcommerce/magento-customer": "^10.0.0-canary.66",
31
- "@graphcommerce/magento-graphql": "^10.0.0-canary.66",
32
- "@graphcommerce/magento-store": "^10.0.0-canary.66",
33
- "@graphcommerce/next-ui": "^10.0.0-canary.66",
34
- "@graphcommerce/prettier-config-pwa": "^10.0.0-canary.66",
35
- "@graphcommerce/react-hook-form": "^10.0.0-canary.66",
36
- "@graphcommerce/typescript-config-pwa": "^10.0.0-canary.66",
23
+ "@graphcommerce/ecommerce-ui": "^10.0.0-canary.67",
24
+ "@graphcommerce/eslint-config-pwa": "^10.0.0-canary.67",
25
+ "@graphcommerce/framer-next-pages": "^10.0.0-canary.67",
26
+ "@graphcommerce/framer-scroller": "^10.0.0-canary.67",
27
+ "@graphcommerce/framer-utils": "^10.0.0-canary.67",
28
+ "@graphcommerce/graphql": "^10.0.0-canary.67",
29
+ "@graphcommerce/image": "^10.0.0-canary.67",
30
+ "@graphcommerce/magento-customer": "^10.0.0-canary.67",
31
+ "@graphcommerce/magento-graphql": "^10.0.0-canary.67",
32
+ "@graphcommerce/magento-store": "^10.0.0-canary.67",
33
+ "@graphcommerce/next-ui": "^10.0.0-canary.67",
34
+ "@graphcommerce/prettier-config-pwa": "^10.0.0-canary.67",
35
+ "@graphcommerce/react-hook-form": "^10.0.0-canary.67",
36
+ "@graphcommerce/typescript-config-pwa": "^10.0.0-canary.67",
37
37
  "@lingui/core": "^5",
38
38
  "@lingui/macro": "^5",
39
39
  "@lingui/react": "^5",