-
-
Notifications
You must be signed in to change notification settings - Fork 364
feat(RadioListGeneric): implement RadioListGeneric component #4908
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
Reviewer's Guide by SourceryThis pull request implements the Sequence diagram for radio list item selectionsequenceDiagram
participant User
participant RadioList as RadioListGeneric
participant Parent as Parent Component
User->>RadioList: Click radio item
RadioList->>RadioList: Check if not disabled
alt not disabled
RadioList->>Parent: OnSelectedChanged(Items, Value)
RadioList->>RadioList: StateHasChanged()
end
Class diagram for RadioListGeneric componentclassDiagram
class RadioListGeneric~TValue~ {
+bool IsAutoAddNullItem
+string NullItemText
+bool ShowBorder
+bool IsVertical
+Color Color
+IEnumerable~SelectedItem<TValue>~ Items
+Func~IEnumerable<SelectedItem<TValue>>, TValue, Task~ OnSelectedChanged
+Type CustomKeyAttribute
+Func~TValue, TValue, bool~ ModelEqualityComparer
-string GroupName
-string ClassString
-string ButtonClassString
+OnParametersSet()
-Task OnClick(SelectedItem<TValue>)
-CheckboxState CheckState(SelectedItem<TValue>)
-RenderFragment GetChildContent(SelectedItem<TValue>)
+bool Equals(TValue, TValue)
}
class IModelEqualityComparer~TValue~ {
<<interface>>
+bool Equals(TValue, TValue)
}
RadioListGeneric --|> IModelEqualityComparer : implements
note for RadioListGeneric "Generic radio list component
Supports button and standard styles"
State diagram for RadioListGeneric item statesstateDiagram-v2
[*] --> Unchecked
Unchecked --> Checked: User clicks/selects
Checked --> Unchecked: User selects different item
state Disabled {
[*] --> DisabledUnchecked
DisabledUnchecked --> DisabledChecked
DisabledChecked --> DisabledUnchecked
}
Unchecked --> DisabledUnchecked: Disable component
Checked --> DisabledChecked: Disable component
DisabledUnchecked --> Unchecked: Enable component
DisabledChecked --> Checked: Enable component
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Thanks for your PR, @A5196060. Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
|
@microsoft-github-policy-service agree |
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 @A5196060 - I've reviewed your changes - here's some feedback:
Overall Comments:
- The OnClick handler doesn't update the Value property with the newly selected item's value before calling OnSelectedChanged. This will prevent the radio selection from working properly.
Here's what I looked at during the review
- 🟡 General issues: 3 issues found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟡 Complexity: 1 issue found
- 🟢 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.
# Conflicts: # src/BootstrapBlazor/Components/Radio/RadioListGeneric.razor.cs
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4908 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 626 628 +2
Lines 27994 28073 +79
Branches 4021 4038 +17
=========================================
+ Hits 27994 28073 +79 ☔ View full report in Codecov by Sentry. |
implement RadioListGeneric component
Summary of the changes (Less than 80 chars)
简单描述你更改了什么, 不超过80个字符;如果有关联 Issue 请在下方填写相关编号
Description
fixes #4906
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
New Features:
RadioListGenericcomponent, a new component for rendering a list of radio buttons.