Closed jason-capsule42 closed 1 year ago
Per Teams conversation with @gusnaughton
[8:14 AM] Gus Naughton This is going to have to involve a larger conversation with the flight search backend team. The ETAirlines file is not the appropriate place to put location data, and the Airports files get generated and overwritten automatically.Get the matching region code from https://github.com/Alaska-ECommerce/ETInfoServiceCore/blob/main/ETInfoServiceCore/App_Data/ETAirlines.xml (@gusnaughton will update the XML to include necessary data)
[8:14 AM] Gus Naughton I can provide the JSON representation of country codes to regions, but I'm not sure where the right place for storing those constants are. Maybe they can be design tokens?
We could instead bake in a method for auro-avatar to fire an event when it fails to load an image for the designated code. This would enable the team to attempt to load the desired avatar, listen for the event flagging the failure and then determine an alternate code they want to use and insert that back in to the avatar.
This is the approach we are planning on.
The idea of regional fallbacks is definitely a good idea for someone to do but that gets way to much into business logic to be part of an open source auro component.
Currently the component does support adding custom images and with that approach you can do anything you want and still keep the current url pattern. I would recommend having a separate utility managed by flight search that handles regional or custom fallbacks before they are passed into auro-avatar. And if that fails auro-avatar will still have a default backup image ready to go.
Closing after discussion as this issue is over a year old with no updates. If this is still important, please message for re-opening.
Is your feature request related to a problem? Please describe.
When a valid airport code does not yet have an avatar image to load we want to fallback to the avatar image for the region.
Describe the solution you'd like
In all cases of an invalid airport code we would continue to use the default image fallback.
In cases of a valid airport code we would check to see if the image loads for it. If not we would.
Describe alternatives you've considered
We could instead bake in a method for
auro-avatar
to fire an event when it fails to load an image for the designated code. This would enable the team to attempt to load the desired avatar, listen for the event flagging the failure and then determine an alternate code they want to use and insert that back in to the avatar.