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(cdk:utils): add tree utils, fix data param of getAllSelectedKeys, fix filtered or paginated tree data value error #1406

Merged
merged 3 commits into from Jan 13, 2023

Conversation

sallerli1
Copy link
Contributor

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our guidelines
  • Tests for the changes have been added/updated or not needed
  • Docs and demo have been added/updated or not needed

What is the current behavior?

  1. 穿梭框用到的树相关工具函数均放在穿梭框组件下作为内部代码,且类型定义和穿梭框强相关
  2. 穿梭框数据处理策略getAllSelectedKeys接收的参数 data 在 mode === immediate 时仍然提供的是切分后的数据
  3. 树穿梭框在有过滤或者分页,且mode === immediate时,新勾选的数据会覆盖之前的数据

What is the new behavior?

  1. 提取工具函数到cdk/utils,并将类型定义改写为通用树类型数据,并补充单元测试
  2. 在 mode === immediate 时,提供 dataSource 而不是切分后的数据
  3. 新增 useTreeCheckStateResolver,在上述情况下外部根据dataSource受控处理勾选状态,不使用内部的的勾选数据

Other information

@idux-bot
Copy link

idux-bot bot commented Jan 12, 2023

This preview will be available after the AzureCI is passed.

@codecov
Copy link

codecov bot commented Jan 12, 2023

Codecov Report

Merging #1406 (abff482) into main (65328e7) will decrease coverage by 0.09%.
The diff coverage is 84.61%.

@@            Coverage Diff             @@
##             main    #1406      +/-   ##
==========================================
- Coverage   92.90%   92.80%   -0.10%     
==========================================
  Files         326      327       +1     
  Lines       29966    30288     +322     
  Branches     2498     2541      +43     
==========================================
+ Hits        27841    28110     +269     
- Misses       2125     2178      +53     
Impacted Files Coverage Δ
.../components/utils/src/useTreeCheckStateResolver.ts 74.82% <74.82%> (ø)
packages/cdk/utils/src/tree.ts 98.40% <98.40%> (ø)
packages/pro/transfer/src/token.ts 100.00% <100.00%> (ø)
packages/pro/transfer/src/types.ts 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@sallerli1 sallerli1 changed the title feat(cdk:utils): add tree utils, fix data param of getAllSelectedKeys, fix filtered or paginated tree data value error [WIP]feat(cdk:utils): add tree utils, fix data param of getAllSelectedKeys, fix filtered or paginated tree data value error Jan 12, 2023
@sallerli1 sallerli1 force-pushed the fix-pro-transfer-tree-check-state branch from 017b140 to b18e6a0 Compare January 12, 2023 13:21
@sallerli1 sallerli1 changed the title [WIP]feat(cdk:utils): add tree utils, fix data param of getAllSelectedKeys, fix filtered or paginated tree data value error feat(cdk:utils): add tree utils, fix data param of getAllSelectedKeys, fix filtered or paginated tree data value error Jan 13, 2023
 `data` param of `getAllSelectedKeys`  strategy fuction should be datasource when mod is immediate
@sallerli1 sallerli1 force-pushed the fix-pro-transfer-tree-check-state branch 2 times, most recently from 5a9144b to df7287d Compare January 13, 2023 08:13
when tree data is filtered or paginated, target data is overidden by new keys which should be appended insteadt
@sallerli1 sallerli1 force-pushed the fix-pro-transfer-tree-check-state branch from df7287d to abff482 Compare January 13, 2023 08:17
@danranVm danranVm merged commit 56035c1 into IDuxFE:main Jan 13, 2023
@sallerli1 sallerli1 deleted the fix-pro-transfer-tree-check-state branch February 20, 2023 06:10
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