Skip to content

Commit

Permalink
VACMS-19227: Fixes address display and extra countries
Browse files Browse the repository at this point in the history
  • Loading branch information
omahane committed Dec 11, 2024
1 parent 72df54e commit 016e057
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 274 deletions.
255 changes: 0 additions & 255 deletions config/sync/field.field.node.press_release.field_address.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,262 +38,7 @@ default_value:
default_value_callback: ''
settings:
available_countries:
AF: AF
AX: AX
AL: AL
DZ: DZ
AS: AS
AD: AD
AO: AO
AI: AI
AQ: AQ
AG: AG
AR: AR
AM: AM
AW: AW
AC: AC
AU: AU
AT: AT
AZ: AZ
BS: BS
BH: BH
BD: BD
BB: BB
BY: BY
BE: BE
BZ: BZ
BJ: BJ
BM: BM
BT: BT
BO: BO
BA: BA
BW: BW
BV: BV
BR: BR
IO: IO
VG: VG
BN: BN
BG: BG
BF: BF
BI: BI
KH: KH
CM: CM
CA: CA
IC: IC
CV: CV
BQ: BQ
KY: KY
CF: CF
EA: EA
TD: TD
CL: CL
CN: CN
CX: CX
CP: CP
CC: CC
CO: CO
KM: KM
CG: CG
CD: CD
CK: CK
CR: CR
CI: CI
HR: HR
CU: CU
CW: CW
CY: CY
CZ: CZ
DK: DK
DG: DG
DJ: DJ
DM: DM
DO: DO
EC: EC
EG: EG
SV: SV
GQ: GQ
ER: ER
EE: EE
SZ: SZ
ET: ET
FK: FK
FO: FO
FJ: FJ
FI: FI
FR: FR
GF: GF
PF: PF
TF: TF
GA: GA
GM: GM
GE: GE
DE: DE
GH: GH
GI: GI
GR: GR
GL: GL
GD: GD
GP: GP
GU: GU
GT: GT
GG: GG
GN: GN
GW: GW
GY: GY
HT: HT
HM: HM
HN: HN
HK: HK
HU: HU
IS: IS
IN: IN
ID: ID
IR: IR
IQ: IQ
IE: IE
IM: IM
IL: IL
IT: IT
JM: JM
JP: JP
JE: JE
JO: JO
KZ: KZ
KE: KE
KI: KI
XK: XK
KW: KW
KG: KG
LA: LA
LV: LV
LB: LB
LS: LS
LR: LR
LY: LY
LI: LI
LT: LT
LU: LU
MO: MO
MG: MG
MW: MW
MY: MY
MV: MV
ML: ML
MT: MT
MH: MH
MQ: MQ
MR: MR
MU: MU
YT: YT
MX: MX
FM: FM
MD: MD
MC: MC
MN: MN
ME: ME
MS: MS
MA: MA
MZ: MZ
MM: MM
NA: NA
NR: NR
NP: NP
NL: NL
NC: NC
NZ: NZ
NI: NI
NE: NE
NG: NG
NU: NU
NF: NF
KP: KP
MK: MK
MP: MP
'NO': 'NO'
OM: OM
PK: PK
PW: PW
PS: PS
PA: PA
PG: PG
PY: PY
PE: PE
PH: PH
PN: PN
PL: PL
PT: PT
PR: PR
QA: QA
RE: RE
RO: RO
RU: RU
RW: RW
WS: WS
SM: SM
ST: ST
SA: SA
SN: SN
RS: RS
SC: SC
SL: SL
SG: SG
SX: SX
SK: SK
SI: SI
SB: SB
SO: SO
ZA: ZA
GS: GS
KR: KR
SS: SS
ES: ES
LK: LK
BL: BL
SH: SH
KN: KN
LC: LC
MF: MF
PM: PM
VC: VC
SD: SD
SR: SR
SJ: SJ
SE: SE
CH: CH
SY: SY
TW: TW
TJ: TJ
TZ: TZ
TH: TH
TL: TL
TG: TG
TK: TK
TO: TO
TT: TT
TA: TA
TN: TN
TR: TR
TM: TM
TC: TC
TV: TV
UM: UM
VI: VI
UG: UG
UA: UA
AE: AE
GB: GB
US: US
UY: UY
UZ: UZ
VU: VU
VA: VA
VE: VE
VN: VN
WF: WF
EH: EH
YE: YE
ZM: ZM
ZW: ZW
langcode_override: ''
field_overrides:
givenName:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

namespace Drupal\va_gov_address\EventSubscriber;

use CommerceGuys\Addressing\AddressFormat\AdministrativeAreaType;
use Drupal\address\Event\AddressEvents;
use Drupal\address\Event\AddressFormatEvent;
use Drupal\address\Event\SubdivisionsEvent;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;

Expand All @@ -17,27 +15,10 @@ class AddPhilippinesAsStateSubscriber implements EventSubscriberInterface {
* {@inheritdoc}
*/
public static function getSubscribedEvents() {
$events[AddressEvents::ADDRESS_FORMAT][] = ['onAddressFormat'];
$events[AddressEvents::SUBDIVISIONS][] = ['onSubdivisions'];
return $events;
}

/**
* Alters the address format for the US.
*
* @param \Drupal\address\Event\AddressFormatEvent $event
* The address format event.
*/
public function onAddressFormat(AddressFormatEvent $event) {
$definition = $event->getDefinition();
if ($definition['country_code'] == 'US') {
$definition['format'] = $definition['format'] . "\n%administrativeArea";
$definition['administrative_area_type'] = AdministrativeAreaType::STATE;
$definition['subdivision_depth'] = 1;
$event->setDefinition($definition);
}
}

/**
* Provides the states of the US (plus the Philippines).
*
Expand Down

0 comments on commit 016e057

Please sign in to comment.