graylog2-server
graylog2-server copied to clipboard
Unify implemented selects
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
Selectcomponent wrapper - Has common styling
- Has some logic around multiple select components
- Has compatibility layer between React Select v1 and v2
- This is our common
-
views/components/Select:- The aggregation builder required some specific React Select behaviour that lead to creating a new common
Selectwrapper for that - Also has some common behaviour and styling in there
- The aggregation builder required some specific React Select behaviour that lead to creating a new common
-
react-select:- Some components (
NumberVisualizationConfiguration,SortDirectionSelect, andSortSelect) don't use any of the above, but React Select directly
- Some components (
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