@akinon/projectzero 2.0.152-rc.0 → 2.0.152-rc.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,11 @@
1
1
  # @akinon/projectzero
2
2
 
3
+ ## 2.0.152-rc.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 97d29893: ZERO-5220: add the pz-rate-review plugin for the Rate & Review extension
8
+
3
9
  ## 2.0.152-rc.0
4
10
 
5
11
  ### Patch Changes
@@ -1,5 +1,39 @@
1
1
  # projectzeronext
2
2
 
3
+ ## 2.0.152-rc.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [97d29893]
8
+ - Updated dependencies [ad5240c4]
9
+ - @akinon/next@2.0.152-rc.1
10
+ - @akinon/pz-theme@2.0.152-rc.1
11
+ - @akinon/pz-virtual-try-on@2.0.152-rc.1
12
+ - @akinon/pz-akifast@2.0.152-rc.1
13
+ - @akinon/pz-apple-pay@2.0.152-rc.1
14
+ - @akinon/pz-b2b@2.0.152-rc.1
15
+ - @akinon/pz-basket-gift-pack@2.0.152-rc.1
16
+ - @akinon/pz-bkm@2.0.152-rc.1
17
+ - @akinon/pz-checkout-gift-pack@2.0.152-rc.1
18
+ - @akinon/pz-click-collect@2.0.152-rc.1
19
+ - @akinon/pz-credit-payment@2.0.152-rc.1
20
+ - @akinon/pz-cybersource-uc@2.0.152-rc.1
21
+ - @akinon/pz-flow-payment@2.0.152-rc.1
22
+ - @akinon/pz-google-pay@2.0.152-rc.1
23
+ - @akinon/pz-gpay@2.0.152-rc.1
24
+ - @akinon/pz-haso@2.0.152-rc.1
25
+ - @akinon/pz-hepsipay@2.0.152-rc.1
26
+ - @akinon/pz-masterpass@2.0.152-rc.1
27
+ - @akinon/pz-masterpass-rest@2.0.152-rc.1
28
+ - @akinon/pz-multi-basket@2.0.152-rc.1
29
+ - @akinon/pz-one-click-checkout@2.0.152-rc.1
30
+ - @akinon/pz-otp@2.0.152-rc.1
31
+ - @akinon/pz-pay-on-delivery@2.0.152-rc.1
32
+ - @akinon/pz-saved-card@2.0.152-rc.1
33
+ - @akinon/pz-similar-products@2.0.152-rc.1
34
+ - @akinon/pz-tabby-extension@2.0.152-rc.1
35
+ - @akinon/pz-tamara-extension@2.0.152-rc.1
36
+
3
37
  ## 2.0.152-rc.0
4
38
 
5
39
  ### Patch Changes
@@ -109,3 +109,9 @@ Integrates Tabby’s installment and deferred payment solutions into the checkou
109
109
  Adds Tamara’s "Buy Now, Pay Later" feature to the payment options. Customers can defer payments while ensuring a seamless checkout experience.
110
110
 
111
111
  [Click here for details](https://www.npmjs.com/package/@akinon/pz-tamara-extension)
112
+
113
+ ### Rate & Review
114
+
115
+ Connects the storefront to the Akinon Rate & Review extension: approved review lists and rating summaries on product pages, rating badges on listings and a review form on the order page. Credentials stay on the server and the customer identity comes from the session.
116
+
117
+ [Click here for details](https://www.npmjs.com/package/@akinon/pz-rate-review)
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "projectzeronext",
3
- "version": "2.0.152-rc.0",
3
+ "version": "2.0.152-rc.1",
4
4
  "private": true,
5
5
  "license": "MIT",
6
6
  "scripts": {
@@ -24,33 +24,33 @@
24
24
  "test:middleware": "jest middleware-matcher.test.ts --bail"
25
25
  },
26
26
  "dependencies": {
27
- "@akinon/next": "2.0.152-rc.0",
28
- "@akinon/pz-akifast": "2.0.152-rc.0",
29
- "@akinon/pz-apple-pay": "2.0.152-rc.0",
30
- "@akinon/pz-b2b": "2.0.152-rc.0",
31
- "@akinon/pz-basket-gift-pack": "2.0.152-rc.0",
32
- "@akinon/pz-bkm": "2.0.152-rc.0",
33
- "@akinon/pz-checkout-gift-pack": "2.0.152-rc.0",
34
- "@akinon/pz-click-collect": "2.0.152-rc.0",
35
- "@akinon/pz-credit-payment": "2.0.152-rc.0",
36
- "@akinon/pz-cybersource-uc": "2.0.152-rc.0",
37
- "@akinon/pz-flow-payment": "2.0.152-rc.0",
38
- "@akinon/pz-google-pay": "2.0.152-rc.0",
39
- "@akinon/pz-gpay": "2.0.152-rc.0",
40
- "@akinon/pz-haso": "2.0.152-rc.0",
41
- "@akinon/pz-hepsipay": "2.0.152-rc.0",
42
- "@akinon/pz-masterpass": "2.0.152-rc.0",
43
- "@akinon/pz-masterpass-rest": "2.0.152-rc.0",
44
- "@akinon/pz-multi-basket": "2.0.152-rc.0",
45
- "@akinon/pz-one-click-checkout": "2.0.152-rc.0",
46
- "@akinon/pz-otp": "2.0.152-rc.0",
47
- "@akinon/pz-pay-on-delivery": "2.0.152-rc.0",
48
- "@akinon/pz-saved-card": "2.0.152-rc.0",
49
- "@akinon/pz-similar-products": "2.0.152-rc.0",
50
- "@akinon/pz-tabby-extension": "2.0.152-rc.0",
51
- "@akinon/pz-tamara-extension": "2.0.152-rc.0",
52
- "@akinon/pz-theme": "2.0.152-rc.0",
53
- "@akinon/pz-virtual-try-on": "2.0.152-rc.0",
27
+ "@akinon/next": "2.0.152-rc.1",
28
+ "@akinon/pz-akifast": "2.0.152-rc.1",
29
+ "@akinon/pz-apple-pay": "2.0.152-rc.1",
30
+ "@akinon/pz-b2b": "2.0.152-rc.1",
31
+ "@akinon/pz-basket-gift-pack": "2.0.152-rc.1",
32
+ "@akinon/pz-bkm": "2.0.152-rc.1",
33
+ "@akinon/pz-checkout-gift-pack": "2.0.152-rc.1",
34
+ "@akinon/pz-click-collect": "2.0.152-rc.1",
35
+ "@akinon/pz-credit-payment": "2.0.152-rc.1",
36
+ "@akinon/pz-cybersource-uc": "2.0.152-rc.1",
37
+ "@akinon/pz-flow-payment": "2.0.152-rc.1",
38
+ "@akinon/pz-google-pay": "2.0.152-rc.1",
39
+ "@akinon/pz-gpay": "2.0.152-rc.1",
40
+ "@akinon/pz-haso": "2.0.152-rc.1",
41
+ "@akinon/pz-hepsipay": "2.0.152-rc.1",
42
+ "@akinon/pz-masterpass": "2.0.152-rc.1",
43
+ "@akinon/pz-masterpass-rest": "2.0.152-rc.1",
44
+ "@akinon/pz-multi-basket": "2.0.152-rc.1",
45
+ "@akinon/pz-one-click-checkout": "2.0.152-rc.1",
46
+ "@akinon/pz-otp": "2.0.152-rc.1",
47
+ "@akinon/pz-pay-on-delivery": "2.0.152-rc.1",
48
+ "@akinon/pz-saved-card": "2.0.152-rc.1",
49
+ "@akinon/pz-similar-products": "2.0.152-rc.1",
50
+ "@akinon/pz-tabby-extension": "2.0.152-rc.1",
51
+ "@akinon/pz-tamara-extension": "2.0.152-rc.1",
52
+ "@akinon/pz-theme": "2.0.152-rc.1",
53
+ "@akinon/pz-virtual-try-on": "2.0.152-rc.1",
54
54
  "@hookform/resolvers": "2.9.0",
55
55
  "@next/third-parties": "16.2.6",
56
56
  "@react-google-maps/api": "2.17.1",
@@ -74,7 +74,7 @@
74
74
  "yup": "0.32.11"
75
75
  },
76
76
  "devDependencies": {
77
- "@akinon/eslint-plugin-projectzero": "2.0.152-rc.0",
77
+ "@akinon/eslint-plugin-projectzero": "2.0.152-rc.1",
78
78
  "@semantic-release/changelog": "6.0.2",
79
79
  "@semantic-release/exec": "6.0.3",
80
80
  "@semantic-release/git": "10.0.1",
@@ -13,6 +13,9 @@ import { ROUTES } from '@theme/routes';
13
13
  import { useLocalization } from '@akinon/next/hooks';
14
14
  import settings from 'settings';
15
15
  import { getOrderStatus } from 'utils';
16
+ import PluginModule, { Component } from '@akinon/next/components/plugin-module';
17
+
18
+ const DELIVERED_ORDER_ITEM_STATUS = '550';
16
19
 
17
20
  const AccountOrderDetail = () => {
18
21
  const { id } = useParams<{ id: string }>();
@@ -228,6 +231,24 @@ const AccountOrderDetail = () => {
228
231
  {itemStatus.label}
229
232
  </div>
230
233
 
234
+ {item?.status?.value?.toString() ===
235
+ DELIVERED_ORDER_ITEM_STATUS && (
236
+ <PluginModule
237
+ component={Component.OrderItemRateAction}
238
+ props={{
239
+ orderId: order.id,
240
+ orderNumber: order.number,
241
+ orderDate: order.created_date,
242
+ product: {
243
+ sku: item.product.sku,
244
+ base_code: item.product.base_code,
245
+ name: item.product.name
246
+ },
247
+ classNames: { root: 'lg:ml-6' }
248
+ }}
249
+ />
250
+ )}
251
+
231
252
  {(item?.is_cancellable || item?.is_refundable) &&
232
253
  order?.is_cancellable && (
233
254
  <div className="lg:ml-24">
@@ -2,7 +2,11 @@ import { getProductData, getWidgetData } from '@akinon/next/data/server';
2
2
  import { withSegmentDefaults } from '@akinon/next/hocs/server';
3
3
  import { AsyncPageProps, ResolvedPageProps, Metadata } from '@akinon/next/types';
4
4
  import { generateJsonLd, serializeJsonLd } from '@theme/utils/generate-jsonld';
5
- import { AccordionWrapper, ProductInfo } from '@theme/views/product';
5
+ import {
6
+ AccordionWrapper,
7
+ ProductInfo,
8
+ ProductRateReview
9
+ } from '@theme/views/product';
6
10
  import ProductLayout from '@theme/views/product/layout';
7
11
  import { notFound } from 'next/navigation';
8
12
 
@@ -83,6 +87,8 @@ async function Page({ params, searchParams }: ResolvedPageProps<{ pk: number }>)
83
87
  data={data}
84
88
  deliveryReturn={deliveryReturn?.attributes}
85
89
  />
90
+
91
+ <ProductRateReview data={data} />
86
92
  </div>
87
93
  </ProductLayout>
88
94
  <script
@@ -7,6 +7,7 @@ import { CategoryHeader } from './category-header';
7
7
  import { Filters } from './filters';
8
8
  import { Pagination } from '@theme/components';
9
9
  import { ProductItem } from '@theme/views/product-item';
10
+ import PluginModule, { Component } from '@akinon/next/components/plugin-module';
10
11
  import { GetCategoryResponse } from '@akinon/next/types';
11
12
  import { useAppDispatch, useAppSelector } from '@akinon/next/redux/hooks';
12
13
  import { setFacets, setMenuOpen } from '@theme/redux/reducers/category';
@@ -119,15 +120,20 @@ export default function ListPage(props: ListPageProps) {
119
120
  'lg:grid-cols-3': layoutSize === 3
120
121
  })}
121
122
  >
122
- {data?.products?.map((product, index) => (
123
- <ProductItem
124
- key={product.pk}
125
- product={product}
126
- width={itemDimensions.width}
127
- height={itemDimensions.height}
128
- index={index}
129
- />
130
- ))}
123
+ <PluginModule
124
+ component={Component.RateReviewPlpProvider}
125
+ props={{ products: data?.products ?? [] }}
126
+ >
127
+ {data?.products?.map((product, index) => (
128
+ <ProductItem
129
+ key={product.pk}
130
+ product={product}
131
+ width={itemDimensions.width}
132
+ height={itemDimensions.height}
133
+ index={index}
134
+ />
135
+ ))}
136
+ </PluginModule>
131
137
  </div>
132
138
  </FavouriteProductIdsProvider>
133
139
  {data?.products?.length > 0 && (
@@ -6,4 +6,5 @@ export { default as ProductGroupInfo } from './product-group-info';
6
6
  export { default as MiscButtons } from './misc-buttons';
7
7
  export { default as ProductInfoSlider } from './slider';
8
8
  export { default as AccordionWrapper } from './accordion-wrapper';
9
+ export { default as ProductRateReview } from './rate-review';
9
10
  export { default as CombineProductCard } from './combine-product-card';
@@ -73,6 +73,17 @@ export default function ProductInfo({ data }: ProductPageProps) {
73
73
 
74
74
  return (
75
75
  <>
76
+ <PluginModule
77
+ component={Component.RateReviewBadge}
78
+ props={{
79
+ product: {
80
+ sku: data.product.sku,
81
+ base_code: data.product.base_code
82
+ },
83
+ classNames: { root: 'mt-2' }
84
+ }}
85
+ />
86
+
76
87
  <div
77
88
  className={clsx(
78
89
  'fixed bottom-0 left-0 w-1/2 h-14 z-[20] bg-white mt-0 border-t border-gray-500 items-center justify-center',
@@ -0,0 +1,21 @@
1
+ 'use client';
2
+
3
+ import PluginModule, { Component } from '@akinon/next/components/plugin-module';
4
+ import { ProductPageProps } from './layout';
5
+
6
+ export default function ProductRateReview({
7
+ data
8
+ }: Pick<ProductPageProps, 'data'>) {
9
+ return (
10
+ <PluginModule
11
+ component={Component.ProductRateReview}
12
+ props={{
13
+ product: {
14
+ sku: data.product.sku,
15
+ base_code: data.product.base_code
16
+ },
17
+ classNames: { root: 'w-full mt-8' }
18
+ }}
19
+ />
20
+ );
21
+ }
@@ -10,6 +10,7 @@ import useFavButton from '../../hooks/use-fav-button';
10
10
  import { Product } from '@akinon/next/types';
11
11
  import { Image } from '@akinon/next/components/image';
12
12
  import { Price, Link } from '@theme/components';
13
+ import PluginModule, { Component } from '@akinon/next/components/plugin-module';
13
14
 
14
15
  interface Props {
15
16
  product: Product;
@@ -81,6 +82,10 @@ export const ProductItem = (props: Props) => {
81
82
  >
82
83
  {product_name}
83
84
  </Link>
85
+ <PluginModule
86
+ component={Component.RateReviewPlpBadge}
87
+ props={{ product }}
88
+ />
84
89
  <div className="font-semibold">
85
90
  {parseFloat(retail_price) > parseFloat(price) && (
86
91
  <Price
@@ -180,6 +180,10 @@ export default async () => {
180
180
  name: 'Virtual Try-On',
181
181
  value: 'pz-virtual-try-on'
182
182
  },
183
+ {
184
+ name: 'Rate & Review',
185
+ value: 'pz-rate-review'
186
+ },
183
187
  {
184
188
  name: 'Masterpass Rest',
185
189
  value: 'pz-masterpass-rest'
@@ -199,6 +199,10 @@ exports.default = () => __awaiter(void 0, void 0, void 0, function* () {
199
199
  name: 'Virtual Try-On',
200
200
  value: 'pz-virtual-try-on'
201
201
  },
202
+ {
203
+ name: 'Rate & Review',
204
+ value: 'pz-rate-review'
205
+ },
202
206
  {
203
207
  name: 'Masterpass Rest',
204
208
  value: 'pz-masterpass-rest'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akinon/projectzero",
3
- "version": "2.0.152-rc.0",
3
+ "version": "2.0.152-rc.1",
4
4
  "private": false,
5
5
  "description": "CLI tool to manage your Project Zero Next project",
6
6
  "bin": {