@graphcommerce/magento-review 3.0.7 → 3.1.2

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,55 @@
1
1
  # Change Log
2
2
 
3
+ ## 3.1.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1378](https://github.com/graphcommerce-org/graphcommerce/pull/1378) [`b610a6e40`](https://github.com/graphcommerce-org/graphcommerce/commit/b610a6e4049e8c9e8b5d2aeff31b8e1bfc24abe5) Thanks [@paales](https://github.com/paales)! - Pin all versions internally so we can’t end up in an unfixable state for the user
8
+
9
+ - Updated dependencies [[`b610a6e40`](https://github.com/graphcommerce-org/graphcommerce/commit/b610a6e4049e8c9e8b5d2aeff31b8e1bfc24abe5), [`22ff9df16`](https://github.com/graphcommerce-org/graphcommerce/commit/22ff9df1677742ae8e07d9b7e5b12fbb487580dc)]:
10
+ - @graphcommerce/graphql@3.0.7
11
+ - @graphcommerce/image@3.1.3
12
+ - @graphcommerce/magento-customer@4.2.1
13
+ - @graphcommerce/magento-product@4.1.4
14
+ - @graphcommerce/magento-store@4.1.5
15
+ - @graphcommerce/next-ui@4.5.1
16
+ - @graphcommerce/react-hook-form@3.0.7
17
+
18
+ ## 3.1.1
19
+
20
+ ### Patch Changes
21
+
22
+ - [#1369](https://github.com/graphcommerce-org/graphcommerce/pull/1369) [`ae6449502`](https://github.com/graphcommerce-org/graphcommerce/commit/ae64495024a455bbe5188588604368c1542840c9) Thanks [@paales](https://github.com/paales)! - Upgraded dependencies
23
+
24
+ - Updated dependencies [[`892018809`](https://github.com/graphcommerce-org/graphcommerce/commit/8920188093d0422ec50580e408dc28ac5f93e46a), [`892018809`](https://github.com/graphcommerce-org/graphcommerce/commit/8920188093d0422ec50580e408dc28ac5f93e46a), [`ae6449502`](https://github.com/graphcommerce-org/graphcommerce/commit/ae64495024a455bbe5188588604368c1542840c9), [`892018809`](https://github.com/graphcommerce-org/graphcommerce/commit/8920188093d0422ec50580e408dc28ac5f93e46a), [`892018809`](https://github.com/graphcommerce-org/graphcommerce/commit/8920188093d0422ec50580e408dc28ac5f93e46a), [`6213f0b0f`](https://github.com/graphcommerce-org/graphcommerce/commit/6213f0b0f5f53d622b993d9f7ea96cbbeb5bd670), [`892018809`](https://github.com/graphcommerce-org/graphcommerce/commit/8920188093d0422ec50580e408dc28ac5f93e46a)]:
25
+ - @graphcommerce/graphql@3.0.6
26
+ - @graphcommerce/next-ui@4.5.0
27
+ - @graphcommerce/image@3.1.2
28
+ - @graphcommerce/magento-customer@4.2.0
29
+ - @graphcommerce/magento-product@4.1.3
30
+ - @graphcommerce/magento-store@4.1.4
31
+ - @graphcommerce/react-hook-form@3.0.6
32
+
33
+ ## 3.1.0
34
+
35
+ ### Minor Changes
36
+
37
+ - [#1322](https://github.com/graphcommerce-org/graphcommerce/pull/1322) [`0298a0de1`](https://github.com/graphcommerce-org/graphcommerce/commit/0298a0de1d13e543c4124a6a099297b4e27e2b05) Thanks [@paales](https://github.com/paales)! - Added `<Slider size='large' />` and made styling with variants
38
+
39
+ ### Patch Changes
40
+
41
+ - [#1322](https://github.com/graphcommerce-org/graphcommerce/pull/1322) [`6f9d23688`](https://github.com/graphcommerce-org/graphcommerce/commit/6f9d23688ea26c74a41623c7f62597d33281d7c1) Thanks [@paales](https://github.com/paales)! - Review form had the wrong colors
42
+
43
+ * [#1322](https://github.com/graphcommerce-org/graphcommerce/pull/1322) [`ffb3dfa75`](https://github.com/graphcommerce-org/graphcommerce/commit/ffb3dfa752bd2304f92caaf253ffe685d7652a9e) Thanks [@paales](https://github.com/paales)! - reviews error because rows was defined
44
+
45
+ - [#1322](https://github.com/graphcommerce-org/graphcommerce/pull/1322) [`a26db0656`](https://github.com/graphcommerce-org/graphcommerce/commit/a26db0656e371f2bad4901aefa14507840e3d4cd) Thanks [@paales](https://github.com/paales)! - ProductReviews nested buttons
46
+
47
+ - Updated dependencies [[`5266388ea`](https://github.com/graphcommerce-org/graphcommerce/commit/5266388eaffda41592623ef7a3ddbbe03c8e0dad), [`9b35403d9`](https://github.com/graphcommerce-org/graphcommerce/commit/9b35403d9dbb2606ac7cf3bb641a0f9cc3d8a2ba), [`0298a0de1`](https://github.com/graphcommerce-org/graphcommerce/commit/0298a0de1d13e543c4124a6a099297b4e27e2b05), [`815132ea4`](https://github.com/graphcommerce-org/graphcommerce/commit/815132ea43937b4b84b59ec9974ac593cb4eb456), [`3326742a0`](https://github.com/graphcommerce-org/graphcommerce/commit/3326742a0dceb45f0cac4741ca09dc4d4f09ad90), [`7a3799bfc`](https://github.com/graphcommerce-org/graphcommerce/commit/7a3799bfc107f26aa9991a91db5f228e3476f4aa), [`9a77f88ed`](https://github.com/graphcommerce-org/graphcommerce/commit/9a77f88ed26cbecdae9a135c3cb234a5b7ecf4df), [`bc8826b9d`](https://github.com/graphcommerce-org/graphcommerce/commit/bc8826b9dc1e6418b2720c9211e46791c33fca8a), [`0eeaad304`](https://github.com/graphcommerce-org/graphcommerce/commit/0eeaad30461b1d5b486438f0287fa76d49429044), [`bc5213547`](https://github.com/graphcommerce-org/graphcommerce/commit/bc52135471479c83d989449dad24798112e898f4), [`3f1912f55`](https://github.com/graphcommerce-org/graphcommerce/commit/3f1912f553318d5888f8af2b841918ef4ae96a84), [`7e910f3b8`](https://github.com/graphcommerce-org/graphcommerce/commit/7e910f3b8eb73cff33261956937124f95520d8e5), [`3b4d46de2`](https://github.com/graphcommerce-org/graphcommerce/commit/3b4d46de2555db9eed733c8fac574bc809d75da4), [`b6c68cda8`](https://github.com/graphcommerce-org/graphcommerce/commit/b6c68cda8836a1d0c78ef351899cec9ec1037385), [`e4ded94d7`](https://github.com/graphcommerce-org/graphcommerce/commit/e4ded94d7b0f0c87f86abcd31340d75533bde73e)]:
48
+ - @graphcommerce/next-ui@4.3.0
49
+ - @graphcommerce/magento-product@4.1.0
50
+ - @graphcommerce/magento-store@4.1.3
51
+ - @graphcommerce/magento-customer@4.1.5
52
+
3
53
  ## 3.0.7
4
54
 
5
55
  ### Patch Changes
@@ -110,9 +110,9 @@ export function CreateProductReviewForm(props: CreateProductReviewFormProps) {
110
110
  marginBottom: theme.spacings.xxs,
111
111
  })}
112
112
  >
113
- {data?.productReviewRatingsMetadata?.items?.map((prrvm) => (
113
+ {data?.productReviewRatingsMetadata?.items?.map((item) => (
114
114
  <FormRow
115
- key={prrvm?.id}
115
+ key={item?.id}
116
116
  className={classes.rating}
117
117
  sx={{
118
118
  paddingBottom: 'unset',
@@ -121,7 +121,7 @@ export function CreateProductReviewForm(props: CreateProductReviewFormProps) {
121
121
  }}
122
122
  >
123
123
  <Typography
124
- variant='h5'
124
+ variant='subtitle1'
125
125
  component='span'
126
126
  className={classes.ratingLabel}
127
127
  sx={{
@@ -129,11 +129,11 @@ export function CreateProductReviewForm(props: CreateProductReviewFormProps) {
129
129
  justifySelf: 'left',
130
130
  }}
131
131
  >
132
- {prrvm?.name}
132
+ {item?.name}
133
133
  </Typography>
134
- {prrvm && (
134
+ {item && (
135
135
  <StarRatingField
136
- id={prrvm?.id ?? ''}
136
+ id={item?.id ?? ''}
137
137
  size='large'
138
138
  onChange={(id, value) => {
139
139
  const productReviewRatingInputValue =
@@ -190,8 +190,7 @@ export function CreateProductReviewForm(props: CreateProductReviewFormProps) {
190
190
  helperText={formState.errors.text?.message}
191
191
  disabled={formState.isSubmitting}
192
192
  multiline
193
- rows={8}
194
- maxRows={8}
193
+ minRows={4}
195
194
  />
196
195
  </FormRow>
197
196
 
@@ -6,7 +6,7 @@ export type ProductReviewChipProps = {
6
6
  rating?: number
7
7
  reviewSectionId?: string
8
8
  max?: number
9
- } & ChipProps
9
+ } & ChipProps<'button'>
10
10
 
11
11
  export function ProductReviewChip(props: ProductReviewChipProps) {
12
12
  const { rating, reviewSectionId = '', max = 5, ...chipProps } = props
@@ -15,7 +15,7 @@ export function ProductReviewChip(props: ProductReviewChipProps) {
15
15
 
16
16
  const normalizedRating = Math.round(rating / (10 / max)) / 10
17
17
 
18
- const handleClick: React.MouseEventHandler<HTMLDivElement> = (e) => {
18
+ const handleClick: React.MouseEventHandler<HTMLButtonElement> = (e) => {
19
19
  const element = document.getElementById(reviewSectionId)
20
20
  e.preventDefault()
21
21
  if (!element) return
@@ -29,12 +29,13 @@ export function ProductReviewChip(props: ProductReviewChipProps) {
29
29
 
30
30
  const chip = (
31
31
  <Chip
32
+ component='button'
32
33
  variant='outlined'
33
34
  clickable={!!reviewSectionId}
34
35
  onClick={handleClick}
35
- icon={<IconSvg src={iconStar} size='small' sx={{ stroke: '#FFDA1C', fill: '#FFDA1C' }} />}
36
+ icon={<IconSvg src={iconStar} sx={{ stroke: '#FFDA1C', fill: '#FFDA1C' }} />}
36
37
  color='default'
37
- size='small'
38
+ size='medium'
38
39
  label={`${normalizedRating}/5`}
39
40
  {...chipProps}
40
41
  />
@@ -6,8 +6,8 @@ import {
6
6
  extendableComponent,
7
7
  } from '@graphcommerce/next-ui'
8
8
  import { Trans } from '@lingui/macro'
9
- import { Typography, Button, Box, SxProps, Theme } from '@mui/material'
10
- import Link from 'next/link'
9
+ import { Typography, Button, Box, SxProps, Theme, Link } from '@mui/material'
10
+ import PageLink from 'next/link'
11
11
  import React, { useState } from 'react'
12
12
  import { ProductReviewChip } from '../ProductReviewChip/ProductReviewChip'
13
13
  import { ProductReviewsFragment } from './ProductReviews.gql'
@@ -74,7 +74,7 @@ export function ProductReviews(props: ProductReviewsProps) {
74
74
  marginTop: theme.spacings.sm,
75
75
  })}
76
76
  >
77
- <Link href={`/account/reviews/add?url_key=${url_key}`} passHref>
77
+ <PageLink href={`/account/reviews/add?url_key=${url_key}`} passHref>
78
78
  <Button
79
79
  variant='pill'
80
80
  color='primary'
@@ -88,7 +88,7 @@ export function ProductReviews(props: ProductReviewsProps) {
88
88
  >
89
89
  <Trans>Write a review</Trans>
90
90
  </Button>
91
- </Link>
91
+ </PageLink>
92
92
 
93
93
  {!!total_pages && total_pages > 1 && (
94
94
  <Pagination
@@ -99,20 +99,9 @@ export function ProductReviews(props: ProductReviewsProps) {
99
99
  margin: `0 -16px 0`,
100
100
  }}
101
101
  renderLink={(p: number, icon: React.ReactNode) => (
102
- <Button
103
- onClick={() => setPage(p)}
104
- className={classes.paginationButton}
105
- sx={{
106
- padding: 0,
107
- minWidth: 'unset',
108
- borderRadius: '100%',
109
- '& > .MuiButton-label': {
110
- padding: 0,
111
- },
112
- }}
113
- >
102
+ <Link color='inherit' underline='hover' onClick={() => setPage(p)}>
114
103
  {icon}
115
- </Button>
104
+ </Link>
116
105
  )}
117
106
  />
118
107
  )}
@@ -189,7 +178,7 @@ export function ProductReviews(props: ProductReviewsProps) {
189
178
  alignItems: 'center',
190
179
  })}
191
180
  >
192
- <ProductReviewChip rating={review?.average_rating} size='small' />
181
+ <ProductReviewChip rating={review?.average_rating} />
193
182
  <Typography component='h3' variant='h5'>
194
183
  {review?.summary}
195
184
  </Typography>
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@graphcommerce/magento-review",
3
3
  "homepage": "https://www.graphcommerce.org/",
4
4
  "repository": "github:graphcommerce-org/graphcommerce",
5
- "version": "3.0.7",
5
+ "version": "3.1.2",
6
6
  "sideEffects": false,
7
7
  "prettier": "@graphcommerce/prettier-config-pwa",
8
8
  "eslintConfig": {
@@ -12,25 +12,25 @@
12
12
  }
13
13
  },
14
14
  "devDependencies": {
15
- "@graphcommerce/eslint-config-pwa": "^4.0.5",
16
- "@graphcommerce/prettier-config-pwa": "^4.0.3",
15
+ "@graphcommerce/eslint-config-pwa": "^4.1.4",
16
+ "@graphcommerce/prettier-config-pwa": "^4.0.5",
17
17
  "@graphcommerce/typescript-config-pwa": "^4.0.2",
18
- "@playwright/test": "^1.19.2"
18
+ "@playwright/test": "^1.20.1"
19
19
  },
20
20
  "dependencies": {
21
- "@graphcommerce/graphql": "^3.0.4",
22
- "@graphcommerce/image": "^3.1.1",
23
- "@graphcommerce/magento-customer": "^4.1.4",
24
- "@graphcommerce/magento-product": "^4.0.6",
25
- "@graphcommerce/magento-store": "^4.1.2",
26
- "@graphcommerce/next-ui": "^4.2.4",
27
- "@graphcommerce/react-hook-form": "^3.0.4",
21
+ "@graphcommerce/graphql": "3.0.7",
22
+ "@graphcommerce/image": "3.1.3",
23
+ "@graphcommerce/magento-customer": "4.2.1",
24
+ "@graphcommerce/magento-product": "4.1.4",
25
+ "@graphcommerce/magento-store": "4.1.5",
26
+ "@graphcommerce/next-ui": "4.5.1",
27
+ "@graphcommerce/react-hook-form": "3.0.7",
28
28
  "schema-dts": "^1.1.0"
29
29
  },
30
30
  "peerDependencies": {
31
31
  "@lingui/macro": "^3.13.2",
32
- "@mui/material": "^5.4.1",
33
- "next": "^12.0.10",
32
+ "@mui/material": "5.5.3",
33
+ "next": "12.1.2",
34
34
  "react": "^17.0.2",
35
35
  "react-dom": "^17.0.2"
36
36
  }