refactor: column settings / color picker #4589
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR refactors and improves on some issues with the current
ColumnSettings
andColorPicker
components, in order to make it usable within other components.Separation of concerns
Previously,
ColorPicker
would dispatch the function to change the column color itself.Since in other implementations, other things should happen upon selection, this has been moved to the parent component; a function with the selected color is propagated.
Unified rendering
Since the ColorPicker had no state whether it was open or closed, the closed version would be rendered in the parent component.
This lead to CSS classes being mixed.
Now, also the closed color picker is rendered within the color picker itself, so no CSS has to be imported by the parent component
Other changes
While we're at it, some other changes were made in an attempt to improve readability.
Changelog
ColorPicker
.ColorPicker
is now also rendered within the component itselfopen
state is passed to it for thisColorPicker
ColorPicker
andColumnSettings
Column
type instead of separate propertyMiniMenu
propicon
toelement
to generalize purposeChecklist