Skip to content

Commit

Permalink
Merge pull request #490 from vtex/update/i18n-greece-4x
Browse files Browse the repository at this point in the history
Add Greece country rules
  • Loading branch information
sheilagomes authored Dec 21, 2022
2 parents 7dc784b + 4f67040 commit 2763416
Show file tree
Hide file tree
Showing 3 changed files with 162 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

### Added

- Greece country rules.

## [4.15.6] - 2022-08-08

### Removed
Expand Down
2 changes: 2 additions & 0 deletions react/countries.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import ECU from './country/ECU'
import ESP from './country/ESP'
import FRA from './country/FRA'
import GBR from './country/GBR'
import GRC from './country/GRC'
import GTM from './country/GTM'
import IDN from './country/IDN'
import KOR from './country/KOR'
Expand Down Expand Up @@ -39,6 +40,7 @@ export default {
ESP,
FRA,
GBR,
GRC,
GTM,
IDN,
KOR,
Expand Down
156 changes: 156 additions & 0 deletions react/country/GRC.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
import { POSTAL_CODE } from '../constants'

export default {
country: 'GRC',
abbr: 'GR',
postalCodeFrom: POSTAL_CODE,
fields: [
{
hidden: true,
name: 'country',
maxLength: 100,
label: 'country',
size: 'medium',
},
{
name: 'postalCode',
maxLength: 5,
label: 'postalCode',
size: 'small',
autoComplete: 'nope',
postalCodeAPI: false,
regex: /^([\d]{5})$/,
required: true,
},
{
name: 'street',
label: 'addressLine1',
required: true,
size: 'xlarge',
},
{
name: 'number',
maxLength: 750,
label: 'number',
size: 'small',
autoComplete: 'nope',
},
{
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: 'province',
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: true,
},

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: 'short_name',
types: ['administrative_area_level_2'],
},

city: {
valueIn: 'long_name',
types: ['administrative_area_level_3', 'locality'],
},

receiverName: {
required: true,
},
},
summary: [
[
{
name: 'street',
},
{
delimiter: ' ',
name: 'number',
},
{
delimiter: ', ',
name: 'complement',
},
],
[
{
name: 'neighborhood',
delimiterAfter: ' - ',
},
{
name: 'city',
},
{
delimiter: ' - ',
name: 'state',
},
],
[
{
name: 'postalCode',
},
],
],
}

0 comments on commit 2763416

Please sign in to comment.