graylog2-server icon indicating copy to clipboard operation
graylog2-server copied to clipboard

Unify implemented selects

Open edmundoa opened this issue 6 years ago • 0 comments

Similarly to https://github.com/Graylog2/graylog2-server/issues/7229, we currently have several differences on how React Select components are used:

  • components/common/Select:

    • This is our common Select component wrapper
    • Has common styling
    • Has some logic around multiple select components
    • Has compatibility layer between React Select v1 and v2
  • views/components/Select:

    • The aggregation builder required some specific React Select behaviour that lead to creating a new common Select wrapper for that
    • Also has some common behaviour and styling in there
  • react-select:

    • Some components (NumberVisualizationConfiguration, SortDirectionSelect, and SortSelect) don't use any of the above, but React Select directly

Having different ways of using Select components is not bad if we have good reasons for doing it, but it adds some additional cognitive load, since naming is very similar and it's easy to mix-up different APIs and/or forget to replicate some behaviour in one of the components.

We should re-evaluate if we can unify or at least create common wrappers for all the use cases we have, so we can provide a more consistent experience and also isolate single components from upstream changes.

  • Graylog Version: 3.2.0-beta.4-SNAPSHOT

edmundoa avatar Jan 21 '20 10:01 edmundoa