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 Tag Categories to Tag filters #1535

Merged
merged 4 commits into from
Nov 9, 2023

Conversation

sjd78
Copy link
Member

@sjd78 sjd78 commented Nov 9, 2023

Resolves: https://issues.redhat.com/browse/MTA-1534

Summary

On the following tables, the Tag filter has been enhanced to show the Tag with Tag Category:

  • Applications
  • Issues / All Issues
  • Dependencies
  • Dependency Details Drawer / Application Table

Tables that use Tag filters now use a set of options in the format "Tag Category Name / Tag Name". The filter render component MultiselectFilterControl has been updated to have special handling of selected values where the selection chips display the Tag Name and the Tag Category Name is displayed as a tooltip.

Existing item filtering and filter values are still operating as a string or string[], but use a string that can uniquely identify each tag. The net effect means that if a tag of the same name exists in more than one category, they are unique. Selecting one of those Tags will only select the tag in that specific category.

Additional change details:

  • Type OptionPropsWithKey renamed FilterSelectOptionProps for more consistent type/component naming
  • Added some jsdoc to FilterToolbar

Screenshots

Tag chips displayed for selected tags:
image

Tag filter select:
image

On the following tables, the Tag filter has been enhanced to group
the Tag select by Tag Category:

  - Applications
  - Issues / All Issues
  - Dependencies

Tables that use Tag filters now send a map of group name (category)
to an array of `FilterSelectOptionProps` (tags).  The filter render
component `MultiselectFilterControl` has been updated to allow for
grouped and ungrouped arrays of `FilterSelectOptionProps` objects.

Existing item filtering and filter values are still operating as a
`string` or `string[]`.  The net effect means that if a tag of the same
name exists in more than one category, and one of them is selected, then
all of them will be selected.

Additional change details:
  - Type `OptionPropsWithKey` renamed `FilterSelectOptionProps` for
    more consistent type/component naming
  - Added some jsdoc to `FilterToolbar`

Signed-off-by: Scott J Dickerson <[email protected]>
Copy link

codecov bot commented Nov 9, 2023

Codecov Report

Attention: 46 lines in your changes are missing coverage. Please review.

Comparison is base (6bea42c) 40.65% compared to head (99f3a81) 40.52%.
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1535      +/-   ##
==========================================
- Coverage   40.65%   40.52%   -0.14%     
==========================================
  Files         145      145              
  Lines        4607     4622      +15     
  Branches     1077     1084       +7     
==========================================
  Hits         1873     1873              
- Misses       2720     2735      +15     
  Partials       14       14              
Flag Coverage Δ
client 40.52% <6.12%> (-0.14%) ⬇️
server ∅ <ø> (∅)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
client/src/app/api/models.ts 100.00% <ø> (ø)
...src/app/components/FilterToolbar/FilterToolbar.tsx 19.29% <ø> (ø)
...p/components/FilterToolbar/SelectFilterControl.tsx 13.63% <0.00%> (ø)
client/src/app/queries/tags.ts 25.55% <0.00%> (-0.29%) ⬇️
...ponents/FilterToolbar/MultiselectFilterControl.tsx 8.97% <6.38%> (-1.97%) ⬇️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sjd78
Copy link
Member Author

sjd78 commented Nov 9, 2023

Note: This is still in draft since there is currently strange behavior where the selected tags do not have their checkboxes checked when a tag is selected. Everything acts selected, just the checkbox does not render as selected for the tag's select option.

Refactored to use a single list and have the items display "Category / Tag".

Follow the UX of the tag fields on data forms.

  - Tags are shown with their category name but without grouping

  - Toolbar chips are shown with the category in a tooltip and the
    tag name as the visible chip

  - Filtering will be considered on a TagCategory + Tag basis.  Tags
    with the same name in multiple categories are distinct.

Signed-off-by: Scott J Dickerson <[email protected]>
@sjd78 sjd78 marked this pull request as ready for review November 9, 2023 20:34
Copy link
Member

@ibolton336 ibolton336 left a comment

Choose a reason for hiding this comment

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

LGTM!

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.

[BUG] Improved Tag Filtering Experience
2 participants