-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add SelectWithIcon component #9
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there an issue this component resolves? This is needed in some plugin?
Probably want someone from ux to review this.
Just a suggestion for a better way of adding and removing fields - at the moment, across multiple plugins, we are removing fields by relying on selecting a specific Example of removing via the dropdown options:
Sounds good, asked UX for review here: https://raintank-corp.slack.com/archives/G014QJ45DD4/p1607365776010900 |
closing this - the component has changed considerably in the SNOW plugin from this. If we want to revisit and extract it out, we can open another PR with the updated changes |
Select
component including buttons to add and remove the field.This can be used as an alternative to the
-- remove --
option that currently exists in our dropdowns.displayIcon
Toggle for displaying the add button
isMulti
Supports both
Select
andMultiSelect
children
Renders elements between the
Select
field and the remove buttonrenderRemove
Toggle for displaying the remove button
onRemove
Function bound to remove button
addIcon
Overrides the default icon for adding
removeIcon
Overrides the default icon for removing
onClickOutside
Function bound to clicks outside of the
Select
Work done:
Added component
Added test fixtures
Added
lodash
to use kebabCase for theoption
test fixturesAdded @testing-library/user-event for better event handling and it is also suggested by RTL
Added
@babel/plugin-transform-runtime
to fix following error when trying to runasync
tests:Bumped
react-dom
down to match currentreact
version and also, it looks likereact-dom
version 17+ causes the tests to fail when there are components wrapped withinClickOutsideWrapper
Basic:
Multi:
Remove Option:
Children:
Custom Add Icon:
Custom Remove Icon: