Skip to content

Handle subdivision jurisdiction.code values #190

@kd-ods

Description

@kd-ods

Describe the bug
The jurisdiction.code value is 'The 2-letter country code (ISO 3166-1) or the subdivision code (ISO 3166-2) for the jurisdiction.'

At the moment, the tool only handles 2-letter values, rendering the appropriate flag.

(Subdivision codes are the 2-letter country code followed by a hyphen, followed by up to 3 characters. See wikipedia entry)

To Reproduce
Steps to reproduce the behavior:

  1. Go to the hosted visualiser
  2. Paste in:
[
  {
    "statementId": "cef8c97f-deff-5474-420f-d73d0b00c333",
    "declarationSubject": "XI-LEI-1XLP8EP6FZUGMP85CM51",
    "statementDate": "2024-06-06",
    "recordId": "XI-LEI-1XLP8EP6FZUGMP85CM51",
    "recordStatus": "new",
    "recordType": "entity",
    "recordDetails": {
      "isComponent": false,
      "entityType": {
        "type": "registeredEntity",
        "details": "Corporation"
      },
      "name": "AIR PRODUCTS MANUFACTURING CORPORATION",
      "alternateNames": [],
      "jurisdiction": {
        "name": "Delaware, United States",
        "code": "US-DE"
      }
    }
  }
]
  1. Click 'Draw'
  2. Notice that no flag icon appears

Expected behaviour

The US flag should appear on the node, as it should do for any jurisdcition.code value of 'US-??'. (In the pasted in JSON, replace "code": "US-DE" with "code": "US" & click 'draw' to see what is expected. )

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions