@akinon/projectzero 1.126.14-v1-rc.10 → 1.126.14
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,39 +1,36 @@
|
|
|
1
1
|
# projectzeronext
|
|
2
2
|
|
|
3
|
-
## 1.126.14
|
|
4
|
-
|
|
5
|
-
### Patch Changes
|
|
6
|
-
|
|
7
|
-
- Updated dependencies [
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
- @akinon/pz-
|
|
12
|
-
- @akinon/pz-
|
|
13
|
-
- @akinon/
|
|
14
|
-
- @akinon/pz-
|
|
15
|
-
- @akinon/pz-
|
|
16
|
-
- @akinon/pz-
|
|
17
|
-
- @akinon/pz-
|
|
18
|
-
- @akinon/pz-
|
|
19
|
-
- @akinon/pz-
|
|
20
|
-
- @akinon/pz-
|
|
21
|
-
- @akinon/pz-
|
|
22
|
-
- @akinon/pz-
|
|
23
|
-
- @akinon/pz-
|
|
24
|
-
- @akinon/pz-
|
|
25
|
-
- @akinon/pz-
|
|
26
|
-
- @akinon/pz-
|
|
27
|
-
- @akinon/pz-
|
|
28
|
-
- @akinon/pz-
|
|
29
|
-
- @akinon/pz-
|
|
30
|
-
- @akinon/pz-
|
|
31
|
-
- @akinon/pz-
|
|
32
|
-
- @akinon/pz-
|
|
33
|
-
- @akinon/pz-
|
|
34
|
-
- @akinon/pz-saved-card@1.126.14-v1-rc.10
|
|
35
|
-
- @akinon/pz-similar-products@1.126.14-v1-rc.10
|
|
36
|
-
- @akinon/pz-tabby-extension@1.126.14-v1-rc.10
|
|
3
|
+
## 1.126.14
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [fb75f8e]
|
|
8
|
+
- @akinon/next@1.126.14
|
|
9
|
+
- @akinon/pz-virtual-try-on@1.126.14
|
|
10
|
+
- @akinon/pz-akifast@1.126.14
|
|
11
|
+
- @akinon/pz-apple-pay@1.126.14
|
|
12
|
+
- @akinon/pz-b2b@1.126.14
|
|
13
|
+
- @akinon/pz-basket-gift-pack@1.126.14
|
|
14
|
+
- @akinon/pz-bkm@1.126.14
|
|
15
|
+
- @akinon/pz-checkout-gift-pack@1.126.14
|
|
16
|
+
- @akinon/pz-click-collect@1.126.14
|
|
17
|
+
- @akinon/pz-credit-payment@1.126.14
|
|
18
|
+
- @akinon/pz-cybersource-uc@1.126.14
|
|
19
|
+
- @akinon/pz-flow-payment@1.126.14
|
|
20
|
+
- @akinon/pz-google-pay@1.126.14
|
|
21
|
+
- @akinon/pz-gpay@1.126.14
|
|
22
|
+
- @akinon/pz-haso@1.126.14
|
|
23
|
+
- @akinon/pz-hepsipay@1.126.14
|
|
24
|
+
- @akinon/pz-masterpass@1.126.14
|
|
25
|
+
- @akinon/pz-masterpass-rest@1.126.14
|
|
26
|
+
- @akinon/pz-multi-basket@1.126.14
|
|
27
|
+
- @akinon/pz-one-click-checkout@1.126.14
|
|
28
|
+
- @akinon/pz-otp@1.126.14
|
|
29
|
+
- @akinon/pz-pay-on-delivery@1.126.14
|
|
30
|
+
- @akinon/pz-saved-card@1.126.14
|
|
31
|
+
- @akinon/pz-similar-products@1.126.14
|
|
32
|
+
- @akinon/pz-tabby-extension@1.126.14
|
|
33
|
+
- @akinon/pz-tamara-extension@1.126.14
|
|
37
34
|
|
|
38
35
|
## 1.126.13
|
|
39
36
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "projectzeronext",
|
|
3
|
-
"version": "1.126.14
|
|
3
|
+
"version": "1.126.14",
|
|
4
4
|
"private": true,
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"scripts": {
|
|
@@ -24,32 +24,32 @@
|
|
|
24
24
|
"test:middleware": "jest middleware-matcher.test.ts --bail"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@akinon/next": "1.126.14
|
|
28
|
-
"@akinon/pz-akifast": "1.126.14
|
|
29
|
-
"@akinon/pz-apple-pay": "1.126.14
|
|
30
|
-
"@akinon/pz-b2b": "1.126.14
|
|
31
|
-
"@akinon/pz-basket-gift-pack": "1.126.14
|
|
32
|
-
"@akinon/pz-bkm": "1.126.14
|
|
33
|
-
"@akinon/pz-checkout-gift-pack": "1.126.14
|
|
34
|
-
"@akinon/pz-click-collect": "1.126.14
|
|
35
|
-
"@akinon/pz-credit-payment": "1.126.14
|
|
36
|
-
"@akinon/pz-cybersource-uc": "1.126.14
|
|
37
|
-
"@akinon/pz-flow-payment": "1.126.14
|
|
38
|
-
"@akinon/pz-google-pay": "1.126.14
|
|
39
|
-
"@akinon/pz-gpay": "1.126.14
|
|
40
|
-
"@akinon/pz-haso": "1.126.14
|
|
41
|
-
"@akinon/pz-hepsipay": "1.126.14
|
|
42
|
-
"@akinon/pz-masterpass": "1.126.14
|
|
43
|
-
"@akinon/pz-masterpass-rest": "1.126.14
|
|
44
|
-
"@akinon/pz-multi-basket": "1.126.14
|
|
45
|
-
"@akinon/pz-one-click-checkout": "1.126.14
|
|
46
|
-
"@akinon/pz-otp": "1.126.14
|
|
47
|
-
"@akinon/pz-pay-on-delivery": "1.126.14
|
|
48
|
-
"@akinon/pz-saved-card": "1.126.14
|
|
49
|
-
"@akinon/pz-similar-products": "1.126.14
|
|
50
|
-
"@akinon/pz-tabby-extension": "1.126.14
|
|
51
|
-
"@akinon/pz-tamara-extension": "1.126.14
|
|
52
|
-
"@akinon/pz-virtual-try-on": "1.126.14
|
|
27
|
+
"@akinon/next": "1.126.14",
|
|
28
|
+
"@akinon/pz-akifast": "1.126.14",
|
|
29
|
+
"@akinon/pz-apple-pay": "1.126.14",
|
|
30
|
+
"@akinon/pz-b2b": "1.126.14",
|
|
31
|
+
"@akinon/pz-basket-gift-pack": "1.126.14",
|
|
32
|
+
"@akinon/pz-bkm": "1.126.14",
|
|
33
|
+
"@akinon/pz-checkout-gift-pack": "1.126.14",
|
|
34
|
+
"@akinon/pz-click-collect": "1.126.14",
|
|
35
|
+
"@akinon/pz-credit-payment": "1.126.14",
|
|
36
|
+
"@akinon/pz-cybersource-uc": "1.126.14",
|
|
37
|
+
"@akinon/pz-flow-payment": "1.126.14",
|
|
38
|
+
"@akinon/pz-google-pay": "1.126.14",
|
|
39
|
+
"@akinon/pz-gpay": "1.126.14",
|
|
40
|
+
"@akinon/pz-haso": "1.126.14",
|
|
41
|
+
"@akinon/pz-hepsipay": "1.126.14",
|
|
42
|
+
"@akinon/pz-masterpass": "1.126.14",
|
|
43
|
+
"@akinon/pz-masterpass-rest": "1.126.14",
|
|
44
|
+
"@akinon/pz-multi-basket": "1.126.14",
|
|
45
|
+
"@akinon/pz-one-click-checkout": "1.126.14",
|
|
46
|
+
"@akinon/pz-otp": "1.126.14",
|
|
47
|
+
"@akinon/pz-pay-on-delivery": "1.126.14",
|
|
48
|
+
"@akinon/pz-saved-card": "1.126.14",
|
|
49
|
+
"@akinon/pz-similar-products": "1.126.14",
|
|
50
|
+
"@akinon/pz-tabby-extension": "1.126.14",
|
|
51
|
+
"@akinon/pz-tamara-extension": "1.126.14",
|
|
52
|
+
"@akinon/pz-virtual-try-on": "1.126.14",
|
|
53
53
|
"@hookform/resolvers": "2.9.0",
|
|
54
54
|
"@next/third-parties": "14.1.0",
|
|
55
55
|
"@react-google-maps/api": "2.17.1",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"yup": "0.32.11"
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
|
-
"@akinon/eslint-plugin-projectzero": "1.126.14
|
|
75
|
+
"@akinon/eslint-plugin-projectzero": "1.126.14",
|
|
76
76
|
"@semantic-release/changelog": "6.0.2",
|
|
77
77
|
"@semantic-release/exec": "6.0.3",
|
|
78
78
|
"@semantic-release/git": "10.0.1",
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
useSetDataSourceShippingOptionsMutation
|
|
12
12
|
} from '@akinon/next/data/client/checkout';
|
|
13
13
|
import { Price, Button, Radio } from '@theme/components';
|
|
14
|
-
import { CheckoutStep } from '@akinon/next/types';
|
|
14
|
+
import { AttributeBasedShippingOption, CheckoutStep } from '@akinon/next/types';
|
|
15
15
|
import { useLocalization } from '@akinon/next/hooks';
|
|
16
16
|
|
|
17
17
|
const ShippingOptions: React.FC = () => {
|
|
@@ -47,22 +47,41 @@ const ShippingOptions: React.FC = () => {
|
|
|
47
47
|
|
|
48
48
|
const initializeSelectedOptions = useCallback(() => {
|
|
49
49
|
if (attribute_based_shipping_options) {
|
|
50
|
-
const newSelected = {
|
|
50
|
+
const newSelected: Record<string, number> = {};
|
|
51
51
|
let hasChanges = false;
|
|
52
52
|
|
|
53
53
|
Object.entries(attributeBasedShippingOptions).forEach(
|
|
54
|
-
([color,
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
54
|
+
([color, group]) => {
|
|
55
|
+
// The step arrives as a dictionary of groups, each carrying its own
|
|
56
|
+
// option list. Both the local and the remote page use this shape.
|
|
57
|
+
const options: AttributeBasedShippingOption[] =
|
|
58
|
+
group?.attribute_based_shipping_options ?? [];
|
|
59
|
+
|
|
60
|
+
if (options.length === 0) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const previous = selectedShippingOptions[color];
|
|
65
|
+
const keepsPrevious = options.some((opt) => opt.pk === previous);
|
|
66
|
+
|
|
67
|
+
newSelected[color] = keepsPrevious ? previous : options[0].pk;
|
|
68
|
+
|
|
69
|
+
if (!keepsPrevious) {
|
|
60
70
|
hasChanges = true;
|
|
61
71
|
}
|
|
62
72
|
}
|
|
63
73
|
);
|
|
64
74
|
|
|
65
|
-
|
|
75
|
+
// A group the backend no longer reports must not stay in the selection:
|
|
76
|
+
// it rejects the whole payload when the group count does not match.
|
|
77
|
+
if (
|
|
78
|
+
Object.keys(newSelected).length !==
|
|
79
|
+
Object.keys(selectedShippingOptions).length
|
|
80
|
+
) {
|
|
81
|
+
hasChanges = true;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
if (hasChanges && Object.keys(newSelected).length > 0) {
|
|
66
85
|
dispatch(setSelectedShippingOptions(newSelected));
|
|
67
86
|
setAttributeBasedShippingOptions(newSelected);
|
|
68
87
|
}
|
|
@@ -203,31 +222,40 @@ const ShippingOptions: React.FC = () => {
|
|
|
203
222
|
{attributeBasedShippingOptions &&
|
|
204
223
|
Object.keys(attributeBasedShippingOptions).length > 0 &&
|
|
205
224
|
Object.entries(attributeBasedShippingOptions).map(
|
|
206
|
-
([color,
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
}
|
|
220
|
-
|
|
225
|
+
([color, group]) => {
|
|
226
|
+
const options: AttributeBasedShippingOption[] =
|
|
227
|
+
group?.attribute_based_shipping_options ?? [];
|
|
228
|
+
|
|
229
|
+
if (options.length === 0) {
|
|
230
|
+
return null;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
return (
|
|
234
|
+
<div key={color}>
|
|
235
|
+
<h3 className="text-lg font-bold">{color}</h3>
|
|
236
|
+
{options.map((option) => (
|
|
237
|
+
<div
|
|
238
|
+
key={option.pk}
|
|
239
|
+
className="py-4 border-t border-gray-400 flex justify-between"
|
|
221
240
|
>
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
241
|
+
<Radio
|
|
242
|
+
name={`attribute-based-shipping-${color}`}
|
|
243
|
+
checked={selectedShippingOptions[color] === option.pk}
|
|
244
|
+
onChange={() =>
|
|
245
|
+
handleAttributeBasedOptionChange(color, option.pk)
|
|
246
|
+
}
|
|
247
|
+
data-testid={`checkout-attribute-based-shipping-${option.pk}`}
|
|
248
|
+
>
|
|
249
|
+
{`${option.shipping_option_name}`}
|
|
250
|
+
</Radio>
|
|
251
|
+
<span className="text-xs">
|
|
252
|
+
<Price value={option.shipping_amount} />
|
|
253
|
+
</span>
|
|
254
|
+
</div>
|
|
255
|
+
))}
|
|
256
|
+
</div>
|
|
257
|
+
);
|
|
258
|
+
}
|
|
231
259
|
)}
|
|
232
260
|
|
|
233
261
|
{dataSourceShippingOptions &&
|