Skip to content

Commit 4ff9373

Browse files
lijinke666lcx-seimawjgogogoYardWill
authored
feat: 新增趋势分析表hover列头显示指标名 (#913)
* fix(frame): incorrect viewport splitline shadow (#898) * fix(frame): incorrect viewport splitline shadow * fix(frame): remove unnecessary init expression * fix: remove unsed import * Update packages/s2-core/src/common/interface/frame.ts * fix(typo): viewPort -> viewport Co-authored-by: Wenjun Xu <[email protected]> * fix(interactive): global selected event emit (#902) * fix: event emit * test: add test * test: add event test Co-authored-by: wengyidong.wyd <[email protected]> * chore: 更新CI中英文翻译 (#907) * chore: 更新CI中英文翻译 * chore: 将issue自动关闭日期增加到15天 * fix: 修复错误修改DefaultOptions问题 (#910) * feat: 新增趋势分析表hover列头显示指标名 Co-authored-by: 刘嘉一 <[email protected]> Co-authored-by: Wenjun Xu <[email protected]> Co-authored-by: YardWill <[email protected]> Co-authored-by: wengyidong.wyd <[email protected]>
1 parent b94cf36 commit 4ff9373

File tree

26 files changed

+282
-106
lines changed

26 files changed

+282
-106
lines changed

.github/workflows/issue-close-require.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,19 @@ jobs:
1313
with:
1414
actions: 'close-issues'
1515
labels: '🤔 Need Reproduce'
16-
inactive-day: 7
16+
inactive-day: 15
1717
body: |
18-
由于该 issue 被标记为需要复现,却 7 天未收到回应。现关闭 issue,若有任何问题,可评论回复。(Cause this issue was labeled as ‘need reproduce’ but received no replay in 7 days, it was going to be closed now. If you have any questions, feel free to comment.)
18+
由于该 issue 被标记为需要复现,却 15 天未收到回应。现关闭 issue,若有任何问题,可评论回复。
19+
20+
Since the issue was labeled as "need reproduce" but no response was received for 15 days. Now close the issue. If you have any questions, feel free to comment.
1921
2022
- name: Needs more info
2123
uses: actions-cool/issues-helper@main
2224
with:
2325
actions: 'close-issues'
2426
labels: '👀 need more info'
25-
inactive-day: 7
27+
inactive-day: 15
2628
body: |
27-
由于该 issue 被标记为需要复现,却 7 天未收到回应。现关闭 issue,若有任何问题,可评论回复。(Cause this issue was labeled as ‘need reproduce’ but received no replay in 7 days, it was going to be closed now. If you have any questions, feel free to comment.)
29+
由于该 issue 被标记为需要复现,却 15 天未收到回应。现关闭 issue,若有任何问题,可评论回复。
30+
31+
Since the issue was labeled as "need reproduce" but no response was received for 15 days. Now close the issue. If you have any questions, feel free to comment.

.github/workflows/issue-labeled.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ jobs:
1717
token: ${{ secrets.GITHUB_TOKEN }}
1818
issue-number: ${{ github.event.issue.number }}
1919
body: |
20-
你好 @${{ github.event.issue.user.login }},请提供一个可以在线访问的链接, 或者使用 [codesandbox](https://codesandbox.io/s/29zle) 并详细说明复现步骤, 7天内未回复issue自动关闭
20+
你好 @${{ github.event.issue.user.login }},请提供一个可以在线访问的链接, 或者 [codesandbox](https://codesandbox.io/s/29zle) 示例并详细说明复现步骤, 15 天内未回复issue自动关闭
2121
22-
Hello, @${{ github.event.issue.user.login }}, please provide an accessible link or use [codesandbox](https://codesandbox.io/s/29zle) to describe the step. It will be closed if we receive no replay in 7 days.
22+
Hello, @${{ github.event.issue.user.login }}, please provide an accessible link or [codesandbox](https://codesandbox.io/s/29zle) usage to describe the reproduction steps. The issue will be closed without any replay within 15 days.
2323
2424
- name: Need more info
2525
if: github.event.label.name == '👀 need more info'
@@ -31,7 +31,7 @@ jobs:
3131
body: |
3232
你好 @${{ github.event.issue.user.login }},你所提供的信息不足于我们排查问题, 请完善 issue 描述, 提供 gif, 截图等方式, 详细说明复现步骤, 感谢配合, 谢谢!
3333
34-
Hello, @${{ github.event.issue.user.login }}, the information you provided is not enough for us to trace the problem. Please complete the issue description, provide gifs, screenshots, etc. and explain the reproduction steps in detail. Thank you so much for being so cooperative!
34+
Hello, @${{ github.event.issue.user.login }}, the information you provided is not enough for us to troubleshoot the problem. Please complete the issue description, provide gifs, screenshots, etc. And explain the reproduction steps in detail. Thanks so much for your cooperation!
3535
3636
- name: Invalid
3737
if: github.event.label.name == '⛔ invalid'
@@ -43,7 +43,7 @@ jobs:
4343
body: |
4444
你好 @${{ github.event.issue.user.login }},请按照 issue 模板填写相关信息, 方便大家高效沟通。
4545
46-
Hello @${{ github.event.issue.user.login }}, please fill in the relevant information according to the issue template, so that everyone can communicate efficiently. Thank you so much!
46+
Hello @${{ github.event.issue.user.login }}, please fill in the relevant information according to the issue template to facilitate communication efficiently. Thanks so much!
4747
4848
- name: Enhancement
4949
if: github.event.label.name == '⚡ enhancement'
@@ -67,7 +67,7 @@ jobs:
6767
body: |
6868
你好 @${{ github.event.issue.user.login }},很抱歉给你带来了不好的体验, 我们会尽快排查问题并修复, 请关注后续发布日志.
6969
70-
Hello, @${{ github.event.issue.user.login }}, We are very sorry for the bad experience. We will troubleshoot and fix the problem as soon as possible. Please pay attention to the subsequent change logs.
70+
Hello, @${{ github.event.issue.user.login }}, We are so sorry for the bad experience. We will troubleshoot and fix the problem as soon as possible. Please pay attention to the follow-up change logs.
7171
7272
- name: Usage
7373
if: github.event.label.name == '🙀 usage' || github.event.label.name == '❔question'
@@ -79,7 +79,7 @@ jobs:
7979
body: |
8080
你好 @${{ github.event.issue.user.login }},Issue 板块是用于 bug 反馈与需求讨论的地方。你可以试着在 [antv s2 discussions](https://github.com/antvis/S2/discussions) 新开一个 discussion,选择 `🙏Q&A` 类别进行提问, 我们会及时进行解答, 感谢你的理解。
8181
82-
Hello, @${{ github.event.issue.user.login }}. The Issue section is used for bug feedback and requirement discussion. You can try to open a new discussion in [antv s2 discussions](https://github.com/antvis/S2/discussions), choose the `🙏Q&A` category to ask questions, we will answer in time. Thank you so much for being so understanding.
82+
Hello, @${{ github.event.issue.user.login }}. The Issue section is used for bug feedback and requirement discussion. You could open a new discussion in [antv s2 discussions](https://github.com/antvis/S2/discussions), choose the `🙏Q&A` category to ask questions. We will answer in time. Thanks so much for your understanding.
8383
8484
- name: Accepted
8585
if: github.event.label.name == '✅ accepted'
@@ -91,4 +91,4 @@ jobs:
9191
body: |
9292
你好 @${{ github.event.issue.user.login }},经过我们的反复讨论, 你的需求现已被采纳, 我们会排期开发, 请关注后续发布日志.
9393
94-
Hello, @${{ github.event.issue.user.login }}, After our repeated discussion, your feature request have been accepted, we will schedule the development, please pay attention to the subsequent release log
94+
Hello, @${{ github.event.issue.user.login }}, your feature request have been accepted After our repeated discussion. We will schedule the development, please pay attention to the follow-up release logs

.github/workflows/lint.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ jobs:
4444
token: ${{ secrets.GITHUB_TOKEN }}
4545
body: |
4646
你好, @${{ github.event.pull_request.user.login }} CI 执行失败, 请点击 [Details] 按钮查看, 并根据日志修复
47-
Hello, @${{ github.event.pull_request.user.login }} CI run failed, please click the [Details] button try to fixed it.
47+
48+
Hello, @${{ github.event.pull_request.user.login }} CI run failed, please click the [Details] button for detailed log information and fix it.
4849
<!-- Created by actions-cool/maintain-one-comment -->
4950
emojis: 'eyes'
5051
body-include: '<!-- Created by actions-cool/maintain-one-comment -->'

.github/workflows/pr-labeled.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
body: |
1919
你好 @${{ github.event.pull_request.user.login }},感谢你的贡献, 为了让代码更健壮, 请补充相应单元测试, 如果有API改动, 请修改 [相应的文档](https://github.com/antvis/S2/tree/master/s2-site)
2020
21-
Hello, @${{ github.event.pull_request.user.login }}, Thank you for your contribution. In order to make the code more robust, please supplement the corresponding unit tests, if there are API changes, please edit the [docs](https://github.com/antvis/S2/tree/master/s2-site).
21+
Hello, @${{ github.event.pull_request.user.login }}, Thanks for your contribution. In order to make the code more robust, please add the corresponding unit tests, and update the [docs](https://github.com/antvis/S2/tree/master/s2-site) if there are API changes.
2222
2323
- name: Need more info
2424
if: github.event.label.name == '👀 need more info'
@@ -30,4 +30,4 @@ jobs:
3030
body: |
3131
你好 @${{ github.event.pull_request.user.login }},感谢你的贡献, 请根据模板完善 PR 描述, 说明其改动目的和类型, 以便于我们可以更好的进行 Code Review
3232
33-
Hello, @${{ github.event.pull_request.user.login }}, Thank you for your contribution. Please improve the PR description according to the template, and explain the purpose and type of change, so that we can conduct a better Code Review.
33+
Hello, @${{ github.event.pull_request.user.login }}, Thanks for your contribution. Please improve the PR description based on the template, and explain the purpose and type of changes for a better Code Review.

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
body: |
4646
你好, @${{ github.event.pull_request.user.login }} CI 执行失败, 请点击 [Details] 按钮查看, 并根据日志修复。
4747
48-
Hello, @${{ github.event.pull_request.user.login }} CI run failed, please click the [Details] button try to fixed it.
48+
Hello, @${{ github.event.pull_request.user.login }} CI run failed, please click the [Details] button for detailed log information and fix it.
4949
<!-- Created by actions-cool/maintain-one-comment -->
5050
emojis: 'eyes'
5151
body-include: '<!-- Created by actions-cool/maintain-one-comment -->'

packages/s2-core/__tests__/unit/interaction/data-cell-multi-selection-spec.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@ describe('Interaction Data Cell Multi Selection Tests', () => {
4444
const mockCell = createMockCell('testId1').mockCell as any;
4545
s2 = createFakeSpreadSheet();
4646
s2.getCell = () => mockCell;
47+
s2.dataCfg = {
48+
...s2.dataCfg,
49+
fields: {
50+
valueInCols: false,
51+
},
52+
};
4753
dataCellMultiSelection = new DataCellMultiSelection(s2);
4854
s2.options = {
4955
...s2.options,
@@ -98,10 +104,21 @@ describe('Interaction Data Cell Multi Selection Tests', () => {
98104

99105
s2.getCell = () => mockCellB.mockCell as any;
100106

107+
s2.interaction.getActiveCells = () =>
108+
[mockCellA.mockCell, mockCellB.mockCell] as any;
109+
110+
const selected = jest.fn();
111+
s2.on(S2Event.GLOBAL_SELECTED, selected);
112+
101113
s2.emit(S2Event.DATA_CELL_CLICK, {
102114
stopPropagation() {},
103115
} as unknown as GEvent);
104116

117+
expect(selected).toHaveBeenCalledWith([
118+
mockCellA.mockCell,
119+
mockCellB.mockCell,
120+
]);
121+
105122
expect(s2.interaction.getState()).toEqual({
106123
cells: [mockCellA.mockCellMeta, mockCellB.mockCellMeta],
107124
stateName: InteractionStateName.SELECTED,

packages/s2-core/__tests__/unit/interaction/shift-multi-selection-spec.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,17 @@ describe('Interaction Shift Multi Selection Tests', () => {
121121

122122
s2.getCell = () => mockCell11.mockCell as any;
123123

124+
s2.interaction.getActiveCells = () =>
125+
[
126+
mockCell00.mockCell,
127+
mockCell10.mockCell,
128+
mockCell01.mockCell,
129+
mockCell11.mockCell,
130+
] as any;
131+
132+
const selected = jest.fn();
133+
s2.on(S2Event.GLOBAL_SELECTED, selected);
134+
124135
s2.emit(S2Event.DATA_CELL_CLICK, {
125136
stopPropagation() {},
126137
} as unknown as GEvent);
@@ -138,6 +149,12 @@ describe('Interaction Shift Multi Selection Tests', () => {
138149
],
139150
stateName: InteractionStateName.SELECTED,
140151
});
152+
expect(selected).toHaveBeenCalledWith([
153+
mockCell00.mockCell,
154+
mockCell10.mockCell,
155+
mockCell01.mockCell,
156+
mockCell11.mockCell,
157+
]);
141158
expect(
142159
s2.interaction.hasIntercepts([InterceptType.CLICK, InterceptType.HOVER]),
143160
).toBeTruthy();

packages/s2-core/__tests__/unit/utils/merge-spec.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@ describe('merge test', () => {
1919
});
2020
});
2121

22+
test('should return new object', () => {
23+
const obj = { name: 'name' };
24+
const result = customMerge(obj, { age: 100 });
25+
26+
expect(obj).toEqual({ name: 'name' });
27+
expect(result).toEqual({ name: 'name', age: 100 });
28+
});
29+
2230
test('should get safety data config', () => {
2331
expect(getSafetyDataConfig(null)).toStrictEqual({
2432
data: [],

packages/s2-core/src/cell/base-cell.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ export abstract class BaseCell<T extends SimpleBBox> extends Group {
200200
// handle link nodes
201201
if (showLinkFieldShape) {
202202
const device = this.spreadsheet.options.style.device;
203-
let fillColor;
203+
let fillColor: string;
204204

205205
// 配置了链接跳转
206206
if (isMobile(device)) {

packages/s2-core/src/cell/col-cell.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ export class ColCell extends HeaderCell {
5757
this.drawBorders();
5858
// draw resize ares
5959
this.drawResizeArea();
60-
this.update();
6160
this.addExpandColumnIconShapes();
61+
this.update();
6262
}
6363

6464
protected drawBackgroundShape() {

0 commit comments

Comments
 (0)