diff --git a/CHANGELOG.md b/CHANGELOG.md index a2b5ee86..3457d3f9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Disable editing country for existing address to be compliant with Profile V2 structure. +- Fix the validations rules for Saudi Arabia. + +- Enable autocomplete postal code from reference field for ARE [[KI#312132](https://vtexhelp.zendesk.com/agent/tickets/312132)]. + +## [4.24.4] - 2024-07-05 + + ## [4.24.3] - 2024-06-06 ### Fixed @@ -954,4 +961,4 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. [Unreleased]: https://github.com/vtex/address-form/compare/v4.23.2...HEAD [4.23.2]: https://github.com/vtex/address-form/compare/v4.23.1...v4.23.2 [4.23.1]: https://github.com/vtex/address-form/compare/v4.23.0...v4.23.1 -[4.23.0]: https://github.com/vtex/address-form/compare/v4.22.8...v4.23.0 \ No newline at end of file +[4.23.0]: https://github.com/vtex/address-form/compare/v4.22.8...v4.23.0 diff --git a/manifest.json b/manifest.json index 9a68ed7d..d99ad064 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "name": "address-form", "vendor": "vtex", - "version": "4.24.3", + "version": "4.24.4", "title": "address-form React component", "description": "address-form React component", "defaultLocale": "en", diff --git a/messages/ar.json b/messages/ar.json index bb6fec6e..4809c1fe 100644 --- a/messages/ar.json +++ b/messages/ar.json @@ -67,6 +67,7 @@ "address-form.error.ERROR_GOOGLE_ADDRESS": "عنوان غير صالح.", "address-form.error.generic": "حقل غير صالح.", "address-form.field.addressQuery": "العنوان", + "address-form.field.emirates": "إمارات", "address-form.field.notApplicable": "غير متاح", "address-form.field.noNumber": "بدون أرقام", "address-form.field.country": "البلد", diff --git a/messages/bg.json b/messages/bg.json index 246ef270..bacf6cd7 100644 --- a/messages/bg.json +++ b/messages/bg.json @@ -67,6 +67,7 @@ "address-form.error.ERROR_GOOGLE_ADDRESS": "Невалиден адрес.", "address-form.error.generic": "Невалидно поле.", "address-form.field.addressQuery": "Адрес", + "address-form.field.emirates": "إمارات", "address-form.field.notApplicable": "Няма", "address-form.field.noNumber": "Няма номер", "address-form.field.country": "Държава", diff --git a/messages/ca.json b/messages/ca.json index 5813a12f..23f3c1c5 100644 --- a/messages/ca.json +++ b/messages/ca.json @@ -67,6 +67,7 @@ "address-form.error.ERROR_GOOGLE_ADDRESS": "Adreça no vàlida.", "address-form.error.generic": "Camp no vàlid.", "address-form.field.addressQuery": "Adreça", + "address-form.field.emirates": "Emirats", "address-form.field.notApplicable": "No escau", "address-form.field.noNumber": "Sense número", "address-form.field.country": "País", diff --git a/messages/context.json b/messages/context.json index ed17fafa..0a74fcd0 100644 --- a/messages/context.json +++ b/messages/context.json @@ -35,6 +35,7 @@ "address-form.error.ERROR_GOOGLE_ADDRESS": "Invalid address.", "address-form.error.generic": "Invalid field.", "address-form.field.addressQuery": "Address", + "address-form.field.emirates": "Emirates", "address-form.field.notApplicable": "N/A", "address-form.field.noNumber": "No number", "address-form.field.country": "Country", diff --git a/messages/cs.json b/messages/cs.json index 5871de2b..3d21d1a7 100644 --- a/messages/cs.json +++ b/messages/cs.json @@ -67,6 +67,7 @@ "address-form.error.ERROR_GOOGLE_ADDRESS": "Neplatná adresa.", "address-form.error.generic": "Neplatné pole.", "address-form.field.addressQuery": "Adresa", + "address-form.field.emirates": "Emiráty", "address-form.field.notApplicable": "N/A", "address-form.field.noNumber": "Žádné číslo", "address-form.field.country": "Země", diff --git a/messages/da.json b/messages/da.json index 100d8859..59e7cbe3 100644 --- a/messages/da.json +++ b/messages/da.json @@ -67,6 +67,7 @@ "address-form.error.ERROR_GOOGLE_ADDRESS": "Ugyldig adresse.", "address-form.error.generic": "Ugyldigt felt.", "address-form.field.addressQuery": "Adresse", + "address-form.field.emirates": "Emiraterne", "address-form.field.notApplicable": "Ikke tilgængelig", "address-form.field.noNumber": "Intet nummer", "address-form.field.country": "Land", diff --git a/messages/de.json b/messages/de.json index 0caf1c0b..f4b8442c 100644 --- a/messages/de.json +++ b/messages/de.json @@ -67,6 +67,7 @@ "address-form.error.ERROR_GOOGLE_ADDRESS": "Ungültige Adresse.", "address-form.error.generic": "Ungültiges Feld.", "address-form.field.addressQuery": "Adresse", + "address-form.field.emirates": "Emirate", "address-form.field.notApplicable": "N/A", "address-form.field.noNumber": "Keine Nummer", "address-form.field.country": "Land", diff --git a/messages/el.json b/messages/el.json index 957881a2..0517d433 100644 --- a/messages/el.json +++ b/messages/el.json @@ -67,6 +67,7 @@ "address-form.error.ERROR_GOOGLE_ADDRESS": "Άκυρη διεύθυνση.", "address-form.error.generic": "Άκυρο πεδίο.", "address-form.field.addressQuery": "Διεύθυνση", + "address-form.field.emirates": "Ηνωμένα Αραβικά Εμιράτα", "address-form.field.notApplicable": "Κ/Α", "address-form.field.noNumber": "Δεν υπάρχει αριθμός", "address-form.field.country": "Χώρα", diff --git a/messages/en.json b/messages/en.json index 8b80bcfc..8a4734d7 100644 --- a/messages/en.json +++ b/messages/en.json @@ -67,6 +67,7 @@ "address-form.error.ERROR_GOOGLE_ADDRESS": "Invalid address.", "address-form.error.generic": "Invalid field.", "address-form.field.addressQuery": "Address", + "address-form.field.emirates": "Emirates", "address-form.field.notApplicable": "N/A", "address-form.field.noNumber": "No number", "address-form.field.country": "Country", diff --git a/messages/es.json b/messages/es.json index 834a38be..f50158e5 100644 --- a/messages/es.json +++ b/messages/es.json @@ -67,6 +67,7 @@ "address-form.error.ERROR_GOOGLE_ADDRESS": "Dirección inválida.", "address-form.error.generic": "Campo inválido.", "address-form.field.addressQuery": "Dirección", + "address-form.field.emirates": "Emiratos", "address-form.field.notApplicable": "S/N", "address-form.field.noNumber": "Sin número", "address-form.field.country": "País", diff --git a/messages/fi.json b/messages/fi.json index 066809d7..0b51330f 100644 --- a/messages/fi.json +++ b/messages/fi.json @@ -67,6 +67,7 @@ "address-form.error.ERROR_GOOGLE_ADDRESS": "Virheellinen osoite.", "address-form.error.generic": "Virheellinen kenttä.", "address-form.field.addressQuery": "Osoite", + "address-form.field.emirates": "Emiraatit", "address-form.field.notApplicable": "–", "address-form.field.noNumber": "Ei numeroa", "address-form.field.country": "Maa", diff --git a/messages/fr.json b/messages/fr.json index 5220b435..6dc28b60 100644 --- a/messages/fr.json +++ b/messages/fr.json @@ -67,6 +67,7 @@ "address-form.error.ERROR_GOOGLE_ADDRESS": "Adresse non valable.", "address-form.error.generic": "Champ non valable.", "address-form.field.addressQuery": "Adresse", + "address-form.field.emirates": "Émirats", "address-form.field.notApplicable": "N/A", "address-form.field.noNumber": "Pas de numéro", "address-form.field.country": "Pays", diff --git a/messages/hu.json b/messages/hu.json index 975167c7..75e0c7e4 100644 --- a/messages/hu.json +++ b/messages/hu.json @@ -67,6 +67,7 @@ "address-form.error.ERROR_GOOGLE_ADDRESS": "Érvénytelen cím.", "address-form.error.generic": "Érvénytelen mező.", "address-form.field.addressQuery": "Cím", + "address-form.field.emirates": "Emirátusok", "address-form.field.notApplicable": "Nem elérhető", "address-form.field.noNumber": "Nincs szám", "address-form.field.country": "Ország", diff --git a/messages/id.json b/messages/id.json index 7d9d6d75..40e57595 100644 --- a/messages/id.json +++ b/messages/id.json @@ -67,6 +67,7 @@ "address-form.error.ERROR_GOOGLE_ADDRESS": "Alamat tidak valid.", "address-form.error.generic": "Bidang tidak valid.", "address-form.field.addressQuery": "Alamat", + "address-form.field.emirates": "Emirat", "address-form.field.notApplicable": "Tidak Ada", "address-form.field.noNumber": "Tidak ada angka", "address-form.field.country": "Negara", diff --git a/messages/it.json b/messages/it.json index d915822d..e8a041f1 100755 --- a/messages/it.json +++ b/messages/it.json @@ -67,6 +67,7 @@ "address-form.error.ERROR_GOOGLE_ADDRESS": "Indirizzo non valido.", "address-form.error.generic": "Campo non valido.", "address-form.field.addressQuery": "Indirizzo", + "address-form.field.emirates": "Emirati", "address-form.field.notApplicable": "N/D", "address-form.field.noNumber": "Nessun numero", "address-form.field.country": "Nazione", diff --git a/messages/ko.json b/messages/ko.json index cbfe34cb..0b7bdcde 100644 --- a/messages/ko.json +++ b/messages/ko.json @@ -67,6 +67,7 @@ "address-form.error.ERROR_GOOGLE_ADDRESS": "잘못된 주소입니다.", "address-form.error.generic": "잘못된 필드입니다.", "address-form.field.addressQuery": "주소", + "address-form.field.emirates": "아랍에미리트", "address-form.field.notApplicable": "해당 없음", "address-form.field.noNumber": "번호 없음", "address-form.field.country": "국가", diff --git a/messages/nl.json b/messages/nl.json index a2da2580..856c3228 100644 --- a/messages/nl.json +++ b/messages/nl.json @@ -67,6 +67,7 @@ "address-form.error.ERROR_GOOGLE_ADDRESS": "Ongeldig adres.", "address-form.error.generic": "Ongeldig veld.", "address-form.field.addressQuery": "Adres", + "address-form.field.emirates": "Emiraten", "address-form.field.notApplicable": "NVT", "address-form.field.noNumber": "Geen nummer", "address-form.field.country": "Land", diff --git a/messages/pl.json b/messages/pl.json index a7e86a76..6555f33a 100644 --- a/messages/pl.json +++ b/messages/pl.json @@ -67,6 +67,7 @@ "address-form.error.ERROR_GOOGLE_ADDRESS": "Nieprawidłowy adres.", "address-form.error.generic": "Nieprawidłowe pole.", "address-form.field.addressQuery": "Adres", + "address-form.field.emirates": "Emiraty", "address-form.field.notApplicable": "B/D", "address-form.field.noNumber": "Brak numeru", "address-form.field.country": "Kraj", diff --git a/messages/pt.json b/messages/pt.json index 2ebde229..b09adb21 100644 --- a/messages/pt.json +++ b/messages/pt.json @@ -67,6 +67,7 @@ "address-form.error.ERROR_GOOGLE_ADDRESS": "Endereço inválido.", "address-form.error.generic": "Campo inválido.", "address-form.field.addressQuery": "Endereço", + "address-form.field.emirates": "Emirados", "address-form.field.notApplicable": "S/N", "address-form.field.noNumber": "Sem número", "address-form.field.country": "País", diff --git a/messages/ro.json b/messages/ro.json index aed29f11..70928fab 100644 --- a/messages/ro.json +++ b/messages/ro.json @@ -67,6 +67,7 @@ "address-form.error.ERROR_GOOGLE_ADDRESS": "Adresă invalidă.", "address-form.error.generic": "Câmp invalid.", "address-form.field.addressQuery": "Adresă", + "address-form.field.emirates": "Emiratele Arabe Unite", "address-form.field.notApplicable": "Nu se aplică", "address-form.field.noNumber": "Fără număr", "address-form.field.country": "Țara", diff --git a/messages/ru.json b/messages/ru.json index d42cbb73..de6291eb 100644 --- a/messages/ru.json +++ b/messages/ru.json @@ -67,6 +67,7 @@ "address-form.error.ERROR_GOOGLE_ADDRESS": "Недействительный адрес.", "address-form.error.generic": "Недействительное поле.", "address-form.field.addressQuery": "Название улицы", + "address-form.field.emirates": "Эмираты", "address-form.field.notApplicable": "Нет", "address-form.field.noNumber": "Без номера", "address-form.field.country": "Страна", diff --git a/messages/sk.json b/messages/sk.json index 6ab4df3c..3aa0b16e 100644 --- a/messages/sk.json +++ b/messages/sk.json @@ -67,6 +67,7 @@ "address-form.error.ERROR_GOOGLE_ADDRESS": "Neplatná adresa.", "address-form.error.generic": "Neplatné pole.", "address-form.field.addressQuery": "Adresa", + "address-form.field.emirates": "Emiráty", "address-form.field.notApplicable": "Nevzťahuje sa", "address-form.field.noNumber": "Žiadne číslo", "address-form.field.country": "Krajina", diff --git a/messages/sl.json b/messages/sl.json index 768a1cac..afce6d54 100644 --- a/messages/sl.json +++ b/messages/sl.json @@ -67,6 +67,7 @@ "address-form.error.ERROR_GOOGLE_ADDRESS": "Neveljaven naslov.", "address-form.error.generic": "Neveljavno polje.", "address-form.field.addressQuery": "Naslov", + "address-form.field.emirates": "Emirati", "address-form.field.notApplicable": "Ni na voljo", "address-form.field.noNumber": "Ni števila", "address-form.field.country": "Država", diff --git a/messages/sv.json b/messages/sv.json index 6877ea1e..bfef81a8 100644 --- a/messages/sv.json +++ b/messages/sv.json @@ -67,6 +67,7 @@ "address-form.error.ERROR_GOOGLE_ADDRESS": "Ogiltig adress.", "address-form.error.generic": "Ogiltigt fält.", "address-form.field.addressQuery": "Adress", + "address-form.field.emirates": "Förenade Arabemiraten", "address-form.field.notApplicable": "Ej tillgängligt", "address-form.field.noNumber": "Inga nummer", "address-form.field.country": "Land", diff --git a/messages/th.json b/messages/th.json index d56b6dbc..28d2e0f2 100644 --- a/messages/th.json +++ b/messages/th.json @@ -67,6 +67,7 @@ "address-form.error.ERROR_GOOGLE_ADDRESS": "ที่อยู่ไม่ถูกต้อง", "address-form.error.generic": "ฟิลด์ข้อมูลไม่ถูกต้อง", "address-form.field.addressQuery": "ที่อยู่", + "address-form.field.emirates": "อาหรับเอมิเรตส์", "address-form.field.notApplicable": "N/A", "address-form.field.noNumber": "ไม่มีเลขที่", "address-form.field.country": "ประเทศ", diff --git a/messages/uk.json b/messages/uk.json index 24a9d303..c77bd3ee 100644 --- a/messages/uk.json +++ b/messages/uk.json @@ -67,6 +67,7 @@ "address-form.error.ERROR_GOOGLE_ADDRESS": "Недійсна адреса.", "address-form.error.generic": "Недійсне значення поля.", "address-form.field.addressQuery": "Адреса", + "address-form.field.emirates": "Емірати", "address-form.field.notApplicable": "Не доступно", "address-form.field.noNumber": "Номер відсутній", "address-form.field.country": "Країна", diff --git a/react/country/ARE.js b/react/country/ARE.js index be458917..d0ac0a16 100644 --- a/react/country/ARE.js +++ b/react/country/ARE.js @@ -1,9 +1,23 @@ -import { POSTAL_CODE } from '../constants' +import { firstLevelPostalCodes } from '../transforms/postalCodes' +import { getOneLevel } from '../transforms/addressFieldsOptions' +import { POSTAL_CODE , ONE_LEVEL} from '../constants' + +const emiratesPostalCodeData = { + 'Abu Dhabi': '00000', + Dubai: '00000', + Sharjah: '00000', + Ajman: '00000', + 'Umm Al Quwain': '00000', + 'Ras Al Khaimah': '00000', + Fujairah: '00000', +} export default { country: 'ARE', abbr: 'AE', - postalCodeFrom: POSTAL_CODE, + postalCodeFrom: ONE_LEVEL, + postalCodeLevels: ['reference'], + firstLevelPostalCodes: firstLevelPostalCodes(emiratesPostalCodeData), fields: [ { hidden: true, @@ -42,11 +56,12 @@ export default { size: 'xlarge', }, { - hidden: true, name: 'reference', maxLength: 750, - label: 'reference', + label: 'emirates', size: 'xlarge', + level: 1, + options: getOneLevel(emiratesPostalCodeData), }, { hidden: true, diff --git a/react/country/SAU.js b/react/country/SAU.js new file mode 100644 index 00000000..2c1bf852 --- /dev/null +++ b/react/country/SAU.js @@ -0,0 +1,158 @@ +import { POSTAL_CODE } from '../constants' + +export default { + country: 'SAU', + abbr: 'SA', + postalCodeFrom: POSTAL_CODE, + fields: [ + { + hidden: true, + name: 'country', + maxLength: 100, + label: 'country', + size: 'medium', + }, + { + name: 'postalCode', + maxLength: 5, + label: 'postalCode', + required: true, + mask: '99999', + regex: '^\\d{5}$', + size: 'small', + autoComplete: 'nope', + postalCodeAPI: false, + }, + { + name: 'street', + label: 'addressLine1', + required: true, + size: 'xlarge', + }, + { + name: 'number', + maxLength: 750, + label: 'number', + size: 'small', + autoComplete: 'nope', + notApplicable: false, + }, + { + name: 'complement', + maxLength: 750, + label: 'addressLine2', + size: 'xlarge', + }, + { + hidden: true, + name: 'reference', + maxLength: 750, + label: 'reference', + size: 'xlarge', + }, + { + hidden: true, + name: 'neighborhood', + maxLength: 100, + label: 'neighborhood', + size: 'large', + }, + { + name: 'city', + maxLength: 100, + label: 'city', + required: true, + size: 'large', + }, + { + name: 'state', + maxLength: 100, + label: 'state', + required: true, + size: 'large', + }, + { + name: 'receiverName', + elementName: 'receiver', + maxLength: 750, + label: 'receiverName', + size: 'xlarge', + required: true, + }, + ], + geolocation: { + postalCode: { + valueIn: 'long_name', + types: ['postal_code'], + required: false, + }, + + number: { + valueIn: 'long_name', + types: ['street_number'], + required: false, + notApplicable: false, + }, + + street: { valueIn: 'long_name', types: ['route'] }, + + neighborhood: { + valueIn: 'long_name', + types: [ + 'neighborhood', + 'sublocality_level_1', + 'sublocality_level_2', + 'sublocality_level_3', + 'sublocality_level_4', + 'sublocality_level_5', + ], + }, + + state: { + valueIn: 'long_name', + types: ['administrative_area_level_1'], + }, + + city: { + valueIn: 'long_name', + types: ['political', 'locality'], + }, + + receiverName: { + required: true, + }, + }, + summary: [ + [ + { + name: 'street', + }, + { + delimiter: ' ', + name: 'number', + }, + { + delimiter: ', ', + name: 'complement', + }, + ], + [ + { + name: 'neighborhood', + delimiterAfter: ' - ', + }, + { + name: 'city', + }, + { + delimiter: ' - ', + name: 'state', + }, + ], + [ + { + name: 'postalCode', + }, + ], + ], +}