Skip to content

Commit

Permalink
Merge pull request #3747 from uktrade/feature-IGUK-609-autocomplete-a…
Browse files Browse the repository at this point in the history
…ria-controls

IGUK-609 autocomplete aria controls
  • Loading branch information
timothyPatterson authored Dec 17, 2024
2 parents ac670e3 + 05327bf commit 09a660a
Show file tree
Hide file tree
Showing 20 changed files with 314 additions and 301 deletions.
20 changes: 10 additions & 10 deletions config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -545,16 +545,16 @@
}
}

# else: # Power search via Activity Stream # TODO: Remove once Opensearch implemented on PROD
# services = {item['instance_name']: item for item in env.opensearch_service}
# OPENSEARCH_INSTANCE_NAME = (
# env.opensearch_instance_name if env.opensearch_instance_name else env.opensearch_service[0]['instance_name']
# )
# connections.create_connection(
# alias='default',
# hosts=[services[OPENSEARCH_INSTANCE_NAME]['credentials']['uri']],
# connection_class=RequestsHttpConnection,
# )
else: # Power search via Activity Stream # TODO: Remove once Opensearch implemented on PROD
services = {item['instance_name']: item for item in env.opensearch_service}
OPENSEARCH_INSTANCE_NAME = (
env.opensearch_instance_name if env.opensearch_instance_name else env.opensearch_service[0]['instance_name']
)
connections.create_connection(
alias='default',
hosts=[services[OPENSEARCH_INSTANCE_NAME]['credentials']['uri']],
connection_class=RequestsHttpConnection,
)

OPENSEARCH_CASE_STUDY_INDEX = env.elasticsearch_case_study_index

Expand Down
2 changes: 2 additions & 0 deletions core/static/javascript/accessible-autocomplete.v3.01.min.js

Large diffs are not rendered by default.

272 changes: 272 additions & 0 deletions core/static/javascript/countries.js
Original file line number Diff line number Diff line change
Expand Up @@ -269,3 +269,275 @@ const countries = [
'Zambia',
'Zimbabwe',
]

const countryISO2CodeToName = {
'AU': 'Australia',
'AZ': 'Azerbaijan',
'BH': 'Bahrain',
'UM-81': 'Baker Island',
'BD': 'Bangladesh',
'BB': 'Barbados',
'BY': 'Belarus',
'BE': 'Belgium',
'BZ': 'Belize',
'BJ': 'Benin',
'BM': 'Bermuda',
'BT': 'Bhutan',
'BO': 'Bolivia',
'BQ-BO': 'Bonaire',
'BA': 'Bosnia and Herzegovina',
'BW': 'Botswana',
'BR': 'Brazil',
'IO': 'British Indian Ocean Territory',
'CA': 'Canada',
'CV': 'Cape Verde',
'KY': 'Cayman Islands',
'ES-CE': 'Ceuta',
'TD': 'Chad',
'CL': 'Chile',
'CN': 'China',
'CX': 'Christmas Island',
'CC': 'Cocos (Keeling) Islands',
'CO': 'Colombia',
'KM': 'Comoros',
'CG': 'Congo',
'CD': 'Congo (Democratic Republic)',
'CK': 'Cook Islands',
'CR': 'Costa Rica',
'HR': 'Croatia',
'CU': 'Cuba',
'CW': 'Curaçao',
'CY': 'Cyprus',
'DM': 'Dominica',
'DO': 'Dominican Republic',
'AE-DU': 'Dubai',
'TL': 'East Timor',
'EC': 'Ecuador',
'EG': 'Egypt',
'SV': 'El Salvador',
'GQ': 'Equatorial Guinea',
'ER': 'Eritrea',
'EE': 'Estonia',
'SZ': 'Eswatini',
'ET': 'Ethiopia',
'FK': 'Falkland Islands',
'FO': 'Faroe Islands',
'FJ': 'Fiji',
'FI': 'Finland',
'FR': 'France',
'GF': 'French Guiana',
'PF': 'French Polynesia',
'AE-FU': 'Fujairah',
'GA': 'Gabon',
'GE': 'Georgia',
'DE': 'Germany',
'GH': 'Ghana',
'GI': 'Gibraltar',
'GR': 'Greece',
'GL': 'Greenland',
'GG': 'Guernsey',
'GN': 'Guinea',
'GW': 'Guinea-Bissau',
'GY': 'Guyana',
'HT': 'Haiti',
'HN': 'Honduras',
'HK': 'Hong Kong',
'UM-84': 'Howland Island',
'HU': 'Hungary',
'IS': 'Iceland',
'IN': 'India',
'ID': 'Indonesia',
'IR': 'Iran',
'IQ': 'Iraq',
'IE': 'Ireland',
'IM': 'Isle of Man',
'IL': 'Israel',
'IT': 'Italy',
'CI': 'Ivory Coast',
'JM': 'Jamaica',
'JP': 'Japan',
'UM-86': 'Jarvis Island',
'JE': 'Jersey',
'UM-67': 'Johnston Atoll',
'JO': 'Jordan',
'KZ': 'Kazakhstan',
'KE': 'Kenya',
'UM-89': 'Kingman Reef',
'KI': 'Kiribati',
'XK': 'Kosovo',
'KW': 'Kuwait',
'KG': 'Kyrgyzstan',
'LA': 'Laos',
'LV': 'Latvia',
'LB': 'Lebanon',
'LS': 'Lesotho',
'LR': 'Liberia',
'LY': 'Libya',
'LI': 'Liechtenstein',
'MY': 'Malaysia',
'MV': 'Maldives',
'ML': 'Mali',
'MT': 'Malta',
'MH': 'Marshall Islands',
'MQ': 'Martinique',
'MR': 'Mauritania',
'MU': 'Mauritius',
'YT': 'Mayotte',
'ES-ML': 'Melilla',
'MX': 'Mexico',
'UM-71': 'Midway Islands',
'MD': 'Moldova',
'MC': 'Monaco',
'MN': 'Mongolia',
'ME': 'Montenegro',
'MS': 'Montserrat',
'MA': 'Morocco',
'MZ': 'Mozambique',
'MM': 'Myanmar (Burma)',
'NA': 'Namibia',
'NR': 'Nauru',
'UM-76': 'Navassa Island',
'NP': 'Nepal',
'NL': 'Netherlands',
'NC': 'New Caledonia',
'NZ': 'New Zealand',
'NI': 'Nicaragua',
'NE': 'Niger',
'NG': 'Nigeria',
'NU': 'Niue',
'NF': 'Norfolk Island',
'MP': 'Northern Mariana Islands',
'KP': 'North Korea',
'MK': 'North Macedonia',
'NO': 'Norway',
'PS': 'Occupied Palestinian Territories',
'OM': 'Oman',
'PK': 'Pakistan',
'PW': 'Palau',
'UM-95': 'Palmyra Atoll',
'PA': 'Panama',
'PG': 'Papua New Guinea',
'PY': 'Paraguay',
'PE': 'Peru',
'PH': 'Philippines',
'PN': 'Pitcairn, Henderson, Ducie and Oeno Islands',
'PL': 'Poland',
'PT': 'Portugal',
'PR': 'Puerto Rico',
'QA': 'Qatar',
'AE-RK': 'Ras al-Khaimah',
'RE': 'Réunion',
'RO': 'Romania',
'RU': 'Russia',
'RW': 'Rwanda',
'BQ-SA': 'Saba',
'BL': 'Saint Barthélemy',
'SH-HL': 'Saint Helena',
'MF': 'Saint-Martin (French part)',
'PM': 'Saint Pierre and Miquelon',
'AE-SH': 'Sharjah',
'SG': 'Singapore',
'BQ-SE': 'Sint Eustatius',
'SX': 'Sint Maarten (Dutch part)',
'SK': 'Slovakia',
'SI': 'Slovenia',
'ES': 'Spain',
'LK': 'Sri Lanka',
'KN': 'St Kitts and Nevis',
'LC': 'St Lucia',
'VC': 'St Vincent',
'SD': 'Sudan',
'SR': 'Suriname',
'SJ': 'Svalbard and Jan Mayen',
'SE': 'Sweden',
'CH': 'Switzerland',
'SY': 'Syria',
'TW': 'Taiwan',
'TJ': 'Tajikistan',
'TZ': 'Tanzania',
'TH': 'Thailand',
'BS': 'The Bahamas',
'GM': 'The Gambia',
'TG': 'Togo',
'TK': 'Tokelau',
'TO': 'Tonga',
'TT': 'Trinidad and Tobago',
'SH-TA': 'Tristan da Cunha',
'TN': 'Tunisia',
'TR': 'Turkey',
'TM': 'Turkmenistan',
'TC': 'Turks and Caicos Islands',
'TV': 'Tuvalu',
'UG': 'Uganda',
'UA': 'Ukraine',
'AE-UQ': 'Umm al-Quwain',
'AE': 'United Arab Emirates',
'GB': 'United Kingdom',
'US': 'United States',
'VI': 'United States Virgin Islands',
'UY': 'Uruguay',
'UZ': 'Uzbekistan',
'VU': 'Vanuatu',
'VA': 'Vatican City',
'UM-79': 'Wake Island',
'WF': 'Wallis and Futuna',
'EH': 'Western Sahara',
'YE': 'Yemen',
'ZM': 'Zambia',
'ZW': 'Zimbabwe',
'AE-AZ': 'Abu Dhabi',
'AF': 'Afghanistan',
'AE-AJ': 'Ajman',
'XQZ': 'Akrotiri',
'AX': 'Åland Islands',
'AL': 'Albania',
'DZ': 'Algeria',
'AS': 'American Samoa',
'AD': 'Andorra',
'AO': 'Angola',
'AI': 'Anguilla',
'AG': 'Antigua and Barbuda',
'AR': 'Argentina',
'AM': 'Armenia',
'AW': 'Aruba',
'SH-AC': 'Ascension',
'AT': 'Austria',
'VG': 'British Virgin Islands',
'BN': 'Brunei',
'BG': 'Bulgaria',
'BF': 'Burkina Faso',
'BI': 'Burundi',
'KH': 'Cambodia',
'CM': 'Cameroon',
'CZ': 'Czechia',
'DK': 'Denmark',
'XXD': 'Dhekelia',
'DJ': 'Djibouti',
'FM': 'Federated States of Micronesia’',
'LT': 'Lithuania',
'LU': 'Luxembourg',
'MO': 'Macao',
'MG': 'Madagascar',
'MW': 'Malawi',
'WS': 'Samoa',
'SM': 'San Marino',
'ST': 'Sao Tome and Principe',
'SA': 'Saudi Arabia',
'SN': 'Senegal',
'RS': 'Serbia',
'SC': 'Seychelles',
'SL': 'Sierra Leone',
'SB': 'Solomon Islands',
'SO': 'Somalia',
'ZA': 'South Africa',
'GS': 'South Georgia and South Sandwich Islands',
'KR': 'South Korea',
'SS': 'South Sudan',
'GD': 'Grenada',
'GP': 'Guadeloupe',
'GU': 'Guam',
'GT': 'Guatemala',
'VE': 'Venezuela',
'VN': 'Vietnam',
'CF': 'Central African Republic'
}
Loading

0 comments on commit 09a660a

Please sign in to comment.