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

Add GroupedEnumFilter #90

Merged
merged 1 commit into from
Nov 23, 2022
Merged

Add GroupedEnumFilter #90

merged 1 commit into from
Nov 23, 2022

Conversation

rszwajko
Copy link
Contributor

The new filter supports displaying enum values divided into groups. The groups are only for presentation and better user experience - logically the values belong to the same enum.

Technically the approach (using nested ToolbarFilter) is borrowed from the Console filter-toolbar [1].

[1] https://github.com/openshift/console/blob/5ba18580676a25e4304df78253aad6a9832d4d56/frontend/public/components/filter-toolbar.tsx#L299

Signed-off-by: Radoslaw Szwajkowski rszwajko@redhat.com

@rszwajko
Copy link
Contributor Author

rszwajko commented Nov 23, 2022

Screenshots

Example usage on Provider list screen.

Screenshot from 2022-11-23 17-40-58
Screenshot from 2022-11-23 17-41-31

The new filter supports displaying enum values divided into groups.
The groups are only for presentation and better user experience -
logically the values belong to the same enum.

Technically the approach (using nested ToolbarFilter) is borrowed from
the Console filter-toolbar [1].

[1] https://github.com/openshift/console/blob/5ba18580676a25e4304df78253aad6a9832d4d56/frontend/public/components/filter-toolbar.tsx#L299

Signed-off-by: Radoslaw Szwajkowski <rszwajko@redhat.com>
@sonarcloud
Copy link

sonarcloud bot commented Nov 23, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@yaacov yaacov merged commit 27b7c0d into kubev2v:main Nov 23, 2022
sjd78 pushed a commit to konveyor/tackle2-ui that referenced this pull request May 23, 2024
Use one ToolbarFilter per options group. First filter provides 
the option list. Remaining filters are hidden and used only for
side effects (separate chip groups). The approach follows
similar widgets used by Forklift plugin and OpenShift Console but
uses a flat list of toolbars (nesting trick requires the widget to be
visible all the time).

Related refactorings in MuliselectFilterControl:
1. drop unused feature - using dictionary type for selectedOptions
2. drop state that can be calculated:
   a) active item from focusedItemIndex
   b) selectedOptions from filters
3. centralize id calculations - use prefix based on category title
4. use label styling for tag category part of option

Resolves: #1774 

Reference-Url: kubev2v/forklift-console-plugin#90
Reference-Url: https://github.com/openshift/console/blob/5ba18580676a25e4304df78253aad6a9832d4d56/frontend/public/components/filter-toolbar.tsx#L299

---------

Signed-off-by: Radoslaw Szwajkowski <rszwajko@redhat.com>
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.

2 participants