teletrace icon indicating copy to clipboard operation
teletrace copied to clipboard

♻️ Add an 'available tags' store

Open galbash opened this issue 3 years ago • 0 comments

Cc: @shaqued

Hi @tvaintrob

Pain

Currently, whenever the developer wants to interact with the available tags he has to interact with the useAvailableTags hook, which returns the filters in it's raw format (pages). While the query is cached, this is still messy and may lead to "loading" in unwanted places

What code could be improved?

We should add a store that loads the available tags, and exposes a 'list' and 'search by name' api. This can improve the code in: https://github.com/epsagon/lupa/blob/75bd36f6642fd387ef15e08bca8b5bb1713ef339/web/src/features/search/components/FilterBuilder/TagSelector.tsx https://github.com/epsagon/lupa/blob/531199c4e43122addea2baea0a840788070bc953/web/src/features/search/components/FilterBuilder/FilterBuilder.tsx

Tasks

  • [ ] Create the store
  • [ ] Use it in TagSelector
  • [ ] Use it in FilterBuilder

Thanks!

galbash avatar Jan 22 '23 11:01 galbash