@graphcommerce/magento-review 3.0.6 → 3.1.1

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,46 @@
1
1
  # Change Log
2
2
 
3
+ ## 3.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#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
8
+
9
+ - 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)]:
10
+ - @graphcommerce/graphql@3.0.6
11
+ - @graphcommerce/next-ui@4.5.0
12
+ - @graphcommerce/image@3.1.2
13
+ - @graphcommerce/magento-customer@4.2.0
14
+ - @graphcommerce/magento-product@4.1.3
15
+ - @graphcommerce/magento-store@4.1.4
16
+ - @graphcommerce/react-hook-form@3.0.6
17
+
18
+ ## 3.1.0
19
+
20
+ ### Minor Changes
21
+
22
+ - [#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
23
+
24
+ ### Patch Changes
25
+
26
+ - [#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
27
+
28
+ * [#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
29
+
30
+ - [#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
31
+
32
+ - 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)]:
33
+ - @graphcommerce/next-ui@4.3.0
34
+ - @graphcommerce/magento-product@4.1.0
35
+ - @graphcommerce/magento-store@4.1.3
36
+ - @graphcommerce/magento-customer@4.1.5
37
+
38
+ ## 3.0.7
39
+
40
+ ### Patch Changes
41
+
42
+ - [#1310](https://github.com/graphcommerce-org/graphcommerce/pull/1310) [`bcae21cfa`](https://github.com/graphcommerce-org/graphcommerce/commit/bcae21cfafe5bf8e0768f9b52028e0e3195cd3b7) Thanks [@LaurensFranken](https://github.com/LaurensFranken)! - Make texts in product reviews component translatable
43
+
3
44
  ## 3.0.6
4
45
 
5
46
  ### 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
  )}
@@ -148,7 +137,9 @@ export function ProductReviews(props: ProductReviewsProps) {
148
137
  alignItems: 'center',
149
138
  })}
150
139
  >
151
- <Typography variant='subtitle1'>Be the first to write a review!</Typography>
140
+ <Typography variant='subtitle1'>
141
+ <Trans>Be the first to write a review!</Trans>
142
+ </Typography>
152
143
  </Box>
153
144
  </Box>
154
145
  {actions}
@@ -187,7 +178,7 @@ export function ProductReviews(props: ProductReviewsProps) {
187
178
  alignItems: 'center',
188
179
  })}
189
180
  >
190
- <ProductReviewChip rating={review?.average_rating} size='small' />
181
+ <ProductReviewChip rating={review?.average_rating} />
191
182
  <Typography component='h3' variant='h5'>
192
183
  {review?.summary}
193
184
  </Typography>
@@ -241,7 +232,7 @@ export function ProductReviews(props: ProductReviewsProps) {
241
232
  })}
242
233
  >
243
234
  <Box className={classes.nickname} sx={{ typography: 'body2' }}>
244
- Written by {review?.nickname}
235
+ <Trans>Written by</Trans> {review?.nickname}
245
236
  </Box>
246
237
  <Box
247
238
  component='time'
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.6",
5
+ "version": "3.1.1",
6
6
  "sideEffects": false,
7
7
  "prettier": "@graphcommerce/prettier-config-pwa",
8
8
  "eslintConfig": {
@@ -12,19 +12,19 @@
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.3",
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.6",
22
+ "@graphcommerce/image": "^3.1.2",
23
+ "@graphcommerce/magento-customer": "^4.2.0",
24
+ "@graphcommerce/magento-product": "^4.1.3",
25
+ "@graphcommerce/magento-store": "^4.1.4",
26
+ "@graphcommerce/next-ui": "^4.5.0",
27
+ "@graphcommerce/react-hook-form": "^3.0.6",
28
28
  "schema-dts": "^1.1.0"
29
29
  },
30
30
  "peerDependencies": {