@graphcommerce/magento-product 8.1.0-canary.17 → 8.1.0-canary.19

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,9 @@
1
1
  # Change Log
2
2
 
3
+ ## 8.1.0-canary.19
4
+
5
+ ## 8.1.0-canary.18
6
+
3
7
  ## 8.1.0-canary.17
4
8
 
5
9
  ## 8.1.0-canary.16
@@ -5,7 +5,7 @@ import {
5
5
  CrosssellsDocument,
6
6
  CrosssellsQuery,
7
7
  } from '@graphcommerce/magento-cart'
8
- import { ExtendableComponent, nonNullable } from '@graphcommerce/next-ui'
8
+ import { ExtendableComponent } from '@graphcommerce/next-ui'
9
9
  import { Box, SxProps, Theme, useThemeProps } from '@mui/material'
10
10
  import { useRouter } from 'next/router'
11
11
  import { useMemo, useRef } from 'react'
@@ -90,7 +90,7 @@ export function AddProductsToCartForm(props: AddProductsToCartFormProps) {
90
90
  const requestData = {
91
91
  cartId,
92
92
  cartItems: cartItems
93
- .filter((cartItem) => cartItem.sku)
93
+ .filter((cartItem) => cartItem.sku && cartItem.quantity !== 0)
94
94
  .map(({ customizable_options, ...cartItem }) => {
95
95
  const options = Object.values(customizable_options ?? {})
96
96
  .flat(1)
@@ -68,7 +68,8 @@ export function useAddProductsToCartAction(
68
68
  if (process.env.NODE_ENV !== 'production') {
69
69
  if (!sku) console.warn(`You must provide a 'sku' to useAddProductsToCartAction`)
70
70
  }
71
- setValue(`cartItems.${index}.sku`, sku ?? '')
71
+ // TODO should be removed, setting the form value on submission isn't a great idea.
72
+ if (!getValues(`cartItems.${index}.sku`)) setValue(`cartItems.${index}.sku`, sku ?? '')
72
73
  startTransition(() => {
73
74
  onClickIncoming?.(e)
74
75
  })
@@ -13,6 +13,8 @@ export function ProductShortDescription(props: ProductShortDescriptionProps) {
13
13
  const { product, sx = [] } = props
14
14
  const { short_description } = product
15
15
 
16
+ if (!short_description?.html) return null
17
+
16
18
  return (
17
19
  <Typography
18
20
  variant='body1'
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@graphcommerce/magento-product",
3
3
  "homepage": "https://www.graphcommerce.org/",
4
4
  "repository": "github:graphcommerce-org/graphcommerce",
5
- "version": "8.1.0-canary.17",
5
+ "version": "8.1.0-canary.19",
6
6
  "sideEffects": false,
7
7
  "prettier": "@graphcommerce/prettier-config-pwa",
8
8
  "eslintConfig": {
@@ -18,18 +18,18 @@
18
18
  "typescript": "5.3.3"
19
19
  },
20
20
  "peerDependencies": {
21
- "@graphcommerce/ecommerce-ui": "^8.1.0-canary.17",
22
- "@graphcommerce/eslint-config-pwa": "^8.1.0-canary.17",
23
- "@graphcommerce/framer-next-pages": "^8.1.0-canary.17",
24
- "@graphcommerce/framer-scroller": "^8.1.0-canary.17",
25
- "@graphcommerce/graphql": "^8.1.0-canary.17",
26
- "@graphcommerce/graphql-mesh": "^8.1.0-canary.17",
27
- "@graphcommerce/image": "^8.1.0-canary.17",
28
- "@graphcommerce/magento-cart": "^8.1.0-canary.17",
29
- "@graphcommerce/magento-store": "^8.1.0-canary.17",
30
- "@graphcommerce/next-ui": "^8.1.0-canary.17",
31
- "@graphcommerce/prettier-config-pwa": "^8.1.0-canary.17",
32
- "@graphcommerce/typescript-config-pwa": "^8.1.0-canary.17",
21
+ "@graphcommerce/ecommerce-ui": "^8.1.0-canary.19",
22
+ "@graphcommerce/eslint-config-pwa": "^8.1.0-canary.19",
23
+ "@graphcommerce/framer-next-pages": "^8.1.0-canary.19",
24
+ "@graphcommerce/framer-scroller": "^8.1.0-canary.19",
25
+ "@graphcommerce/graphql": "^8.1.0-canary.19",
26
+ "@graphcommerce/graphql-mesh": "^8.1.0-canary.19",
27
+ "@graphcommerce/image": "^8.1.0-canary.19",
28
+ "@graphcommerce/magento-cart": "^8.1.0-canary.19",
29
+ "@graphcommerce/magento-store": "^8.1.0-canary.19",
30
+ "@graphcommerce/next-ui": "^8.1.0-canary.19",
31
+ "@graphcommerce/prettier-config-pwa": "^8.1.0-canary.19",
32
+ "@graphcommerce/typescript-config-pwa": "^8.1.0-canary.19",
33
33
  "@lingui/core": "^4.2.1",
34
34
  "@lingui/macro": "^4.2.1",
35
35
  "@lingui/react": "^4.2.1",