Skip to content

fix(module:checkbox): fix type of options#9099

Merged
Laffery merged 1 commit into
NG-ZORRO:masterfrom
HyperLife1119:fix/checkbox-group-options-type
Apr 21, 2025
Merged

fix(module:checkbox): fix type of options#9099
Laffery merged 1 commit into
NG-ZORRO:masterfrom
HyperLife1119:fix/checkbox-group-options-type

Conversation

@HyperLife1119
Copy link
Copy Markdown
Collaborator

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Application (the showcase website) / infrastructure changes
  • Other... Please describe:

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@zorro-bot
Copy link
Copy Markdown

zorro-bot Bot commented Apr 19, 2025

This preview will be available after the AzureCI is passed.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Copy Markdown

codecov Bot commented Apr 19, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.01%. Comparing base (1c1c3e4) to head (b1aef26).
Report is 1 commits behind head on master.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Collaborator

@Laffery Laffery left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Laffery Laffery merged commit 7be2fe5 into NG-ZORRO:master Apr 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants