Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[partner imagery] Destination fallback imagery not implemented #68

Open
gusnaughton opened this issue Nov 6, 2024 · 0 comments
Open

Comments

@gusnaughton
Copy link
Member

gusnaughton commented Nov 6, 2024

Please verify the version of auro-avatar you have installed

V5.2.0

Please describe the bug

Right now, partner imagery does not fall back on the country code of the station itself, so for almost all international non-AS bookings, a cloud is displayed.

Reproducing the error on the docsite

This issue is reproducible on the Auro docsite

Expected behavior

The Component Library's has implemented a system that can take a station code, retrieve its image from the CDN, and if one does not exist, it pulls the country or region code from the airport code itself and displays that respective image.

The Component Library at build time pulls our citylist.xml file and opens up a hook to search for country codes by station code, allowing us to implement the logic like this:

findLocation(error) {
    this.airport = airports.find((airport) => airport.code === this.iata?.trim()?.toUpperCase());
    switch (this.airport?.code) {
      // Spain/Madrid's avatar is different than the rest of the region
      case 'MAD':
        return this.image = 'https://resource.alaskaair.net/v3/assets/blt2cefe12c88e9dd91/blt661a8f446aaa58e0/Iberia-Spain-Madrid?auto=webp&environment=production';
    }
    switch (this.airport?.country) {
      case 'US':
        switch (this.airport.region) {
          // West US
          case 'AK':
          case 'CA':
          case 'NV':
          case 'OR':
          case 'UT':
          case 'WA':
            this.image = 'https://resource.alaskaair.net/v3/assets/blt2cefe12c88e9dd91/blt4fef4cd68063a18f/UnitedStates-West?auto=webp&environment=production';
            break;
          // Hawaii
          case 'HI':
            this.image = 'https://resource.alaskaair.net/v3/assets/blt2cefe12c88e9dd91/blt9b1dbc7c322f5038/UnitedStates-Hawaii?auto=webp&environment=production';
            break;
          // Rockies
          case 'ID':
          case 'MO':
          case 'WY':
          case 'CO':
            this.image = 'https://resource.alaskaair.net/v3/assets/blt2cefe12c88e9dd91/blt12bce1464e407df5/UnitedStates-RockyMountains?auto=webp&environment=production';
            break;
          // Southwest
          case 'AZ':
          case 'NM':
          case 'OK':
          case 'TX':
            this.image = 'https://resource.alaskaair.net/v3/assets/blt2cefe12c88e9dd91/blt279cea7b977cbcfc/UnitedStates-Southwest?auto=webp&environment=production';
            break;
          // Midwest
          case 'OH':
          case 'MI':
          case 'IN':
          case 'WI':
          case 'IL':
          case 'MN':
          case 'IA':
          case 'MS':
          case 'ND':
          case 'SD':
          case 'NE':
          case 'KS':
            this.image = 'https://resource.alaskaair.net/v3/assets/blt2cefe12c88e9dd91/blt68455ca1ab5990f2/UnitedStates-Midwest?auto=webp&environment=production';
            break;
          // Upper South
          case 'KY':
          case 'TN':
          case 'VA':
          case 'WV':
            this.image = 'https://resource.alaskaair.net/v3/assets/blt2cefe12c88e9dd91/blt24f720485fb0d3a4/UnitedStates-UpperSouth?auto=webp&environment=production';
            break;
          // Southeast
          case 'GA':
          case 'AL':
          case 'MS':
          case 'SC':
          case 'NC':
          case 'OK':
          case 'AR':
          case 'FL':
          case 'LA':
            this.image = 'https://resource.alaskaair.net/v3/assets/blt2cefe12c88e9dd91/blt24ccbb03ffbcf078/UnitedStates-Southeast?auto=webp&environment=production';
            break;
          // Midatlantic
          case 'DE':
          case 'MD':
          case 'NJ':
          case 'NY':
          case 'PA':
          case 'DC':
            this.image = 'https://resource.alaskaair.net/v3/assets/blt2cefe12c88e9dd91/blte8e80a67e7319988/United%20States-Midatlantic?auto=webp&environment=production';
            break;
          // New England
          case 'CT':
          case 'ME':
          case 'MA':
          case 'NH':
          case 'RI':
          case 'VT':
            this.image = 'https://resource.alaskaair.net/v3/assets/blt2cefe12c88e9dd91/bltb16626bc2ac810d3/UnitedStates-NewEngland?auto=webp&environment=production';
            break;
        }
        break;
      // canada
      case 'CA':
        switch (this.airport.region) {
          // british columbia
          case 'BC':
            this.image = 'https://resource.alaskaair.net/v3/assets/blt2cefe12c88e9dd91/blt64dd8cc3254cdb33/Canada-BC?auto=webp&environment=production';
            break;
          // alberta
          case 'AB':
            this.image = 'https://resource.alaskaair.net/v3/assets/blt2cefe12c88e9dd91/blt3db1e4c565b0dae7/Canada-Alberta?auto=webp&environment=production';
            break;
          // manitoba
          case 'MB':
            this.image = 'https://resource.alaskaair.net/v3/assets/blt2cefe12c88e9dd91/bltbf4484e57f78cf42/Canada-Manitoba?auto=webp&environment=production';
            break;
          // ontario
          case 'ON':
            this.image = 'https://resource.alaskaair.net/v3/assets/blt2cefe12c88e9dd91/blt558923a32e05aa07/Canada-Ontario?auto=webp&environment=production';
            break;
          // quebec
          case 'QC':
            this.image = 'https://resource.alaskaair.net/v3/assets/blt2cefe12c88e9dd91/blt5cd3b0fe285d6b22/Canada-Quebec?auto=webp&environment=production';
            break;
          // nova scotia
          case 'NS':
            this.image = 'https://resource.alaskaair.net/v3/assets/blt2cefe12c88e9dd91/bltca6e0d41eec6c0d8/Canada-NovaScotia_PrinceEdwardIslands_Brunswick?auto=webp&environment=production';
            break;
          // yukon
          case 'YT':
            this.image = 'https://resource.alaskaair.net/v3/assets/blt2cefe12c88e9dd91/bltb9df56ed68d142ad/Canada-NorthwestTerritories_Yukon_Nunavat?auto=webp&environment=production';
            break;
        }
        break;
      // Central America
      case 'BZ':
      case 'CR':
      case 'SV':
      case 'GT':
      case 'HN':
      case 'MX':
      case 'NI':
      case 'PA':
        this.image = 'https://resource.alaskaair.net/v3/assets/blt2cefe12c88e9dd91/blt173c4e0049f56975/CentralAmerica?auto=webp&environment=production';
        break;
      // South America - Andes
      case 'AR':
      case 'CL':
      case 'PE':
        this.image = 'https://resource.alaskaair.net/v3/assets/blt2cefe12c88e9dd91/bltf827b476b9dc3a67/SouthAmerica_Andes?auto=webp&environment=production';
        break;
      // South America - Amazon
      case 'BR':
      case 'EC':
      case 'VE':
      case 'GY':
      case 'SR':
        this.image = 'https://resource.alaskaair.net/v3/assets/blt2cefe12c88e9dd91/blt586fed4f5b47e4fc/SouthAmerica_Amazon?auto=webp&environment=production';
        break;
      // South America - Georgia
      case 'GE':
        this.image = 'https://resource.alaskaair.net/v3/assets/blt2cefe12c88e9dd91/blt81bc38fbe901dd2c/SouthAmerica_FalklandIslands_SouthGeorgia_SouthSandwichIslands?auto=webp&environment=production';
        break;
      // South America - Uruguay
      case 'UY':
        this.image = 'https://resource.alaskaair.net/v3/assets/blt2cefe12c88e9dd91/bltbfc106f48740ec42/SouthAmerica_Uruguay_Paraguay?auto=webp&environment=production';
        break;
      // Carribbean
      case 'AI':
      case 'AG':
      case 'AW':
      case 'BS':
      case 'BB':
      case 'BM':
      case 'BQ':
      case 'KY':
      case 'CU':
      case 'CW':
      case 'DM':
      case 'DO':
      case 'GD':
      case 'GP':
      case 'HT':
      case 'JM':
      case 'MQ':
      case 'KN':
      case 'LC':
      case 'SX':
      case 'VC':
      case 'TT':
      case 'TC':
      case 'VI':
        this.image = 'https://resource.alaskaair.net/v3/assets/blt2cefe12c88e9dd91/blt0cecf559ce9fd7fd/Caribbean?auto=webp&environment=production';
        break;
      // Puerto Rico
      case 'PR':
        this.image = 'https://resource.alaskaair.net/v3/assets/blt2cefe12c88e9dd91/blt1e64c70503efc18d/PuertoRico?auto=webp&environment=production';
        break;
      // Western Africa
      case 'CI':
      case 'GH':
      case 'GN':
      case 'NG':
        this.image = 'https://resource.alaskaair.net/v3/assets/blt2cefe12c88e9dd91/bltf6449c64d75287e1/WesternAfrica?auto=webp&environment=production';
        break;
      // Middle Africa
      case 'AO':
        this.image = 'https://resource.alaskaair.net/v3/assets/blt2cefe12c88e9dd91/blt24df80eab91f3625/MiddleAfrica?auto=webp&environment=production';
        break;
      // Eastern Africa
      case 'DJ':
      case 'ET':
      case 'KE':
      case 'MU':
      case 'MZ':
      case 'RW':
      case 'SC':
      case 'SO':
      case 'UG':
      case 'TZ':
      case 'ZM':
      case 'ZW':
        this.image = 'https://resource.alaskaair.net/v3/assets/blt2cefe12c88e9dd91/blt53cec84cb101d249/EasternAfrica?auto=webp&environment=production';
        break;
      // Southern Africa
      case 'NA':
      case 'ZA':
        this.image = 'https://resource.alaskaair.net/v3/assets/blt2cefe12c88e9dd91/blte9993296aad47133/SouthernAfrica?auto=webp&environment=production';
        break;
      // Eastern Asia
      case 'CN':
      case 'KR':
      case 'JP':
      case 'TW':
        this.image = 'https://resource.alaskaair.net/v3/assets/blt2cefe12c88e9dd91/blt54b01a26afc371a4/EasternAsia?auto=webp&environment=production';
        break;
      // Southeast Asia
      case 'BN':
      case 'KH':
      case 'ID':
      case 'MY':
      case 'MM':
      case 'PH':
      case 'SG':
      case 'TH':
      case 'MV':
      case 'VN':
        this.image = 'https://resource.alaskaair.net/v3/assets/blt2cefe12c88e9dd91/blte4d66d62c3372dc7/SouthEasternAsia?auto=webp&environment=production';
        break;
      // Western Asia
      case 'AM':
      case 'AZ':
      case 'BH':
      case 'CY':
      case 'GE':
      case 'IQ':
      case 'IL':
      case 'JO':
      case 'KW':
      case 'LB':
      case 'OM':
      case 'QA':
      case 'SA':
      case 'TR':
      case 'AE':
        this.image = 'https://resource.alaskaair.net/v3/assets/blt2cefe12c88e9dd91/bltb5e492340b2ec7ca/WesternAsia?auto=webp&environment=production';
        break;
      // Micronesia
      case 'GU':
      case 'PF':
      case 'KI':
      case 'WS':
      case 'TO':
      case 'TV':
      case 'FJ':
      case 'NC':
      case 'PG':
      case 'SB':
      case 'VU':
        this.image = 'https://resource.alaskaair.net/v3/assets/blt2cefe12c88e9dd91/blt7d6f0a04b0c4983b/Micronesia_Polynesia_Melanesia?auto=webp&environment=production';
        break;
      // New Zealand
      case 'NZ':
        this.image = 'https://resource.alaskaair.net/v3/assets/blt2cefe12c88e9dd91/blt9ed06c0c93b64897/NewZealand?auto=webp&environment=production';
        break;
      // Iberian Peninsula
      case 'ES':
      case 'PT':
      case 'GI':
        this.image = 'https://resource.alaskaair.net/v3/assets/blt2cefe12c88e9dd91/blt89ccf49b0a5f2550/Iberia-Spain?auto=webp&environment=production';
        break;
      // Balkans
      case 'AL':
      case 'BG':
      case 'HR':
      case 'CS':
      case 'SI':
        this.image = 'https://resource.alaskaair.net/v3/assets/blt2cefe12c88e9dd91/bltd2356b6248e6bb79/Balkans?auto=webp&environment=production';
        break;
      // Area of Akyarw
      case 'IT':
      case 'MT':
        this.image = 'https://resource.alaskaair.net/v3/assets/blt2cefe12c88e9dd91/bltbf33f99def028044/AreaofAkayarw?auto=webp&environment=production';
        break;
      // Eastern Europe
      case 'CZ':
      case 'HU':
      case 'PL':
      case 'RO':
      case 'RU':
      case 'UA':
        this.image = 'https://resource.alaskaair.net/v3/assets/blt2cefe12c88e9dd91/blta628bfbb9aaf5bb5/EasternEurope?auto=webp&environment=production';
        break;
      // Baltic States
      case 'EE':
      case 'LV':
      case 'LT':
        this.image = 'https://resource.alaskaair.net/v3/assets/blt2cefe12c88e9dd91/blt45fbd447416cb158/BalticStates?auto=webp&environment=production';
        break;
      // British Isles
      case 'IE':
      case 'GB':
        this.image = 'https://resource.alaskaair.net/v3/assets/blt2cefe12c88e9dd91/blt2a5512c4d14fef7f/BritishIsles?auto=webp&environment=production';
        break;
      // Nordic
      case 'DK':
      case 'FI':
      case 'IS':
      case 'NO':
      case 'SE':
        this.image = 'https://resource.alaskaair.net/v3/assets/blt2cefe12c88e9dd91/bltee5c6b753aa5a840/NordicCountries?auto=webp&environment=production';
        break;
      // Belgium & Luxemborg
      case 'BE':
      case 'LU':
        this.image = 'https://resource.alaskaair.net/v3/assets/blt2cefe12c88e9dd91/blt7318a470d1f97178/Belgium_Luxembourg?auto=webp&environment=production';
        break;
      case 'FR':
        this.image = 'https://resource.alaskaair.net/v3/assets/blt2cefe12c88e9dd91/blt1931ba357b55816c/France?auto=webp&environment=production';
        break;
      case 'DE':
        this.image = 'https://resource.alaskaair.net/v3/assets/blt2cefe12c88e9dd91/blt7bbb8a37d6f75a34/Germany?auto=webp&environment=production';
        break;
      case 'NL':
        this.image = 'https://resource.alaskaair.net/v3/assets/blt2cefe12c88e9dd91/blt4b56ba9f17185f67/Netherlands?auto=webp&environment=production';
        break;
      case 'HK':
        this.image = 'https://resource.alaskaair.net/v3/assets/blt2cefe12c88e9dd91/blt7c39a6bec39cc629/CathayPacific-HongKong?auto=webp&environment=production';
        break;
      case 'FI':
        this.image = 'https://resource.alaskaair.net/v3/assets/blt2cefe12c88e9dd91/bltb4a230a9d7cd9b3c/Finnair-Finland?auto=webp&environment=production';
        break;
      case 'JP':
        this.image = 'https://resource.alaskaair.net/v3/assets/blt2cefe12c88e9dd91/blt45a5f0eac1a471f5/JapanAirlines-Japan?auto=webp&environment=production';
        break;
      case 'MA':
        this.image = 'https://resource.alaskaair.net/v3/assets/blt2cefe12c88e9dd91/blt441857a58565fb37/RoyalAirMaroc-Morrocco?auto=webp&environment=production';
        break;
      case 'MY':
        this.image = 'https://resource.alaskaair.net/v3/assets/blt2cefe12c88e9dd91/blt906dab287f2720eb/MalaysiaAirlines-Malaysia?auto=webp&environment=production';
        break;
      case 'RU':
        this.image = 'https://resource.alaskaair.net/v3/assets/blt2cefe12c88e9dd91/blt757ab56ad4716a7e/S7Airlines-Russia?auto=webp&environment=production';
        break;
      case 'AU':
        this.image = 'https://resource.alaskaair.net/v3/assets/blt2cefe12c88e9dd91/blt8d13a1fdf442f1c7/Australia?auto=webp&environment=production';
        break;
      case 'LK':
        this.image = 'https://resource.alaskaair.net/v3/assets/blt2cefe12c88e9dd91/blt8ba9dfc8d6184581/SriLankanAirlines-SriLanka?auto=webp&environment=production';
        break;
      default:
        this.image = 'https://resource.alaskaair.net/v3/assets/blt2cefe12c88e9dd91/blte7ef1645a7c62031/partner?auto=webp&environment=production';
        break;
    }
  }

https://components.alaskaair.com/catelog/demo/airport-avatar

What browsers are you seeing the problem on?

Firefox, Chrome, Safari, Microsoft Edge

Additional context

What is the best way for the Auro Design System to manage the countries for each airport? Should it pull a version of citylist, or hit a citylist API?

@gusnaughton gusnaughton added Type: Bug Bug or Bug fixes not-reviewed Issue has not been reviewed by Auro team members auro-avatar labels Nov 6, 2024
@Patrick-Daly-AA Patrick-Daly-AA removed their assignment Nov 6, 2024
@Patrick-Daly-AA Patrick-Daly-AA removed the not-reviewed Issue has not been reviewed by Auro team members label Nov 12, 2024
@jason-capsule42 jason-capsule42 removed the Type: Bug Bug or Bug fixes label Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants