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: Further drilling by different groupby fields #23754

Merged
merged 2 commits into from
Apr 21, 2023

Conversation

kgabryje
Copy link
Member

SUMMARY

Some charts, like Pivot Table (groupbyRows, groupbyColumns), Mixed Chart (groupby, groupby_b) or Graph (source, target) have more than 1 dimensions field in their form data.
If user started drilling by 1 field (e.g. groupbyRows) and then attempted further drilling by another field (e.g. groupbyColumns), the drilling would incorrectly apply the selected dimension to the first field instead of the second.
Moreover, if a chart has multiple adhoc filter fields (Mixed Chart - adhoc_filters and adhoc_filters_b), the same problem would occur - the filter might get applied to the wrong field.

This PR fixes the issue by passing the information about current drilling config to the modal, so that it knows how to construct the form data of the drilled chart.

Also, we save the history of drilling configs in the state so that the "undo" feature also works correctly.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before:

Screen.Recording.2023-04-20.at.17.44.03.mov

After:

Screen.Recording.2023-04-20.at.17.42.18.mov

TESTING INSTRUCTIONS

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@codecov
Copy link

codecov bot commented Apr 20, 2023

Codecov Report

Merging #23754 (b092830) into master (f80e738) will decrease coverage by 0.04%.
The diff coverage is 27.02%.

❗ Current head b092830 differs from pull request most recent head 4ed494d. Consider uploading reports for the commit 4ed494d to get more accurate results

@@            Coverage Diff             @@
##           master   #23754      +/-   ##
==========================================
- Coverage   68.11%   68.07%   -0.04%     
==========================================
  Files        1922     1923       +1     
  Lines       74103    74155      +52     
  Branches     8100     8106       +6     
==========================================
+ Hits        50476    50484       +8     
- Misses      21549    21593      +44     
  Partials     2078     2078              
Flag Coverage Δ
javascript 54.09% <27.02%> (-0.07%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...d/src/SqlLab/components/AceEditorWrapper/index.tsx 65.06% <ø> (ø)
...onents/Chart/ChartContextMenu/ChartContextMenu.tsx 76.19% <ø> (ø)
...ols/DndColumnSelectControl/ColumnSelectPopover.tsx 3.29% <0.00%> (-0.04%) ⬇️
...ols/FilterControl/AdhocFilterEditPopover/index.jsx 70.21% <ø> (ø)
...ols/MetricControl/AdhocMetricEditPopover/index.jsx 81.37% <ø> (ø)
superset-frontend/src/explore/constants.ts 100.00% <ø> (ø)
...ontrols/DndColumnSelectControl/useResizeButton.tsx 2.77% <2.77%> (ø)
...tend/src/components/Chart/DrillBy/DrillByModal.tsx 73.07% <46.87%> (-8.04%) ⬇️
.../src/components/Chart/DrillBy/DrillByMenuItems.tsx 90.00% <75.00%> (-1.31%) ⬇️
...t-frontend/src/components/AsyncAceEditor/index.tsx 91.11% <100.00%> (+0.20%) ⬆️

... and 4 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Member

@villebro villebro left a comment

Choose a reason for hiding this comment

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

LGTM and tested to work as expected.

@kgabryje kgabryje merged commit 0b43112 into apache:master Apr 21, 2023
sebastianliebscher pushed a commit to sebastianliebscher/superset that referenced this pull request Apr 28, 2023
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 3.0.0 labels Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/L 🚢 3.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants