@graphcommerce/magento-review 8.1.0-canary.3 → 8.1.0-canary.6
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 +64 -2
- package/components/CreateProductReviewForm/CreateProductReviewForm.tsx +18 -8
- package/components/JsonLdProductReview/JsonLdProductReview.graphql +2 -3
- package/components/JsonLdProductReview/jsonLdProductReview.ts +2 -2
- package/components/ProductReviews/ProductReviews.graphql +1 -1
- package/package.json +13 -12
package/CHANGELOG.md
CHANGED
|
@@ -1,8 +1,70 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
## 8.1.0-canary.
|
|
3
|
+
## 8.1.0-canary.6
|
|
4
4
|
|
|
5
|
-
## 8.1.0-canary.
|
|
5
|
+
## 8.1.0-canary.5
|
|
6
|
+
|
|
7
|
+
## 8.0.6-canary.4
|
|
8
|
+
|
|
9
|
+
## 8.0.6-canary.3
|
|
10
|
+
|
|
11
|
+
## 8.0.6-canary.2
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#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
|
|
16
|
+
([@FrankHarland](https://github.com/FrankHarland))
|
|
17
|
+
|
|
18
|
+
## 8.0.6-canary.1
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- [#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
|
|
23
|
+
([@paales](https://github.com/paales))
|
|
24
|
+
|
|
25
|
+
## 8.0.6-canary.0
|
|
26
|
+
|
|
27
|
+
## 8.0.5
|
|
28
|
+
|
|
29
|
+
## 8.0.5-canary.10
|
|
30
|
+
|
|
31
|
+
## 8.0.5-canary.9
|
|
32
|
+
|
|
33
|
+
## 8.0.5-canary.8
|
|
34
|
+
|
|
35
|
+
## 8.0.5-canary.7
|
|
36
|
+
|
|
37
|
+
## 8.0.5-canary.6
|
|
38
|
+
|
|
39
|
+
## 8.0.5-canary.5
|
|
40
|
+
|
|
41
|
+
## 8.0.5-canary.4
|
|
42
|
+
|
|
43
|
+
## 8.0.5-canary.3
|
|
44
|
+
|
|
45
|
+
## 8.0.5-canary.2
|
|
46
|
+
|
|
47
|
+
## 8.0.5-canary.1
|
|
48
|
+
|
|
49
|
+
## 8.0.5-canary.0
|
|
50
|
+
|
|
51
|
+
## 8.0.4
|
|
52
|
+
|
|
53
|
+
## 8.0.4-canary.1
|
|
54
|
+
|
|
55
|
+
## 8.0.4-canary.0
|
|
56
|
+
|
|
57
|
+
## 8.0.3
|
|
58
|
+
|
|
59
|
+
## 8.0.3-canary.6
|
|
60
|
+
|
|
61
|
+
## 8.0.3-canary.5
|
|
62
|
+
|
|
63
|
+
## 8.0.3-canary.4
|
|
64
|
+
|
|
65
|
+
## 8.0.3-canary.3
|
|
66
|
+
|
|
67
|
+
## 8.0.3-canary.2
|
|
6
68
|
|
|
7
69
|
## 8.0.3-canary.1
|
|
8
70
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { TextFieldElement } from '@graphcommerce/ecommerce-ui'
|
|
1
2
|
import { useQuery } from '@graphcommerce/graphql'
|
|
2
3
|
import { ProductReviewRatingInput } from '@graphcommerce/graphql-mesh'
|
|
3
4
|
import { ApolloCustomerErrorAlert } from '@graphcommerce/magento-customer'
|
|
@@ -12,7 +13,7 @@ import {
|
|
|
12
13
|
import { useFormGqlMutation } from '@graphcommerce/react-hook-form'
|
|
13
14
|
import { Trans } from '@lingui/react'
|
|
14
15
|
// eslint-disable-next-line @typescript-eslint/no-restricted-imports
|
|
15
|
-
import { Box,
|
|
16
|
+
import { Box, Typography, Alert, Button, SxProps, Theme } from '@mui/material'
|
|
16
17
|
import { useRouter } from 'next/router'
|
|
17
18
|
import { useEffect, useState } from 'react'
|
|
18
19
|
import { CreateProductReviewDocument } from './CreateProductReview.gql'
|
|
@@ -54,7 +55,7 @@ export function CreateProductReviewForm(props: CreateProductReviewFormProps) {
|
|
|
54
55
|
},
|
|
55
56
|
{ errorPolicy: 'all' },
|
|
56
57
|
)
|
|
57
|
-
const { handleSubmit,
|
|
58
|
+
const { handleSubmit, control, formState, required, error } = form
|
|
58
59
|
const submitHandler = handleSubmit(() => {})
|
|
59
60
|
|
|
60
61
|
useEffect(() => {
|
|
@@ -91,13 +92,16 @@ export function CreateProductReviewForm(props: CreateProductReviewFormProps) {
|
|
|
91
92
|
return (
|
|
92
93
|
<Form onSubmit={submitHandler} noValidate className={classes.root} sx={sx}>
|
|
93
94
|
<FormRow>
|
|
94
|
-
<
|
|
95
|
+
<TextFieldElement
|
|
95
96
|
variant='outlined'
|
|
96
97
|
type='text'
|
|
97
98
|
error={!!formState.errors.nickname || !!error}
|
|
98
99
|
label={<Trans id='Name' />}
|
|
99
100
|
required={required.nickname}
|
|
100
|
-
|
|
101
|
+
name='nickname'
|
|
102
|
+
rules={{ required: required.nickname }}
|
|
103
|
+
showValid
|
|
104
|
+
control={control}
|
|
101
105
|
helperText={formState.errors.nickname?.message}
|
|
102
106
|
disabled={formState.isSubmitting}
|
|
103
107
|
InputProps={{
|
|
@@ -169,26 +173,32 @@ export function CreateProductReviewForm(props: CreateProductReviewFormProps) {
|
|
|
169
173
|
</Box>
|
|
170
174
|
|
|
171
175
|
<FormRow>
|
|
172
|
-
<
|
|
176
|
+
<TextFieldElement
|
|
173
177
|
variant='outlined'
|
|
174
178
|
type='text'
|
|
175
179
|
error={!!formState.errors.summary || !!error}
|
|
176
180
|
label={<Trans id='Summary' />}
|
|
177
181
|
required={required.summary}
|
|
178
|
-
|
|
182
|
+
name='summary'
|
|
183
|
+
rules={{ required: required.summary }}
|
|
184
|
+
control={control}
|
|
185
|
+
showValid
|
|
179
186
|
helperText={formState.errors.summary?.message}
|
|
180
187
|
disabled={formState.isSubmitting}
|
|
181
188
|
/>
|
|
182
189
|
</FormRow>
|
|
183
190
|
|
|
184
191
|
<FormRow>
|
|
185
|
-
<
|
|
192
|
+
<TextFieldElement
|
|
186
193
|
variant='outlined'
|
|
187
194
|
type='text'
|
|
188
195
|
error={!!formState.errors.text || !!error}
|
|
189
196
|
label={<Trans id='Review' />}
|
|
190
197
|
required={required.text}
|
|
191
|
-
|
|
198
|
+
name='text'
|
|
199
|
+
rules={{ required: required.text }}
|
|
200
|
+
control={control}
|
|
201
|
+
showValid
|
|
192
202
|
helperText={formState.errors.text?.message}
|
|
193
203
|
disabled={formState.isSubmitting}
|
|
194
204
|
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: JsonLdProductReviewFragment
|
|
5
|
+
props: Partial<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.1.0-canary.
|
|
5
|
+
"version": "8.1.0-canary.6",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"prettier": "@graphcommerce/prettier-config-pwa",
|
|
8
8
|
"eslintConfig": {
|
|
@@ -18,17 +18,18 @@
|
|
|
18
18
|
"typescript": "5.3.3"
|
|
19
19
|
},
|
|
20
20
|
"peerDependencies": {
|
|
21
|
-
"@graphcommerce/
|
|
22
|
-
"@graphcommerce/
|
|
23
|
-
"@graphcommerce/graphql
|
|
24
|
-
"@graphcommerce/
|
|
25
|
-
"@graphcommerce/
|
|
26
|
-
"@graphcommerce/magento-
|
|
27
|
-
"@graphcommerce/magento-
|
|
28
|
-
"@graphcommerce/
|
|
29
|
-
"@graphcommerce/
|
|
30
|
-
"@graphcommerce/
|
|
31
|
-
"@graphcommerce/
|
|
21
|
+
"@graphcommerce/ecommerce-ui": "^8.1.0-canary.6",
|
|
22
|
+
"@graphcommerce/eslint-config-pwa": "^8.1.0-canary.6",
|
|
23
|
+
"@graphcommerce/graphql": "^8.1.0-canary.6",
|
|
24
|
+
"@graphcommerce/graphql-mesh": "^8.1.0-canary.6",
|
|
25
|
+
"@graphcommerce/image": "^8.1.0-canary.6",
|
|
26
|
+
"@graphcommerce/magento-customer": "^8.1.0-canary.6",
|
|
27
|
+
"@graphcommerce/magento-product": "^8.1.0-canary.6",
|
|
28
|
+
"@graphcommerce/magento-store": "^8.1.0-canary.6",
|
|
29
|
+
"@graphcommerce/next-ui": "^8.1.0-canary.6",
|
|
30
|
+
"@graphcommerce/prettier-config-pwa": "^8.1.0-canary.6",
|
|
31
|
+
"@graphcommerce/react-hook-form": "^8.1.0-canary.6",
|
|
32
|
+
"@graphcommerce/typescript-config-pwa": "^8.1.0-canary.6",
|
|
32
33
|
"@lingui/core": "^4.2.1",
|
|
33
34
|
"@lingui/macro": "^4.2.1",
|
|
34
35
|
"@lingui/react": "^4.2.1",
|