@akinon/projectzero 1.40.0 ā 1.41.0-rc.0
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 +37 -0
- package/app-template/CHANGELOG.md +337 -7
- package/app-template/package.json +15 -10
- package/app-template/public/locales/en/account.json +4 -4
- package/app-template/public/locales/tr/account.json +1 -1
- package/app-template/src/app/[commerce]/[locale]/[currency]/[...prettyurl]/page.tsx +8 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/account/coupons/page.tsx +4 -4
- package/app-template/src/app/[commerce]/[locale]/[currency]/account/profile/page.tsx +1 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/orders/completed/[token]/page.tsx +12 -8
- package/app-template/src/components/checkbox.tsx +2 -2
- package/app-template/src/components/input.tsx +19 -7
- package/app-template/src/components/price.tsx +3 -3
- package/app-template/src/views/account/address-form.tsx +22 -7
- package/app-template/src/views/account/contact-form.tsx +22 -6
- package/app-template/src/views/account/favourite-products/favourite-products-list.tsx +5 -1
- package/app-template/src/views/category/filters/filter-item.tsx +131 -0
- package/app-template/src/views/category/filters/index.tsx +5 -105
- package/app-template/tsconfig.json +14 -4
- package/commands/create.ts +29 -5
- package/dist/commands/create.js +25 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @akinon/projectzero
|
|
2
2
|
|
|
3
|
+
## 1.41.0-rc.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 9b6bf91: ZERO-2660: Change campaings to campaigns
|
|
8
|
+
- 00ffde2: ZERO-2637: enhance create command with improved messaging
|
|
9
|
+
|
|
3
10
|
## 1.40.0
|
|
4
11
|
|
|
5
12
|
## 1.39.0
|
|
@@ -19,6 +26,36 @@
|
|
|
19
26
|
- cd78ddc: ZERO-2661: rename .npmignore to .gitignore during project creation
|
|
20
27
|
- 735f4f0: ZERO-2661: create .npmignore in app-template
|
|
21
28
|
|
|
29
|
+
## 1.34.0-rc.16
|
|
30
|
+
|
|
31
|
+
### Minor Changes
|
|
32
|
+
|
|
33
|
+
- cd78ddc: ZERO-2661: rename .npmignore to .gitignore during project creation
|
|
34
|
+
|
|
35
|
+
## 1.34.0-rc.15
|
|
36
|
+
|
|
37
|
+
### Minor Changes
|
|
38
|
+
|
|
39
|
+
- 735f4f0: ZERO-2661: create .npmignore in app-template
|
|
40
|
+
|
|
41
|
+
## 1.34.0-rc.14
|
|
42
|
+
|
|
43
|
+
## 1.34.0-rc.13
|
|
44
|
+
|
|
45
|
+
## 1.34.0-rc.12
|
|
46
|
+
|
|
47
|
+
## 1.34.0-rc.11
|
|
48
|
+
|
|
49
|
+
## 1.34.0-rc.10
|
|
50
|
+
|
|
51
|
+
## 1.34.0-rc.9
|
|
52
|
+
|
|
53
|
+
## 1.34.0-rc.8
|
|
54
|
+
|
|
55
|
+
## 1.34.0-rc.7
|
|
56
|
+
|
|
57
|
+
## 1.34.0-rc.6
|
|
58
|
+
|
|
22
59
|
## 1.33.2
|
|
23
60
|
|
|
24
61
|
### Patch Changes
|
|
@@ -1,5 +1,47 @@
|
|
|
1
1
|
# projectzeronext
|
|
2
2
|
|
|
3
|
+
## 1.41.0-rc.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- c53ea3e: ZERO-2609: Reset additional form fields when selectedFormType is not company
|
|
8
|
+
- 27a5296: ZERO-2631:Fix Checkbox Click
|
|
9
|
+
- 9b6bf91: ZERO-2660: Change campaings to campaigns
|
|
10
|
+
- 74a1269: ZERO-2658:Edit product name clickability on completed order page
|
|
11
|
+
- 75080fd: ZERO-2630: Add max limit to postcode area
|
|
12
|
+
- 91265bb: ZERO-2551: Improve pretty url and caching performance
|
|
13
|
+
- 902d828: ZERO-2621:edit position of loaderSpinner in favorites page
|
|
14
|
+
- 7a4bb76: ZERO-2610:Refactor FilterItem component for better readability and efficiency
|
|
15
|
+
- dff0d59: ZERO-2659: add formData support to proxy api requests
|
|
16
|
+
- beb499e: ZERO-2551: Add new tsconfig paths
|
|
17
|
+
- 4614eee: ZERO-2602: The script that checks the build for standalone projects
|
|
18
|
+
- f046f8e: ZERO-2575: update version for react-number-format
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- Updated dependencies [a4c8d6a]
|
|
23
|
+
- Updated dependencies [c53ea3e]
|
|
24
|
+
- Updated dependencies [c53ef7b]
|
|
25
|
+
- Updated dependencies [1448a96]
|
|
26
|
+
- Updated dependencies [75080fd]
|
|
27
|
+
- Updated dependencies [91265bb]
|
|
28
|
+
- Updated dependencies [bbe18b9]
|
|
29
|
+
- Updated dependencies [dff0d59]
|
|
30
|
+
- Updated dependencies [beb499e]
|
|
31
|
+
- Updated dependencies [f046f8e]
|
|
32
|
+
- @akinon/next@1.41.0-rc.0
|
|
33
|
+
- @akinon/pz-b2b@1.41.0-rc.0
|
|
34
|
+
- @akinon/pz-basket-gift-pack@1.41.0-rc.0
|
|
35
|
+
- @akinon/pz-bkm@1.41.0-rc.0
|
|
36
|
+
- @akinon/pz-checkout-gift-pack@1.41.0-rc.0
|
|
37
|
+
- @akinon/pz-click-collect@1.41.0-rc.0
|
|
38
|
+
- @akinon/pz-credit-payment@1.41.0-rc.0
|
|
39
|
+
- @akinon/pz-gpay@1.41.0-rc.0
|
|
40
|
+
- @akinon/pz-masterpass@1.41.0-rc.0
|
|
41
|
+
- @akinon/pz-one-click-checkout@1.41.0-rc.0
|
|
42
|
+
- @akinon/pz-otp@1.41.0-rc.0
|
|
43
|
+
- @akinon/pz-pay-on-delivery@1.41.0-rc.0
|
|
44
|
+
|
|
3
45
|
## 1.40.0
|
|
4
46
|
|
|
5
47
|
### Minor Changes
|
|
@@ -121,13 +163,301 @@
|
|
|
121
163
|
|
|
122
164
|
### Patch Changes
|
|
123
165
|
|
|
124
|
-
-
|
|
125
|
-
-
|
|
126
|
-
-
|
|
127
|
-
-
|
|
128
|
-
-
|
|
129
|
-
-
|
|
130
|
-
-
|
|
166
|
+
- Updated dependencies [a4c8d6a]
|
|
167
|
+
- Updated dependencies [d09b677]
|
|
168
|
+
- Updated dependencies [6d4aadb]
|
|
169
|
+
- Updated dependencies [8e6e8cf]
|
|
170
|
+
- Updated dependencies [c53ef7b]
|
|
171
|
+
- Updated dependencies [ebb63ce]
|
|
172
|
+
- Updated dependencies [7cebe87]
|
|
173
|
+
- Updated dependencies [616690d]
|
|
174
|
+
- Updated dependencies [f3b595e]
|
|
175
|
+
- Updated dependencies [91265bb]
|
|
176
|
+
- Updated dependencies [59fb7c3]
|
|
177
|
+
- Updated dependencies [bbe18b9]
|
|
178
|
+
- Updated dependencies [f0c23bc]
|
|
179
|
+
- Updated dependencies [3420416]
|
|
180
|
+
- Updated dependencies [495d155]
|
|
181
|
+
- Updated dependencies [beb499e]
|
|
182
|
+
- Updated dependencies [6c18543]
|
|
183
|
+
- Updated dependencies [40ad73e]
|
|
184
|
+
- Updated dependencies [495d155]
|
|
185
|
+
- Updated dependencies [f046f8e]
|
|
186
|
+
- Updated dependencies [6b2972b]
|
|
187
|
+
- Updated dependencies [3e68768]
|
|
188
|
+
- @akinon/next@1.34.0-rc.20
|
|
189
|
+
- @akinon/pz-masterpass@1.34.0-rc.20
|
|
190
|
+
- @akinon/pz-one-click-checkout@1.34.0-rc.20
|
|
191
|
+
- @akinon/pz-b2b@1.34.0-rc.20
|
|
192
|
+
- @akinon/pz-gpay@1.34.0-rc.20
|
|
193
|
+
- @akinon/pz-otp@1.34.0-rc.20
|
|
194
|
+
- @akinon/pz-pay-on-delivery@1.34.0-rc.20
|
|
195
|
+
|
|
196
|
+
## 1.34.0-rc.19
|
|
197
|
+
|
|
198
|
+
### Patch Changes
|
|
199
|
+
|
|
200
|
+
- Updated dependencies [c53ef7b]
|
|
201
|
+
- @akinon/next@1.34.0-rc.19
|
|
202
|
+
- @akinon/pz-b2b@1.34.0-rc.19
|
|
203
|
+
- @akinon/pz-gpay@1.34.0-rc.19
|
|
204
|
+
- @akinon/pz-masterpass@1.34.0-rc.19
|
|
205
|
+
- @akinon/pz-one-click-checkout@1.34.0-rc.19
|
|
206
|
+
- @akinon/pz-otp@1.34.0-rc.19
|
|
207
|
+
- @akinon/pz-pay-on-delivery@1.34.0-rc.19
|
|
208
|
+
|
|
209
|
+
## 1.34.0-rc.18
|
|
210
|
+
|
|
211
|
+
### Minor Changes
|
|
212
|
+
|
|
213
|
+
- 9b6bf91: ZERO-2660: Change campaings to campaigns
|
|
214
|
+
- 902d828: ZERO-2621:edit position of loaderSpinner in favorites page
|
|
215
|
+
|
|
216
|
+
### Patch Changes
|
|
217
|
+
|
|
218
|
+
- Updated dependencies [a4c8d6a]
|
|
219
|
+
- @akinon/next@1.34.0-rc.18
|
|
220
|
+
- @akinon/pz-b2b@1.34.0-rc.18
|
|
221
|
+
- @akinon/pz-gpay@1.34.0-rc.18
|
|
222
|
+
- @akinon/pz-masterpass@1.34.0-rc.18
|
|
223
|
+
- @akinon/pz-one-click-checkout@1.34.0-rc.18
|
|
224
|
+
- @akinon/pz-otp@1.34.0-rc.18
|
|
225
|
+
- @akinon/pz-pay-on-delivery@1.34.0-rc.18
|
|
226
|
+
|
|
227
|
+
## 1.34.0-rc.17
|
|
228
|
+
|
|
229
|
+
### Minor Changes
|
|
230
|
+
|
|
231
|
+
- 567e4c1: ZERO-2580:Add checked attribute from props to checkbox
|
|
232
|
+
- d09b677: ZERO-2577: Fix pagination bug and update usePagination hook and ensure pagination controls rendering correctly
|
|
233
|
+
- 27a5296: ZERO-2631:Fix Checkbox Click
|
|
234
|
+
- ebb63ce: ZERO-2525: Fix category facet removal bug and add close icon to active filters
|
|
235
|
+
- 74a1269: ZERO-2658:Edit product name clickability on completed order page
|
|
236
|
+
- 0d0f36c: ZERO-2598: Fix eslint warnings and update dependencies
|
|
237
|
+
- 91265bb: ZERO-2551: Improve pretty url and caching performance
|
|
238
|
+
- f0c23bc: ZERO-2135: add custom not found page
|
|
239
|
+
- 3420416: ZERO-2533: extend eslint config from @akinon/next
|
|
240
|
+
- beb499e: ZERO-2551: Add new tsconfig paths
|
|
241
|
+
- 6c18543: ZERO-2542:Refactor and show error in OneClickCheckoutButtons
|
|
242
|
+
- 202f84e: ZERO-2569: Fix static keys
|
|
243
|
+
- 4614eee: ZERO-2602: The script that checks the build for standalone projects
|
|
244
|
+
- f046f8e: ZERO-2575: update version for react-number-format
|
|
245
|
+
- 12c10a4: ZERO-2570: Category filters routes to absolute url
|
|
246
|
+
|
|
247
|
+
### Patch Changes
|
|
248
|
+
|
|
249
|
+
- Updated dependencies [d09b677]
|
|
250
|
+
- Updated dependencies [6d4aadb]
|
|
251
|
+
- Updated dependencies [8e6e8cf]
|
|
252
|
+
- Updated dependencies [ebb63ce]
|
|
253
|
+
- Updated dependencies [7cebe87]
|
|
254
|
+
- Updated dependencies [616690d]
|
|
255
|
+
- Updated dependencies [f3b595e]
|
|
256
|
+
- Updated dependencies [91265bb]
|
|
257
|
+
- Updated dependencies [59fb7c3]
|
|
258
|
+
- Updated dependencies [bbe18b9]
|
|
259
|
+
- Updated dependencies [f0c23bc]
|
|
260
|
+
- Updated dependencies [3420416]
|
|
261
|
+
- Updated dependencies [495d155]
|
|
262
|
+
- Updated dependencies [beb499e]
|
|
263
|
+
- Updated dependencies [6c18543]
|
|
264
|
+
- Updated dependencies [40ad73e]
|
|
265
|
+
- Updated dependencies [495d155]
|
|
266
|
+
- Updated dependencies [f046f8e]
|
|
267
|
+
- Updated dependencies [6b2972b]
|
|
268
|
+
- Updated dependencies [3e68768]
|
|
269
|
+
- @akinon/next@1.34.0-rc.17
|
|
270
|
+
- @akinon/pz-masterpass@1.34.0-rc.17
|
|
271
|
+
- @akinon/pz-one-click-checkout@1.34.0-rc.17
|
|
272
|
+
- @akinon/pz-b2b@1.34.0-rc.17
|
|
273
|
+
- @akinon/pz-gpay@1.34.0-rc.17
|
|
274
|
+
- @akinon/pz-otp@1.34.0-rc.17
|
|
275
|
+
- @akinon/pz-pay-on-delivery@1.34.0-rc.17
|
|
276
|
+
|
|
277
|
+
## 1.34.0-rc.16
|
|
278
|
+
|
|
279
|
+
### Patch Changes
|
|
280
|
+
|
|
281
|
+
- @akinon/next@1.34.0-rc.16
|
|
282
|
+
- @akinon/pz-b2b@1.34.0-rc.16
|
|
283
|
+
- @akinon/pz-gpay@1.34.0-rc.16
|
|
284
|
+
- @akinon/pz-masterpass@1.34.0-rc.16
|
|
285
|
+
- @akinon/pz-one-click-checkout@1.34.0-rc.16
|
|
286
|
+
- @akinon/pz-otp@1.34.0-rc.16
|
|
287
|
+
- @akinon/pz-pay-on-delivery@1.34.0-rc.16
|
|
288
|
+
|
|
289
|
+
## 1.34.0-rc.15
|
|
290
|
+
|
|
291
|
+
### Patch Changes
|
|
292
|
+
|
|
293
|
+
- @akinon/next@1.34.0-rc.15
|
|
294
|
+
- @akinon/pz-b2b@1.34.0-rc.15
|
|
295
|
+
- @akinon/pz-gpay@1.34.0-rc.15
|
|
296
|
+
- @akinon/pz-masterpass@1.34.0-rc.15
|
|
297
|
+
- @akinon/pz-one-click-checkout@1.34.0-rc.15
|
|
298
|
+
- @akinon/pz-otp@1.34.0-rc.15
|
|
299
|
+
- @akinon/pz-pay-on-delivery@1.34.0-rc.15
|
|
300
|
+
|
|
301
|
+
## 1.34.0-rc.14
|
|
302
|
+
|
|
303
|
+
### Minor Changes
|
|
304
|
+
|
|
305
|
+
- 4614eee: ZERO-2602: The script that checks the build for standalone projects
|
|
306
|
+
|
|
307
|
+
### Patch Changes
|
|
308
|
+
|
|
309
|
+
- @akinon/next@1.34.0-rc.14
|
|
310
|
+
- @akinon/pz-b2b@1.34.0-rc.14
|
|
311
|
+
- @akinon/pz-gpay@1.34.0-rc.14
|
|
312
|
+
- @akinon/pz-masterpass@1.34.0-rc.14
|
|
313
|
+
- @akinon/pz-one-click-checkout@1.34.0-rc.14
|
|
314
|
+
- @akinon/pz-otp@1.34.0-rc.14
|
|
315
|
+
- @akinon/pz-pay-on-delivery@1.34.0-rc.14
|
|
316
|
+
|
|
317
|
+
## 1.34.0-rc.13
|
|
318
|
+
|
|
319
|
+
### Minor Changes
|
|
320
|
+
|
|
321
|
+
- 74a1269: ZERO-2658:Edit product name clickability on completed order page
|
|
322
|
+
|
|
323
|
+
### Patch Changes
|
|
324
|
+
|
|
325
|
+
- @akinon/next@1.34.0-rc.13
|
|
326
|
+
- @akinon/pz-b2b@1.34.0-rc.13
|
|
327
|
+
- @akinon/pz-gpay@1.34.0-rc.13
|
|
328
|
+
- @akinon/pz-masterpass@1.34.0-rc.13
|
|
329
|
+
- @akinon/pz-one-click-checkout@1.34.0-rc.13
|
|
330
|
+
- @akinon/pz-otp@1.34.0-rc.13
|
|
331
|
+
- @akinon/pz-pay-on-delivery@1.34.0-rc.13
|
|
332
|
+
|
|
333
|
+
## 1.34.0-rc.12
|
|
334
|
+
|
|
335
|
+
### Patch Changes
|
|
336
|
+
|
|
337
|
+
- Updated dependencies [616690d]
|
|
338
|
+
- @akinon/next@1.34.0-rc.12
|
|
339
|
+
- @akinon/pz-b2b@1.34.0-rc.12
|
|
340
|
+
- @akinon/pz-gpay@1.34.0-rc.12
|
|
341
|
+
- @akinon/pz-masterpass@1.34.0-rc.12
|
|
342
|
+
- @akinon/pz-one-click-checkout@1.34.0-rc.12
|
|
343
|
+
- @akinon/pz-otp@1.34.0-rc.12
|
|
344
|
+
- @akinon/pz-pay-on-delivery@1.34.0-rc.12
|
|
345
|
+
|
|
346
|
+
## 1.34.0-rc.11
|
|
347
|
+
|
|
348
|
+
### Patch Changes
|
|
349
|
+
|
|
350
|
+
- Updated dependencies [8e6e8cf]
|
|
351
|
+
- @akinon/next@1.34.0-rc.11
|
|
352
|
+
- @akinon/pz-b2b@1.34.0-rc.11
|
|
353
|
+
- @akinon/pz-gpay@1.34.0-rc.11
|
|
354
|
+
- @akinon/pz-masterpass@1.34.0-rc.11
|
|
355
|
+
- @akinon/pz-one-click-checkout@1.34.0-rc.11
|
|
356
|
+
- @akinon/pz-otp@1.34.0-rc.11
|
|
357
|
+
- @akinon/pz-pay-on-delivery@1.34.0-rc.11
|
|
358
|
+
|
|
359
|
+
## 1.34.0-rc.10
|
|
360
|
+
|
|
361
|
+
### Patch Changes
|
|
362
|
+
|
|
363
|
+
- Updated dependencies [bbe18b9]
|
|
364
|
+
- @akinon/next@1.34.0-rc.10
|
|
365
|
+
- @akinon/pz-b2b@1.34.0-rc.10
|
|
366
|
+
- @akinon/pz-gpay@1.34.0-rc.10
|
|
367
|
+
- @akinon/pz-masterpass@1.34.0-rc.10
|
|
368
|
+
- @akinon/pz-one-click-checkout@1.34.0-rc.10
|
|
369
|
+
- @akinon/pz-otp@1.34.0-rc.10
|
|
370
|
+
- @akinon/pz-pay-on-delivery@1.34.0-rc.10
|
|
371
|
+
|
|
372
|
+
## 1.34.0-rc.9
|
|
373
|
+
|
|
374
|
+
### Minor Changes
|
|
375
|
+
|
|
376
|
+
- beb499e: ZERO-2551: Add new tsconfig paths
|
|
377
|
+
|
|
378
|
+
### Patch Changes
|
|
379
|
+
|
|
380
|
+
- Updated dependencies [beb499e]
|
|
381
|
+
- @akinon/next@1.34.0-rc.9
|
|
382
|
+
- @akinon/pz-b2b@1.34.0-rc.9
|
|
383
|
+
- @akinon/pz-gpay@1.34.0-rc.9
|
|
384
|
+
- @akinon/pz-masterpass@1.34.0-rc.9
|
|
385
|
+
- @akinon/pz-one-click-checkout@1.34.0-rc.9
|
|
386
|
+
- @akinon/pz-otp@1.34.0-rc.9
|
|
387
|
+
- @akinon/pz-pay-on-delivery@1.34.0-rc.9
|
|
388
|
+
|
|
389
|
+
## 1.34.0-rc.8
|
|
390
|
+
|
|
391
|
+
### Minor Changes
|
|
392
|
+
|
|
393
|
+
- 91265bb: ZERO-2551: Improve pretty url and caching performance
|
|
394
|
+
|
|
395
|
+
### Patch Changes
|
|
396
|
+
|
|
397
|
+
- Updated dependencies [91265bb]
|
|
398
|
+
- @akinon/next@1.34.0-rc.8
|
|
399
|
+
- @akinon/pz-b2b@1.34.0-rc.8
|
|
400
|
+
- @akinon/pz-gpay@1.34.0-rc.8
|
|
401
|
+
- @akinon/pz-masterpass@1.34.0-rc.8
|
|
402
|
+
- @akinon/pz-one-click-checkout@1.34.0-rc.8
|
|
403
|
+
- @akinon/pz-otp@1.34.0-rc.8
|
|
404
|
+
- @akinon/pz-pay-on-delivery@1.34.0-rc.8
|
|
405
|
+
|
|
406
|
+
## 1.34.0-rc.7
|
|
407
|
+
|
|
408
|
+
### Minor Changes
|
|
409
|
+
|
|
410
|
+
- 0d0f36c: ZERO-2598: Fix eslint warnings and update dependencies
|
|
411
|
+
|
|
412
|
+
### Patch Changes
|
|
413
|
+
|
|
414
|
+
- @akinon/next@1.34.0-rc.7
|
|
415
|
+
- @akinon/pz-b2b@1.34.0-rc.7
|
|
416
|
+
- @akinon/pz-gpay@1.34.0-rc.7
|
|
417
|
+
- @akinon/pz-masterpass@1.34.0-rc.7
|
|
418
|
+
- @akinon/pz-one-click-checkout@1.34.0-rc.7
|
|
419
|
+
- @akinon/pz-otp@1.34.0-rc.7
|
|
420
|
+
- @akinon/pz-pay-on-delivery@1.34.0-rc.7
|
|
421
|
+
|
|
422
|
+
## 1.34.0-rc.6
|
|
423
|
+
|
|
424
|
+
### Minor Changes
|
|
425
|
+
|
|
426
|
+
- 567e4c1: ZERO-2580:Add checked attribute from props to checkbox
|
|
427
|
+
- d09b677: ZERO-2577: Fix pagination bug and update usePagination hook and ensure pagination controls rendering correctly
|
|
428
|
+
- 27a5296: ZERO-2631:Fix Checkbox Click
|
|
429
|
+
- ebb63ce: ZERO-2525: Fix category facet removal bug and add close icon to active filters
|
|
430
|
+
- f0c23bc: ZERO-2135: add custom not found page
|
|
431
|
+
- 3420416: ZERO-2533: extend eslint config from @akinon/next
|
|
432
|
+
- 6c18543: ZERO-2542:Refactor and show error in OneClickCheckoutButtons
|
|
433
|
+
- 202f84e: ZERO-2569: Fix static keys
|
|
434
|
+
- f046f8e: ZERO-2575: update version for react-number-format
|
|
435
|
+
- 12c10a4: ZERO-2570: Category filters routes to absolute url
|
|
436
|
+
|
|
437
|
+
### Patch Changes
|
|
438
|
+
|
|
439
|
+
- Updated dependencies [d09b677]
|
|
440
|
+
- Updated dependencies [6d4aadb]
|
|
441
|
+
- Updated dependencies [ebb63ce]
|
|
442
|
+
- Updated dependencies [7cebe87]
|
|
443
|
+
- Updated dependencies [f3b595e]
|
|
444
|
+
- Updated dependencies [59fb7c3]
|
|
445
|
+
- Updated dependencies [f0c23bc]
|
|
446
|
+
- Updated dependencies [3420416]
|
|
447
|
+
- Updated dependencies [495d155]
|
|
448
|
+
- Updated dependencies [6c18543]
|
|
449
|
+
- Updated dependencies [40ad73e]
|
|
450
|
+
- Updated dependencies [495d155]
|
|
451
|
+
- Updated dependencies [f046f8e]
|
|
452
|
+
- Updated dependencies [6b2972b]
|
|
453
|
+
- Updated dependencies [3e68768]
|
|
454
|
+
- @akinon/next@1.34.0-rc.6
|
|
455
|
+
- @akinon/pz-masterpass@1.34.0-rc.6
|
|
456
|
+
- @akinon/pz-one-click-checkout@1.34.0-rc.6
|
|
457
|
+
- @akinon/pz-b2b@1.34.0-rc.6
|
|
458
|
+
- @akinon/pz-gpay@1.34.0-rc.6
|
|
459
|
+
- @akinon/pz-otp@1.34.0-rc.6
|
|
460
|
+
- @akinon/pz-pay-on-delivery@1.34.0-rc.6
|
|
131
461
|
|
|
132
462
|
## 1.33.2
|
|
133
463
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "projectzeronext",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.41.0-rc.0",
|
|
4
4
|
"private": true,
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"scripts": {
|
|
@@ -22,13 +22,18 @@
|
|
|
22
22
|
"prestart": "pz-prestart"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@akinon/next": "1.
|
|
26
|
-
"@akinon/pz-b2b": "1.
|
|
27
|
-
"@akinon/pz-
|
|
28
|
-
"@akinon/pz-
|
|
29
|
-
"@akinon/pz-
|
|
30
|
-
"@akinon/pz-
|
|
31
|
-
"@akinon/pz-
|
|
25
|
+
"@akinon/next": "1.41.0-rc.0",
|
|
26
|
+
"@akinon/pz-b2b": "1.41.0-rc.0",
|
|
27
|
+
"@akinon/pz-basket-gift-pack": "1.41.0-rc.0",
|
|
28
|
+
"@akinon/pz-bkm": "1.41.0-rc.0",
|
|
29
|
+
"@akinon/pz-checkout-gift-pack": "1.41.0-rc.0",
|
|
30
|
+
"@akinon/pz-click-collect": "1.41.0-rc.0",
|
|
31
|
+
"@akinon/pz-credit-payment": "1.41.0-rc.0",
|
|
32
|
+
"@akinon/pz-gpay": "1.41.0-rc.0",
|
|
33
|
+
"@akinon/pz-masterpass": "1.41.0-rc.0",
|
|
34
|
+
"@akinon/pz-one-click-checkout": "1.41.0-rc.0",
|
|
35
|
+
"@akinon/pz-otp": "1.41.0-rc.0",
|
|
36
|
+
"@akinon/pz-pay-on-delivery": "1.41.0-rc.0",
|
|
32
37
|
"@hookform/resolvers": "2.9.0",
|
|
33
38
|
"@next/third-parties": "14.1.0",
|
|
34
39
|
"@react-google-maps/api": "2.17.1",
|
|
@@ -53,7 +58,7 @@
|
|
|
53
58
|
"yup": "0.32.11"
|
|
54
59
|
},
|
|
55
60
|
"devDependencies": {
|
|
56
|
-
"@akinon/eslint-plugin-projectzero": "1.
|
|
61
|
+
"@akinon/eslint-plugin-projectzero": "1.41.0-rc.0",
|
|
57
62
|
"@semantic-release/changelog": "6.0.2",
|
|
58
63
|
"@semantic-release/exec": "6.0.3",
|
|
59
64
|
"@semantic-release/git": "10.0.1",
|
|
@@ -80,7 +85,7 @@
|
|
|
80
85
|
"jest-css-modules-transform": "4.3.0",
|
|
81
86
|
"lint-staged": "13.1.0",
|
|
82
87
|
"prettier": "2.6.2",
|
|
83
|
-
"react-number-format": "
|
|
88
|
+
"react-number-format": "5.3.4",
|
|
84
89
|
"sass": "1.49.9",
|
|
85
90
|
"semantic-release": "19.0.5",
|
|
86
91
|
"server-only": "0.0.1",
|
|
@@ -286,11 +286,11 @@
|
|
|
286
286
|
"empty_coupon": "You don't have any coupons"
|
|
287
287
|
},
|
|
288
288
|
"title": {
|
|
289
|
-
"
|
|
289
|
+
"campaigns": {
|
|
290
290
|
"active": "Active Campaigns",
|
|
291
|
-
"to_be_active": "
|
|
292
|
-
"expired": "Expired
|
|
293
|
-
"used": "Used
|
|
291
|
+
"to_be_active": "Campaigns to be Active",
|
|
292
|
+
"expired": "Expired Campaigns",
|
|
293
|
+
"used": "Used Campaigns"
|
|
294
294
|
},
|
|
295
295
|
"coupons": {
|
|
296
296
|
"active": "Active Coupons",
|
|
@@ -51,7 +51,7 @@ export default function Page() {
|
|
|
51
51
|
{basketOffersLoading && <LoaderSpinner className="mb-8" />}
|
|
52
52
|
{basketOffersSuccess && (
|
|
53
53
|
<CouponItem
|
|
54
|
-
mainTitle={t('account.my_vouchers.title.
|
|
54
|
+
mainTitle={t('account.my_vouchers.title.campaigns.active')}
|
|
55
55
|
subTitles={[
|
|
56
56
|
t('account.my_vouchers.card.campaign_name'),
|
|
57
57
|
t('account.my_vouchers.card.starting_date'),
|
|
@@ -68,7 +68,7 @@ export default function Page() {
|
|
|
68
68
|
{futureBasketOffersLoading && <LoaderSpinner className="mb-8" />}
|
|
69
69
|
{futureBasketOffersSuccess && (
|
|
70
70
|
<CouponItem
|
|
71
|
-
mainTitle={t('account.my_vouchers.title.
|
|
71
|
+
mainTitle={t('account.my_vouchers.title.campaigns.to_be_active')}
|
|
72
72
|
subTitles={[
|
|
73
73
|
t('account.my_vouchers.card.campaign_name'),
|
|
74
74
|
t('account.my_vouchers.card.starting_date'),
|
|
@@ -85,7 +85,7 @@ export default function Page() {
|
|
|
85
85
|
{expiredBasketOffersLoading && <LoaderSpinner className="mb-8" />}
|
|
86
86
|
{expiredBasketOffersSuccess && (
|
|
87
87
|
<CouponItem
|
|
88
|
-
mainTitle={t('account.my_vouchers.title.
|
|
88
|
+
mainTitle={t('account.my_vouchers.title.campaigns.expired')}
|
|
89
89
|
subTitles={[
|
|
90
90
|
t('account.my_vouchers.card.campaign_name'),
|
|
91
91
|
t('account.my_vouchers.card.starting_date'),
|
|
@@ -102,7 +102,7 @@ export default function Page() {
|
|
|
102
102
|
{discountItemsLoading && <LoaderSpinner className="mb-8" />}
|
|
103
103
|
{discountItemsSuccess && (
|
|
104
104
|
<CouponItem
|
|
105
|
-
mainTitle={t('account.my_vouchers.title.
|
|
105
|
+
mainTitle={t('account.my_vouchers.title.campaigns.used')}
|
|
106
106
|
subTitles={[
|
|
107
107
|
t('account.my_vouchers.card.campaign_name'),
|
|
108
108
|
t('account.my_vouchers.card.starting_date'),
|
package/app-template/src/app/[commerce]/[locale]/[currency]/orders/completed/[token]/page.tsx
CHANGED
|
@@ -182,21 +182,25 @@ const CheckoutCompleted = ({
|
|
|
182
182
|
}}
|
|
183
183
|
>
|
|
184
184
|
{data.order.orderitem_set.map((item) => (
|
|
185
|
-
<div
|
|
186
|
-
|
|
185
|
+
<div
|
|
186
|
+
key={`order-item-${item.id}`}
|
|
187
|
+
className="flex justify-between gap-x-4 w-full"
|
|
188
|
+
>
|
|
189
|
+
<Link
|
|
190
|
+
className="flex justify-between gap-x-4 flex-1 items-center transition-all text-xs text-black-800 hover:text-secondary"
|
|
191
|
+
href={item.product.absolute_url}
|
|
192
|
+
passHref
|
|
193
|
+
>
|
|
187
194
|
<Image
|
|
188
195
|
src={item.product.image}
|
|
189
196
|
alt={item.product.name}
|
|
190
197
|
width={64}
|
|
191
198
|
height={96}
|
|
192
199
|
/>
|
|
200
|
+
|
|
201
|
+
<span>{item.product.name}</span>
|
|
193
202
|
</Link>
|
|
194
|
-
<div className="flex justify-
|
|
195
|
-
<>
|
|
196
|
-
<div className="text-xs text-black-800 transition-all w-full hover:text-secondary">
|
|
197
|
-
{item.product.name}
|
|
198
|
-
</div>
|
|
199
|
-
</>
|
|
203
|
+
<div className="flex justify-end items-center">
|
|
200
204
|
<div>
|
|
201
205
|
{item.retail_price !== item.price && (
|
|
202
206
|
<div className="text-black-800 line-through text-xs min-w-max sm:text-sm">
|
|
@@ -3,7 +3,7 @@ import { CheckboxProps } from '@theme/components/types';
|
|
|
3
3
|
import { twMerge } from 'tailwind-merge';
|
|
4
4
|
|
|
5
5
|
const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>((props, ref) => {
|
|
6
|
-
const { children, checked, error, ...rest } = props;
|
|
6
|
+
const { children, checked = false, error, ...rest } = props;
|
|
7
7
|
|
|
8
8
|
return (
|
|
9
9
|
<label className={twMerge('flex flex-col text-xs', props.className)}>
|
|
@@ -12,7 +12,7 @@ const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>((props, ref) => {
|
|
|
12
12
|
type="checkbox"
|
|
13
13
|
{...rest}
|
|
14
14
|
ref={ref}
|
|
15
|
-
|
|
15
|
+
defaultChecked={checked}
|
|
16
16
|
className="w-4 h-4 shrink-0"
|
|
17
17
|
/>
|
|
18
18
|
{children && <span className="ml-2">{children}</span>}
|
|
@@ -1,17 +1,28 @@
|
|
|
1
1
|
import clsx from 'clsx';
|
|
2
|
-
import { forwardRef, FocusEvent, useState } from 'react';
|
|
2
|
+
import { forwardRef, FocusEvent, useState, Ref } from 'react';
|
|
3
3
|
import { Controller } from 'react-hook-form';
|
|
4
|
-
import
|
|
4
|
+
import { PatternFormat, PatternFormatProps } from 'react-number-format';
|
|
5
5
|
import { InputProps } from '@theme/components/types';
|
|
6
6
|
import { twMerge } from 'tailwind-merge';
|
|
7
7
|
|
|
8
|
+
const PatternFormatWithRef = forwardRef(
|
|
9
|
+
(props: PatternFormatProps, ref: Ref<HTMLInputElement>) => {
|
|
10
|
+
return <PatternFormat {...props} getInputRef={ref} />;
|
|
11
|
+
}
|
|
12
|
+
);
|
|
13
|
+
PatternFormatWithRef.displayName = 'PatternFormatWithRef';
|
|
14
|
+
|
|
8
15
|
export const Input = forwardRef<
|
|
9
16
|
HTMLInputElement,
|
|
10
17
|
InputProps &
|
|
11
18
|
Pick<
|
|
12
|
-
|
|
13
|
-
'
|
|
14
|
-
>
|
|
19
|
+
PatternFormatProps,
|
|
20
|
+
'mask' | 'allowEmptyFormatting' | 'onValueChange'
|
|
21
|
+
> & {
|
|
22
|
+
format?: string;
|
|
23
|
+
defaultValue?: string;
|
|
24
|
+
type?: string;
|
|
25
|
+
}
|
|
15
26
|
>((props, ref) => {
|
|
16
27
|
const [focused, setFocused] = useState(false);
|
|
17
28
|
const [hasValue, setHasValue] = useState(false);
|
|
@@ -37,6 +48,7 @@ export const Input = forwardRef<
|
|
|
37
48
|
),
|
|
38
49
|
props.className
|
|
39
50
|
);
|
|
51
|
+
|
|
40
52
|
const inputProps: any = {
|
|
41
53
|
id,
|
|
42
54
|
ref,
|
|
@@ -79,14 +91,14 @@ export const Input = forwardRef<
|
|
|
79
91
|
<Controller
|
|
80
92
|
name={props.name ?? ''}
|
|
81
93
|
control={props.control}
|
|
82
|
-
defaultValue={false}
|
|
83
94
|
render={({ field }) => (
|
|
84
|
-
<
|
|
95
|
+
<PatternFormatWithRef
|
|
85
96
|
format={format}
|
|
86
97
|
mask={mask ?? ''}
|
|
87
98
|
{...rest}
|
|
88
99
|
{...field}
|
|
89
100
|
{...inputProps}
|
|
101
|
+
type={props.type as 'text' | 'password' | 'tel'}
|
|
90
102
|
/>
|
|
91
103
|
)}
|
|
92
104
|
/>
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { useMemo } from 'react';
|
|
2
|
-
import
|
|
2
|
+
import { NumericFormat, NumericFormatProps } from 'react-number-format';
|
|
3
3
|
import { getCurrency } from '@akinon/next/utils';
|
|
4
4
|
import { PriceProps } from '@theme/types';
|
|
5
5
|
import { useLocalization } from '@akinon/next/hooks';
|
|
6
6
|
|
|
7
|
-
export const Price = (props:
|
|
7
|
+
export const Price = (props: NumericFormatProps & PriceProps) => {
|
|
8
8
|
const {
|
|
9
9
|
value,
|
|
10
10
|
currencyCode,
|
|
@@ -38,7 +38,7 @@ export const Price = (props: NumberFormatProps & PriceProps) => {
|
|
|
38
38
|
);
|
|
39
39
|
|
|
40
40
|
return (
|
|
41
|
-
<
|
|
41
|
+
<NumericFormat
|
|
42
42
|
value={useNegative ? `-${useNegativeSpace}${_value}` : _value}
|
|
43
43
|
{...{
|
|
44
44
|
[useCurrencyAfterPrice ? 'suffix' : 'prefix']: currency
|
|
@@ -31,7 +31,7 @@ interface Props {
|
|
|
31
31
|
onSubmit: (data: any) => void;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
const makeAddressFormSchema = (t, { phoneNumberLength }) =>
|
|
34
|
+
const makeAddressFormSchema = (t, { phoneNumberLength, postCodeLength }) =>
|
|
35
35
|
yup.object().shape({
|
|
36
36
|
title: yup.string().required(t('account.address_book.form.error.required')),
|
|
37
37
|
first_name: yup
|
|
@@ -65,8 +65,9 @@ const makeAddressFormSchema = (t, { phoneNumberLength }) =>
|
|
|
65
65
|
.max(255, t('account.address_book.form.error.line_max')),
|
|
66
66
|
postcode: yup
|
|
67
67
|
.string()
|
|
68
|
-
.
|
|
69
|
-
.
|
|
68
|
+
.transform((value: string) => value.replace(/_/g, '').replace(/ /g, ''))
|
|
69
|
+
.min(postCodeLength, t('account.address_book.form.error.postcode_min'))
|
|
70
|
+
.max(postCodeLength, t('account.address_book.form.error.postcode_max'))
|
|
70
71
|
.required(t('account.address_book.form.error.required')),
|
|
71
72
|
company_name: yup.string().nullable(),
|
|
72
73
|
tax_no: yup.string().nullable(),
|
|
@@ -80,7 +81,8 @@ export const AddressForm = (props: Props) => {
|
|
|
80
81
|
const { data, onSubmit } = props;
|
|
81
82
|
const config = useAppSelector((state) => state.config);
|
|
82
83
|
const addressFormSchema = makeAddressFormSchema(t, {
|
|
83
|
-
phoneNumberLength: config.user_phone_format.length
|
|
84
|
+
phoneNumberLength: config.user_phone_format.length,
|
|
85
|
+
postCodeLength: config.user_post_code_format.length
|
|
84
86
|
});
|
|
85
87
|
const {
|
|
86
88
|
register,
|
|
@@ -181,12 +183,22 @@ export const AddressForm = (props: Props) => {
|
|
|
181
183
|
if (data && country) {
|
|
182
184
|
reset({
|
|
183
185
|
...data,
|
|
184
|
-
is_corporate:
|
|
185
|
-
String(data.is_corporate) === AddressType.company ? 'true' : 'false' // TODO: Fix this! This hack for radio buttons can't be set to boolean value
|
|
186
|
+
is_corporate: String(data.is_corporate)
|
|
186
187
|
});
|
|
187
188
|
}
|
|
188
189
|
}, [data, country, reset]);
|
|
189
190
|
|
|
191
|
+
useEffect(() => {
|
|
192
|
+
if (selectedFormType !== AddressType.company) {
|
|
193
|
+
reset({
|
|
194
|
+
...watch(),
|
|
195
|
+
company_name: '',
|
|
196
|
+
tax_office: '',
|
|
197
|
+
tax_no: ''
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
}, [selectedFormType, reset, watch]);
|
|
201
|
+
|
|
190
202
|
return (
|
|
191
203
|
<form
|
|
192
204
|
onSubmit={handleSubmit(onSubmit)}
|
|
@@ -322,12 +334,15 @@ export const AddressForm = (props: Props) => {
|
|
|
322
334
|
)}
|
|
323
335
|
</label>
|
|
324
336
|
<Input
|
|
325
|
-
type="number"
|
|
326
337
|
label={t('account.address_book.form.post_code.placeholder')}
|
|
327
338
|
{...register('postcode')}
|
|
328
339
|
error={errors.postcode}
|
|
329
340
|
data-testid="address-form-post-code"
|
|
330
341
|
required
|
|
342
|
+
format={config.user_post_code_format.replaceAll(/\9/g, '#')}
|
|
343
|
+
control={control}
|
|
344
|
+
mask="_"
|
|
345
|
+
allowEmptyFormatting
|
|
331
346
|
/>
|
|
332
347
|
{selectedFormType === AddressType.company && (
|
|
333
348
|
<>
|
|
@@ -3,9 +3,9 @@ import {
|
|
|
3
3
|
Button,
|
|
4
4
|
FileInput,
|
|
5
5
|
Input,
|
|
6
|
+
Link,
|
|
6
7
|
LoaderSpinner,
|
|
7
|
-
Select
|
|
8
|
-
Link
|
|
8
|
+
Select
|
|
9
9
|
} from '@theme/components';
|
|
10
10
|
import { useSession } from 'next-auth/react';
|
|
11
11
|
import { useEffect, useState } from 'react';
|
|
@@ -45,7 +45,8 @@ const contactFormSchema = (t) =>
|
|
|
45
45
|
.when('subject', {
|
|
46
46
|
is: (value) => value === '2',
|
|
47
47
|
then: yup.string().required(t('account.contact.form.error.required'))
|
|
48
|
-
})
|
|
48
|
+
}),
|
|
49
|
+
file: yup.mixed()
|
|
49
50
|
});
|
|
50
51
|
|
|
51
52
|
const ContactForm = () => {
|
|
@@ -110,8 +111,18 @@ const ContactForm = () => {
|
|
|
110
111
|
resolver: yupResolver(contactFormSchema(t))
|
|
111
112
|
});
|
|
112
113
|
|
|
113
|
-
const onSubmit: SubmitHandler<ContactFormType> = (data) => {
|
|
114
|
-
|
|
114
|
+
const onSubmit: SubmitHandler<ContactFormType> = (data, event) => {
|
|
115
|
+
const formData = new FormData()
|
|
116
|
+
|
|
117
|
+
Object.keys(data ?? {}).forEach((key) => {
|
|
118
|
+
if (key === "file" && data[key]){
|
|
119
|
+
formData.append(key, data[key][0]);
|
|
120
|
+
} else if (data[key]) {
|
|
121
|
+
formData.append(key, data[key]);
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
sendContact(formData);
|
|
115
126
|
};
|
|
116
127
|
|
|
117
128
|
const handleChange = (e) => {
|
|
@@ -242,7 +253,12 @@ const ContactForm = () => {
|
|
|
242
253
|
<label className="text-xs text-gray-800 mb-2 block">
|
|
243
254
|
{t('account.contact.form.file.title')}
|
|
244
255
|
</label>
|
|
245
|
-
<FileInput
|
|
256
|
+
<FileInput
|
|
257
|
+
name="file"
|
|
258
|
+
title="file"
|
|
259
|
+
className="w-full mb-5"
|
|
260
|
+
{...register('file')}
|
|
261
|
+
/>
|
|
246
262
|
<Button type="submit" className="w-full font-medium">
|
|
247
263
|
{t('account.contact.form.submit_button')}
|
|
248
264
|
</Button>
|
|
@@ -30,7 +30,11 @@ const FavoriteProductsList = () => {
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
if (isLoading || isFetching) {
|
|
33
|
-
return
|
|
33
|
+
return (
|
|
34
|
+
<div className="flex items-center justify-center h-80">
|
|
35
|
+
<LoaderSpinner />
|
|
36
|
+
</div>
|
|
37
|
+
);
|
|
34
38
|
}
|
|
35
39
|
|
|
36
40
|
return (
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import clsx from 'clsx';
|
|
2
|
+
import { useAppDispatch } from '@akinon/next/redux/hooks';
|
|
3
|
+
import { Facet, FacetChoice } from '@akinon/next/types';
|
|
4
|
+
import { Accordion, Radio, Checkbox } from '../../../components';
|
|
5
|
+
import { WIDGET_TYPE } from '../../../types';
|
|
6
|
+
import { SizeFilter } from './size-filter';
|
|
7
|
+
import { toggleFacet } from '@theme/redux/reducers/category';
|
|
8
|
+
import { commonProductAttributes } from '@theme/settings';
|
|
9
|
+
import { useRouter } from '@akinon/next/hooks';
|
|
10
|
+
|
|
11
|
+
const COMPONENT_TYPES = {
|
|
12
|
+
[WIDGET_TYPE.category]: Radio,
|
|
13
|
+
[WIDGET_TYPE.multiselect]: Checkbox
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const sizeKey = commonProductAttributes.find(
|
|
17
|
+
(item) => item.translationKey === 'size'
|
|
18
|
+
).key;
|
|
19
|
+
|
|
20
|
+
interface Props {
|
|
21
|
+
facet: Facet;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const sortByPredefinedOrder = (
|
|
25
|
+
aLabel: string,
|
|
26
|
+
bLabel: string,
|
|
27
|
+
order: string[]
|
|
28
|
+
) => {
|
|
29
|
+
const aIndex = order.indexOf(aLabel);
|
|
30
|
+
const bIndex = order.indexOf(bLabel);
|
|
31
|
+
|
|
32
|
+
if (aIndex !== -1 && bIndex !== -1) return aIndex - bIndex;
|
|
33
|
+
if (aIndex !== -1) return -1;
|
|
34
|
+
if (bIndex !== -1) return 1;
|
|
35
|
+
|
|
36
|
+
return null;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
const sortByNumericValue = (aLabel: string, bLabel: string) => {
|
|
40
|
+
const aNum = parseInt(aLabel, 10);
|
|
41
|
+
const bNum = parseInt(bLabel, 10);
|
|
42
|
+
|
|
43
|
+
if (!isNaN(aNum) && !isNaN(bNum)) return aNum - bNum;
|
|
44
|
+
if (!isNaN(aNum)) return -1;
|
|
45
|
+
if (!isNaN(bNum)) return 1;
|
|
46
|
+
|
|
47
|
+
return null;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
const sortChoices = (
|
|
51
|
+
facetKey: string,
|
|
52
|
+
choices: FacetChoice[]
|
|
53
|
+
): FacetChoice[] => {
|
|
54
|
+
if (facetKey === sizeKey) {
|
|
55
|
+
const order = ['xs', 's', 'm', 'l', 'xl'];
|
|
56
|
+
|
|
57
|
+
return choices.sort((a, b) => {
|
|
58
|
+
const aLabel = a.label.toLowerCase();
|
|
59
|
+
const bLabel = b.label.toLowerCase();
|
|
60
|
+
|
|
61
|
+
const orderComparison = sortByPredefinedOrder(aLabel, bLabel, order);
|
|
62
|
+
if (orderComparison !== null) return orderComparison;
|
|
63
|
+
|
|
64
|
+
const numericComparison = sortByNumericValue(aLabel, bLabel);
|
|
65
|
+
if (numericComparison !== null) return numericComparison;
|
|
66
|
+
|
|
67
|
+
return aLabel.localeCompare(bLabel);
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
return choices;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
const getComponentByWidgetType = (widgetType: string, facetKey: string) => {
|
|
75
|
+
if (facetKey === sizeKey) {
|
|
76
|
+
return SizeFilter;
|
|
77
|
+
}
|
|
78
|
+
return COMPONENT_TYPES[widgetType] || COMPONENT_TYPES[WIDGET_TYPE.category];
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
export const FilterItem = ({ facet }: Props) => {
|
|
82
|
+
const dispatch = useAppDispatch();
|
|
83
|
+
const router = useRouter();
|
|
84
|
+
|
|
85
|
+
const handleSelectFilter = (choice: FacetChoice) => {
|
|
86
|
+
if (facet.key === 'category_ids') {
|
|
87
|
+
router.push(choice.url);
|
|
88
|
+
} else {
|
|
89
|
+
dispatch(toggleFacet({ facet, choice }));
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
const Component = getComponentByWidgetType(facet.widget_type, facet.key);
|
|
94
|
+
const choices = sortChoices(facet.key, [...facet.data.choices]);
|
|
95
|
+
|
|
96
|
+
return (
|
|
97
|
+
<Accordion
|
|
98
|
+
key={facet.key}
|
|
99
|
+
title={facet.name}
|
|
100
|
+
isCollapse={choices.some((choice) => choice.is_selected)}
|
|
101
|
+
dataTestId={`filter-${facet.name}`}
|
|
102
|
+
>
|
|
103
|
+
<div
|
|
104
|
+
className={clsx('flex gap-4', {
|
|
105
|
+
'flex-wrap flex-row': facet.key === sizeKey,
|
|
106
|
+
'flex-col': facet.key !== sizeKey
|
|
107
|
+
})}
|
|
108
|
+
>
|
|
109
|
+
{choices.map((choice, index) => (
|
|
110
|
+
<Component
|
|
111
|
+
key={choice.label}
|
|
112
|
+
data={choice}
|
|
113
|
+
name={facet.key}
|
|
114
|
+
onChange={() => facet.key !== sizeKey && handleSelectFilter(choice)}
|
|
115
|
+
onClick={() => facet.key === sizeKey && handleSelectFilter(choice)}
|
|
116
|
+
checked={choice.is_selected}
|
|
117
|
+
data-testid={`${choice.label.trim()}`}
|
|
118
|
+
>
|
|
119
|
+
{choice.label} (
|
|
120
|
+
<span
|
|
121
|
+
data-testid={`filter-count-${facet.name.toLowerCase()}-${index}`}
|
|
122
|
+
>
|
|
123
|
+
{choice.quantity}
|
|
124
|
+
</span>
|
|
125
|
+
)
|
|
126
|
+
</Component>
|
|
127
|
+
))}
|
|
128
|
+
</div>
|
|
129
|
+
</Accordion>
|
|
130
|
+
);
|
|
131
|
+
};
|
|
@@ -1,26 +1,14 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { WIDGET_TYPE } from '@theme/types';
|
|
4
3
|
import clsx from 'clsx';
|
|
5
4
|
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
import { useLocalization, useRouter } from '@akinon/next/hooks';
|
|
10
|
-
import { Facet, FacetChoice } from '@akinon/next/types';
|
|
5
|
+
import { Button, Icon } from '@theme/components';
|
|
6
|
+
import { useLocalization } from '@akinon/next/hooks';
|
|
11
7
|
import { useAppDispatch, useAppSelector } from '@akinon/next/redux/hooks';
|
|
12
|
-
import {
|
|
13
|
-
resetSelectedFacets,
|
|
14
|
-
toggleFacet
|
|
15
|
-
} from '@theme/redux/reducers/category';
|
|
8
|
+
import { resetSelectedFacets } from '@theme/redux/reducers/category';
|
|
16
9
|
import CategoryActiveFilters from '@theme/views/category/category-active-filters';
|
|
17
10
|
import { useMemo } from 'react';
|
|
18
|
-
import {
|
|
19
|
-
|
|
20
|
-
const COMPONENT_TYPES = {
|
|
21
|
-
[WIDGET_TYPE.category]: Radio,
|
|
22
|
-
[WIDGET_TYPE.multiselect]: Checkbox
|
|
23
|
-
};
|
|
11
|
+
import { FilterItem } from './filter-item';
|
|
24
12
|
|
|
25
13
|
interface Props {
|
|
26
14
|
isMenuOpen: boolean;
|
|
@@ -28,31 +16,11 @@ interface Props {
|
|
|
28
16
|
}
|
|
29
17
|
|
|
30
18
|
export const Filters = (props: Props) => {
|
|
31
|
-
const router = useRouter();
|
|
32
19
|
const facets = useAppSelector((state) => state.category.facets);
|
|
33
20
|
const dispatch = useAppDispatch();
|
|
34
21
|
const { t } = useLocalization();
|
|
35
22
|
const { isMenuOpen, setIsMenuOpen } = props;
|
|
36
23
|
|
|
37
|
-
const handleSelectFilter = ({
|
|
38
|
-
facet,
|
|
39
|
-
choice
|
|
40
|
-
}: {
|
|
41
|
-
facet: Facet;
|
|
42
|
-
choice: FacetChoice;
|
|
43
|
-
}) => {
|
|
44
|
-
if (facet.key === 'category_ids') {
|
|
45
|
-
router.push(choice.url);
|
|
46
|
-
} else {
|
|
47
|
-
dispatch(
|
|
48
|
-
toggleFacet({
|
|
49
|
-
facet,
|
|
50
|
-
choice
|
|
51
|
-
})
|
|
52
|
-
);
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
|
|
56
24
|
const haveFilter = useMemo(() => {
|
|
57
25
|
return (
|
|
58
26
|
facets.filter(
|
|
@@ -66,10 +34,6 @@ export const Filters = (props: Props) => {
|
|
|
66
34
|
dispatch(resetSelectedFacets());
|
|
67
35
|
};
|
|
68
36
|
|
|
69
|
-
const sizeKey = commonProductAttributes.find(
|
|
70
|
-
(item) => item.translationKey === 'size'
|
|
71
|
-
).key;
|
|
72
|
-
|
|
73
37
|
return (
|
|
74
38
|
<div
|
|
75
39
|
className={clsx(
|
|
@@ -88,71 +52,7 @@ export const Filters = (props: Props) => {
|
|
|
88
52
|
<span>{t('category.filters.ready_to_wear')}</span>
|
|
89
53
|
</div>
|
|
90
54
|
{facets.map((facet) => {
|
|
91
|
-
|
|
92
|
-
const choices = [...facet.data.choices];
|
|
93
|
-
|
|
94
|
-
if (facet.key === sizeKey) {
|
|
95
|
-
// If it's a size facet, use the custom size filter component
|
|
96
|
-
Component = SizeFilter;
|
|
97
|
-
|
|
98
|
-
const order = ['xs', 's', 'm', 'l', 'xl'];
|
|
99
|
-
choices.sort((a, b) => {
|
|
100
|
-
return (
|
|
101
|
-
order.indexOf(a.label.toLowerCase()) -
|
|
102
|
-
order.indexOf(b.label.toLowerCase())
|
|
103
|
-
);
|
|
104
|
-
});
|
|
105
|
-
} else {
|
|
106
|
-
Component =
|
|
107
|
-
COMPONENT_TYPES[facet.widget_type] ||
|
|
108
|
-
COMPONENT_TYPES[WIDGET_TYPE.category];
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
return (
|
|
112
|
-
<Accordion
|
|
113
|
-
key={facet.key}
|
|
114
|
-
title={facet.name}
|
|
115
|
-
isCollapse={choices.some((choice) => choice.is_selected)}
|
|
116
|
-
dataTestId={`filter-${facet.name}`}
|
|
117
|
-
>
|
|
118
|
-
<div
|
|
119
|
-
className={clsx(
|
|
120
|
-
'flex gap-4 flex-wrap',
|
|
121
|
-
facet.key === sizeKey ? 'flex-row' : 'flex-col' // TODO: This condition must be refactor to a better way
|
|
122
|
-
)}
|
|
123
|
-
>
|
|
124
|
-
{choices.map((choice, index) => (
|
|
125
|
-
<Component // TODO: This dynamic component can be a hook or higher order component so it props can be standardized
|
|
126
|
-
key={choice.label}
|
|
127
|
-
data={choice}
|
|
128
|
-
name={facet.key}
|
|
129
|
-
onChange={() => {
|
|
130
|
-
if (facet.key !== sizeKey) {
|
|
131
|
-
// TODO: This condition must be refactor to a better way
|
|
132
|
-
handleSelectFilter({ facet, choice });
|
|
133
|
-
}
|
|
134
|
-
}}
|
|
135
|
-
onClick={() => {
|
|
136
|
-
if (facet.key === sizeKey) {
|
|
137
|
-
// TODO: This condition must be refactor to a better way
|
|
138
|
-
handleSelectFilter({ facet, choice });
|
|
139
|
-
}
|
|
140
|
-
}}
|
|
141
|
-
checked={choice.is_selected}
|
|
142
|
-
data-testid={`${choice.label.trim()}`}
|
|
143
|
-
>
|
|
144
|
-
{choice.label} (
|
|
145
|
-
<span
|
|
146
|
-
data-testid={`filter-count-${facet.name.toLowerCase()}-${index}`}
|
|
147
|
-
>
|
|
148
|
-
{choice.quantity}
|
|
149
|
-
</span>
|
|
150
|
-
)
|
|
151
|
-
</Component>
|
|
152
|
-
))}
|
|
153
|
-
</div>
|
|
154
|
-
</Accordion>
|
|
155
|
-
);
|
|
55
|
+
return <FilterItem key={facet.key} facet={facet} />;
|
|
156
56
|
})}
|
|
157
57
|
<div className="lg:hidden">
|
|
158
58
|
<CategoryActiveFilters />
|
|
@@ -3,7 +3,19 @@
|
|
|
3
3
|
"display": "Default",
|
|
4
4
|
"compilerOptions": {
|
|
5
5
|
"baseUrl": "./src",
|
|
6
|
-
"paths": {
|
|
6
|
+
"paths": {
|
|
7
|
+
"@theme/*": ["./*"],
|
|
8
|
+
"@root/*": ["./app/[commerce]/[locale]/[currency]/*"],
|
|
9
|
+
"@product/*": ["./app/[commerce]/[locale]/[currency]/product/*"],
|
|
10
|
+
"@group-product/*": [
|
|
11
|
+
"./app/[commerce]/[locale]/[currency]/group-product/*"
|
|
12
|
+
],
|
|
13
|
+
"@category/*": ["./app/[commerce]/[locale]/[currency]/category/*"],
|
|
14
|
+
"@special-page/*": [
|
|
15
|
+
"./app/[commerce]/[locale]/[currency]/special-page/*"
|
|
16
|
+
],
|
|
17
|
+
"@flat-page/*": ["./app/[commerce]/[locale]/[currency]/flat-page/*"]
|
|
18
|
+
},
|
|
7
19
|
"allowSyntheticDefaultImports": true,
|
|
8
20
|
"composite": false,
|
|
9
21
|
"declaration": true,
|
|
@@ -40,7 +52,5 @@
|
|
|
40
52
|
".next/types/**/*.ts",
|
|
41
53
|
"../../packages/**/*"
|
|
42
54
|
],
|
|
43
|
-
"exclude": ["node_modules",
|
|
44
|
-
"../../packages/projectzero/app-template"
|
|
45
|
-
]
|
|
55
|
+
"exclude": ["node_modules", "../../packages/projectzero/app-template"]
|
|
46
56
|
}
|
package/commands/create.ts
CHANGED
|
@@ -3,6 +3,7 @@ import * as fs from 'fs';
|
|
|
3
3
|
import * as readline from 'readline';
|
|
4
4
|
import { slugify } from '../utils';
|
|
5
5
|
|
|
6
|
+
const { execSync } = require('child_process');
|
|
6
7
|
const loadingSpinner = require('loading-spinner');
|
|
7
8
|
|
|
8
9
|
interface Question {
|
|
@@ -139,7 +140,8 @@ export default async (): Promise<void> => {
|
|
|
139
140
|
const answers = await getAnswers();
|
|
140
141
|
const brandName =
|
|
141
142
|
answers.brandName === '.' ? path.basename(workingDir) : answers.brandName;
|
|
142
|
-
const projectDir = path.resolve(workingDir, slugify(brandName));
|
|
143
|
+
const projectDir = answers.brandName === '.' ? workingDir : path.resolve(workingDir, slugify(brandName));
|
|
144
|
+
const relativeProjectDir = answers.brandName === '.' ? '.' : slugify(brandName);
|
|
143
145
|
|
|
144
146
|
if (!fs.existsSync(projectDir)) {
|
|
145
147
|
fs.mkdirSync(projectDir, { recursive: true });
|
|
@@ -172,12 +174,34 @@ export default async (): Promise<void> => {
|
|
|
172
174
|
name: slugify(brandName)
|
|
173
175
|
});
|
|
174
176
|
|
|
177
|
+
|
|
178
|
+
console.log('\x1b[34m%s\x1b[0m', '\nš Installing packages...\n');
|
|
179
|
+
|
|
180
|
+
execSync(`cd ${relativeProjectDir} && yarn install`, { stdio: 'ignore' });
|
|
181
|
+
|
|
175
182
|
loadingSpinner.stop();
|
|
176
183
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
184
|
+
const successMessage = `
|
|
185
|
+
⨠${brandName} project is ready at \x1b[4m${projectDir}\x1b[0m
|
|
186
|
+
|
|
187
|
+
Within the directory, the following commands are available:
|
|
188
|
+
|
|
189
|
+
\x1b[35m$ yarn dev\x1b[0m
|
|
190
|
+
\x1b[32mLaunches the development server.\x1b[0m
|
|
191
|
+
|
|
192
|
+
\x1b[35m$ yarn build\x1b[0m
|
|
193
|
+
\x1b[32mCompiles the app into static files for production.\x1b[0m
|
|
194
|
+
|
|
195
|
+
\x1b[35m$ yarn start\x1b[0m
|
|
196
|
+
\x1b[32mRuns the production server.\x1b[0m
|
|
197
|
+
`;
|
|
198
|
+
|
|
199
|
+
const getStartedMessage = answers.brandName === '.'
|
|
200
|
+
? 'To get started, you can type:\n\n \x1b[35m$ yarn dev\x1b[0m\n'
|
|
201
|
+
: `To get started, you can type:\n\n \x1b[35m$ cd ${relativeProjectDir}\x1b[0m\n \x1b[35m$ yarn dev\x1b[0m\n`;
|
|
181
202
|
|
|
203
|
+
console.log('\x1b[32m%s\x1b[0m', successMessage);
|
|
204
|
+
console.log('\x1b[36m%s\x1b[0m', getStartedMessage);
|
|
205
|
+
console.log('\x1b[33m%s\x1b[0m', 'Project setup is complete\n');
|
|
182
206
|
console.log('\x1b[33m%s\x1b[0m', 'Project Zero - Akinon\n');
|
|
183
207
|
};
|
package/dist/commands/create.js
CHANGED
|
@@ -39,6 +39,7 @@ const path_1 = __importDefault(require("path"));
|
|
|
39
39
|
const fs = __importStar(require("fs"));
|
|
40
40
|
const readline = __importStar(require("readline"));
|
|
41
41
|
const utils_1 = require("../utils");
|
|
42
|
+
const { execSync } = require('child_process');
|
|
42
43
|
const loadingSpinner = require('loading-spinner');
|
|
43
44
|
const workingDir = path_1.default.resolve(process.cwd());
|
|
44
45
|
const rl = readline.createInterface({
|
|
@@ -131,7 +132,8 @@ exports.default = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
131
132
|
}
|
|
132
133
|
const answers = yield getAnswers();
|
|
133
134
|
const brandName = answers.brandName === '.' ? path_1.default.basename(workingDir) : answers.brandName;
|
|
134
|
-
const projectDir = path_1.default.resolve(workingDir, (0, utils_1.slugify)(brandName));
|
|
135
|
+
const projectDir = answers.brandName === '.' ? workingDir : path_1.default.resolve(workingDir, (0, utils_1.slugify)(brandName));
|
|
136
|
+
const relativeProjectDir = answers.brandName === '.' ? '.' : (0, utils_1.slugify)(brandName);
|
|
135
137
|
if (!fs.existsSync(projectDir)) {
|
|
136
138
|
fs.mkdirSync(projectDir, { recursive: true });
|
|
137
139
|
}
|
|
@@ -153,7 +155,28 @@ exports.default = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
153
155
|
updateFileContents(path_1.default.join(projectDir, 'package.json'), {
|
|
154
156
|
name: (0, utils_1.slugify)(brandName)
|
|
155
157
|
});
|
|
158
|
+
console.log('\x1b[34m%s\x1b[0m', '\nš Installing packages...\n');
|
|
159
|
+
execSync(`cd ${relativeProjectDir} && yarn install`, { stdio: 'ignore' });
|
|
156
160
|
loadingSpinner.stop();
|
|
157
|
-
|
|
161
|
+
const successMessage = `
|
|
162
|
+
⨠${brandName} project is ready at \x1b[4m${projectDir}\x1b[0m
|
|
163
|
+
|
|
164
|
+
Within the directory, the following commands are available:
|
|
165
|
+
|
|
166
|
+
\x1b[35m$ yarn dev\x1b[0m
|
|
167
|
+
\x1b[32mLaunches the development server.\x1b[0m
|
|
168
|
+
|
|
169
|
+
\x1b[35m$ yarn build\x1b[0m
|
|
170
|
+
\x1b[32mCompiles the app into static files for production.\x1b[0m
|
|
171
|
+
|
|
172
|
+
\x1b[35m$ yarn start\x1b[0m
|
|
173
|
+
\x1b[32mRuns the production server.\x1b[0m
|
|
174
|
+
`;
|
|
175
|
+
const getStartedMessage = answers.brandName === '.'
|
|
176
|
+
? 'To get started, you can type:\n\n \x1b[35m$ yarn dev\x1b[0m\n'
|
|
177
|
+
: `To get started, you can type:\n\n \x1b[35m$ cd ${relativeProjectDir}\x1b[0m\n \x1b[35m$ yarn dev\x1b[0m\n`;
|
|
178
|
+
console.log('\x1b[32m%s\x1b[0m', successMessage);
|
|
179
|
+
console.log('\x1b[36m%s\x1b[0m', getStartedMessage);
|
|
180
|
+
console.log('\x1b[33m%s\x1b[0m', 'Project setup is complete\n');
|
|
158
181
|
console.log('\x1b[33m%s\x1b[0m', 'Project Zero - Akinon\n');
|
|
159
182
|
});
|