ONSdigital / design-system

ONS Design System
https://service-manual.ons.gov.uk/design-system
MIT License
30 stars 20 forks source link

Allow Autosuggest to alternatively use a json 'blob' instead of external file #2276

Closed jrbarnes9 closed 3 months ago

jrbarnes9 commented 2 years ago

Currently it appears that you can only use an 'external' json file for the autosuggest 'list'. Could this be enhanced to allow it to alternatively use a json 'blob' instead? This would allow for the option to dynamically build the autosuggest list from dynamic query data, ie if the UI running the DS received a dynamic set of data about different surveys, the autosuggest should be able to receive a json blob containing the different surveys in the dynamic data, rather than being forced to have a predetermined json file. Whilst it could be possible to generate a dynamic json output at a fixed url, it would be easier to be able to pass the json directly to the autosuggest component

Originally posted by @Paul-Joel in https://github.com/ONSdigital/design-system/discussions/894#discussioncomment-2969266

yatesn commented 2 years ago

Is this definitely still needed? Discuss with @Paul-Joel

willcAND commented 1 year ago

Spoke with Paul regarding this, who mentioned it would be a nice to have but can't remember specific circumstances. Agreed as team this is low priority as autosuggest component working as suggested with current implementation. Adding low priority tag.