@akinon/projectzero 2.0.153-beta.0 → 2.0.153-rc.4

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.
Files changed (53) hide show
  1. package/CHANGELOG.md +9 -1
  2. package/app-template/.env.example +1 -0
  3. package/app-template/AGENTS.md +8 -0
  4. package/app-template/CHANGELOG.md +88 -32
  5. package/app-template/README.md +25 -1
  6. package/app-template/docs/plugins.md +6 -0
  7. package/app-template/next-env.d.ts +1 -1
  8. package/app-template/next.config.mjs +7 -1
  9. package/app-template/package.json +41 -41
  10. package/app-template/public/locales/en/common.json +5 -0
  11. package/app-template/public/locales/en/product.json +6 -0
  12. package/app-template/public/locales/tr/common.json +5 -0
  13. package/app-template/public/locales/tr/product.json +6 -0
  14. package/app-template/src/__tests__/data-source-landing-page.test.tsx +132 -0
  15. package/app-template/src/app/[pz]/[...prettyurl]/page.tsx +14 -0
  16. package/app-template/src/app/[pz]/account/orders/[id]/(detail)/page.tsx +21 -0
  17. package/app-template/src/app/[pz]/data-source-landing-page/[pk]/loading.tsx +5 -0
  18. package/app-template/src/app/[pz]/data-source-landing-page/[pk]/page.tsx +62 -0
  19. package/app-template/src/app/[pz]/product/[pk]/page.tsx +7 -1
  20. package/app-template/src/app/api/client-env/route.ts +5 -0
  21. package/app-template/src/app/global-error.tsx +22 -0
  22. package/app-template/src/hooks/favourite-product-ids-context.tsx +104 -0
  23. package/app-template/src/hooks/index.ts +2 -0
  24. package/app-template/src/hooks/use-fav-button.tsx +35 -13
  25. package/app-template/src/plugins.js +1 -0
  26. package/app-template/src/proxy.ts +2 -1
  27. package/app-template/src/types/widgets.ts +58 -0
  28. package/app-template/src/utils/__tests__/favourite-product-ids-fallback.test.ts +42 -0
  29. package/app-template/src/utils/__tests__/sanitize.test.ts +127 -0
  30. package/app-template/src/utils/favourite-product-ids-fallback.ts +51 -0
  31. package/app-template/src/utils/sanitize.ts +167 -0
  32. package/app-template/src/views/category/category-info.tsx +31 -17
  33. package/app-template/src/views/data-source-page/__tests__/header.test.tsx +173 -0
  34. package/app-template/src/views/data-source-page/__tests__/layout.test.tsx +83 -0
  35. package/app-template/src/views/data-source-page/__tests__/sections.test.tsx +143 -0
  36. package/app-template/src/views/data-source-page/banner.tsx +45 -0
  37. package/app-template/src/views/data-source-page/footer.tsx +27 -0
  38. package/app-template/src/views/data-source-page/header.tsx +140 -0
  39. package/app-template/src/views/data-source-page/layout.tsx +45 -0
  40. package/app-template/src/views/data-source-page/products.tsx +55 -0
  41. package/app-template/src/views/data-source-page/stories.tsx +70 -0
  42. package/app-template/src/views/header/search/index.tsx +13 -5
  43. package/app-template/src/views/product/__tests__/product-offers.test.tsx +217 -0
  44. package/app-template/src/views/product/index.ts +1 -0
  45. package/app-template/src/views/product/product-info.tsx +14 -0
  46. package/app-template/src/views/product/product-offers.tsx +125 -0
  47. package/app-template/src/views/product/rate-review.tsx +21 -0
  48. package/app-template/src/views/product/slider.tsx +85 -38
  49. package/app-template/src/views/product-item/index.tsx +6 -1
  50. package/app-template/tsconfig.json +3 -0
  51. package/commands/plugins.ts +8 -0
  52. package/dist/commands/plugins.js +8 -0
  53. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,6 +1,14 @@
1
1
  # @akinon/projectzero
2
2
 
3
- ## 2.0.153-beta.0
3
+ ## 2.0.153-rc.4
4
+
5
+ ### Patch Changes
6
+
7
+ - 97d29893: ZERO-5220: add the pz-rate-review plugin for the Rate & Review extension
8
+ - 143be2b9d: ZERO-3457: Crop styles are customizable and logic improved for rendering similar products modal
9
+ - d99a6a7d5: ZERO-3457_1: Fixed the settings prop and made sure everything is customizable.
10
+ - e18836b20: ZERO-4160: Restore scope in Sentry addon configuration in akinon.json
11
+ - 9c778307: ZERO-5200: Show the other sellers of a product with their price and stock on the product detail page
4
12
 
5
13
  ## 2.0.152
6
14
 
@@ -11,6 +11,7 @@ NEXT_PUBLIC_THEME_EDITOR_ORIGINS=http://localhost:5174
11
11
  SERVICE_BACKEND_URL=https://02fde10fee4440269e695aa10707dfaf.lb.akinoncloud.com
12
12
  SITEMAP_S3_BUCKET_NAME=0fb534
13
13
  NEXT_PUBLIC_VIRTUAL_TRY_ON_API_URL=https://d2a26507c7094f359aba349b96a96881.lb.akinoncloud.com
14
+ NEXT_PUBLIC_ENABLE_IMAGE_SEARCH=true
14
15
 
15
16
  # PZ Dashboard dataLayer observability (unset = observer disabled)
16
17
  # NEXT_PUBLIC_PZ_DASHBOARD_URL=http://localhost:3005
@@ -1,3 +1,11 @@
1
+ <!-- BEGIN:nextjs-agent-rules -->
2
+
3
+ # Next.js: ALWAYS read docs before coding
4
+
5
+ Before any Next.js work, find and read the relevant doc in `node_modules/next/dist/docs/`. Your training data is outdated — the docs are the source of truth.
6
+
7
+ <!-- END:nextjs-agent-rules -->
8
+
1
9
  # Project Zero Next.js - Developer Instructions
2
10
 
3
11
  ## 📚 Available Instruction Files
@@ -1,37 +1,93 @@
1
1
  # projectzeronext
2
2
 
3
- ## 2.0.153-beta.0
4
-
5
- ### Patch Changes
6
-
7
- - Updated dependencies [cbbbfd757]
8
- - @akinon/next@2.0.153-beta.0
9
- - @akinon/pz-theme@2.0.153-beta.0
10
- - @akinon/pz-virtual-try-on@2.0.153-beta.0
11
- - @akinon/pz-akifast@2.0.153-beta.0
12
- - @akinon/pz-apple-pay@2.0.153-beta.0
13
- - @akinon/pz-b2b@2.0.153-beta.0
14
- - @akinon/pz-basket-gift-pack@2.0.153-beta.0
15
- - @akinon/pz-bkm@2.0.153-beta.0
16
- - @akinon/pz-checkout-gift-pack@2.0.153-beta.0
17
- - @akinon/pz-click-collect@2.0.153-beta.0
18
- - @akinon/pz-credit-payment@2.0.153-beta.0
19
- - @akinon/pz-cybersource-uc@2.0.153-beta.0
20
- - @akinon/pz-flow-payment@2.0.153-beta.0
21
- - @akinon/pz-google-pay@2.0.153-beta.0
22
- - @akinon/pz-gpay@2.0.153-beta.0
23
- - @akinon/pz-haso@2.0.153-beta.0
24
- - @akinon/pz-hepsipay@2.0.153-beta.0
25
- - @akinon/pz-masterpass@2.0.153-beta.0
26
- - @akinon/pz-masterpass-rest@2.0.153-beta.0
27
- - @akinon/pz-multi-basket@2.0.153-beta.0
28
- - @akinon/pz-one-click-checkout@2.0.153-beta.0
29
- - @akinon/pz-otp@2.0.153-beta.0
30
- - @akinon/pz-pay-on-delivery@2.0.153-beta.0
31
- - @akinon/pz-saved-card@2.0.153-beta.0
32
- - @akinon/pz-similar-products@2.0.153-beta.0
33
- - @akinon/pz-tabby-extension@2.0.153-beta.0
34
- - @akinon/pz-tamara-extension@2.0.153-beta.0
3
+ ## 2.0.153-rc.4
4
+
5
+ ### Patch Changes
6
+
7
+ - 219164a3: ZERO-2301: Add data source landing page data fetcher for Seller Center store pages
8
+ - 1a8622a9b: ZERO-3392: Implemented AI Search functionality and update env
9
+ - 2fea41430: ZERO-4620: Add runtime access to `NEXT_PUBLIC_*` environment variables from Client Components
10
+ - b55acb768: ZERO-2577: Fix pagination bug and update usePagination hook and ensure pagination controls rendering correctly
11
+ - 143be2b9d: ZERO-3457: Crop styles are customizable and logic improved for rendering similar products modal
12
+ - 9f8cd3bc5: ZERO-3449: AI Search Active Filters & Crop Style changes have been implemented
13
+ - d99a6a7d5: ZERO-3457_1: Fixed the settings prop and made sure everything is customizable.
14
+ - 8a0379e62: ZERO-4845: Implement FavouriteProductIds context and provider; enhance fav button logic and add tests for fallback functionality
15
+ - ccf21475d: ZERO-4404: Add Next.js 16.2 AI improvements
16
+ - c0228aff0: ZERO-4159: Upgrade the package versions
17
+ - b05c35435: ZERO-2570: Category filters routes to absolute url
18
+ - e18836b20: ZERO-4160: Restore scope in Sentry addon configuration in akinon.json
19
+ - c3244a310: ZERO-4013: Update runtime version to node:25-alpine in project configuration
20
+ - Updated dependencies [a3e2acbf8]
21
+ - Updated dependencies [219164a3]
22
+ - Updated dependencies [86187b1c2]
23
+ - Updated dependencies [0cf9ea239]
24
+ - Updated dependencies [97d29893]
25
+ - Updated dependencies [324f97d55]
26
+ - Updated dependencies [51ea06888]
27
+ - Updated dependencies
28
+ - Updated dependencies [c97525a31]
29
+ - Updated dependencies [eba125b24]
30
+ - Updated dependencies [2fea41430]
31
+ - Updated dependencies [119f0c110]
32
+ - Updated dependencies [823a4449a]
33
+ - Updated dependencies [b55acb768]
34
+ - Updated dependencies [760258c1c]
35
+ - Updated dependencies [5da13fffc]
36
+ - Updated dependencies [143be2b9d]
37
+ - Updated dependencies [7889b08fe]
38
+ - Updated dependencies [fb4aa9b47]
39
+ - Updated dependencies [9f8cd3bc5]
40
+ - Updated dependencies [bfafa3f49]
41
+ - Updated dependencies [00b9f488f]
42
+ - Updated dependencies [57d7eb305]
43
+ - Updated dependencies [d99a6a7d5]
44
+ - Updated dependencies [9db81a714]
45
+ - Updated dependencies [591e345e1]
46
+ - Updated dependencies [0df6bc1f8]
47
+ - Updated dependencies [4de5303c5]
48
+ - Updated dependencies [63a720003]
49
+ - Updated dependencies [95b139dc1]
50
+ - Updated dependencies [1d00f2d06]
51
+ - Updated dependencies [4ac7b2a1e]
52
+ - Updated dependencies [4998a9631]
53
+ - Updated dependencies [804d2bd6c]
54
+ - Updated dependencies [c0228aff0]
55
+ - Updated dependencies [3909d3224]
56
+ - Updated dependencies [6a3d8a631]
57
+ - Updated dependencies [ad5240c4]
58
+ - Updated dependencies [e18836b20]
59
+ - Updated dependencies [b1111d7b1]
60
+ - Updated dependencies [1595d458e]
61
+ - Updated dependencies [dca128112]
62
+ - Updated dependencies [9c778307]
63
+ - Updated dependencies [52694374]
64
+ - @akinon/pz-tabby-extension@2.0.153-rc.4
65
+ - @akinon/next@2.0.153-rc.4
66
+ - @akinon/pz-checkout-gift-pack@2.0.153-rc.4
67
+ - @akinon/pz-masterpass-rest@2.0.153-rc.4
68
+ - @akinon/pz-one-click-checkout@2.0.153-rc.4
69
+ - @akinon/pz-basket-gift-pack@2.0.153-rc.4
70
+ - @akinon/pz-pay-on-delivery@2.0.153-rc.4
71
+ - @akinon/pz-credit-payment@2.0.153-rc.4
72
+ - @akinon/pz-click-collect@2.0.153-rc.4
73
+ - @akinon/pz-multi-basket@2.0.153-rc.4
74
+ - @akinon/pz-masterpass@2.0.153-rc.4
75
+ - @akinon/pz-gpay@2.0.153-rc.4
76
+ - @akinon/pz-b2b@2.0.153-rc.4
77
+ - @akinon/pz-bkm@2.0.153-rc.4
78
+ - @akinon/pz-otp@2.0.153-rc.4
79
+ - @akinon/pz-similar-products@2.0.153-rc.4
80
+ - @akinon/pz-virtual-try-on@2.0.153-rc.4
81
+ - @akinon/pz-theme@2.0.153-rc.4
82
+ - @akinon/pz-cybersource-uc@2.0.153-rc.4
83
+ - @akinon/pz-saved-card@2.0.153-rc.4
84
+ - @akinon/pz-akifast@2.0.153-rc.4
85
+ - @akinon/pz-apple-pay@2.0.153-rc.4
86
+ - @akinon/pz-flow-payment@2.0.153-rc.4
87
+ - @akinon/pz-google-pay@2.0.153-rc.4
88
+ - @akinon/pz-haso@2.0.153-rc.4
89
+ - @akinon/pz-hepsipay@2.0.153-rc.4
90
+ - @akinon/pz-tamara-extension@2.0.153-rc.4
35
91
 
36
92
  ## 2.0.152
37
93
 
@@ -12,6 +12,30 @@ Run `cp .env.example .env && yarn` command at project root and all dependencies
12
12
 
13
13
  - `SITEMAP_S3_BUCKET_NAME`: S3 bucket name for XML sitemaps (e.g., "0fb534"). This is required for the sitemap route to function correctly.
14
14
 
15
+ ### Optional Environment Variables
16
+
17
+ - `NEXT_PUBLIC_ENABLE_IMAGE_SEARCH`: Set to `true` to enable image search feature for all users. If not set or `false`, the feature will only be visible to users who have enabled it via localStorage.
18
+
19
+ ## Image Search Feature
20
+
21
+ The image search functionality allows users to search for similar products by uploading images or cropping existing product images.
22
+
23
+ ### Feature Visibility Control
24
+
25
+ The image search feature can be controlled in two ways:
26
+
27
+ 1. **Environment Variable (Global)**: Set `NEXT_PUBLIC_ENABLE_IMAGE_SEARCH=true` to enable for all users
28
+ 2. **localStorage (Individual Users)**: Users can enable it locally using browser developer tools
29
+
30
+ ````
31
+
32
+ ### Feature Locations
33
+
34
+ When enabled, the image search feature appears in:
35
+
36
+ - **Header Search**: Camera icon next to the search input
37
+ - **Product Detail Page**: "View Similar Styles" button on product images
38
+
15
39
  ### Build
16
40
 
17
41
  To build the app, run the following command:
@@ -19,7 +43,7 @@ To build the app, run the following command:
19
43
  ```bash
20
44
  cd projectzeronext # Project root
21
45
  yarn build
22
- ```
46
+ ````
23
47
 
24
48
  ### Develop
25
49
 
@@ -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,7 +1,7 @@
1
1
  /// <reference types="next" />
2
2
  /// <reference types="next/image-types/global" />
3
3
  /// <reference types="next/navigation-types/compat/navigation" />
4
- import "./.next/types/routes.d.ts";
4
+ import "./.next/dev/types/routes.d.ts";
5
5
 
6
6
  // NOTE: This file should not be edited
7
7
  // see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
@@ -38,6 +38,9 @@ const nextConfig = {
38
38
  ]
39
39
  }
40
40
  ];
41
+ },
42
+ logging: {
43
+ browserToTerminal: 'error'
41
44
  }
42
45
  };
43
46
 
@@ -50,9 +53,12 @@ const withSerwist = withSerwistInit({
50
53
  const sentryConfig = {
51
54
  silent: true,
52
55
  dryRun: !process.env.SENTRY_DSN,
53
- org: 'akinon'
56
+ org: 'akinon',
54
57
  // project: 'enter_your_project_name_here',
55
58
  // authToken: 'enter_your_auth_token_here'
59
+ sourcemaps: {
60
+ deleteSourcemapsAfterUpload: true
61
+ }
56
62
  };
57
63
 
58
64
  const enhancedConfig = withPzConfig(nextConfig);
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "projectzeronext",
3
- "version": "2.0.153-beta.0",
3
+ "version": "2.0.153-rc.4",
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.153-beta.0",
28
- "@akinon/pz-akifast": "2.0.153-beta.0",
29
- "@akinon/pz-apple-pay": "2.0.153-beta.0",
30
- "@akinon/pz-b2b": "2.0.153-beta.0",
31
- "@akinon/pz-basket-gift-pack": "2.0.153-beta.0",
32
- "@akinon/pz-bkm": "2.0.153-beta.0",
33
- "@akinon/pz-checkout-gift-pack": "2.0.153-beta.0",
34
- "@akinon/pz-click-collect": "2.0.153-beta.0",
35
- "@akinon/pz-credit-payment": "2.0.153-beta.0",
36
- "@akinon/pz-cybersource-uc": "2.0.153-beta.0",
37
- "@akinon/pz-flow-payment": "2.0.153-beta.0",
38
- "@akinon/pz-google-pay": "2.0.153-beta.0",
39
- "@akinon/pz-gpay": "2.0.153-beta.0",
40
- "@akinon/pz-haso": "2.0.153-beta.0",
41
- "@akinon/pz-hepsipay": "2.0.153-beta.0",
42
- "@akinon/pz-masterpass": "2.0.153-beta.0",
43
- "@akinon/pz-masterpass-rest": "2.0.153-beta.0",
44
- "@akinon/pz-multi-basket": "2.0.153-beta.0",
45
- "@akinon/pz-one-click-checkout": "2.0.153-beta.0",
46
- "@akinon/pz-otp": "2.0.153-beta.0",
47
- "@akinon/pz-pay-on-delivery": "2.0.153-beta.0",
48
- "@akinon/pz-saved-card": "2.0.153-beta.0",
49
- "@akinon/pz-similar-products": "2.0.153-beta.0",
50
- "@akinon/pz-tabby-extension": "2.0.153-beta.0",
51
- "@akinon/pz-tamara-extension": "2.0.153-beta.0",
52
- "@akinon/pz-theme": "2.0.153-beta.0",
53
- "@akinon/pz-virtual-try-on": "2.0.153-beta.0",
27
+ "@akinon/next": "2.0.153-rc.4",
28
+ "@akinon/pz-akifast": "2.0.153-rc.4",
29
+ "@akinon/pz-apple-pay": "2.0.153-rc.4",
30
+ "@akinon/pz-b2b": "2.0.153-rc.4",
31
+ "@akinon/pz-basket-gift-pack": "2.0.153-rc.4",
32
+ "@akinon/pz-bkm": "2.0.153-rc.4",
33
+ "@akinon/pz-checkout-gift-pack": "2.0.153-rc.4",
34
+ "@akinon/pz-click-collect": "2.0.153-rc.4",
35
+ "@akinon/pz-credit-payment": "2.0.153-rc.4",
36
+ "@akinon/pz-cybersource-uc": "2.0.153-rc.4",
37
+ "@akinon/pz-flow-payment": "2.0.153-rc.4",
38
+ "@akinon/pz-google-pay": "2.0.153-rc.4",
39
+ "@akinon/pz-gpay": "2.0.153-rc.4",
40
+ "@akinon/pz-haso": "2.0.153-rc.4",
41
+ "@akinon/pz-hepsipay": "2.0.153-rc.4",
42
+ "@akinon/pz-masterpass": "2.0.153-rc.4",
43
+ "@akinon/pz-masterpass-rest": "2.0.153-rc.4",
44
+ "@akinon/pz-multi-basket": "2.0.153-rc.4",
45
+ "@akinon/pz-one-click-checkout": "2.0.153-rc.4",
46
+ "@akinon/pz-otp": "2.0.153-rc.4",
47
+ "@akinon/pz-pay-on-delivery": "2.0.153-rc.4",
48
+ "@akinon/pz-saved-card": "2.0.153-rc.4",
49
+ "@akinon/pz-similar-products": "2.0.153-rc.4",
50
+ "@akinon/pz-tabby-extension": "2.0.153-rc.4",
51
+ "@akinon/pz-tamara-extension": "2.0.153-rc.4",
52
+ "@akinon/pz-theme": "2.0.153-rc.4",
53
+ "@akinon/pz-virtual-try-on": "2.0.153-rc.4",
54
54
  "@hookform/resolvers": "2.9.0",
55
55
  "@next/third-parties": "16.2.6",
56
56
  "@react-google-maps/api": "2.17.1",
@@ -59,7 +59,7 @@
59
59
  "next": "16.2.6",
60
60
  "@serwist/next": "9.5.11",
61
61
  "next-auth": "5.0.0-beta.30",
62
- "pino": "8.11.0",
62
+ "pino": "8.21.0",
63
63
  "serwist": "9.5.11",
64
64
  "postcss": "8.4.49",
65
65
  "react": "19.2.5",
@@ -67,14 +67,14 @@
67
67
  "react-google-recaptcha": "2.1.0",
68
68
  "react-hook-form": "7.71.2",
69
69
  "react-intersection-observer": "9.4.0",
70
- "react-multi-carousel": "2.8.4",
71
- "react-string-replace": "1.1.0",
72
- "start-server-and-test": "2.0.3",
73
- "tailwind-merge": "1.8.0",
70
+ "react-multi-carousel": "2.8.5",
71
+ "react-string-replace": "1.1.1",
72
+ "start-server-and-test": "2.0.8",
73
+ "tailwind-merge": "1.14.0",
74
74
  "yup": "0.32.11"
75
75
  },
76
76
  "devDependencies": {
77
- "@akinon/eslint-plugin-projectzero": "2.0.153-beta.0",
77
+ "@akinon/eslint-plugin-projectzero": "2.0.153-rc.4",
78
78
  "@semantic-release/changelog": "6.0.2",
79
79
  "@semantic-release/exec": "6.0.3",
80
80
  "@semantic-release/git": "10.0.1",
@@ -89,25 +89,25 @@
89
89
  "@types/react": "19.2.14",
90
90
  "@types/react-dom": "19.2.3",
91
91
  "client-only": "0.0.1",
92
- "clsx": "1.1.1",
92
+ "clsx": "1.2.1",
93
93
  "currency-symbol-map": "5.1.0",
94
94
  "eslint": "9.39.4",
95
95
  "eslint-config-next": "16.2.4",
96
96
  "eslint-config-prettier": "10.1.1",
97
97
  "husky": "8.0.0",
98
98
  "jest": "29.7.0",
99
- "jest-css-modules-transform": "4.3.0",
99
+ "jest-css-modules-transform": "4.4.2",
100
100
  "jest-environment-jsdom": "29.7.0",
101
- "lint-staged": "13.1.0",
102
- "prettier": "2.6.2",
101
+ "lint-staged": "13.3.0",
102
+ "prettier": "2.8.8",
103
103
  "react-number-format": "5.3.4",
104
- "sass": "1.49.9",
104
+ "sass": "1.83.0",
105
105
  "semantic-release": "19.0.5",
106
106
  "server-only": "0.0.1",
107
- "stylelint": "14.6.0",
107
+ "stylelint": "14.16.1",
108
108
  "stylelint-config-sass-guidelines": "9.0.1",
109
109
  "stylelint-config-standard": "25.0.0",
110
- "stylelint-scss": "4.2.0",
110
+ "stylelint-scss": "4.7.0",
111
111
  "stylelint-selector-bem-pattern": "2.1.1",
112
112
  "tailwindcss": "4.2.0",
113
113
  "ts-jest": "29.2.6",
@@ -144,5 +144,10 @@
144
144
  "address": {
145
145
  "label": "Select Address"
146
146
  }
147
+ },
148
+ "data_source_page": {
149
+ "search_placeholder": "Search in store",
150
+ "search_button": "Search in store",
151
+ "all_products": "All products of the store"
147
152
  }
148
153
  }
@@ -34,6 +34,12 @@
34
34
  "installment_not_available": "Installment options not available",
35
35
  "cash": "Cash",
36
36
  "installment": "Installment",
37
+ "offers": {
38
+ "title": "OTHER SELLERS OF THE PRODUCT",
39
+ "see_all": "See All",
40
+ "in_stock": "In Stock",
41
+ "out_of_stock": "Out of Stock"
42
+ },
37
43
  "stock_alert": {
38
44
  "title": "Stock Alert",
39
45
  "success_description": "When your size is back in stock we'll send an email to: <Email/>",
@@ -144,5 +144,10 @@
144
144
  "address": {
145
145
  "label": "Adres Seçiniz"
146
146
  }
147
+ },
148
+ "data_source_page": {
149
+ "search_placeholder": "Mağazada ara",
150
+ "search_button": "Mağazada ara",
151
+ "all_products": "Mağazanın tüm ürünleri"
147
152
  }
148
153
  }
@@ -34,6 +34,12 @@
34
34
  "installment_not_available": "Taksit seçenekleri mevcut değil",
35
35
  "cash": "Peşin",
36
36
  "installment": "Taksit",
37
+ "offers": {
38
+ "title": "ÜRÜNÜN DİĞER SATICILARI",
39
+ "see_all": "Hepsini gör",
40
+ "in_stock": "Stokta var",
41
+ "out_of_stock": "Stokta yok"
42
+ },
37
43
  "stock_alert": {
38
44
  "title": "Stok Uyarısı",
39
45
  "success_description": "Bedeniniz stoklara tekrar girdiğinde şu adrese bir e-posta göndereceğiz: <Email/>",
@@ -0,0 +1,132 @@
1
+ import { render, screen } from '@testing-library/react';
2
+ import { getDataSourcePageData, getWidgetData } from '@akinon/next/data/server';
3
+ import Page, {
4
+ generateMetadata
5
+ } from '../app/[pz]/data-source-landing-page/[pk]/page';
6
+
7
+ jest.mock('@akinon/next/data/server', () => ({
8
+ getDataSourcePageData: jest.fn(),
9
+ getWidgetData: jest.fn()
10
+ }));
11
+
12
+ jest.mock('@akinon/next/hocs/server', () => ({
13
+ withSegmentDefaults: (component) => component
14
+ }));
15
+
16
+ jest.mock('@akinon/next/utils/pz-segments', () => ({
17
+ parsePzParams: () => ({ locale: 'tr' })
18
+ }));
19
+
20
+ jest.mock('next/navigation', () => ({
21
+ notFound: jest.fn(() => {
22
+ throw new Error('NEXT_NOT_FOUND');
23
+ })
24
+ }));
25
+
26
+ // `@theme/*` modules resolve to these paths; jest keys mocks by resolved path.
27
+ jest.mock('../settings', () => ({ __esModule: true, default: {} }));
28
+ jest.mock('../views/data-source-page/layout', () => ({
29
+ __esModule: true,
30
+ default: ({ data }) => <div data-testid="store-page">{data.pk}</div>
31
+ }));
32
+
33
+ const mockGetDataSourcePageData = getDataSourcePageData as jest.Mock;
34
+ const mockGetWidgetData = getWidgetData as jest.Mock;
35
+
36
+ const page = {
37
+ pk: 3,
38
+ data_source: {
39
+ pk: 17,
40
+ name: 'ayse-ticaret',
41
+ slug: 'ayse-ticaret',
42
+ title: 'Ayşe Ticaret'
43
+ },
44
+ widget: 'ayse-ticaret-0',
45
+ product_collection_widget: 'ayse-ticaret-collection',
46
+ is_active: true
47
+ };
48
+
49
+ const renderPage = async (pk: string) =>
50
+ render(await Page({ params: { pk }, searchParams: {} }));
51
+
52
+ // Route params arrive as strings even though the page types them as numbers.
53
+ const metadataFor = (pk: string) =>
54
+ generateMetadata({
55
+ params: Promise.resolve({ pk })
56
+ } as unknown as Parameters<typeof generateMetadata>[0]);
57
+
58
+ describe('data source landing page route', () => {
59
+ beforeEach(() => {
60
+ jest.clearAllMocks();
61
+ });
62
+
63
+ it('renders the store page for an active landing page', async () => {
64
+ mockGetDataSourcePageData.mockResolvedValue(page);
65
+
66
+ await renderPage('3');
67
+
68
+ expect(mockGetDataSourcePageData).toHaveBeenCalledWith({ pk: 3 });
69
+ expect(screen.getByTestId('store-page')).toHaveTextContent('3');
70
+ });
71
+
72
+ it.each([
73
+ ['a missing page', null],
74
+ ['a failed request', undefined],
75
+ ['an inactive page', { ...page, is_active: false }]
76
+ ])('responds with not found for %s', async (_, data) => {
77
+ mockGetDataSourcePageData.mockResolvedValue(data);
78
+
79
+ await expect(renderPage('3')).rejects.toThrow('NEXT_NOT_FOUND');
80
+ });
81
+
82
+ it('responds with not found for an invalid pk without fetching', async () => {
83
+ await expect(renderPage('03')).rejects.toThrow('NEXT_NOT_FOUND');
84
+ await expect(renderPage('abc')).rejects.toThrow('NEXT_NOT_FOUND');
85
+ expect(mockGetDataSourcePageData).not.toHaveBeenCalled();
86
+ });
87
+
88
+ it('builds the metadata from the store and its page widget', async () => {
89
+ mockGetDataSourcePageData.mockResolvedValue(page);
90
+ mockGetWidgetData.mockResolvedValue({
91
+ attributes: {
92
+ footer: {
93
+ value: { description: '<p>Kargo &amp; İade</p><p>Hızlı teslimat</p>' }
94
+ }
95
+ }
96
+ });
97
+
98
+ await expect(metadataFor('3')).resolves.toEqual({
99
+ title: 'Ayşe Ticaret',
100
+ description: 'Kargo & İade Hızlı teslimat'
101
+ });
102
+ expect(mockGetDataSourcePageData).toHaveBeenCalledWith({
103
+ pk: 3,
104
+ locale: 'tr'
105
+ });
106
+ expect(mockGetWidgetData).toHaveBeenCalledWith({
107
+ slug: 'ayse-ticaret-0',
108
+ locale: 'tr'
109
+ });
110
+
111
+ mockGetWidgetData.mockResolvedValue({
112
+ attributes: { banner: { value: { subtitle: 'Yeni sezon' } } }
113
+ });
114
+ mockGetDataSourcePageData.mockResolvedValue({
115
+ ...page,
116
+ data_source: { ...page.data_source, title: '' }
117
+ });
118
+
119
+ await expect(metadataFor('3')).resolves.toEqual({
120
+ title: 'ayse-ticaret',
121
+ description: 'Yeni sezon'
122
+ });
123
+ });
124
+
125
+ it('returns empty metadata when there is no page', async () => {
126
+ mockGetDataSourcePageData.mockResolvedValue(null);
127
+
128
+ await expect(metadataFor('3')).resolves.toEqual({});
129
+ await expect(metadataFor('x')).resolves.toEqual({});
130
+ expect(mockGetWidgetData).not.toHaveBeenCalled();
131
+ });
132
+ });
@@ -115,6 +115,14 @@ export async function generateMetadata(props: AsyncPageProps) {
115
115
  result = await module['generateMetadata']?.(commonProps as any);
116
116
  });
117
117
  }
118
+
119
+ if (prettyUrlResult.path.startsWith('/data-source-landing-page/')) {
120
+ await import('@data-source-landing-page/[pk]/page').then(
121
+ async (module) => {
122
+ result = await module['generateMetadata']?.(commonProps as any);
123
+ }
124
+ );
125
+ }
118
126
  // eslint-disable-next-line no-empty
119
127
  } catch (error) {}
120
128
 
@@ -189,5 +197,11 @@ export default async function Page(props) {
189
197
  return <FlatPage {...commonProps} />;
190
198
  }
191
199
 
200
+ if (result.path.startsWith('/data-source-landing-page/')) {
201
+ const DataSourcePage = (await import('@data-source-landing-page/[pk]/page'))
202
+ .default;
203
+ return <DataSourcePage {...commonProps} />;
204
+ }
205
+
192
206
  return null;
193
207
  }
@@ -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">
@@ -0,0 +1,5 @@
1
+ import { PageLoaderSpinner } from '@theme/views/page-loader-spinner';
2
+
3
+ export default function Loading() {
4
+ return <PageLoaderSpinner />;
5
+ }