feat(MultiSelectFilter): add MultiSelectFilter component#6097
Merged
feat(MultiSelectFilter): add MultiSelectFilter component#6097
Conversation
Contributor
Reviewer's GuideThis PR implements a new multi-select filter component with its rendering and filtering logic, refactors an existing filter input binding, and adds comprehensive unit tests to validate the new component’s behavior. Sequence Diagram for GetFilterConditions in MultiSelectFiltersequenceDiagram
participant C as Caller
participant MSF as MultiSelectFilter~TType~
participant FKVA as FilterKeyValueAction
C->>MSF: GetFilterConditions()
activate MSF
MSF->>FKVA: new FilterKeyValueAction() (Logic = Or)
alt _value1 is string
MSF->>MSF: items = _value1.Split(',')
loop for each item in items
MSF->>FKVA: new FilterKeyValueAction(FieldKey, item, _action1)
MSF->>FKVA: filter.Filters.Add(subFilter)
end
else _value1 is IEnumerable~string~
loop for each item in _value1 (as values)
MSF->>FKVA: new FilterKeyValueAction(FieldKey, item, _action1)
MSF->>FKVA: filter.Filters.Add(subFilter)
end
end
MSF-->>C: filter
deactivate MSF
Sequence Diagram: User Applies Filter via MultiSelectsequenceDiagram
actor User
participant MSC as MultiSelect
participant MSF as MultiSelectFilter
participant Table as DataTable
User->>MSC: Selects items
activate MSC
MSC->>MSF: Updates _value1 (via @bind-Value)
MSC->>MSF: OnValueChanged() / Triggers OnFilterAsync()
activate MSF
MSF->>MSF: OnFilterAsync()
MSF->>Table: Applies filter conditions
Table-->>User: Shows filtered data
deactivate MSF
deactivate MSC
Sequence Diagram: User Changes Filter Action via FilterButtonsequenceDiagram
actor User
participant FBC as FilterButton
participant MSF as MultiSelectFilter
participant Table as DataTable
User->>FBC: Selects filter action
activate FBC
FBC->>MSF: Updates _action1 (via @bind-Value)
FBC->>MSF: OnSelectedItemChanged() / Triggers OnFilterAsync()
activate MSF
MSF->>MSF: OnFilterAsync()
MSF->>Table: Applies filter conditions
Table-->>User: Shows filtered data
deactivate MSF
deactivate FBC
Sequence Diagram: User Clears Filter via FilterButtonsequenceDiagram
actor User
participant FBC as FilterButton
participant MSF as MultiSelectFilter
participant Table as DataTable
User->>FBC: Clicks 'Clear Filter'
activate FBC
FBC->>MSF: OnClearFilter()
activate MSF
MSF->>MSF: Reset() filter state (_value1, _action1, etc.)
MSF->>Table: Clears filter conditions
Table-->>User: Shows unfiltered data
deactivate MSF
deactivate FBC
Class Diagram for the new MultiSelectFilter ComponentclassDiagram
class FilterBase {
%% Base class for filter components
}
class MultiSelectFilter~TType~ {
+List~SelectedItem~ Items
-TType _value1
-FilterAction _action1
+Reset() void
+GetFilterConditions() FilterKeyValueAction
+SetFilterConditionsAsync(filter: FilterKeyValueAction) Task
}
MultiSelectFilter --|> FilterBase
class FilterKeyValueAction {
%% Data structure for filter conditions
}
class SelectedItem {
%% Represents an item in a select list
}
MultiSelectFilter ..> FilterKeyValueAction : uses
MultiSelectFilter ..> SelectedItem : uses
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6097 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 701 703 +2
Lines 30968 31026 +58
Branches 4380 4387 +7
=========================================
+ Hits 30968 31026 +58 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Hey @ArgoZhang - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟡 General issues: 2 issues found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Link issues
fixes #6096
Summary By Copilot
Regression?
Risk
Verification
Packaging changes reviewed?
☑️ Self Check before Merge
Summary by Sourcery
Add a new MultiSelectFilter component for table column filtering, integrate it into header and cell templates, refine the search input behavior in the existing MultiFilter component, and cover functionality with unit tests.
New Features:
Enhancements:
Tests: