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

fix(module: tree): fix IList DataSource cannot be modify in place #3275

Merged
merged 2 commits into from
Jun 4, 2023

Conversation

Jtfk
Copy link
Contributor

@Jtfk Jtfk commented May 29, 2023

🤔 This is a ...

  • New feature
  • Bug fix
  • Site / documentation update
  • Demo update
  • Component style update
  • Bundle size optimization
  • Performance optimization
  • Refactoring
  • Code style optimization
  • Test Case
  • Branch merge
  • Other (about what?)

🔗 Related issue link

Possible #2896

💡 Background and solution

In #2507, Tree#DataSource and Tree#ChildrenExpression are changed to IEnumerable making modifying DataSource in place not possible. This issue is currently present in Tree demo draggable page at the time of writing.

This PR aims to fix this by skipping ToList() call when the DataSource is IList in both TreeNode ChildDataItems and GetParentChildDataItems.

Additionally, some test cases are added to verify it.

📝 Changelog

Language Changelog
🇺🇸 English
🇨🇳 Chinese

☑️ Self Check before Merge

⚠️ Please check all items below before review. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • Changelog is provided or not needed

@github-actions
Copy link

github-actions bot commented May 29, 2023

@Jtfk
Copy link
Contributor Author

Jtfk commented May 29, 2023

@dotnet-policy-service agree

@ElderJames
Copy link
Member

Thank you for contribution.

@codecov
Copy link

codecov bot commented May 29, 2023

Codecov Report

Patch coverage: 80.00% and project coverage change: -0.70 ⚠️

Comparison is base (4fcfc02) 45.96% compared to head (f3e1735) 45.26%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3275      +/-   ##
==========================================
- Coverage   45.96%   45.26%   -0.70%     
==========================================
  Files         557      557              
  Lines       26734    26740       +6     
  Branches      266      266              
==========================================
- Hits        12288    12105     -183     
- Misses      14406    14595     +189     
  Partials       40       40              
Impacted Files Coverage Δ
components/tree/TreeNode.razor.cs 27.43% <80.00%> (+27.43%) ⬆️

... and 31 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@Jtfk Jtfk changed the title feat(module: tree): fix IList DataSource cannot be modify in place fix(module: tree): fix IList DataSource cannot be modify in place May 30, 2023
@ElderJames ElderJames merged commit 33032f7 into ant-design-blazor:master Jun 4, 2023
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants