@akinon/projectzero 1.37.0-rc.2 → 1.37.0-rc.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# projectzeronext
|
|
2
2
|
|
|
3
|
+
## 1.37.0-rc.3
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 75080fd: ZERO-2630: Add max limit to postcode area
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [75080fd]
|
|
12
|
+
- @akinon/next@1.37.0-rc.3
|
|
13
|
+
- @akinon/pz-b2b@1.37.0-rc.3
|
|
14
|
+
- @akinon/pz-gpay@1.37.0-rc.3
|
|
15
|
+
- @akinon/pz-masterpass@1.37.0-rc.3
|
|
16
|
+
- @akinon/pz-one-click-checkout@1.37.0-rc.3
|
|
17
|
+
- @akinon/pz-otp@1.37.0-rc.3
|
|
18
|
+
- @akinon/pz-pay-on-delivery@1.37.0-rc.3
|
|
19
|
+
|
|
3
20
|
## 1.37.0-rc.2
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "projectzeronext",
|
|
3
|
-
"version": "1.37.0-rc.
|
|
3
|
+
"version": "1.37.0-rc.3",
|
|
4
4
|
"private": true,
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"scripts": {
|
|
@@ -22,13 +22,13 @@
|
|
|
22
22
|
"prestart": "pz-prestart"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@akinon/next": "1.37.0-rc.
|
|
26
|
-
"@akinon/pz-b2b": "1.37.0-rc.
|
|
27
|
-
"@akinon/pz-gpay": "1.37.0-rc.
|
|
28
|
-
"@akinon/pz-masterpass": "1.37.0-rc.
|
|
29
|
-
"@akinon/pz-one-click-checkout": "1.37.0-rc.
|
|
30
|
-
"@akinon/pz-otp": "1.37.0-rc.
|
|
31
|
-
"@akinon/pz-pay-on-delivery": "1.37.0-rc.
|
|
25
|
+
"@akinon/next": "1.37.0-rc.3",
|
|
26
|
+
"@akinon/pz-b2b": "1.37.0-rc.3",
|
|
27
|
+
"@akinon/pz-gpay": "1.37.0-rc.3",
|
|
28
|
+
"@akinon/pz-masterpass": "1.37.0-rc.3",
|
|
29
|
+
"@akinon/pz-one-click-checkout": "1.37.0-rc.3",
|
|
30
|
+
"@akinon/pz-otp": "1.37.0-rc.3",
|
|
31
|
+
"@akinon/pz-pay-on-delivery": "1.37.0-rc.3",
|
|
32
32
|
"@hookform/resolvers": "2.9.0",
|
|
33
33
|
"@next/third-parties": "14.1.0",
|
|
34
34
|
"@react-google-maps/api": "2.17.1",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"yup": "0.32.11"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@akinon/eslint-plugin-projectzero": "1.37.0-rc.
|
|
56
|
+
"@akinon/eslint-plugin-projectzero": "1.37.0-rc.3",
|
|
57
57
|
"@semantic-release/changelog": "6.0.2",
|
|
58
58
|
"@semantic-release/exec": "6.0.3",
|
|
59
59
|
"@semantic-release/git": "10.0.1",
|
|
@@ -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,
|
|
@@ -322,12 +324,15 @@ export const AddressForm = (props: Props) => {
|
|
|
322
324
|
)}
|
|
323
325
|
</label>
|
|
324
326
|
<Input
|
|
325
|
-
type="number"
|
|
326
327
|
label={t('account.address_book.form.post_code.placeholder')}
|
|
327
328
|
{...register('postcode')}
|
|
328
329
|
error={errors.postcode}
|
|
329
330
|
data-testid="address-form-post-code"
|
|
330
331
|
required
|
|
332
|
+
format={config.user_post_code_format.replaceAll(/\9/g, '#')}
|
|
333
|
+
control={control}
|
|
334
|
+
mask="_"
|
|
335
|
+
allowEmptyFormatting
|
|
331
336
|
/>
|
|
332
337
|
{selectedFormType === AddressType.company && (
|
|
333
338
|
<>
|