feat(transfer)单击头部CheckBox时Items中IsDisabled为true的元素状态不改变#8147
Open
Tony-ST0754 wants to merge 1 commit into
Open
feat(transfer)单击头部CheckBox时Items中IsDisabled为true的元素状态不改变#8147Tony-ST0754 wants to merge 1 commit into
Tony-ST0754 wants to merge 1 commit into
Conversation
refactor:OnHeaderCheck方法中过滤IsDisabled=true的子元素
|
Thanks for your PR, @Tony-ST0754. Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
Contributor
Reviewer's guide (collapsed on small PRs)Reviewer's GuideUpdates the TransferPanel header checkbox handler so that bulk select/deselect only toggles items that are not disabled, leaving IsDisabled=true items’ Active state unchanged. Sequence diagram for TransferPanel header checkbox ignoring disabled itemssequenceDiagram
actor User
participant TransferPanel
User->>TransferPanel: OnHeaderCheck(state, headerItem)
alt state == CheckboxState.Checked
TransferPanel->>TransferPanel: GetShownItems()
loop for each item in shownItems
alt [item.IsDisabled]
Note over TransferPanel: item.Active unchanged
else [!item.IsDisabled]
TransferPanel->>TransferPanel: item.Active = true
end
end
else state != CheckboxState.Checked
TransferPanel->>TransferPanel: GetShownItems()
loop for each item in shownItems
alt [item.IsDisabled]
Note over TransferPanel: item.Active unchanged
else [!item.IsDisabled]
TransferPanel->>TransferPanel: item.Active = false
end
end
end
opt OnSelectedItemsChanged != null
TransferPanel->>TransferPanel: OnSelectedItemsChanged(SelectedItems)
end
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- In
OnHeaderCheck, consider filtering the result ofGetShownItems()once (e.g.,GetShownItems().Where(i => !i.IsDisabled)) instead of repeating theif (!i.IsDisabled)check in both branches to reduce duplication and make the intent clearer.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In `OnHeaderCheck`, consider filtering the result of `GetShownItems()` once (e.g., `GetShownItems().Where(i => !i.IsDisabled)`) instead of repeating the `if (!i.IsDisabled)` check in both branches to reduce duplication and make the intent clearer.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8147 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 766 766
Lines 34213 34221 +8
Branches 4696 4698 +2
=========================================
+ Hits 34213 34221 +8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
refactor:OnHeaderCheck方法中过滤IsDisabled=true的子元素
Link issues
fixes #8146
问题描述 / Problem Description
使用
LeftItemTemplate和RightItemTemplate时单独控制某个元素IsDisabled=true时,在单击组件头部中的CheckBox时,Items中IsDisabled=true的元素状态还是会跟着改变为:选中或未选中根本原因 / Root Cause
当子元素
IsDisabled=true时,也就是禁用了,这时单击组件头部中的CheckBox时,被禁用的子元素状态不应改变解决方案 / Solution
修改组件中
OnHeaderCheck方法,过滤掉IsDisabled=true的子元素Regression?
Risk
Verification
Packaging changes reviewed?
☑️ Self Check before Merge
Summary by Sourcery
Bug Fixes: