fix(module:checkbox): fix type of options#9099
Merged
Laffery merged 1 commit intoApr 21, 2025
Merged
Conversation
|
This preview will be available after the AzureCI is passed. |
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes an issue with the checkbox module by updating the type of the nzOptions property so that it accepts NzCheckboxOption[], string[], or number[].
- Updated the type of nzOptions in the checkbox group component
- Aims to improve flexibility in accepted option types
Comments suppressed due to low confidence (2)
components/checkbox/checkbox-group.component.ts:86
- It is recommended to add tests that cover scenarios for nzOptions being provided as string[] and number[] in addition to NzCheckboxOption[].
readonly nzOptions = input<NzCheckboxOption[] | string[] | number[]>([]);
components/checkbox/checkbox-group.component.ts:86
- The updated type for nzOptions now accepts three different types, which may require additional type guards or conversion logic in the component. Please ensure that the implementation properly handles each type to prevent potential runtime issues.
readonly nzOptions = input<NzCheckboxOption[] | string[] | number[]>([]);
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #9099 +/- ##
=======================================
Coverage 92.01% 92.01%
=======================================
Files 564 564
Lines 20026 20026
Branches 3107 3107
=======================================
+ Hits 18426 18427 +1
Misses 1261 1261
+ Partials 339 338 -1 ☔ View full report in Codecov by Sentry. 🚀 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.
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Does this PR introduce a breaking change?
Other information