-
-
Notifications
You must be signed in to change notification settings - Fork 364
feat(TreeView): add SetItems instance method #4934
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
Conversation
# Conflicts: # src/BootstrapBlazor/BootstrapBlazor.csproj
Co-Authored-By: Chason <[email protected]>
Co-Authored-By: Chason <[email protected]>
Co-Authored-By: Chason <[email protected]>
This reverts commit ac16979.
This reverts commit a5eed01.
Co-Authored-By: Chason <[email protected]>
Co-Authored-By: Chason <[email protected]>
Reviewer's Guide by SourceryThis pull request introduces a new Sequence diagram for TreeView item managementsequenceDiagram
participant Client
participant TreeView
participant TreeNodeStateCache
Client->>TreeView: SetItems(items)
Note over TreeView: Clear FlatItems & _rows
TreeView->>TreeView: StateHasChanged()
Client->>TreeView: SetActiveItem(item)
TreeView->>TreeView: Set _activeItem
TreeView->>TreeView: Expand parent nodes
TreeView->>TreeView: StateHasChanged()
Class diagram for TreeView component changesclassDiagram
class TreeView~TItem~ {
-TreeViewItem~TItem~? _activeItem
-List~TreeViewItem~TItem~~ Items
-List~TreeViewItem~TItem~~ FlatItems
+SetActiveItem(TreeViewItem~TItem~? item) void
+SetActiveItem(TItem item) void
+SetItems(List~TreeViewItem~TItem~~ items) void
+SetFlatItems(List~TreeViewItem~TItem~~ flatItems) void
}
note for TreeView~TItem~ "Added new SetItems and SetFlatItems methods
Refactored ActiveItem to _activeItem private field"
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @ArgoZhang - I've reviewed your changes - here's some feedback:
Overall Comments:
- Consider adding parameter validation in SetItems and SetFlatItems methods to handle null or empty collections appropriately.
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 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.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4934 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 628 628
Lines 28080 28078 -2
Branches 4042 4043 +1
=========================================
- Hits 28080 28078 -2 ☔ View full report in Codecov by Sentry. |
add SetItems instance method
Summary of the changes (Less than 80 chars)
简单描述你更改了什么, 不超过80个字符;如果有关联 Issue 请在下方填写相关编号
Description
fixes #4933
Regression?
[If yes, specify the version the behavior has regressed from]
[是否影响老版本]
Risk
[Justify the selection above]
Verification
Packaging changes reviewed?
☑️ Self Check before Merge
Summary by Sourcery
Add a
SetItemsinstance method to theTreeViewcomponent to allow resetting the data source and re-render the tree view.New Features:
SetItemsandSetFlatItemsinstance methods to theTreeViewcomponent. These methods allow for dynamically updating the tree view data and refreshing the display.Tests:
SetItemsandSetFlatItemsmethods.