Skip to content

Commit

Permalink
Merge branch 'next' into feat-g
Browse files Browse the repository at this point in the history
  • Loading branch information
wjgogogo committed May 6, 2024
2 parents 0d237c2 + 4ca1918 commit 43b9141
Show file tree
Hide file tree
Showing 57 changed files with 3,851 additions and 1,347 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/issue-opend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,13 @@ jobs:
你好 @${{ github.event.issue.user.login }},请按照 issue 模板填写相关信息, 方便大家高效沟通, 强烈推荐你阅读 [提 Issue 前必读](https://github.com/antvis/S2/issues/1904) 和 [如何向开源项目提交无法解答的问题](https://zhuanlan.zhihu.com/p/25795393)。
Hello @${{ github.event.issue.user.login }}, please fill in the relevant information according to the issue template to facilitate communication efficiently. recommend you to read [提 Issue 前必读](https://github.com/antvis/S2/issues/1904) and [如何向开源项目提交无法解答的问题](https://zhuanlan.zhihu.com/p/25795393), Thanks so much!
# 标题或正文 (版本号) 带有 next, 增加标记便于统计
- name: Auto Set Next Label
if: contains(github.event.issue.title, 'next') || contains(github.event.issue.body, 'next')
uses: actions-cool/issues-helper@main
with:
actions: 'add-labels'
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.issue.number }}
labels: 'next'
37 changes: 3 additions & 34 deletions .github/workflows/release-success.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,39 +57,8 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.JINKE_GITHUB_TOKEN }}

# 开始部署官网
- name: 🔊 Deploy start notify
uses: zcong1993/actions-ding@master
with:
dingToken: ${{ secrets.DING_TALK_ACCESS_TOKEN }}
ignoreError: true
body: |
{
"msgtype": "link",
"link": {
"title": "📢 开始自动部署旧版官网 (https://s2.antv.vision) 📢 ",
"text": "🔗 请点击链接查看详情",
"messageUrl": "https://github.com/antvis/S2/actions/workflows/release-success.yml",
"picUrl": "https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*gt5-RZDjt3IAAAAAAAAAAAAADmJ7AQ/original"
}
}
- name: Use Node.js 16
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'yarn'

# 安装官网依赖
- name: Install Dependencies
run: yarn

# 部署官网
- name: Deploy Site
run: yarn deploy

# 失败通知
- name: 🔊 Deploy failed notify
- name: 🔊 Create failed notify
if: ${{ failure() }}
uses: zcong1993/actions-ding@master
with:
Expand All @@ -99,8 +68,8 @@ jobs:
{
"msgtype": "link",
"link": {
"title": "🚨 旧版官网部署失败",
"text": "🔗 请点击链接查看具体原因, 尝试点击右上角 [Re-run all jobs] 重试, 或者手动部署 🚑",
"title": "🚨 同步 CHANGELOG 失败",
"text": "🔗 请点击链接查看具体原因, 尝试点击右上角 [Re-run all jobs] 重试 🚑",
"messageUrl": "https://github.com/antvis/S2/actions/workflows/release-success.yml",
"picUrl": "https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*PRSkSqsE_vYAAAAAAAAAAAAADmJ7AQ/original"
}
Expand Down
40 changes: 0 additions & 40 deletions .github/workflows/site-build-notify.yml

This file was deleted.

48 changes: 0 additions & 48 deletions .github/workflows/sync-notify.yml

This file was deleted.

20 changes: 20 additions & 0 deletions packages/s2-core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
# [@antv/s2-v2.0.0-next.19](https://github.com/antvis/S2/compare/@antv/s2-v2.0.0-next.18...@antv/s2-v2.0.0-next.19) (2024-04-30)


### Bug Fixes

* **layout:** 修复空数据的情况开启汇总分组渲染报错 close [#2661](https://github.com/antvis/S2/issues/2661) ([#2662](https://github.com/antvis/S2/issues/2662)) ([8158660](https://github.com/antvis/S2/commit/81586601ea7451f6ca56932bd4bf4ef7738dbd7d))
* 修复数据导出时列头被格式化 close [#2688](https://github.com/antvis/S2/issues/2688) ([#2694](https://github.com/antvis/S2/issues/2694)) ([19d8e60](https://github.com/antvis/S2/commit/19d8e608c27da89771cef7439402585af00750b9))
* 修复树状模式下开启分页, 行头展开收起后表格渲染异常 close [#2582](https://github.com/antvis/S2/issues/2582) ([#2590](https://github.com/antvis/S2/issues/2590)) ([b9e48a0](https://github.com/antvis/S2/commit/b9e48a0202d4105b75b0961096f106ca6039c553))
* 修复紧凑模式下单元格宽度计算忽略了icon宽度的问题 ([#2673](https://github.com/antvis/S2/issues/2673)) ([23ee734](https://github.com/antvis/S2/commit/23ee734ee09106f05b4278b8ab02202a78949a1d))
* 修复维值带有 '-' 时刷选复制无法复制表头 close [#2684](https://github.com/antvis/S2/issues/2684) ([#2691](https://github.com/antvis/S2/issues/2691)) ([11c0325](https://github.com/antvis/S2/commit/11c03256cf7bdc369601d9efd8f8e65807ae7b2f))
* 修复表格右键事件无法触发 close [#2687](https://github.com/antvis/S2/issues/2687) ([#2690](https://github.com/antvis/S2/issues/2690)) ([8b4f3e3](https://github.com/antvis/S2/commit/8b4f3e3dab83e6ae38b1d3362049af8352a7a4a9))
* 修复计算列宽时计算的文字宽度和判断文本是否溢出隐藏的文字宽度不一致的问题 ([#2689](https://github.com/antvis/S2/issues/2689)) ([2f52f3b](https://github.com/antvis/S2/commit/2f52f3be865327230d7a44762f34eb5711452cfa))
* 修复透视表开启多行文本后自定义行高不生效 close [#2678](https://github.com/antvis/S2/issues/2678) ([#2686](https://github.com/antvis/S2/issues/2686)) ([164259b](https://github.com/antvis/S2/commit/164259b66194de03c2073520389d2edfc352f9ab))
* 修复非滚动引起的渲染也会触发滚动事件的问题 ([#2692](https://github.com/antvis/S2/issues/2692)) ([0cc2839](https://github.com/antvis/S2/commit/0cc2839c4058bb8fea8d73b03db00165612d6515))


### Features

* canvas 支持挂载 s2 实例 ([#2645](https://github.com/antvis/S2/issues/2645)) ([ed21dcb](https://github.com/antvis/S2/commit/ed21dcb82ea4cb434587a4ffa4819f2a619ca1aa))

# [@antv/s2-v2.0.0-next.18](https://github.com/antvis/S2/compare/@antv/s2-v2.0.0-next.17...@antv/s2-v2.0.0-next.18) (2024-04-26)


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`PivotSheet Special Dimension Values Copy Tests should correctly copy data with header 1`] = `
Array [
Object {
"content": " 两片罐事业部 宝翼制罐 河北制罐 成都制罐 哈尔滨制
dq dq dq dq dq
2018-三月 53332
2019-三月 53332
2023-三月 53332 67456 53332 66293.333333 97192.090909
2023-四月 67454 0 70442.733333 56665 100535.760606
2023-五月 23566 -10000 73786.40303 65554 103879.430303
2023-六月 67456 22222 77130.072727 53332 107223.1
2023-七月 0 39998 80473.742424 70442.733333 61292.833333
2023-八月 0 48877 83817.412121 73786.40303 66293.333333
2023-九月 22222 49999 87161.081818 77130.072727 56665",
"type": "text/plain",
},
Object {
"content": "<meta charset=\\"utf-8\\"><table><tbody><tr><td></td><td>两片罐事业部</td><td>宝翼制罐</td><td>河北制罐</td><td>成都制罐</td><td>哈尔滨制罐</td></tr><tr><td></td><td>dq</td><td>dq</td><td>dq</td><td>dq</td><td>dq</td></tr><tr><td>2018年-三月</td><td>53332</td><td></td><td></td><td></td><td></td></tr><tr><td>2019年-三月</td><td>53332</td><td></td><td></td><td></td><td></td></tr><tr><td>2023年-三月</td><td>53332</td><td>67456</td><td>53332</td><td>66293.333333</td><td>97192.090909</td></tr><tr><td>2023年-四月</td><td>67454</td><td>0</td><td>70442.733333</td><td>56665</td><td>100535.760606</td></tr><tr><td>2023年-五月</td><td>23566</td><td>-10000</td><td>73786.40303</td><td>65554</td><td>103879.430303</td></tr><tr><td>2023年-六月</td><td>67456</td><td>22222</td><td>77130.072727</td><td>53332</td><td>107223.1</td></tr><tr><td>2023年-七月</td><td>0</td><td>39998</td><td>80473.742424</td><td>70442.733333</td><td>61292.833333</td></tr><tr><td>2023年-八月</td><td>0</td><td>48877</td><td>83817.412121</td><td>73786.40303</td><td>66293.333333</td></tr><tr><td>2023年-九月</td><td>22222</td><td>49999</td><td>87161.081818</td><td>77130.072727</td><td>56665</td></tr></tbody></table>",
"type": "text/html",
},
]
`;
62 changes: 62 additions & 0 deletions packages/s2-core/__tests__/bugs/issue-2684-spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/**
* 透视表维值含有 "-", 复制数据时表头缺失
* @description spec for issue #2684
* https://github.com/antvis/S2/issues/2684
*/

import { isEmpty } from 'lodash';
import { InteractionStateName } from '../../src';
import { getSelectedData } from '../../src/utils/export/copy';
import * as mockDataConfig from '../data/data-issue-2684.json';
import { createPivotSheet } from '../util/helpers';
import type { S2Options, SpreadSheet } from '@/index';

const s2Options: S2Options = {
width: 600,
height: 480,
interaction: {
copy: {
enable: true,
withHeader: true,
withFormat: true,
},
brushSelection: {
dataCell: true,
rowCell: true,
colCell: true,
},
multiSelection: true,
},
};

describe('PivotSheet Special Dimension Values Copy Tests', () => {
let s2: SpreadSheet;

beforeEach(async () => {
s2 = createPivotSheet(s2Options);
s2.setDataCfg(mockDataConfig);
await s2.render();
});

test('should correctly copy data with header', () => {
const { rowLeafNodes, colLeafNodes } = s2.facet.getLayoutResult();
const cells = s2.facet.getDataCells().map((cell) => {
const meta = cell.getMeta();
const colId = String(colLeafNodes[meta.colIndex].id);
const rowId = isEmpty(rowLeafNodes)
? String(meta.rowIndex)
: String(rowLeafNodes[meta.rowIndex].id);

return { ...meta, colId, rowId };
});

s2.interaction.changeState({
cells,
stateName: InteractionStateName.SELECTED,
});

const data = getSelectedData(s2);

expect(data).toMatchSnapshot();
});
});
Loading

0 comments on commit 43b9141

Please sign in to comment.