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(layout): 修复 treeRowsWidth 配置不生效 close #1622 #1646

Merged
merged 4 commits into from
Aug 5, 2022

Conversation

lijinke666
Copy link
Member

@lijinke666 lijinke666 commented Aug 3, 2022

👀 PR includes

🐛 Bugfix

  • Solve the issue and close #0

📝 Description

由于历史原因, 同时存在两个 treeRowsWidth

const s2Option = {
  hierarchyType: 'tree',
  style: {
    rowCfg: {
      width: 50,
      treeRowsWidth: 500
    },
    treeRowsWidth: 100,  // 以这个为准
  },
};
  1. style.rowCfg.treeRowsWidth : 宽高 resize 的时候使用
  2. style.treeRowsWidth: 自定义宽高/预设场景

问题: 当同时存在 style.rowCfg.widthstyle.treeRowsWidth 时, 后者未生效
解法:

  1. 废弃 style.rowCfg.treeRowsWidth 因为这两个属性其实是同一个含义
  2. resize 的时候, 同时设置 style.rowCfg.treeRowsWidthstyle.treeRowsWidth 保持兼容

🖼️ 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.

@vercel
Copy link

vercel bot commented Aug 3, 2022

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

Name Status Preview Updated
antvis-s2 ✅ Ready (Inspect) Visit Preview Aug 5, 2022 at 10:07AM (UTC)
s2 ❌ Failed (Inspect) Aug 5, 2022 at 10:07AM (UTC)

@lgtm-com
Copy link

lgtm-com bot commented Aug 3, 2022

This pull request introduces 1 alert when merging 3af7230 into 9d5d8b7 - view on LGTM.com

new alerts:

  • 1 for Unused variable, import, function or class

@github-actions
Copy link
Contributor

github-actions bot commented Aug 3, 2022

Size Change: +32 B (0%)

Total Size: 425 kB

Filename Size Change
./packages/s2-core/dist/index.min.js 165 kB +32 B (0%)
ℹ️ View Unchanged
Filename Size
./packages/s2-core/dist/style.min.css 389 B
./packages/s2-core/node_modules/@testing-library/dom/dist/@testing-library/dom.cjs.js 21.7 kB
./packages/s2-core/node_modules/@testing-library/dom/dist/@testing-library/dom.esm.js 21.2 kB
./packages/s2-core/node_modules/@testing-library/dom/dist/@testing-library/dom.umd.js 60.3 kB
./packages/s2-core/node_modules/@testing-library/dom/dist/@testing-library/dom.umd.min.js 33.9 kB
./packages/s2-core/node_modules/@testing-library/dom/dist/config.js 1.16 kB
./packages/s2-core/node_modules/@testing-library/dom/dist/DOMElementFilter.js 1.87 kB
./packages/s2-core/node_modules/@testing-library/dom/dist/event-map.js 1.18 kB
./packages/s2-core/node_modules/@testing-library/dom/dist/events.js 1.55 kB
./packages/s2-core/node_modules/@testing-library/dom/dist/get-node-text.js 300 B
./packages/s2-core/node_modules/@testing-library/dom/dist/get-queries-for-element.js 738 B
./packages/s2-core/node_modules/@testing-library/dom/dist/get-user-code-frame.js 810 B
./packages/s2-core/node_modules/@testing-library/dom/dist/helpers.js 1.07 kB
./packages/s2-core/node_modules/@testing-library/dom/dist/index.js 1.14 kB
./packages/s2-core/node_modules/@testing-library/dom/dist/label-helpers.js 1.05 kB
./packages/s2-core/node_modules/@testing-library/dom/dist/matches.js 1.14 kB
./packages/s2-core/node_modules/@testing-library/dom/dist/pretty-dom.js 1.47 kB
./packages/s2-core/node_modules/@testing-library/dom/dist/queries/all-utils.js 337 B
./packages/s2-core/node_modules/@testing-library/dom/dist/queries/alt-text.js 573 B
./packages/s2-core/node_modules/@testing-library/dom/dist/queries/display-value.js 713 B
./packages/s2-core/node_modules/@testing-library/dom/dist/queries/index.js 418 B
./packages/s2-core/node_modules/@testing-library/dom/dist/queries/label-text.js 1.8 kB
./packages/s2-core/node_modules/@testing-library/dom/dist/queries/placeholder-text.js 491 B
./packages/s2-core/node_modules/@testing-library/dom/dist/queries/role.js 2.67 kB
./packages/s2-core/node_modules/@testing-library/dom/dist/queries/test-id.js 498 B
./packages/s2-core/node_modules/@testing-library/dom/dist/queries/text.js 958 B
./packages/s2-core/node_modules/@testing-library/dom/dist/queries/title.js 718 B
./packages/s2-core/node_modules/@testing-library/dom/dist/query-helpers.js 1.81 kB
./packages/s2-core/node_modules/@testing-library/dom/dist/role-helpers.js 2.82 kB
./packages/s2-core/node_modules/@testing-library/dom/dist/screen.js 1.51 kB
./packages/s2-core/node_modules/@testing-library/dom/dist/suggestions.js 1.5 kB
./packages/s2-core/node_modules/@testing-library/dom/dist/wait-for-element-to-be-removed.js 748 B
./packages/s2-core/node_modules/@testing-library/dom/dist/wait-for.js 2.38 kB
./packages/s2-react/dist/index.min.js 64.1 kB
./packages/s2-react/dist/style.min.css 3.21 kB
./packages/s2-vue/dist/index.min.js 20.4 kB
./packages/s2-vue/dist/style.min.css 1.61 kB

compressed-size-action

@github-actions
Copy link
Contributor

github-actions bot commented Aug 3, 2022

你好, @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 Aug 3, 2022
stone-lyl
stone-lyl previously approved these changes Aug 4, 2022
Copy link
Member

@stone-lyl stone-lyl left a comment

Choose a reason for hiding this comment

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

LG

@stone-lyl
Copy link
Member

单测挂了,需要看一下

lcx-seima
lcx-seima previously approved these changes Aug 5, 2022
@lgtm-com
Copy link

lgtm-com bot commented Aug 5, 2022

This pull request introduces 1 alert when merging 7f479de into 3ea6349 - view on LGTM.com

new alerts:

  • 1 for Unused variable, import, function or class

@lijinke666 lijinke666 enabled auto-merge (squash) August 5, 2022 09:37
@github-actions github-actions bot removed the 🚨 test failed 单元测试挂了 label Aug 5, 2022
@lgtm-com
Copy link

lgtm-com bot commented Aug 5, 2022

This pull request introduces 1 alert when merging a4659f8 into fbf45df - view on LGTM.com

new alerts:

  • 1 for Unused variable, import, function or class

@codecov
Copy link

codecov bot commented Aug 5, 2022

Codecov Report

Merging #1646 (a4659f8) into master (fbf45df) will increase coverage by 0.03%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #1646      +/-   ##
==========================================
+ Coverage   77.29%   77.32%   +0.03%     
==========================================
  Files         231      231              
  Lines       11174    11177       +3     
  Branches     2354     2355       +1     
==========================================
+ Hits         8637     8643       +6     
+ Misses       1232     1231       -1     
+ Partials     1305     1303       -2     
Impacted Files Coverage Δ
...kages/s2-core/src/interaction/row-column-resize.ts 86.53% <ø> (ø)
packages/s2-core/src/common/constant/options.ts 100.00% <100.00%> (ø)
packages/s2-core/src/facet/pivot-facet.ts 82.14% <100.00%> (-0.30%) ⬇️
packages/s2-core/src/facet/base-facet.ts 85.35% <0.00%> (+0.45%) ⬆️
...ckages/s2-core/src/interaction/event-controller.ts 83.39% <0.00%> (+0.77%) ⬆️

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

@lijinke666 lijinke666 merged commit 9e70d62 into master Aug 5, 2022
@lijinke666 lijinke666 deleted the fix-row-width branch August 5, 2022 10:38
@lijinke666
Copy link
Member Author

🎉 This PR is included in version @antv/s2-v1.25.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@lijinke666
Copy link
Member Author

🎉 This PR is included in version @antv/s2-react-v1.23.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

xingwanying added a commit that referenced this pull request Aug 12, 2022
* feat: 当前只能复制数值可带表头复制 (#1590)

* feat: 添加通过 cellMetas 获取单元格对应的列头文本的方法

* feat: 添加通过 cellMetas 获取单元格对应的行头文本的方法

* feat: 只复制数据单元格时可以携带行列头

* feat: 选择某X行/列数据时可以携带行列头

* feat: 提取矩阵转换为字符串的方法

* test: 添加带行列头复制的单测

* test: 明细表添加带行列头复制的单测

* docs: 复制数据是否带表头信息

* feat(interaction): 行列宽高支持控制拖拽范围 (#1583)

* feat(interaction): 行列宽高支持控制拖拽范围

* feat(interaction): 增加测试和文档

* feat(interaction): 增加主题色

* Update row-column-resize-spec.ts

* Update packages/s2-core/src/interaction/row-column-resize.ts

Co-authored-by: Wenjun Xu <906626481@qq.com>

* fix: rename

Co-authored-by: Wenjun Xu <906626481@qq.com>

* docs: 复制数据是否带表头信息

* refactor: 评审细节修改

Co-authored-by: zishang <lyl275911@antgroup.com>
Co-authored-by: Jinke Li <a1231236677287@163.com>
Co-authored-by: Wenjun Xu <906626481@qq.com>

* fix(layout): 修复 Firefox 浏览器部分 icon 渲染失败 close #1571 (#1599)

* fix: 有冻结行且有垂直scrollWidth时冻结行无法 resize (#1594)

* fix: 有冻结行且有垂直scrollWidth时冻结航无法resize

* fix: 有冻结行且有垂直scrollWidth时冻结航无法resize

Co-authored-by: owen.wjh <owen.wjh@antgroup.com>

* chore: 🤖 更新 lock 和 changelog 文件 (#1601)

* fix: sortByFunc 排序后行列维度节点丢失 (#1606)

* fix(interaction): 向左移动到不完全可见cell的时候,没有滚动过去 (#1607)

* fix: 明细表复制时无需使用formatter格式化列头label (#1610)

* fix: 明细表复制时无需使用formatter格式化列头label

* test: 完善明细表导出case

* feat: 支持resize最右侧column (#1611)

* feat: 支持resize最右侧column

* fix: 添加testing-library/dom dep

* fix: npm源

* fix: npm源

* fix: 切换成dispatchEvent

* fix: testcase fix

Co-authored-by: owen.wjh <owen.wjh@antgroup.com>

* docs: 将 S2Event 提取到 API 文档中, 方便查看 (#1618)

* fix(strategysheet): 修复趋势分析表列头格式化不生效 (#1616)

* fix(strategysheet): 修复趋势分析表列头格式化不生效

* fix: update

* test: 增加测试

* fix: test

* docs: 优化文档说法和校正有误的内容 (#1640)

* docs: 让 demo 展示符合主题

* docs: 排序文档优化

* docs: 合并单元格文档更新

* docs: getAllCells()获取数据说明问题

* fix:  修复存在 0 时,数值为 number 时,排序错误的问题 (#1644)

* fix: 修复存在 0 时,排序错误的问题

* test: 补充存在 0 时,排序错误的单测

* fix: 修复单测字典序排序错误

Co-authored-by: zishang <lyl275911@antgroup.com>

* fix(pagination): 分页配置未传 current 参数时表格渲染空白 (#1633)

* feat: 复制支持html格式 (#1647)

* feat: 复制支持html格式

* fix: 修复复制测试用例

* fix: 添加复制格式测试用例

* Update packages/s2-core/src/utils/export/copy.ts

Co-authored-by: stone <stone-lyl@users.noreply.github.com>

* fix: moved mimetype as enum

* chore: generic type narrowing

* fix: html escaping special chars

Co-authored-by: owen.wjh <owen.wjh@antgroup.com>
Co-authored-by: stone <stone-lyl@users.noreply.github.com>

* feat(interaction): 宽高调整事件透出 resizedWidth/resizedHeight, 修复错误类型定义 (#1638)

* feat(interaction): 宽高调整事件透出 resizedWidth/resizedHeight, 修复错误类型定义

* docs: 优化文档

* chore: 更新 reviewer

* fix: 修复pivot模式 cell点击事件无法触发BUG (#1623)

fix: 修复pivot-table cell事件无法触发BUG

* chore: 发布成功后自动部署官网 (#1649)

* fix(layout): 修复 treeRowsWidth 配置不生效 close #1622 (#1646)

* fix(layout): 修复 treeRowsWidth 配置不生效 close #1622

* test: 修复测试

* chore: 🤖 更新 lock 和 changelog 文件 (#1650)

* fix: 修复选中态的描边宽度样式问题 (#1654)

* fix: 链接字段高亮下划线过长 (#1652)

* refactor: measureTextWidth移动为spreadsheet实例方法

* test: 调整 text 测试用例

* feat: 明细表行头单元格支持拖拽 (#1655)

* feat: 明细表行头单元格支持拖拽

* feat: 明细表行头单元格支持拖拽

* test: 添加单测

* fix(interaction): 优化resetSheetStyle性能 (#1653)

* fix: 优化reset性能

* fix: icon draw

* docs: 官网文档优化 (#1661)

* fix(scroll): 修复滚动边界判断错误导致无法滚动 (#1664)

Co-authored-by: 卿珂 <lijinke.ljk@antgroup.com>

* chore: update the reviewers (#1673)

* fix(resize): 修复总计列存在子节点时无法调整宽度 (#1675)

* fix: 修复明细表 onRaneSort 失效问题 (#1678)

* docs: 修改排序API文档 (#1677)

* refactor: 重构多指标绘制文本布局逻辑

* feat: 趋势分析表支持icon字段标记

Co-authored-by: stone <stone-lyl@users.noreply.github.com>
Co-authored-by: zishang <lyl275911@antgroup.com>
Co-authored-by: Jinke Li <a1231236677287@163.com>
Co-authored-by: Wenjun Xu <906626481@qq.com>
Co-authored-by: serializedowen <wjh199455@gmail.com>
Co-authored-by: owen.wjh <owen.wjh@antgroup.com>
Co-authored-by: 刘嘉一 <lcx.seima@gmail.com>
Co-authored-by: YardWill <YardWill@users.noreply.github.com>
Co-authored-by: xiaochong44 <277324181@qq.com>
Co-authored-by: 卿珂 <lijinke.ljk@antgroup.com>
@lijinke666
Copy link
Member Author

🎉 This PR is included in version 1.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

wjgogogo pushed a commit that referenced this pull request Oct 25, 2023
* fix(layout): 修复 treeRowsWidth 配置不生效 close #1622

* test: 修复测试
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants