@akinon/projectzero 1.37.0-rc.2 → 1.37.0-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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # @akinon/projectzero
2
2
 
3
+ ## 1.37.0-rc.4
4
+
5
+ ## 1.37.0-rc.3
6
+
3
7
  ## 1.37.0-rc.2
4
8
 
5
9
  ## 1.37.0-rc.1
@@ -1,5 +1,35 @@
1
1
  # projectzeronext
2
2
 
3
+ ## 1.37.0-rc.4
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [05b1fe1]
8
+ - @akinon/next@1.37.0-rc.4
9
+ - @akinon/pz-b2b@1.37.0-rc.4
10
+ - @akinon/pz-gpay@1.37.0-rc.4
11
+ - @akinon/pz-masterpass@1.37.0-rc.4
12
+ - @akinon/pz-one-click-checkout@1.37.0-rc.4
13
+ - @akinon/pz-otp@1.37.0-rc.4
14
+ - @akinon/pz-pay-on-delivery@1.37.0-rc.4
15
+
16
+ ## 1.37.0-rc.3
17
+
18
+ ### Minor Changes
19
+
20
+ - 75080fd: ZERO-2630: Add max limit to postcode area
21
+
22
+ ### Patch Changes
23
+
24
+ - Updated dependencies [75080fd]
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
+
3
33
  ## 1.37.0-rc.2
4
34
 
5
35
  ### Patch Changes
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "projectzeronext",
3
- "version": "1.37.0-rc.2",
3
+ "version": "1.37.0-rc.4",
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.2",
26
- "@akinon/pz-b2b": "1.37.0-rc.2",
27
- "@akinon/pz-gpay": "1.37.0-rc.2",
28
- "@akinon/pz-masterpass": "1.37.0-rc.2",
29
- "@akinon/pz-one-click-checkout": "1.37.0-rc.2",
30
- "@akinon/pz-otp": "1.37.0-rc.2",
31
- "@akinon/pz-pay-on-delivery": "1.37.0-rc.2",
25
+ "@akinon/next": "1.37.0-rc.4",
26
+ "@akinon/pz-b2b": "1.37.0-rc.4",
27
+ "@akinon/pz-gpay": "1.37.0-rc.4",
28
+ "@akinon/pz-masterpass": "1.37.0-rc.4",
29
+ "@akinon/pz-one-click-checkout": "1.37.0-rc.4",
30
+ "@akinon/pz-otp": "1.37.0-rc.4",
31
+ "@akinon/pz-pay-on-delivery": "1.37.0-rc.4",
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.2",
56
+ "@akinon/eslint-plugin-projectzero": "1.37.0-rc.4",
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
- .min(5, t('account.address_book.form.error.postcode_min'))
69
- .max(5, t('account.address_book.form.error.postcode_max'))
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
  <>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akinon/projectzero",
3
- "version": "1.37.0-rc.2",
3
+ "version": "1.37.0-rc.4",
4
4
  "private": false,
5
5
  "description": "CLI tool to manage your Project Zero Next project",
6
6
  "bin": {