@graphcommerce/magento-review 8.0.6-canary.3 → 8.0.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 CHANGED
@@ -1,22 +1,6 @@
1
1
  # Change Log
2
2
 
3
- ## 8.0.6-canary.3
4
-
5
- ## 8.0.6-canary.2
6
-
7
- ### Patch Changes
8
-
9
- - [#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
10
- ([@FrankHarland](https://github.com/FrankHarland))
11
-
12
- ## 8.0.6-canary.1
13
-
14
- ### Patch Changes
15
-
16
- - [#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
17
- ([@paales](https://github.com/paales))
18
-
19
- ## 8.0.6-canary.0
3
+ ## 8.0.6
20
4
 
21
5
  ## 8.0.5
22
6
 
@@ -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, control, formState, required, error } = form
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
- <TextFieldElement
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
- name='nickname'
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
- <TextFieldElement
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
- name='summary'
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
- <TextFieldElement
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
- name='text'
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
@@ -1,4 +1,5 @@
1
- fragment JsonLdProductReview on ProductInterface {
2
- rating_summary
1
+ fragment JsonLdProductReview on ProductInterface @inject(into: ["JsonLdProduct"]) {
3
2
  ...ProductReviews
3
+ review_count
4
+ rating_summary
4
5
  }
@@ -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: Partial<JsonLdProductReviewFragment>,
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?.items.map((review) => ({
15
+ review: reviews.items.map((review) => ({
16
16
  '@type': 'Review',
17
17
  reviewRating: {
18
18
  '@type': 'Rating',
@@ -1,4 +1,4 @@
1
- fragment ProductReviews on ProductInterface {
1
+ fragment ProductReviews on ProductInterface @inject(into: ["ProductPageItem"]) {
2
2
  reviews(pageSize: $reviewPageSize, currentPage: $reviewPage) {
3
3
  page_info {
4
4
  total_pages
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.6-canary.3",
5
+ "version": "8.0.6",
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/ecommerce-ui": "^8.0.6-canary.3",
22
- "@graphcommerce/eslint-config-pwa": "^8.0.6-canary.3",
23
- "@graphcommerce/graphql": "^8.0.6-canary.3",
24
- "@graphcommerce/graphql-mesh": "^8.0.6-canary.3",
25
- "@graphcommerce/image": "^8.0.6-canary.3",
26
- "@graphcommerce/magento-customer": "^8.0.6-canary.3",
27
- "@graphcommerce/magento-product": "^8.0.6-canary.3",
28
- "@graphcommerce/magento-store": "^8.0.6-canary.3",
29
- "@graphcommerce/next-ui": "^8.0.6-canary.3",
30
- "@graphcommerce/prettier-config-pwa": "^8.0.6-canary.3",
31
- "@graphcommerce/react-hook-form": "^8.0.6-canary.3",
32
- "@graphcommerce/typescript-config-pwa": "^8.0.6-canary.3",
21
+ "@graphcommerce/eslint-config-pwa": "^8.0.6",
22
+ "@graphcommerce/graphql": "^8.0.6",
23
+ "@graphcommerce/graphql-mesh": "^8.0.6",
24
+ "@graphcommerce/image": "^8.0.6",
25
+ "@graphcommerce/magento-customer": "^8.0.6",
26
+ "@graphcommerce/magento-product": "^8.0.6",
27
+ "@graphcommerce/magento-store": "^8.0.6",
28
+ "@graphcommerce/next-ui": "^8.0.6",
29
+ "@graphcommerce/prettier-config-pwa": "^8.0.6",
30
+ "@graphcommerce/react-hook-form": "^8.0.6",
31
+ "@graphcommerce/typescript-config-pwa": "^8.0.6",
33
32
  "@lingui/core": "^4.2.1",
34
33
  "@lingui/macro": "^4.2.1",
35
34
  "@lingui/react": "^4.2.1",