Skip to content
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

Generic selection component #2013

Merged
merged 9 commits into from
Nov 21, 2023
Merged

Generic selection component #2013

merged 9 commits into from
Nov 21, 2023

Conversation

nelsonkopliku
Copy link
Member

Description

Generalizes the current ProviderSelection to a Select which will be used also for other filters in the catalog.

How was this tested?

Test and storybook

@nelsonkopliku nelsonkopliku self-assigned this Nov 17, 2023
@nelsonkopliku nelsonkopliku added enhancement New feature or request user story ux javascript Pull requests that update Javascript code labels Nov 17, 2023
@nelsonkopliku nelsonkopliku force-pushed the generic-selection-component branch 2 times, most recently from 14e09e3 to daec644 Compare November 17, 2023 15:01
Copy link
Contributor

@dottorblaster dottorblaster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job but a Select component is not only used for filters, but for selects 😄

Could you do the whole composition about the all options on the outside layer?

@nelsonkopliku nelsonkopliku force-pushed the generic-selection-component branch 2 times, most recently from 826a1b2 to b1f8931 Compare November 20, 2023 13:57
@nelsonkopliku
Copy link
Member Author

@dottorblaster good point thanks! At the end I decided to let the used define whether an All options option is wanted b1f8931

@nelsonkopliku nelsonkopliku force-pushed the generic-selection-component branch 2 times, most recently from c9483af to 1eb3386 Compare November 20, 2023 15:02
Copy link
Contributor

@dottorblaster dottorblaster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job, just one thing to adjust. This way we could reuse this component as a generic select in the future and not only as a filter. That's why I asked you to move out the whole "all" logic outside of the component to increase the chance for composition.

assets/js/components/ChecksCatalog/ChecksCatalog.jsx Outdated Show resolved Hide resolved
Comment on lines 30 to 31
options={PROVIDERS}
withAllOption
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
options={PROVIDERS}
withAllOption
options={[ALL_OPTION, ...PROVIDERS]}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could reuse this component as a generic select in the future and not only as a filter.

We can already do this, even with the withAllOption prop, right?

assets/js/components/Select/Select.jsx Outdated Show resolved Hide resolved
@nelsonkopliku
Copy link
Member Author

@dottorblaster heres the last two commits 8e02b2a and 40ed6f0

Copy link
Contributor

@dottorblaster dottorblaster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! Thanks!

@nelsonkopliku
Copy link
Member Author

@dottorblaster in total honesty I was confused by the whole "all" logic outside 😅
I mean, we still have in the component the logic to handle how to render an all. We just changed how we add an all option to the options.

Anyway, thanks for the review!

@nelsonkopliku nelsonkopliku merged commit 47d9687 into main Nov 21, 2023
26 checks passed
@nelsonkopliku nelsonkopliku deleted the generic-selection-component branch November 21, 2023 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request javascript Pull requests that update Javascript code user story ux
Development

Successfully merging this pull request may close these issues.

None yet

3 participants