-
-
Notifications
You must be signed in to change notification settings - Fork 364
feat(MultiSelect): add CloseButtonIcon parameter #5662
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 introduces a new Updated class diagram for the ComponentIcons enumclassDiagram
class ComponentIcons {
<<enumeration>>
MultiSelectDropdownIcon
MultiSelectCloseIcon
MultiSelectClearIcon
}
note for ComponentIcons "Renamed MultiSelectClearIcon to MultiSelectCloseIcon and MultiSelectClearableIcon to MultiSelectClearIcon"
File-Level Changes
Assessment against 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:
- The enum ComponentIcons.cs has both MultiSelectCloseIcon and MultiSelectClearIcon, but the component only uses CloseButtonIcon and ClearIcon - should the enum be simplified?
- Consider if ShowCloseButton should be enabled by default.
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 Security: all looks good
- 🟡 Testing: 1 issue found
- 🟢 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.
| /// <summary> | ||
| /// 获得/设置 关闭按钮图标 默认为 null | ||
| /// </summary> | ||
| [Parameter] | ||
| public string? CloseButtonIcon { get; set; } |
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.
suggestion: Consider aligning the nullability annotations for the new CloseButtonIcon parameter.
Other icon parameters in the component use a [NotNull] annotation. Assess if CloseButtonIcon should be annotated similarly or if its nullability is intentional.
| /// <summary> | |
| /// 获得/设置 关闭按钮图标 默认为 null | |
| /// </summary> | |
| [Parameter] | |
| public string? CloseButtonIcon { get; set; } | |
| /// <summary> | |
| /// 获得/设置 关闭按钮图标 默认为 string.Empty | |
| /// </summary> | |
| [Parameter] | |
| [NotNull] | |
| public string CloseButtonIcon { get; set; } = ""; |
| cut.SetParametersAndRender(pb => | ||
| { | ||
| pb.Add(a => a.ClearableIcon, "icon-clear-test"); | ||
| pb.Add(a => a.ClearIcon, "icon-clear-test"); |
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.
suggestion (testing): Add test for CloseButtonIcon
Since this PR introduces a new CloseButtonIcon parameter, it's important to add a dedicated test case for it, similar to the existing ClearIcon_Ok test. This ensures that the new parameter functions as expected and doesn't introduce regressions.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5662 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 654 654
Lines 29542 29542
Branches 4204 4204
=========================================
Hits 29542 29542 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Link issues
fixes #5661
Summary By Copilot
This pull request includes several changes to the
MultiSelectcomponent in theBootstrapBlazorproject. The changes mainly focus on renaming and updating icon properties, as well as updating related tests.Icon Property Updates:
src/BootstrapBlazor/Components/Select/MultiSelect.razor: ReplacedClearIconwithCloseButtonIconin theDynamicElementand updated the clearable icon reference. [1] [2]src/BootstrapBlazor/Components/Select/MultiSelect.razor.cs: Added a newCloseButtonIconparameter and removed theClearableIconparameter. Updated theOnParametersSetmethod to set default values forCloseButtonIconandClearIcon. [1] [2] [3]Enum and Icon Mapping Updates:
src/BootstrapBlazor/Enums/ComponentIcons.cs: RenamedMultiSelectClearIcontoMultiSelectCloseIconandMultiSelectClearableIcontoMultiSelectClearIcon.BootstrapIcons,FontAwesomeIcons, andMaterialDesignIconsto reflect the new icon names. [1] [2] [3]Version Update:
src/BootstrapBlazor/BootstrapBlazor.csproj: Updated the project version from9.5.0-beta04to9.5.0-beta05.Test Updates:
test/UnitTest/Components/MultiSelectTest.cs: Updated tests to reflect the changes in icon properties, including renamingClearableIcontoClearIconand modifying item selection logic. [1] [2]Regression?
Risk
Verification
Packaging changes reviewed?
☑️ Self Check before Merge
Summary by Sourcery
Adds a CloseButtonIcon parameter to the MultiSelect component, allowing customization of the close button icon. Also renames ClearableIcon to ClearIcon and updates related icon mappings and tests.
Enhancements: