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

refactor(standardized form data): refine interface and improve code smells #20518

Merged
merged 3 commits into from
Jun 28, 2022

Conversation

zhaoyongjie
Copy link
Member

@zhaoyongjie zhaoyongjie commented Jun 28, 2022

SUMMARY

This PR intends to clean up code and refine interfaces. there are no functional changes.

  1. rename denormalizeFormData to formDataOverrides in ControlPanelConfig
  2. a simpler approach for transformation.
  3. remove updateStandardizedState in ControlPanelConfig
  4. remove updateStandardizedState callback from each plugins
  5. add size, entity, and series to StandardizedControls

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

N/A

TESTING INSTRUCTIONS

CI

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

@zhaoyongjie zhaoyongjie requested review from kgabryje, geido and stephenLYZ and removed request for kgabryje June 28, 2022 09:12
@zhaoyongjie
Copy link
Member Author

/testenv up

@codecov
Copy link

codecov bot commented Jun 28, 2022

Codecov Report

Merging #20518 (6abd36a) into master (bbbe102) will decrease coverage by 0.00%.
The diff coverage is 69.27%.

❗ Current head 6abd36a differs from pull request most recent head bce9cbb. Consider uploading reports for the commit bce9cbb to get more accurate results

@@            Coverage Diff             @@
##           master   #20518      +/-   ##
==========================================
- Coverage   66.85%   66.85%   -0.01%     
==========================================
  Files        1749     1751       +2     
  Lines       65415    65424       +9     
  Branches     6906     6910       +4     
==========================================
+ Hits        43735    43740       +5     
- Misses      19930    19934       +4     
  Partials     1750     1750              
Flag Coverage Δ
javascript 51.84% <51.31%> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
.../superset-ui-core/src/query/types/QueryFormData.ts 100.00% <ø> (ø)
.../legacy-plugin-chart-world-map/src/controlPanel.ts 25.00% <0.00%> (ø)
...s/legacy-preset-chart-nvd3/src/Bar/controlPanel.ts 14.28% <0.00%> (ø)
...gacy-preset-chart-nvd3/src/DistBar/controlPanel.ts 7.14% <0.00%> (-1.20%) ⬇️
.../legacy-preset-chart-nvd3/src/Line/controlPanel.ts 50.00% <0.00%> (ø)
.../BigNumber/BigNumberWithTrendline/controlPanel.tsx 25.00% <0.00%> (+5.00%) ⬆️
...s/plugin-chart-echarts/src/BoxPlot/controlPanel.ts 16.66% <0.00%> (-8.34%) ⬇️
...s/plugin-chart-echarts/src/Funnel/controlPanel.tsx 66.66% <0.00%> (+9.52%) ⬆️
...ns/plugin-chart-echarts/src/Gauge/controlPanel.tsx 66.66% <0.00%> (+16.66%) ⬆️
...ns/plugin-chart-echarts/src/Graph/controlPanel.tsx 21.42% <0.00%> (+1.42%) ⬆️
... and 49 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bbbe102...bce9cbb. Read the comment docs.

@github-actions
Copy link
Contributor

@zhaoyongjie Ephemeral environment spinning up at http://54.184.4.230:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

@kgabryje
Copy link
Member

I think I found a bug when moving between Line Chart, Big Number and Pie chart. When I add 2 metrics while on Line Chart and then I switch to Big Number, it uses the first metric(correctly). Then I replace a metric on Big Number and switch to Pie chart. Pie Chart shows the second metric from Line chart instead of the metric from Big Number

Screen.Recording.2022-06-28.at.11.43.54.mov

@kgabryje
Copy link
Member

Oh it actually looks like it rotates on the metrics available in standardized form data when I switch between charts with a single metric 😄

Screen.Recording.2022-06-28.at.11.49.09.mov

@zhaoyongjie
Copy link
Member Author

I think I found a bug when moving between Line Chart, Big Number and Pie chart. When I add 2 metrics while on Line Chart and then I switch to Big Number, it uses the first metric(correctly). Then I replace a metric on Big Number and switch to Pie chart. Pie Chart shows the second metric from Line chart instead of the metric from Big Number
Screen.Recording.2022-06-28.at.11.43.54.mov

Thanks! Nice catch!

@@ -220,8 +220,4 @@ export function isDruidFormData(
return 'granularity' in formData;
}

export function isSavedMetric(metric: QueryFormMetric): metric is SavedMetric {
Copy link
Member Author

Choose a reason for hiding this comment

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

move to query/types/Metric.ts

@zhaoyongjie
Copy link
Member Author

/testenv up

@github-actions
Copy link
Contributor

@zhaoyongjie Ephemeral environment spinning up at http://34.214.147.176:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

Copy link
Member

@kgabryje kgabryje left a comment

Choose a reason for hiding this comment

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

Tested, works great!

@zhaoyongjie zhaoyongjie merged commit c348a09 into apache:master Jun 28, 2022
@github-actions
Copy link
Contributor

Ephemeral environment shutdown and build artifacts deleted.

akshatsri pushed a commit to charan1314/superset that referenced this pull request Jul 19, 2022
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 2.1.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/XL 🚢 2.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants