@graphcommerce/magento-product 4.0.4 → 4.0.5

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,21 @@
1
1
  # Change Log
2
2
 
3
+ ## 4.0.5
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1292](https://github.com/ho-nl/m2-pwa/pull/1292)
8
+ [`5a1ba9e66`](https://github.com/ho-nl/m2-pwa/commit/5a1ba9e664abbac89c4f5f71f7d6d6ed1aefa5c0)
9
+ Thanks [@paales](https://github.com/paales)! - Renamed SvgIcon to IconSvg to prevent collisions
10
+ with MUI
11
+
12
+ - Updated dependencies
13
+ [[`5a1ba9e66`](https://github.com/ho-nl/m2-pwa/commit/5a1ba9e664abbac89c4f5f71f7d6d6ed1aefa5c0),
14
+ [`990df655b`](https://github.com/ho-nl/m2-pwa/commit/990df655b73b469718d6cb5837ee65dfe2ad6a1d),
15
+ [`63f9b56eb`](https://github.com/ho-nl/m2-pwa/commit/63f9b56eb68ba790567ff1427e599fd2c3c8f1ee)]:
16
+ - @graphcommerce/magento-cart@4.1.3
17
+ - @graphcommerce/next-ui@4.2.0
18
+
3
19
  ## 4.0.4
4
20
 
5
21
  ### Patch Changes
@@ -6,11 +6,13 @@ import {
6
6
  MessageSnackbar,
7
7
  TextInputNumber,
8
8
  iconChevronRight,
9
- SvgIcon,
9
+ IconSvg,
10
10
  extendableComponent,
11
+ AnimatedRow,
11
12
  } from '@graphcommerce/next-ui'
12
13
  import { Trans } from '@lingui/macro'
13
- import { Divider, Typography, ButtonProps, Box } from '@mui/material'
14
+ import { Divider, Typography, ButtonProps, Box, Alert } from '@mui/material'
15
+ import { AnimatePresence } from 'framer-motion'
14
16
  import PageLink from 'next/link'
15
17
  import React from 'react'
16
18
  import { ProductAddToCartDocument, ProductAddToCartMutationVariables } from './ProductAddToCart.gql'
@@ -38,7 +40,7 @@ export default function ProductAddToCart(
38
40
  defaultValues: { ...variables },
39
41
  })
40
42
 
41
- const { handleSubmit, formState, error, muiRegister, required } = form
43
+ const { handleSubmit, formState, error, muiRegister, required, data } = form
42
44
  const submitHandler = handleSubmit(() => {})
43
45
 
44
46
  return (
@@ -85,8 +87,21 @@ export default function ProductAddToCart(
85
87
 
86
88
  <ApolloCartErrorAlert error={error} />
87
89
 
90
+ <AnimatePresence initial={false}>
91
+ {data?.addProductsToCart?.user_errors.map((e) => (
92
+ <AnimatedRow key={e?.code}>
93
+ <Alert severity='error'>{e?.message}</Alert>
94
+ </AnimatedRow>
95
+ ))}
96
+ </AnimatePresence>
97
+
88
98
  <MessageSnackbar
89
- open={!formState.isSubmitting && formState.isSubmitSuccessful && !error?.message}
99
+ open={
100
+ !formState.isSubmitting &&
101
+ formState.isSubmitSuccessful &&
102
+ !error?.message &&
103
+ !data?.addProductsToCart?.user_errors?.length
104
+ }
90
105
  variant='pill'
91
106
  action={
92
107
  <PageLink href='/cart' passHref>
@@ -94,7 +109,7 @@ export default function ProductAddToCart(
94
109
  size='medium'
95
110
  variant='pill'
96
111
  color='secondary'
97
- endIcon={<SvgIcon src={iconChevronRight} />}
112
+ endIcon={<IconSvg src={iconChevronRight} />}
98
113
  >
99
114
  <Trans>View shopping cart</Trans>
100
115
  </Button>
@@ -1,5 +1,5 @@
1
1
  import { cloneDeep } from '@graphcommerce/graphql'
2
- import { iconCancelAlt, SvgIcon } from '@graphcommerce/next-ui'
2
+ import { iconCancelAlt, IconSvg } from '@graphcommerce/next-ui'
3
3
  import { Chip, ChipProps, SxProps, Theme } from '@mui/material'
4
4
  import { useProductListLinkReplace } from '../../hooks/useProductListLinkReplace'
5
5
  import { useProductListParamsContext } from '../../hooks/useProductListParamsContext'
@@ -45,7 +45,7 @@ export default function FilterCheckboxType(props: FilterCheckboxTypeProps) {
45
45
  }
46
46
  : undefined
47
47
  }
48
- deleteIcon={isActive ? <SvgIcon src={iconCancelAlt} size='small' /> : undefined}
48
+ deleteIcon={isActive ? <IconSvg src={iconCancelAlt} size='small' /> : undefined}
49
49
  label={label}
50
50
  clickable
51
51
  {...chipProps}
@@ -3,7 +3,7 @@ import {
3
3
  iconChevronLeft,
4
4
  iconChevronRight,
5
5
  responsiveVal,
6
- SvgIcon,
6
+ IconSvg,
7
7
  useScrollY,
8
8
  extendableComponent,
9
9
  } from '@graphcommerce/next-ui'
@@ -107,7 +107,7 @@ export default function ProductListFiltersContainer(props: ProductListFiltersCon
107
107
  size='small'
108
108
  sx={{ position: 'absolute', top: 2, left: 2, zIndex: 10 }}
109
109
  >
110
- <SvgIcon src={iconChevronLeft} />
110
+ <IconSvg src={iconChevronLeft} />
111
111
  </ScrollerButton>
112
112
  <Box
113
113
  className={classes.container}
@@ -165,7 +165,7 @@ export default function ProductListFiltersContainer(props: ProductListFiltersCon
165
165
  size='small'
166
166
  sx={{ position: 'absolute', top: 2, right: 2, zIndex: 10 }}
167
167
  >
168
- <SvgIcon src={iconChevronRight} />
168
+ <IconSvg src={iconChevronRight} />
169
169
  </ScrollerButton>
170
170
  </ScrollerProvider>
171
171
  </MotionDiv>
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  responsiveVal,
3
3
  iconOrderBefore,
4
- SvgIcon,
4
+ IconSvg,
5
5
  extendableComponent,
6
6
  } from '@graphcommerce/next-ui'
7
7
  import { Box, darken, lighten, Typography } from '@mui/material'
@@ -31,7 +31,7 @@ export default function ProductSidebarDelivery() {
31
31
  borderRadius: responsiveVal(theme.shape.borderRadius * 3, theme.shape.borderRadius * 4),
32
32
  })}
33
33
  >
34
- <SvgIcon
34
+ <IconSvg
35
35
  className={classes.image}
36
36
  src={iconOrderBefore}
37
37
  size='small'
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": "4.0.4",
5
+ "version": "4.0.5",
6
6
  "sideEffects": false,
7
7
  "prettier": "@graphcommerce/prettier-config-pwa",
8
8
  "eslintConfig": {
@@ -21,9 +21,9 @@
21
21
  "@graphcommerce/framer-scroller": "^2.0.4",
22
22
  "@graphcommerce/graphql": "^3.0.3",
23
23
  "@graphcommerce/image": "^3.1.0",
24
- "@graphcommerce/magento-cart": "^4.1.2",
24
+ "@graphcommerce/magento-cart": "^4.1.3",
25
25
  "@graphcommerce/magento-store": "^4.1.0",
26
- "@graphcommerce/next-ui": "^4.1.3",
26
+ "@graphcommerce/next-ui": "^4.2.0",
27
27
  "schema-dts": "^1.1.0",
28
28
  "type-fest": "^2.12.0"
29
29
  },