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

Consumers autoselect #722

Merged
merged 2 commits into from
Mar 12, 2024
Merged

Conversation

matiasgarciaisaia
Copy link
Member

@matiasgarciaisaia matiasgarciaisaia commented Mar 11, 2024

Replace the Consumers Dataset dropdown with an autoselect control like the one we have for Region selection, with a filter.

Dataset selector showing the list of datasets matching the letter "a"

Fixes #717

Setting the project up yields these changes in the package-json.lock, so
its format must have changed somewhere down the line. These changes have
been automatically generated by npm.
In production, the amount of datasets to pick from was getting large and
unsorted, so the UX was really bad.

This change mimics the Region selection, with an autoselect control for
the users to filter the available options.

See #717
Copy link

@mverzilli mverzilli left a comment

Choose a reason for hiding this comment

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

LGTM!

@matiasgarciaisaia matiasgarciaisaia merged commit 28c3be2 into main Mar 12, 2024
6 checks passed
Comment on lines +24 to +31
(let [props (merge {:choices @(rf/subscribe [:sources/dropdown-options])
:label-fn :name
:render-fn (fn [source] [:div.option-row
[:span (:name source)]
[:span.option-context (:value source)]])}
attrs)]
(into [filter-select/single-dropdown] (mapcat identity props))))
Copy link
Member Author

Choose a reason for hiding this comment

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

This view is essentially the same as the one for the regions-dropdown-component, so I guess there's a component we should extract - but I didn't trust my ClojureScript-foo enough to go for it now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enhance consumers selection
2 participants