@akinon/projectzero 2.0.0-beta.10 → 2.0.0-beta.12
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 +12 -0
- package/app-template/CHANGELOG.md +52 -0
- package/app-template/docs/plugins.md +60 -25
- package/app-template/jest.config.ts +2 -2
- package/app-template/package.json +22 -22
- package/app-template/src/app/[commerce]/[locale]/[currency]/account/orders/[id]/cancellation/page.tsx +7 -4
- package/app-template/src/app/[commerce]/[locale]/[currency]/account/orders/[id]/page.tsx +47 -44
- package/app-template/src/components/button.tsx +2 -2
- package/app-template/src/components/checkbox.tsx +1 -0
- package/app-template/src/settings.js +2 -1
- package/app-template/src/views/account/order.tsx +10 -8
- package/app-template/src/views/anonymous-tracking/order-detail/index.tsx +44 -37
- package/app-template/src/views/checkout/steps/payment/options/redirection.tsx +5 -1
- package/app-template/src/views/header/action-menu.tsx +5 -1
- package/app-template/src/views/product/price-wrapper.tsx +7 -2
- package/app-template/src/views/product/product-info.tsx +33 -3
- package/app-template/tailwind.config.js +11 -7
- package/codemods/update-tailwind-config/index.js +30 -0
- package/codemods/update-tailwind-config/transform.js +102 -0
- package/commands/codemod.ts +0 -1
- package/commands/plugins.ts +20 -30
- package/dist/commands/codemod.js +0 -1
- package/dist/commands/plugins.js +19 -20
- package/package.json +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @akinon/projectzero
|
|
2
2
|
|
|
3
|
+
## 2.0.0-beta.12
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 1d79e32: ZERO-3540: Next.js Upgrade to 15.4.5
|
|
8
|
+
|
|
9
|
+
## 2.0.0-beta.11
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- ac783d6: ZERO-3482: Update tailwindcss to version 4.1.11 and enhance button cursor styles
|
|
14
|
+
|
|
3
15
|
## 2.0.0-beta.10
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
|
@@ -1,5 +1,57 @@
|
|
|
1
1
|
# projectzeronext
|
|
2
2
|
|
|
3
|
+
## 2.0.0-beta.12
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 1d79e32: ZERO-3540: Next.js Upgrade to 15.4.5
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [1d79e32]
|
|
12
|
+
- @akinon/pz-checkout-gift-pack@2.0.0-beta.12
|
|
13
|
+
- @akinon/pz-one-click-checkout@2.0.0-beta.12
|
|
14
|
+
- @akinon/pz-basket-gift-pack@2.0.0-beta.12
|
|
15
|
+
- @akinon/pz-tamara-extension@2.0.0-beta.12
|
|
16
|
+
- @akinon/pz-pay-on-delivery@2.0.0-beta.12
|
|
17
|
+
- @akinon/pz-tabby-extension@2.0.0-beta.12
|
|
18
|
+
- @akinon/pz-credit-payment@2.0.0-beta.12
|
|
19
|
+
- @akinon/pz-click-collect@2.0.0-beta.12
|
|
20
|
+
- @akinon/pz-masterpass@2.0.0-beta.12
|
|
21
|
+
- @akinon/pz-saved-card@2.0.0-beta.12
|
|
22
|
+
- @akinon/next@2.0.0-beta.12
|
|
23
|
+
- @akinon/pz-akifast@2.0.0-beta.12
|
|
24
|
+
- @akinon/pz-gpay@2.0.0-beta.12
|
|
25
|
+
- @akinon/pz-b2b@2.0.0-beta.12
|
|
26
|
+
- @akinon/pz-bkm@2.0.0-beta.12
|
|
27
|
+
- @akinon/pz-otp@2.0.0-beta.12
|
|
28
|
+
|
|
29
|
+
## 2.0.0-beta.11
|
|
30
|
+
|
|
31
|
+
### Minor Changes
|
|
32
|
+
|
|
33
|
+
- ac783d6: ZERO-3482: Update tailwindcss to version 4.1.11 and enhance button cursor styles
|
|
34
|
+
|
|
35
|
+
### Patch Changes
|
|
36
|
+
|
|
37
|
+
- Updated dependencies [ac783d6]
|
|
38
|
+
- @akinon/pz-checkout-gift-pack@2.0.0-beta.11
|
|
39
|
+
- @akinon/pz-one-click-checkout@2.0.0-beta.11
|
|
40
|
+
- @akinon/pz-basket-gift-pack@2.0.0-beta.11
|
|
41
|
+
- @akinon/pz-tamara-extension@2.0.0-beta.11
|
|
42
|
+
- @akinon/pz-pay-on-delivery@2.0.0-beta.11
|
|
43
|
+
- @akinon/pz-tabby-extension@2.0.0-beta.11
|
|
44
|
+
- @akinon/pz-credit-payment@2.0.0-beta.11
|
|
45
|
+
- @akinon/pz-click-collect@2.0.0-beta.11
|
|
46
|
+
- @akinon/pz-masterpass@2.0.0-beta.11
|
|
47
|
+
- @akinon/pz-saved-card@2.0.0-beta.11
|
|
48
|
+
- @akinon/next@2.0.0-beta.11
|
|
49
|
+
- @akinon/pz-akifast@2.0.0-beta.11
|
|
50
|
+
- @akinon/pz-gpay@2.0.0-beta.11
|
|
51
|
+
- @akinon/pz-b2b@2.0.0-beta.11
|
|
52
|
+
- @akinon/pz-bkm@2.0.0-beta.11
|
|
53
|
+
- @akinon/pz-otp@2.0.0-beta.11
|
|
54
|
+
|
|
3
55
|
## 2.0.0-beta.10
|
|
4
56
|
|
|
5
57
|
### Minor Changes
|
|
@@ -15,13 +15,18 @@ The plugins selected from this list will be added to the project and ready for u
|
|
|
15
15
|
|
|
16
16
|
### Plugin List
|
|
17
17
|
|
|
18
|
-
1.
|
|
19
|
-
2.
|
|
18
|
+
1. Basket Gift Pack
|
|
19
|
+
2. Click & Collect
|
|
20
20
|
3. Checkout Gift Pack
|
|
21
|
-
4. Checkout
|
|
22
|
-
5.
|
|
23
|
-
6.
|
|
24
|
-
7.
|
|
21
|
+
4. One Click Checkout
|
|
22
|
+
5. Garanti Pay
|
|
23
|
+
6. Pay On Delivery
|
|
24
|
+
7. OTP
|
|
25
|
+
8. BKM Express
|
|
26
|
+
9. Credit Payment
|
|
27
|
+
10. Multi Basket
|
|
28
|
+
11. Tabby Payment Extension
|
|
29
|
+
12. Tamara Payment Extension
|
|
25
30
|
|
|
26
31
|
## Installation
|
|
27
32
|
|
|
@@ -33,44 +38,74 @@ The plugins selected from this list will be added to the project and ready for u
|
|
|
33
38
|
|
|
34
39
|
2. Select the plugins desire to install from the list provided.
|
|
35
40
|
|
|
36
|
-
###
|
|
41
|
+
### Basket Gift Pack
|
|
37
42
|
|
|
38
|
-
|
|
43
|
+
Adds a gift pack and/or a gift note to products in the basket. Enhances the gifting experience for customers.
|
|
39
44
|
|
|
40
|
-
[Click here for details](https://
|
|
45
|
+
[Click here for details](https://www.npmjs.com/package/@akinon/pz-basket-gift-pack)
|
|
41
46
|
|
|
42
|
-
###
|
|
47
|
+
### Click & Collect
|
|
43
48
|
|
|
44
|
-
|
|
49
|
+
Allows customers to place an order online and pick it up from a selected store. Reduces delivery costs and improves convenience for users.
|
|
45
50
|
|
|
46
|
-
[Click here for details](https://
|
|
51
|
+
[Click here for details](https://www.npmjs.com/package/@akinon/pz-click-collect)
|
|
47
52
|
|
|
48
53
|
### Checkout Gift Pack
|
|
49
54
|
|
|
50
|
-
|
|
55
|
+
Enables a gift pack option on the payment page. Customers can choose to wrap their purchases as gifts during checkout.
|
|
56
|
+
|
|
57
|
+
[Click here for details](https://www.npmjs.com/package/@akinon/pz-checkout-gift-pack)
|
|
58
|
+
|
|
59
|
+
### One Click Checkout
|
|
51
60
|
|
|
52
|
-
|
|
61
|
+
Simplifies the checkout process by adding one-click payment methods.
|
|
53
62
|
|
|
54
|
-
|
|
63
|
+
[Click here for details](https://www.npmjs.com/package/@akinon/pz-one-click-checkout)
|
|
55
64
|
|
|
56
|
-
|
|
65
|
+
### Garanti Pay
|
|
57
66
|
|
|
58
|
-
|
|
67
|
+
Allows Garanti Bank credit card users to make fast and secure payments without entering card details.
|
|
68
|
+
|
|
69
|
+
[Click here for details](https://www.npmjs.com/package/@akinon/pz-gpay)
|
|
70
|
+
|
|
71
|
+
### Pay On Delivery
|
|
72
|
+
|
|
73
|
+
Provides an option for customers to pay with cash or a credit card at the time of delivery.
|
|
74
|
+
|
|
75
|
+
[Click here for details](https://www.npmjs.com/package/@akinon/pz-pay-on-delivery)
|
|
59
76
|
|
|
60
77
|
### OTP
|
|
61
78
|
|
|
62
|
-
|
|
79
|
+
Adds SMS-based OTP (One-Time Password) verification for secure actions such as registration and updating profile information.
|
|
63
80
|
|
|
64
|
-
[Click here for details](https://
|
|
81
|
+
[Click here for details](https://www.npmjs.com/package/@akinon/pz-otp)
|
|
65
82
|
|
|
66
|
-
###
|
|
83
|
+
### BKM Express
|
|
67
84
|
|
|
68
|
-
|
|
85
|
+
Integrates the BKM Express payment method for users to make fast and secure payments without entering card details.
|
|
69
86
|
|
|
70
|
-
[Click here for details](https://
|
|
87
|
+
[Click here for details](https://www.npmjs.com/package/@akinon/pz-bkm)
|
|
71
88
|
|
|
72
|
-
###
|
|
89
|
+
### Credit Payment
|
|
90
|
+
|
|
91
|
+
Supports credit card payments with installment and non-installment options.
|
|
92
|
+
|
|
93
|
+
[Click here for details](https://www.npmjs.com/package/@akinon/pz-credit-payment)
|
|
94
|
+
|
|
95
|
+
### Multi Basket
|
|
96
|
+
|
|
97
|
+
Enables customers to create and manage multiple virtual baskets at the same time. Facilitates better basket organization.
|
|
98
|
+
|
|
99
|
+
[Click here for details](https://www.npmjs.com/package/@akinon/pz-multi-basket)
|
|
100
|
+
|
|
101
|
+
### Tabby Payment Extension
|
|
102
|
+
|
|
103
|
+
Integrates Tabby’s installment and deferred payment solutions into the checkout.
|
|
104
|
+
|
|
105
|
+
[Click here for details](https://www.npmjs.com/package/@akinon/pz-tabby-extension)
|
|
106
|
+
|
|
107
|
+
### Tamara Payment Extension
|
|
73
108
|
|
|
74
|
-
|
|
109
|
+
Adds Tamara’s "Buy Now, Pay Later" feature to the payment options. Customers can defer payments while ensuring a seamless checkout experience.
|
|
75
110
|
|
|
76
|
-
[Click here for details](https://
|
|
111
|
+
[Click here for details](https://www.npmjs.com/package/@akinon/pz-tamara-extension)
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
const nextJest = require('next/jest');
|
|
2
|
-
import type {
|
|
2
|
+
import type { JestConfigWithTsJest } from 'ts-jest';
|
|
3
3
|
|
|
4
4
|
const createJestConfig = nextJest({
|
|
5
5
|
dir: './'
|
|
6
6
|
});
|
|
7
7
|
|
|
8
|
-
const config:
|
|
8
|
+
const config: JestConfigWithTsJest = {
|
|
9
9
|
preset: 'ts-jest',
|
|
10
10
|
setupFilesAfterEnv: ['<rootDir>/setupTests.ts'],
|
|
11
11
|
transform: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "projectzeronext",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.12",
|
|
4
4
|
"private": true,
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"scripts": {
|
|
@@ -24,35 +24,35 @@
|
|
|
24
24
|
"test:middleware": "jest middleware-matcher.test.ts --bail"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@akinon/next": "2.0.0-beta.
|
|
28
|
-
"@akinon/pz-akifast": "2.0.0-beta.
|
|
29
|
-
"@akinon/pz-b2b": "2.0.0-beta.
|
|
30
|
-
"@akinon/pz-basket-gift-pack": "2.0.0-beta.
|
|
31
|
-
"@akinon/pz-bkm": "2.0.0-beta.
|
|
32
|
-
"@akinon/pz-checkout-gift-pack": "2.0.0-beta.
|
|
33
|
-
"@akinon/pz-click-collect": "2.0.0-beta.
|
|
34
|
-
"@akinon/pz-credit-payment": "2.0.0-beta.
|
|
35
|
-
"@akinon/pz-gpay": "2.0.0-beta.
|
|
36
|
-
"@akinon/pz-masterpass": "2.0.0-beta.
|
|
37
|
-
"@akinon/pz-one-click-checkout": "2.0.0-beta.
|
|
38
|
-
"@akinon/pz-otp": "2.0.0-beta.
|
|
39
|
-
"@akinon/pz-pay-on-delivery": "2.0.0-beta.
|
|
40
|
-
"@akinon/pz-saved-card": "2.0.0-beta.
|
|
41
|
-
"@akinon/pz-tabby-extension": "2.0.0-beta.
|
|
42
|
-
"@akinon/pz-tamara-extension": "2.0.0-beta.
|
|
27
|
+
"@akinon/next": "2.0.0-beta.12",
|
|
28
|
+
"@akinon/pz-akifast": "2.0.0-beta.12",
|
|
29
|
+
"@akinon/pz-b2b": "2.0.0-beta.12",
|
|
30
|
+
"@akinon/pz-basket-gift-pack": "2.0.0-beta.12",
|
|
31
|
+
"@akinon/pz-bkm": "2.0.0-beta.12",
|
|
32
|
+
"@akinon/pz-checkout-gift-pack": "2.0.0-beta.12",
|
|
33
|
+
"@akinon/pz-click-collect": "2.0.0-beta.12",
|
|
34
|
+
"@akinon/pz-credit-payment": "2.0.0-beta.12",
|
|
35
|
+
"@akinon/pz-gpay": "2.0.0-beta.12",
|
|
36
|
+
"@akinon/pz-masterpass": "2.0.0-beta.12",
|
|
37
|
+
"@akinon/pz-one-click-checkout": "2.0.0-beta.12",
|
|
38
|
+
"@akinon/pz-otp": "2.0.0-beta.12",
|
|
39
|
+
"@akinon/pz-pay-on-delivery": "2.0.0-beta.12",
|
|
40
|
+
"@akinon/pz-saved-card": "2.0.0-beta.12",
|
|
41
|
+
"@akinon/pz-tabby-extension": "2.0.0-beta.12",
|
|
42
|
+
"@akinon/pz-tamara-extension": "2.0.0-beta.12",
|
|
43
43
|
"@hookform/resolvers": "2.9.0",
|
|
44
44
|
"@next/third-parties": "14.1.0",
|
|
45
45
|
"@react-google-maps/api": "2.17.1",
|
|
46
46
|
"@tailwindcss/postcss": "4.0.0",
|
|
47
47
|
"dayjs": "1.11.5",
|
|
48
48
|
"lossless-json": "2.0.5",
|
|
49
|
-
"next": "15.
|
|
49
|
+
"next": "15.4.5",
|
|
50
50
|
"next-auth": "4.24.11",
|
|
51
51
|
"next-pwa": "5.6.0",
|
|
52
52
|
"pino": "8.11.0",
|
|
53
53
|
"postcss": "8.5.3",
|
|
54
|
-
"react": "19.
|
|
55
|
-
"react-dom": "19.
|
|
54
|
+
"react": "19.1.1",
|
|
55
|
+
"react-dom": "19.1.1",
|
|
56
56
|
"react-google-recaptcha": "2.1.0",
|
|
57
57
|
"react-hook-form": "7.31.3",
|
|
58
58
|
"react-intersection-observer": "9.4.0",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"yup": "0.32.11"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
|
-
"@akinon/eslint-plugin-projectzero": "2.0.0-beta.
|
|
66
|
+
"@akinon/eslint-plugin-projectzero": "2.0.0-beta.12",
|
|
67
67
|
"@semantic-release/changelog": "6.0.2",
|
|
68
68
|
"@semantic-release/exec": "6.0.3",
|
|
69
69
|
"@semantic-release/git": "10.0.1",
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
"stylelint-config-standard": "25.0.0",
|
|
101
101
|
"stylelint-scss": "4.2.0",
|
|
102
102
|
"stylelint-selector-bem-pattern": "2.1.1",
|
|
103
|
-
"tailwindcss": "4.1.
|
|
103
|
+
"tailwindcss": "4.1.11",
|
|
104
104
|
"ts-jest": "29.1.1",
|
|
105
105
|
"ts-node": "10.7.0",
|
|
106
106
|
"typescript": "5.7.2"
|
|
@@ -237,13 +237,13 @@ const AccountOrderCancellation = ({ params }) => {
|
|
|
237
237
|
<div>
|
|
238
238
|
<div className="pb-2 mb-3 text-lg border-gray border-b">
|
|
239
239
|
<span data-testid="account-orders-return-order-count">
|
|
240
|
-
{order
|
|
240
|
+
{order?.orderitem_set?.length}
|
|
241
241
|
</span>{' '}
|
|
242
242
|
<span>{t('account.my_orders.detail.products')}</span>
|
|
243
243
|
</div>
|
|
244
244
|
|
|
245
245
|
<form onSubmit={handleSubmit(onSubmit)}>
|
|
246
|
-
{order
|
|
246
|
+
{order?.orderitem_set?.map((item, index: number) => (
|
|
247
247
|
<Controller
|
|
248
248
|
defaultValue={[]}
|
|
249
249
|
control={control}
|
|
@@ -254,7 +254,7 @@ const AccountOrderCancellation = ({ params }) => {
|
|
|
254
254
|
return cancelItem.order_item === item.id;
|
|
255
255
|
});
|
|
256
256
|
|
|
257
|
-
const cancellationType = item
|
|
257
|
+
const cancellationType = item?.is_refundable
|
|
258
258
|
? 'refund'
|
|
259
259
|
: 'cancel';
|
|
260
260
|
|
|
@@ -270,7 +270,10 @@ const AccountOrderCancellation = ({ params }) => {
|
|
|
270
270
|
onChange={onChange}
|
|
271
271
|
value={value}
|
|
272
272
|
selectOption={selectOption}
|
|
273
|
-
fileInput={fileInputCondition(
|
|
273
|
+
fileInput={fileInputCondition(
|
|
274
|
+
item,
|
|
275
|
+
item?.product?.name
|
|
276
|
+
)}
|
|
274
277
|
/>
|
|
275
278
|
);
|
|
276
279
|
}}
|
|
@@ -33,14 +33,15 @@ const AccountOrderDetail = ({ params }) => {
|
|
|
33
33
|
const groupedOrder = [];
|
|
34
34
|
|
|
35
35
|
if (order) {
|
|
36
|
-
const groupedData =
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
groups[tracking_number]
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
36
|
+
const groupedData =
|
|
37
|
+
order?.orderitem_set?.reduce((groups, item) => {
|
|
38
|
+
const { tracking_number } = item;
|
|
39
|
+
if (!groups[tracking_number]) {
|
|
40
|
+
groups[tracking_number] = [];
|
|
41
|
+
}
|
|
42
|
+
groups[tracking_number].push(item);
|
|
43
|
+
return groups;
|
|
44
|
+
}, {}) || {};
|
|
44
45
|
|
|
45
46
|
const result = Object.values(groupedData);
|
|
46
47
|
|
|
@@ -77,8 +78,8 @@ const AccountOrderDetail = ({ params }) => {
|
|
|
77
78
|
|
|
78
79
|
<div>
|
|
79
80
|
<span className="text-base font-bold">
|
|
80
|
-
{order?.orderitem_set
|
|
81
|
-
{t('account.my_orders.detail.products')} {groupedOrder
|
|
81
|
+
{order?.orderitem_set?.length}{' '}
|
|
82
|
+
{t('account.my_orders.detail.products')} {groupedOrder?.length}{' '}
|
|
82
83
|
{t('account.my_orders.detail.packages')}
|
|
83
84
|
</span>
|
|
84
85
|
</div>
|
|
@@ -88,16 +89,17 @@ const AccountOrderDetail = ({ params }) => {
|
|
|
88
89
|
className="break-words"
|
|
89
90
|
>
|
|
90
91
|
<span>{t('account.my_orders.detail.delivery_address')}</span>:{' '}
|
|
91
|
-
{order
|
|
92
|
-
{order
|
|
93
|
-
{order
|
|
92
|
+
{order?.shipping_address?.line}{' '}
|
|
93
|
+
{order?.shipping_address?.district?.name}{' '}
|
|
94
|
+
{order?.shipping_address?.township?.name}{' '}
|
|
95
|
+
{order?.shipping_address?.city?.name}
|
|
94
96
|
</div>
|
|
95
97
|
</OrderDetailHeader>
|
|
96
98
|
|
|
97
99
|
<div>
|
|
98
100
|
{groupedOrder.map((group, i) => {
|
|
99
101
|
const orderStatus = getOrderStatus(
|
|
100
|
-
group[0]
|
|
102
|
+
group[0]?.status?.value?.toString(),
|
|
101
103
|
t
|
|
102
104
|
);
|
|
103
105
|
|
|
@@ -121,8 +123,8 @@ const AccountOrderDetail = ({ params }) => {
|
|
|
121
123
|
<div className="flex justify-between items-center lg:gap-x-12">
|
|
122
124
|
<div className="text-base">{orderStatus.label}</div>
|
|
123
125
|
|
|
124
|
-
{group[0]
|
|
125
|
-
<Link href={group[0]
|
|
126
|
+
{group[0]?.tracking_number && group[0]?.tracking_url && (
|
|
127
|
+
<Link href={group[0]?.tracking_url}>
|
|
126
128
|
<Button className="px-7" appearance="filled">
|
|
127
129
|
{t('account.my_orders.detail.track_shipment')}
|
|
128
130
|
</Button>
|
|
@@ -134,7 +136,7 @@ const AccountOrderDetail = ({ params }) => {
|
|
|
134
136
|
<div className="px-4 lg:px-7">
|
|
135
137
|
{group.map((item, index) => {
|
|
136
138
|
const itemStatus = getOrderStatus(
|
|
137
|
-
item
|
|
139
|
+
item?.status?.value?.toString(),
|
|
138
140
|
t
|
|
139
141
|
);
|
|
140
142
|
|
|
@@ -147,15 +149,15 @@ const AccountOrderDetail = ({ params }) => {
|
|
|
147
149
|
<div className="shrink-0">
|
|
148
150
|
<Link
|
|
149
151
|
className="block"
|
|
150
|
-
href={item
|
|
152
|
+
href={item?.product?.absolute_url}
|
|
151
153
|
>
|
|
152
154
|
<Image
|
|
153
155
|
src={
|
|
154
|
-
item
|
|
156
|
+
item?.product?.image
|
|
155
157
|
? item.product.image
|
|
156
158
|
: '/noimage.jpg'
|
|
157
159
|
}
|
|
158
|
-
alt={item
|
|
160
|
+
alt={item?.product?.name}
|
|
159
161
|
width={112}
|
|
160
162
|
height={150}
|
|
161
163
|
/>
|
|
@@ -164,33 +166,33 @@ const AccountOrderDetail = ({ params }) => {
|
|
|
164
166
|
|
|
165
167
|
<div className="flex flex-col justify-between lg:max-w-48">
|
|
166
168
|
<div className="text-sm">
|
|
167
|
-
<Link href={item
|
|
168
|
-
{item
|
|
169
|
+
<Link href={item?.product?.absolute_url}>
|
|
170
|
+
{item?.product?.name}
|
|
169
171
|
</Link>
|
|
170
172
|
</div>
|
|
171
173
|
|
|
172
174
|
<div className="text-gray-900 text-xs">
|
|
173
|
-
{item
|
|
175
|
+
{item?.product?.attributes?.filterable_color && (
|
|
174
176
|
<div>
|
|
175
177
|
<span>
|
|
176
178
|
{t('account.my_orders.detail.color')}
|
|
177
179
|
</span>
|
|
178
|
-
: {item
|
|
180
|
+
: {item?.product?.attributes?.filterable_color}
|
|
179
181
|
</div>
|
|
180
182
|
)}
|
|
181
183
|
|
|
182
|
-
{item
|
|
184
|
+
{item?.product?.attributes?.size && (
|
|
183
185
|
<div>
|
|
184
186
|
<span>
|
|
185
187
|
{t('account.my_orders.detail.size')}
|
|
186
188
|
</span>
|
|
187
|
-
:{item
|
|
189
|
+
:{item?.product?.attributes?.size}
|
|
188
190
|
</div>
|
|
189
191
|
)}
|
|
190
192
|
|
|
191
193
|
<div>
|
|
192
194
|
<span>{t('account.my_orders.detail.code')}</span>:{' '}
|
|
193
|
-
{item
|
|
195
|
+
{item?.product?.base_code}
|
|
194
196
|
</div>
|
|
195
197
|
</div>
|
|
196
198
|
</div>
|
|
@@ -207,11 +209,11 @@ const AccountOrderDetail = ({ params }) => {
|
|
|
207
209
|
{itemStatus.label}
|
|
208
210
|
</div>
|
|
209
211
|
|
|
210
|
-
{(item
|
|
211
|
-
order
|
|
212
|
+
{(item?.is_cancellable || item?.is_refundable) &&
|
|
213
|
+
order?.is_cancellable && (
|
|
212
214
|
<div className="lg:ml-24">
|
|
213
215
|
<Link
|
|
214
|
-
href={`${ROUTES.ACCOUNT_ORDERS}/${order
|
|
216
|
+
href={`${ROUTES.ACCOUNT_ORDERS}/${order?.id}/cancellation`}
|
|
215
217
|
>
|
|
216
218
|
<Button
|
|
217
219
|
className="px-4 uppercase font-bold h-7"
|
|
@@ -227,21 +229,21 @@ const AccountOrderDetail = ({ params }) => {
|
|
|
227
229
|
)}
|
|
228
230
|
</div>
|
|
229
231
|
<div className="flex flex-col justify-center items-end lg:ml-6 lg:min-w-[7rem]">
|
|
230
|
-
{parseFloat(item
|
|
231
|
-
parseFloat(item
|
|
232
|
+
{parseFloat(item?.retail_price || '0') >
|
|
233
|
+
parseFloat(item?.price || '0') && (
|
|
232
234
|
<Price
|
|
233
235
|
className="font-normal line-through"
|
|
234
|
-
value={item
|
|
236
|
+
value={item?.retail_price}
|
|
235
237
|
/>
|
|
236
238
|
)}
|
|
237
239
|
|
|
238
240
|
<Price
|
|
239
241
|
className={clsx('font-normal', {
|
|
240
242
|
'text-secondary-600':
|
|
241
|
-
parseFloat(item
|
|
242
|
-
parseFloat(item
|
|
243
|
+
parseFloat(item?.retail_price || '0') >
|
|
244
|
+
parseFloat(item?.price || '0')
|
|
243
245
|
})}
|
|
244
|
-
value={item
|
|
246
|
+
value={item?.price}
|
|
245
247
|
/>
|
|
246
248
|
</div>
|
|
247
249
|
</div>
|
|
@@ -325,29 +327,29 @@ const AccountOrderDetail = ({ params }) => {
|
|
|
325
327
|
<div className="flex justify-between text-sm text-black-700 mb-2">
|
|
326
328
|
<p>
|
|
327
329
|
<span>{t('account.my_orders.detail.subtotal')}</span> (
|
|
328
|
-
{order
|
|
330
|
+
{order?.orderitem_set?.length}{' '}
|
|
329
331
|
<span>{t('account.my_orders.detail.items')}</span>)
|
|
330
332
|
</p>
|
|
331
333
|
|
|
332
334
|
<Price
|
|
333
335
|
className="font-normal min-w-max"
|
|
334
336
|
value={
|
|
335
|
-
parseFloat(order
|
|
336
|
-
parseFloat(order
|
|
337
|
+
parseFloat(order?.amount_without_discount || '0') -
|
|
338
|
+
parseFloat(order?.shipping_amount || '0')
|
|
337
339
|
}
|
|
338
340
|
/>
|
|
339
341
|
</div>
|
|
340
342
|
|
|
341
|
-
{order
|
|
342
|
-
order
|
|
343
|
+
{order?.discountitem_set &&
|
|
344
|
+
order?.discountitem_set?.map((item, index) => (
|
|
343
345
|
<div
|
|
344
346
|
className="flex justify-between text-sm text-black-700 mb-2"
|
|
345
347
|
key={index}
|
|
346
348
|
>
|
|
347
|
-
<p>{item
|
|
349
|
+
<p>{item?.name}</p>
|
|
348
350
|
<Price
|
|
349
351
|
className="font-normal min-w-max"
|
|
350
|
-
value={item
|
|
352
|
+
value={item?.amount}
|
|
351
353
|
useNegative
|
|
352
354
|
/>
|
|
353
355
|
</div>
|
|
@@ -360,7 +362,8 @@ const AccountOrderDetail = ({ params }) => {
|
|
|
360
362
|
className="font-normal min-w-max"
|
|
361
363
|
data-testid="account-orders-detail-total"
|
|
362
364
|
value={
|
|
363
|
-
parseFloat(order
|
|
365
|
+
parseFloat(order?.amount || '0') -
|
|
366
|
+
parseFloat(order?.shipping_amount || '0')
|
|
364
367
|
}
|
|
365
368
|
/>
|
|
366
369
|
</div>
|
|
@@ -35,7 +35,7 @@ export const Button = (props: ButtonProps) => {
|
|
|
35
35
|
|
|
36
36
|
const buttonClasses = twMerge(
|
|
37
37
|
clsx(
|
|
38
|
-
'px-4 text-xs transition-all duration-200',
|
|
38
|
+
'px-4 text-xs transition-all duration-200 cursor-pointer',
|
|
39
39
|
'inline-flex gap-2 justify-center items-center',
|
|
40
40
|
variants[appearance],
|
|
41
41
|
sizes[size],
|
|
@@ -54,7 +54,7 @@ export const Button = (props: ButtonProps) => {
|
|
|
54
54
|
{children}
|
|
55
55
|
</Link>
|
|
56
56
|
) : (
|
|
57
|
-
<button {...rest} className={buttonClasses}>
|
|
57
|
+
<button data-testid="button" {...rest} className={buttonClasses}>
|
|
58
58
|
{children}
|
|
59
59
|
</button>
|
|
60
60
|
);
|
|
@@ -9,6 +9,7 @@ const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>((props, ref) => {
|
|
|
9
9
|
<label className={twMerge('flex flex-col text-xs', props.className)}>
|
|
10
10
|
<div className="flex items-center">
|
|
11
11
|
<input
|
|
12
|
+
data-testid="checkbox"
|
|
12
13
|
type="checkbox"
|
|
13
14
|
{...rest}
|
|
14
15
|
ref={ref}
|
|
@@ -13,7 +13,7 @@ export const Order = (props) => {
|
|
|
13
13
|
.reverse()
|
|
14
14
|
.join(' ');
|
|
15
15
|
|
|
16
|
-
const orderStatus = getOrderStatus(props
|
|
16
|
+
const orderStatus = getOrderStatus(props?.status?.value?.toString(), t);
|
|
17
17
|
|
|
18
18
|
return (
|
|
19
19
|
<div className="border border-gray px-5 py-4 text-sm mb-4 last:mb-0">
|
|
@@ -58,30 +58,32 @@ export const Order = (props) => {
|
|
|
58
58
|
|
|
59
59
|
<div className="w-full flex flex-col justify-between mt-6 mb-2 order-3 md:items-center md:flex-row md:order-none md:gap-20 lg:gap-40">
|
|
60
60
|
<ul className="flex flex-wrap gap-3.5 mb-6 items-center md:mb-0">
|
|
61
|
-
{props
|
|
61
|
+
{props?.orderitem_set?.slice(0, 3).map((item, index) => (
|
|
62
62
|
// TODO: Static image will change (TR)
|
|
63
63
|
<li className="shrink-0" key={index}>
|
|
64
64
|
<Image
|
|
65
|
-
src={
|
|
66
|
-
|
|
65
|
+
src={
|
|
66
|
+
item?.product?.image ? item.product.image : '/noimage.jpg'
|
|
67
|
+
}
|
|
68
|
+
alt={item?.product?.name}
|
|
67
69
|
width={64}
|
|
68
70
|
height={96}
|
|
69
71
|
/>
|
|
70
72
|
</li>
|
|
71
73
|
))}
|
|
72
|
-
{props
|
|
73
|
-
<div>+ {props
|
|
74
|
+
{props?.orderitem_set?.length > 3 && (
|
|
75
|
+
<div>+ {props?.orderitem_set?.length - 3}</div>
|
|
74
76
|
)}
|
|
75
77
|
</ul>
|
|
76
78
|
|
|
77
|
-
<span className={orderStatus
|
|
79
|
+
<span className={orderStatus?.className}>{orderStatus?.label}</span>
|
|
78
80
|
</div>
|
|
79
81
|
|
|
80
82
|
<div
|
|
81
83
|
className="order-2 flex items-end md:order-none"
|
|
82
84
|
data-testid="account-orders-count"
|
|
83
85
|
>
|
|
84
|
-
{props
|
|
86
|
+
{props?.orderitem_set?.length} {t('account.my_orders.order.items')}
|
|
85
87
|
</div>
|
|
86
88
|
</div>
|
|
87
89
|
</div>
|