@graphcommerce/magento-review 8.0.6-canary.4 → 8.0.7
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 +13 -32
- package/components/CreateProductReviewForm/CreateProductReviewForm.tsx +8 -18
- package/components/JsonLdProductReview/JsonLdProductReview.graphql +3 -2
- package/components/JsonLdProductReview/jsonLdProductReview.ts +2 -2
- package/components/ProductReviews/ProductReviews.graphql +1 -1
- package/package.json +12 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,24 +1,8 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
## 8.0.
|
|
3
|
+
## 8.0.7
|
|
4
4
|
|
|
5
|
-
## 8.0.6
|
|
6
|
-
|
|
7
|
-
## 8.0.6-canary.2
|
|
8
|
-
|
|
9
|
-
### Patch Changes
|
|
10
|
-
|
|
11
|
-
- [#2234](https://github.com/graphcommerce-org/graphcommerce/pull/2234) [`0767bc4`](https://github.com/graphcommerce-org/graphcommerce/commit/0767bc40f7b596209f24ca4e745ff0441f3275c9) - Upgrade input components to no longer use muiRegister, which improves INP scores
|
|
12
|
-
([@FrankHarland](https://github.com/FrankHarland))
|
|
13
|
-
|
|
14
|
-
## 8.0.6-canary.1
|
|
15
|
-
|
|
16
|
-
### Patch Changes
|
|
17
|
-
|
|
18
|
-
- [#2213](https://github.com/graphcommerce-org/graphcommerce/pull/2213) [`a0d952e`](https://github.com/graphcommerce-org/graphcommerce/commit/a0d952e6b8a71a7451bfdb2bdb5150fc218169e2) - Moved product reviews to the relatedUpsells query so we do not pass the queryComplexity limit
|
|
19
|
-
([@paales](https://github.com/paales))
|
|
20
|
-
|
|
21
|
-
## 8.0.6-canary.0
|
|
5
|
+
## 8.0.6
|
|
22
6
|
|
|
23
7
|
## 8.0.5
|
|
24
8
|
|
|
@@ -92,8 +76,7 @@
|
|
|
92
76
|
|
|
93
77
|
### Patch Changes
|
|
94
78
|
|
|
95
|
-
- [`e33660f`](https://github.com/graphcommerce-org/graphcommerce/commit/e33660f172466dcfa0ab7262cee612d9a3e47776) - Accessibility improvements for the frontend: Added skip content link. Removed empty buttons from tab flow. Gave focus to elements (such as the menu) that appear when after clicking a button. Improved aria labels where needed
|
|
96
|
-
([@FrankHarland](https://github.com/FrankHarland))
|
|
79
|
+
- [`e33660f`](https://github.com/graphcommerce-org/graphcommerce/commit/e33660f172466dcfa0ab7262cee612d9a3e47776) - Accessibility improvements for the frontend: Added skip content link. Removed empty buttons from tab flow. Gave focus to elements (such as the menu) that appear when after clicking a button. Improved aria labels where needed ([@FrankHarland](https://github.com/FrankHarland))
|
|
97
80
|
|
|
98
81
|
## 8.0.0-canary.100
|
|
99
82
|
|
|
@@ -125,8 +108,7 @@
|
|
|
125
108
|
|
|
126
109
|
### Patch Changes
|
|
127
110
|
|
|
128
|
-
- [#2168](https://github.com/graphcommerce-org/graphcommerce/pull/2168) [`986dc96`](https://github.com/graphcommerce-org/graphcommerce/commit/986dc96e6e88b58471dfcccf952d99bbb8a81884) - Added schema-dts as a dependency, so it isn't required in the example
|
|
129
|
-
([@paales](https://github.com/paales))
|
|
111
|
+
- [#2168](https://github.com/graphcommerce-org/graphcommerce/pull/2168) [`986dc96`](https://github.com/graphcommerce-org/graphcommerce/commit/986dc96e6e88b58471dfcccf952d99bbb8a81884) - Added schema-dts as a dependency, so it isn't required in the example ([@paales](https://github.com/paales))
|
|
130
112
|
|
|
131
113
|
## 8.0.0-canary.86
|
|
132
114
|
|
|
@@ -150,8 +132,7 @@
|
|
|
150
132
|
|
|
151
133
|
### Patch Changes
|
|
152
134
|
|
|
153
|
-
- [`e33660f`](https://github.com/graphcommerce-org/graphcommerce/commit/e33660f172466dcfa0ab7262cee612d9a3e47776) - a11y improvements (see https://github.com/graphcommerce-org/graphcommerce/issues/1995 for more info)
|
|
154
|
-
([@FrankHarland](https://github.com/FrankHarland))
|
|
135
|
+
- [`e33660f`](https://github.com/graphcommerce-org/graphcommerce/commit/e33660f172466dcfa0ab7262cee612d9a3e47776) - a11y improvements (see https://github.com/graphcommerce-org/graphcommerce/issues/1995 for more info) ([@FrankHarland](https://github.com/FrankHarland))
|
|
155
136
|
|
|
156
137
|
## 8.0.0-canary.76
|
|
157
138
|
|
|
@@ -1382,31 +1363,31 @@
|
|
|
1382
1363
|
All occurences of `<Trans>` and `t` need to be replaced:
|
|
1383
1364
|
|
|
1384
1365
|
```tsx
|
|
1385
|
-
import { Trans, t } from
|
|
1366
|
+
import { Trans, t } from '@lingui/macro'
|
|
1386
1367
|
|
|
1387
1368
|
function MyComponent() {
|
|
1388
|
-
const foo =
|
|
1369
|
+
const foo = 'bar'
|
|
1389
1370
|
return (
|
|
1390
1371
|
<div aria-label={t`Account ${foo}`}>
|
|
1391
1372
|
<Trans>My Translation {foo}</Trans>
|
|
1392
1373
|
</div>
|
|
1393
|
-
)
|
|
1374
|
+
)
|
|
1394
1375
|
}
|
|
1395
1376
|
```
|
|
1396
1377
|
|
|
1397
1378
|
Needs to be replaced with:
|
|
1398
1379
|
|
|
1399
1380
|
```tsx
|
|
1400
|
-
import { Trans } from
|
|
1401
|
-
import { i18n } from
|
|
1381
|
+
import { Trans } from '@lingui/react'
|
|
1382
|
+
import { i18n } from '@lingui/core'
|
|
1402
1383
|
|
|
1403
1384
|
function MyComponent() {
|
|
1404
|
-
const foo =
|
|
1385
|
+
const foo = 'bar'
|
|
1405
1386
|
return (
|
|
1406
1387
|
<div aria-label={i18n._(/* i18n */ `Account {foo}`, { foo })}>
|
|
1407
|
-
<Trans key=
|
|
1388
|
+
<Trans key='My Translation {foo}' values={{ foo }}></Trans>
|
|
1408
1389
|
</div>
|
|
1409
|
-
)
|
|
1390
|
+
)
|
|
1410
1391
|
}
|
|
1411
1392
|
```
|
|
1412
1393
|
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { TextFieldElement } from '@graphcommerce/ecommerce-ui'
|
|
2
1
|
import { useQuery } from '@graphcommerce/graphql'
|
|
3
2
|
import { ProductReviewRatingInput } from '@graphcommerce/graphql-mesh'
|
|
4
3
|
import { ApolloCustomerErrorAlert } from '@graphcommerce/magento-customer'
|
|
@@ -13,7 +12,7 @@ import {
|
|
|
13
12
|
import { useFormGqlMutation } from '@graphcommerce/react-hook-form'
|
|
14
13
|
import { Trans } from '@lingui/react'
|
|
15
14
|
// eslint-disable-next-line @typescript-eslint/no-restricted-imports
|
|
16
|
-
import { Box, Typography, Alert, Button, SxProps, Theme } from '@mui/material'
|
|
15
|
+
import { Box, TextField, Typography, Alert, Button, SxProps, Theme } from '@mui/material'
|
|
17
16
|
import { useRouter } from 'next/router'
|
|
18
17
|
import { useEffect, useState } from 'react'
|
|
19
18
|
import { CreateProductReviewDocument } from './CreateProductReview.gql'
|
|
@@ -55,7 +54,7 @@ export function CreateProductReviewForm(props: CreateProductReviewFormProps) {
|
|
|
55
54
|
},
|
|
56
55
|
{ errorPolicy: 'all' },
|
|
57
56
|
)
|
|
58
|
-
const { handleSubmit,
|
|
57
|
+
const { handleSubmit, muiRegister, formState, required, error } = form
|
|
59
58
|
const submitHandler = handleSubmit(() => {})
|
|
60
59
|
|
|
61
60
|
useEffect(() => {
|
|
@@ -92,16 +91,13 @@ export function CreateProductReviewForm(props: CreateProductReviewFormProps) {
|
|
|
92
91
|
return (
|
|
93
92
|
<Form onSubmit={submitHandler} noValidate className={classes.root} sx={sx}>
|
|
94
93
|
<FormRow>
|
|
95
|
-
<
|
|
94
|
+
<TextField
|
|
96
95
|
variant='outlined'
|
|
97
96
|
type='text'
|
|
98
97
|
error={!!formState.errors.nickname || !!error}
|
|
99
98
|
label={<Trans id='Name' />}
|
|
100
99
|
required={required.nickname}
|
|
101
|
-
|
|
102
|
-
rules={{ required: required.nickname }}
|
|
103
|
-
showValid
|
|
104
|
-
control={control}
|
|
100
|
+
{...muiRegister('nickname', { required: required.nickname })}
|
|
105
101
|
helperText={formState.errors.nickname?.message}
|
|
106
102
|
disabled={formState.isSubmitting}
|
|
107
103
|
InputProps={{
|
|
@@ -173,32 +169,26 @@ export function CreateProductReviewForm(props: CreateProductReviewFormProps) {
|
|
|
173
169
|
</Box>
|
|
174
170
|
|
|
175
171
|
<FormRow>
|
|
176
|
-
<
|
|
172
|
+
<TextField
|
|
177
173
|
variant='outlined'
|
|
178
174
|
type='text'
|
|
179
175
|
error={!!formState.errors.summary || !!error}
|
|
180
176
|
label={<Trans id='Summary' />}
|
|
181
177
|
required={required.summary}
|
|
182
|
-
|
|
183
|
-
rules={{ required: required.summary }}
|
|
184
|
-
control={control}
|
|
185
|
-
showValid
|
|
178
|
+
{...muiRegister('summary', { required: required.summary })}
|
|
186
179
|
helperText={formState.errors.summary?.message}
|
|
187
180
|
disabled={formState.isSubmitting}
|
|
188
181
|
/>
|
|
189
182
|
</FormRow>
|
|
190
183
|
|
|
191
184
|
<FormRow>
|
|
192
|
-
<
|
|
185
|
+
<TextField
|
|
193
186
|
variant='outlined'
|
|
194
187
|
type='text'
|
|
195
188
|
error={!!formState.errors.text || !!error}
|
|
196
189
|
label={<Trans id='Review' />}
|
|
197
190
|
required={required.text}
|
|
198
|
-
|
|
199
|
-
rules={{ required: required.text }}
|
|
200
|
-
control={control}
|
|
201
|
-
showValid
|
|
191
|
+
{...muiRegister('text', { required: required.text })}
|
|
202
192
|
helperText={formState.errors.text?.message}
|
|
203
193
|
disabled={formState.isSubmitting}
|
|
204
194
|
multiline
|
|
@@ -2,7 +2,7 @@ import type { Product } from 'schema-dts'
|
|
|
2
2
|
import type { JsonLdProductReviewFragment } from './JsonLdProductReview.gql'
|
|
3
3
|
|
|
4
4
|
export function jsonLdProductReview(
|
|
5
|
-
props:
|
|
5
|
+
props: JsonLdProductReviewFragment,
|
|
6
6
|
): Pick<Product, 'aggregateRating' | 'review'> {
|
|
7
7
|
const { reviews, review_count, rating_summary } = props
|
|
8
8
|
|
|
@@ -12,7 +12,7 @@ export function jsonLdProductReview(
|
|
|
12
12
|
reviewCount: review_count ?? undefined,
|
|
13
13
|
ratingValue: rating_summary ? Math.max(rating_summary * 0.5 * 0.1, 1) : undefined,
|
|
14
14
|
},
|
|
15
|
-
review: reviews
|
|
15
|
+
review: reviews.items.map((review) => ({
|
|
16
16
|
'@type': 'Review',
|
|
17
17
|
reviewRating: {
|
|
18
18
|
'@type': 'Rating',
|
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": "8.0.
|
|
5
|
+
"version": "8.0.7",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"prettier": "@graphcommerce/prettier-config-pwa",
|
|
8
8
|
"eslintConfig": {
|
|
@@ -18,18 +18,17 @@
|
|
|
18
18
|
"typescript": "5.3.3"
|
|
19
19
|
},
|
|
20
20
|
"peerDependencies": {
|
|
21
|
-
"@graphcommerce/
|
|
22
|
-
"@graphcommerce/
|
|
23
|
-
"@graphcommerce/graphql": "^8.0.
|
|
24
|
-
"@graphcommerce/
|
|
25
|
-
"@graphcommerce/
|
|
26
|
-
"@graphcommerce/magento-
|
|
27
|
-
"@graphcommerce/magento-
|
|
28
|
-
"@graphcommerce/
|
|
29
|
-
"@graphcommerce/
|
|
30
|
-
"@graphcommerce/
|
|
31
|
-
"@graphcommerce/
|
|
32
|
-
"@graphcommerce/typescript-config-pwa": "^8.0.6-canary.4",
|
|
21
|
+
"@graphcommerce/eslint-config-pwa": "^8.0.7",
|
|
22
|
+
"@graphcommerce/graphql": "^8.0.7",
|
|
23
|
+
"@graphcommerce/graphql-mesh": "^8.0.7",
|
|
24
|
+
"@graphcommerce/image": "^8.0.7",
|
|
25
|
+
"@graphcommerce/magento-customer": "^8.0.7",
|
|
26
|
+
"@graphcommerce/magento-product": "^8.0.7",
|
|
27
|
+
"@graphcommerce/magento-store": "^8.0.7",
|
|
28
|
+
"@graphcommerce/next-ui": "^8.0.7",
|
|
29
|
+
"@graphcommerce/prettier-config-pwa": "^8.0.7",
|
|
30
|
+
"@graphcommerce/react-hook-form": "^8.0.7",
|
|
31
|
+
"@graphcommerce/typescript-config-pwa": "^8.0.7",
|
|
33
32
|
"@lingui/core": "^4.2.1",
|
|
34
33
|
"@lingui/macro": "^4.2.1",
|
|
35
34
|
"@lingui/react": "^4.2.1",
|