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: 修复无汇总数据时前端计算汇总值缺少聚合方式导致排序失效的问题 #2711

Merged
merged 5 commits into from
May 11, 2024

Conversation

lijinke666
Copy link
Member

👀 PR includes

🐛 Bugfix

  • Solve the issue and close #

📝 Description

未开启小计, 但是希望按汇总数据进行排序, 增加前端兜底聚合方式 (求和), 兼容该场景

const sortParams: S2DataConfig['sortParams'] = [
  {
    sortFieldId: '2799920880364640bd8f935abd18c5c6',
    sortByMeasure: TOTAL_VALUE,
    sortMethod,
    query: {
      [EXTRA_FIELD]: 'b0aa459e944f4fa2a15aa676675b4fba',
    },
  },
]

🖼️ 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 May 10, 2024

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

Name Status Preview Comments Updated (UTC)
antvis-s2 ❌ Failed (Inspect) May 11, 2024 3:40am

Copy link
Contributor

github-actions bot commented May 10, 2024

Size Change: +104 B (0%)

Total Size: 7.94 MB

Filename Size Change
./packages/s2-core/dist/index.min.js 182 kB +26 B (+0.01%)
./packages/s2-react/node_modules/@antv/s2/dist/index.min.js 182 kB +26 B (+0.01%)
./packages/s2-shared/node_modules/@antv/s2/dist/index.min.js 182 kB +26 B (+0.01%)
./packages/s2-vue/node_modules/@antv/s2/dist/index.min.js 182 kB +26 B (+0.01%)
ℹ️ View Unchanged
Filename Size
./packages/s2-core/dist/style.min.css 389 B
./packages/s2-core/node_modules/@antv/g-canvas/dist/g.min.js 61.4 kB
./packages/s2-core/node_modules/@testing-library/dom/dist/@testing-library/dom.cjs.js 22.1 kB
./packages/s2-core/node_modules/@testing-library/dom/dist/@testing-library/dom.esm.js 21.5 kB
./packages/s2-core/node_modules/@testing-library/dom/dist/@testing-library/dom.umd.js 86.6 kB
./packages/s2-core/node_modules/@testing-library/dom/dist/@testing-library/dom.umd.min.js 48.6 kB
./packages/s2-core/node_modules/@testing-library/dom/dist/config.js 1.15 kB
./packages/s2-core/node_modules/@testing-library/dom/dist/DOMElementFilter.js 1.85 kB
./packages/s2-core/node_modules/@testing-library/dom/dist/event-map.js 1.19 kB
./packages/s2-core/node_modules/@testing-library/dom/dist/events.js 1.54 kB
./packages/s2-core/node_modules/@testing-library/dom/dist/get-node-text.js 298 B
./packages/s2-core/node_modules/@testing-library/dom/dist/get-queries-for-element.js 737 B
./packages/s2-core/node_modules/@testing-library/dom/dist/get-user-code-frame.js 805 B
./packages/s2-core/node_modules/@testing-library/dom/dist/helpers.js 1.09 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.72 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 571 B
./packages/s2-core/node_modules/@testing-library/dom/dist/queries/display-value.js 711 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.79 kB
./packages/s2-core/node_modules/@testing-library/dom/dist/queries/placeholder-text.js 490 B
./packages/s2-core/node_modules/@testing-library/dom/dist/queries/role.js 2.66 kB
./packages/s2-core/node_modules/@testing-library/dom/dist/queries/test-id.js 497 B
./packages/s2-core/node_modules/@testing-library/dom/dist/queries/text.js 1.02 kB
./packages/s2-core/node_modules/@testing-library/dom/dist/queries/title.js 716 B
./packages/s2-core/node_modules/@testing-library/dom/dist/query-helpers.js 1.8 kB
./packages/s2-core/node_modules/@testing-library/dom/dist/role-helpers.js 2.83 kB
./packages/s2-core/node_modules/@testing-library/dom/dist/screen.js 1.64 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 738 B
./packages/s2-core/node_modules/@testing-library/dom/dist/wait-for.js 2.36 kB
./packages/s2-core/node_modules/d3-dsv/dist/d3-dsv.js 2.3 kB
./packages/s2-core/node_modules/d3-dsv/dist/d3-dsv.min.js 1.52 kB
./packages/s2-core/node_modules/d3-interpolate/dist/d3-interpolate.js 4.53 kB
./packages/s2-core/node_modules/d3-interpolate/dist/d3-interpolate.min.js 3.19 kB
./packages/s2-core/node_modules/d3-timer/dist/d3-timer.js 1.45 kB
./packages/s2-core/node_modules/d3-timer/dist/d3-timer.min.js 919 B
./packages/s2-core/node_modules/tinycolor2/dist/tinycolor-min.js 5.45 kB
./packages/s2-react/dist/index.min.js 67.1 kB
./packages/s2-react/dist/style.min.css 3.43 kB
./packages/s2-react/node_modules/@ant-design/icons/dist/index.umd.js 201 kB
./packages/s2-react/node_modules/@ant-design/icons/dist/index.umd.min.js 170 kB
./packages/s2-react/node_modules/@antv/g-canvas/dist/g.min.js 61.4 kB
./packages/s2-react/node_modules/@antv/s2/dist/style.min.css 389 B
./packages/s2-react/node_modules/@testing-library/react/dist/@testing-library/react.cjs.js 4.28 kB
./packages/s2-react/node_modules/@testing-library/react/dist/@testing-library/react.esm.js 3.9 kB
./packages/s2-react/node_modules/@testing-library/react/dist/@testing-library/react.pure.cjs.js 3.98 kB
./packages/s2-react/node_modules/@testing-library/react/dist/@testing-library/react.pure.esm.js 3.59 kB
./packages/s2-react/node_modules/@testing-library/react/dist/@testing-library/react.pure.umd.js 74.6 kB
./packages/s2-react/node_modules/@testing-library/react/dist/@testing-library/react.pure.umd.min.js 39 kB
./packages/s2-react/node_modules/@testing-library/react/dist/@testing-library/react.umd.js 74.9 kB
./packages/s2-react/node_modules/@testing-library/react/dist/@testing-library/react.umd.min.js 39.1 kB
./packages/s2-react/node_modules/@testing-library/react/dist/act-compat.js 1.86 kB
./packages/s2-react/node_modules/@testing-library/react/dist/fire-event.js 853 B
./packages/s2-react/node_modules/@testing-library/react/dist/index.js 634 B
./packages/s2-react/node_modules/@testing-library/react/dist/pure.js 2.06 kB
./packages/s2-react/node_modules/ahooks/dist/ahooks.js 32.1 kB
./packages/s2-react/node_modules/antd/dist/antd-with-locales.js 765 kB
./packages/s2-react/node_modules/antd/dist/antd-with-locales.min.js 347 kB
./packages/s2-react/node_modules/antd/dist/antd.compact.css 72.3 kB
./packages/s2-react/node_modules/antd/dist/antd.compact.min.css 67.8 kB
./packages/s2-react/node_modules/antd/dist/antd.css 72.3 kB
./packages/s2-react/node_modules/antd/dist/antd.dark.css 73.6 kB
./packages/s2-react/node_modules/antd/dist/antd.dark.min.css 69.1 kB
./packages/s2-react/node_modules/antd/dist/antd.js 691 kB
./packages/s2-react/node_modules/antd/dist/antd.min.css 67.8 kB
./packages/s2-react/node_modules/antd/dist/antd.min.js 292 kB
./packages/s2-react/node_modules/antd/dist/antd.variable.css 77.2 kB
./packages/s2-react/node_modules/antd/dist/antd.variable.min.css 68.4 kB
./packages/s2-react/node_modules/antd/dist/compact-theme.js 120 B
./packages/s2-react/node_modules/antd/dist/dark-theme.js 118 B
./packages/s2-react/node_modules/antd/dist/default-theme.js 7.72 kB
./packages/s2-react/node_modules/antd/dist/theme.js 4.29 kB
./packages/s2-react/node_modules/antd/dist/variable-theme.js 122 B
./packages/s2-react/node_modules/d3-dsv/dist/d3-dsv.js 2.3 kB
./packages/s2-react/node_modules/d3-dsv/dist/d3-dsv.min.js 1.52 kB
./packages/s2-react/node_modules/react-beautiful-dnd/dist/react-beautiful-dnd.cjs.js 45.8 kB
./packages/s2-react/node_modules/react-beautiful-dnd/dist/react-beautiful-dnd.esm.js 45.6 kB
./packages/s2-react/node_modules/react-beautiful-dnd/dist/react-beautiful-dnd.js 73.6 kB
./packages/s2-react/node_modules/react-beautiful-dnd/dist/react-beautiful-dnd.min.js 31.4 kB
./packages/s2-react/node_modules/vite-plugin-svgr/dist/index.js 823 B
./packages/s2-shared/node_modules/@antv/s2/dist/style.min.css 389 B
./packages/s2-vue/dist/index.min.js 21.1 kB
./packages/s2-vue/dist/style.min.css 1.68 kB
./packages/s2-vue/node_modules/@antv/s2/dist/style.min.css 389 B
./packages/s2-vue/node_modules/@testing-library/vue/dist/fire-event.js 1.4 kB
./packages/s2-vue/node_modules/@testing-library/vue/dist/index.js 586 B
./packages/s2-vue/node_modules/@testing-library/vue/dist/render.js 1.57 kB
./packages/s2-vue/node_modules/@vue/shared/dist/shared.cjs.js 7.86 kB
./packages/s2-vue/node_modules/@vue/shared/dist/shared.cjs.prod.js 7.85 kB
./packages/s2-vue/node_modules/@vue/shared/dist/shared.esm-bundler.js 7.63 kB
./packages/s2-vue/node_modules/ant-design-vue/dist/antd-with-locales.js 742 kB
./packages/s2-vue/node_modules/ant-design-vue/dist/antd-with-locales.min.js 365 kB
./packages/s2-vue/node_modules/ant-design-vue/dist/antd.compact.css 72.9 kB
./packages/s2-vue/node_modules/ant-design-vue/dist/antd.compact.min.css 66 kB
./packages/s2-vue/node_modules/ant-design-vue/dist/antd.css 72.9 kB
./packages/s2-vue/node_modules/ant-design-vue/dist/antd.dark.css 74.2 kB
./packages/s2-vue/node_modules/ant-design-vue/dist/antd.dark.min.css 67.2 kB
./packages/s2-vue/node_modules/ant-design-vue/dist/antd.js 676 kB
./packages/s2-vue/node_modules/ant-design-vue/dist/antd.min.css 66 kB
./packages/s2-vue/node_modules/ant-design-vue/dist/antd.min.js 316 kB
./packages/s2-vue/node_modules/ant-design-vue/dist/antd.variable.css 78.5 kB
./packages/s2-vue/node_modules/ant-design-vue/dist/antd.variable.min.css 66.6 kB
./packages/s2-vue/node_modules/ant-design-vue/dist/compact-theme.js 120 B
./packages/s2-vue/node_modules/ant-design-vue/dist/dark-theme.js 118 B
./packages/s2-vue/node_modules/ant-design-vue/dist/default-theme.js 7.63 kB
./packages/s2-vue/node_modules/ant-design-vue/dist/theme.js 4.24 kB
./packages/s2-vue/node_modules/ant-design-vue/dist/variable-theme.js 122 B
./packages/s2-vue/node_modules/vue/dist/vue.cjs.js 1.01 kB
./packages/s2-vue/node_modules/vue/dist/vue.cjs.prod.js 817 B
./packages/s2-vue/node_modules/vue/dist/vue.esm-browser.js 106 kB
./packages/s2-vue/node_modules/vue/dist/vue.esm-browser.prod.js 51 kB
./packages/s2-vue/node_modules/vue/dist/vue.esm-bundler.js 915 B
./packages/s2-vue/node_modules/vue/dist/vue.global.js 106 kB
./packages/s2-vue/node_modules/vue/dist/vue.global.prod.js 49.9 kB
./packages/s2-vue/node_modules/vue/dist/vue.runtime.esm-browser.js 72.5 kB
./packages/s2-vue/node_modules/vue/dist/vue.runtime.esm-browser.prod.js 33.3 kB
./packages/s2-vue/node_modules/vue/dist/vue.runtime.esm-bundler.js 306 B
./packages/s2-vue/node_modules/vue/dist/vue.runtime.global.js 73.9 kB
./packages/s2-vue/node_modules/vue/dist/vue.runtime.global.prod.js 33.1 kB

compressed-size-action

Copy link
Contributor

github-actions bot commented May 10, 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 May 10, 2024
wjgogogo
wjgogogo previously approved these changes May 11, 2024
@lijinke666 lijinke666 merged commit ab53003 into master May 11, 2024
8 of 9 checks passed
@lijinke666 lijinke666 deleted the fix-sort-fallback branch May 11, 2024 03:41
@github-actions github-actions bot removed the 🚨 test failed 单元测试挂了 label May 11, 2024
@lijinke666
Copy link
Member Author

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

The release is available on:

Your semantic-release bot 📦🚀

lijinke666 added a commit that referenced this pull request May 11, 2024
* fix: 修复无汇总数据时前端计算汇总值缺少聚合方式导致排序失效的问题

* test: 单测修复

* test: 单测修复

* fix: 配置了 subTotalsDimensions 时不兜底
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.

2 participants