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: 修复数据导出时列头被格式化 close #2688 #2694

Merged
merged 6 commits into from
Apr 30, 2024
Merged

Conversation

lijinke666
Copy link
Member

@lijinke666 lijinke666 commented Apr 29, 2024

👀 PR includes

🐛 Bugfix

📝 Description

  1. fix: 修复明细表自定义多级列头导出格式错误 close #2664 #2674 有一定碰伤, 透视表的行列头也可以进行格式化, 需要保留, 还原相关变更, 保留并重构明细表的现有处理逻辑.
  2. 重构复制导出相关单测, 修正部分错误的单测结果.

image

  meta: [
    { field: 'area', formatter: (v) => `${v}-#` },
    { field: 'city', formatter: (v) => `${v}-@` },
    { field: 'number', formatter: (v) => `${v}-$` },
  ]

🖼️ Screenshot

Before After
image image

🔗 Related issue link

🔍 Self-Check before the merge

  • Add or update relevant docs.
  • Add or update relevant demos.
  • Add or update test case.
  • Add or update relevant TypeScript definitions.

Copy link

vercel bot commented Apr 29, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
antvis-s2 ❌ Failed (Inspect) Apr 30, 2024 7:40am

Copy link
Contributor

github-actions bot commented Apr 29, 2024

Size Change: +57 B (0%)

Total Size: 320 kB

Filename Size Change
./packages/s2-core/dist/index.min.js 223 kB +57 B (0%)
ℹ️ View Unchanged
Filename Size
./packages/s2-core/dist/style.min.css 402 B
./packages/s2-react/dist/index.min.js 69.3 kB
./packages/s2-react/dist/style.min.css 4 kB
./packages/s2-vue/dist/index.min.js 21 kB
./packages/s2-vue/dist/style.min.css 1.97 kB

compressed-size-action

Copy link
Contributor

github-actions bot commented Apr 29, 2024

你好, @lijinke666 CI 执行失败, 请点击 [Details] 按钮查看, 并根据日志修复。

Hello, @lijinke666 CI run failed, please click the [Details] button for detailed log information and fix it.

@github-actions github-actions bot added the 🚨 test failed 单元测试挂了 label Apr 29, 2024
@@ -31,38 +33,28 @@ describe('PivotSheet Export Test', () => {
meta: [],
fields: {
valueInCols: true,
columns: ['province', 'city', 'type', 'sub_type', 'number'],
Copy link
Member Author

Choose a reason for hiding this comment

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

很多单测是错的, 可能之前复制粘贴的, 透视表但是跑的是明细表的用例

@@ -387,4 +384,47 @@ describe('TableSheet Export Test', () => {
expect(data.split(NewLine)).toMatchSnapshot();
},
);

it('should not apply formatter for col header by { formatHeader: false, formatData: true }', async () => {
Copy link
Member Author

Choose a reason for hiding this comment

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

增加各种场景的用例

@github-actions github-actions bot removed the 🚨 test failed 单元测试挂了 label Apr 30, 2024
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 86.36364% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 80.05%. Comparing base (ecdc9c8) to head (5448361).
Report is 333 commits behind head on next.

Files Patch % Lines
...-core/src/utils/export/copy/base-data-cell-copy.ts 83.33% 0 Missing and 1 partial ⚠️
...core/src/utils/export/copy/pivot-data-cell-copy.ts 83.33% 0 Missing and 1 partial ⚠️
packages/s2-core/src/utils/export/method.ts 75.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             next    #2694      +/-   ##
==========================================
+ Coverage   75.77%   80.05%   +4.28%     
==========================================
  Files         257      176      -81     
  Lines       11994    10090    -1904     
  Branches     2464     2312     -152     
==========================================
- Hits         9088     8078    -1010     
+ Misses       1398      620     -778     
+ Partials     1508     1392     -116     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@lijinke666 lijinke666 merged commit 19d8e60 into next Apr 30, 2024
7 of 8 checks passed
@lijinke666 lijinke666 deleted the fix-2688 branch April 30, 2024 07:34
@lijinke666
Copy link
Member Author

🎉 This PR is included in version @antv/s2-v2.0.0-next.19 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
next 2.0-next 版本的问题 pr(fix) bug fix released on @next
Projects
None yet
2 participants