Skip to content
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

feat(module:tree-view): upgrade tree view #9003

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

WwwHhhYran
Copy link
Contributor

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?

Upgrade Tree View Component

angular/cdk has now marked treeControl as deprecated in 18.2.0, replacing it with levelAccessor and childrenAccessor, and is planning to remove treeControl in 21.0.0. So I'm going to synchronise this feature in Ng Zorro.

So I've made the following changes:

  • Deprecate nzTreeControl parameter and add nzLevelAccessor and nzChildrenAccessor paramter, in order to synchronize the new features of CdkTree (@angular/cdk ^18.2.0)
  • Rewrite all demos for Tree View component based on levelAccessor and childrenAccessor.
  • Update document

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@WwwHhhYran WwwHhhYran requested a review from hsuanxyz as a code owner February 11, 2025 12:25
Copy link

zorro-bot bot commented Feb 11, 2025

This preview will be available after the AzureCI is passed.

Copy link

codecov bot commented Feb 11, 2025

Codecov Report

Attention: Patch coverage is 95.45455% with 8 lines in your changes missing coverage. Please review.

Project coverage is 92.00%. Comparing base (2d9ff5f) to head (9c549c0).

Files with missing lines Patch % Lines
components/tree-view/indent.ts 81.81% 0 Missing and 6 partials ⚠️
components/tree-view/flattener.ts 97.36% 0 Missing and 1 partial ⚠️
components/tree-view/tree-virtual-scroll-view.ts 66.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9003      +/-   ##
==========================================
+ Coverage   91.94%   92.00%   +0.06%     
==========================================
  Files         559      575      +16     
  Lines       19769    20261     +492     
  Branches     3050     3122      +72     
==========================================
+ Hits        18176    18642     +466     
- Misses       1266     1279      +13     
- Partials      327      340      +13     

☔ 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.

@Laffery Laffery added this to the v19.2 milestone Feb 13, 2025
@HyperLife1119 HyperLife1119 added the PR: need-test Test is necessary for code changes. label Feb 14, 2025
@WwwHhhYran
Copy link
Contributor Author

There has been a lack of testing for Tree-View component for a long time, and this is a historical problem. I will add test cases to make up for it in the future. ( WIP...

@WwwHhhYran WwwHhhYran force-pushed the feat/tree_view_accessor branch from bf44c72 to 386deb3 Compare March 3, 2025 13:00
@WwwHhhYran WwwHhhYran force-pushed the feat/tree_view_accessor branch from 386deb3 to 9c549c0 Compare March 12, 2025 06:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants