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

chore: Update color scheme when deleted or changed #20589

Merged
merged 40 commits into from
Jul 25, 2022

Conversation

geido
Copy link
Member

@geido geido commented Jul 1, 2022

SUMMARY

This PR updates the color scheme for Dashboards and Charts when a color scheme in EXTRA_CATEGORICAL_COLOR_SCHEMES or EXTRA_SEQUENTIAL_COLOR_SCHEMES is deleted or changed.

KNOWN LIMITATIONS

At the moment, it isn't possible to regenerate the shared label colors for all charts when the Dashboard is using tabs. This is a problem affecting master too that will be investigated separetely.

TEST COVERAGE

More test cases covering the color schemes' behaviours will be published In a separate PR

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

}
const genColorMap = (scheme: string, update = false) => {
// TODO: to check why colorMap is always empty
const colorMap = getSharedLabelColor().getColorMap(
Copy link
Member Author

Choose a reason for hiding this comment

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

@stephenLYZ I am having hard times understanding why the color map is always empty. Can you shed some light?

Copy link
Member

Choose a reason for hiding this comment

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

I found dashboardInfo.json_metadata is not updated even though I have updated dashboard metadata, but using dashboardInfo.metadata is okay.

Copy link
Member Author

@geido geido Jul 5, 2022

Choose a reason for hiding this comment

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

@stephenLYZ it looks like shared_label_colors are only generated for rendered charts. See my comment in the PR description

@codecov
Copy link

codecov bot commented Jul 1, 2022

Codecov Report

Merging #20589 (824eb1d) into master (e3c6380) will decrease coverage by 11.50%.
The diff coverage is 73.91%.

❗ Current head 824eb1d differs from pull request most recent head 1518409. Consider uploading reports for the commit 1518409 to get more accurate results

@@             Coverage Diff             @@
##           master   #20589       +/-   ##
===========================================
- Coverage   66.30%   54.80%   -11.51%     
===========================================
  Files        1757     1757               
  Lines       66860    66862        +2     
  Branches     7077     7077               
===========================================
- Hits        44332    36641     -7691     
- Misses      20719    28412     +7693     
  Partials     1809     1809               
Flag Coverage Δ
hive 53.26% <50.00%> (-0.01%) ⬇️
mysql ?
postgres ?
presto 53.12% <50.00%> (-0.01%) ⬇️
python 57.83% <50.00%> (-23.77%) ⬇️
sqlite ?
unit 50.26% <50.00%> (-0.01%) ⬇️

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

Impacted Files Coverage Δ
...t-frontend/src/dashboard/actions/dashboardState.js 37.05% <ø> (ø)
superset/dashboards/dao.py 31.38% <0.00%> (-64.94%) ⬇️
...src/dashboard/components/PropertiesModal/index.tsx 62.82% <50.00%> (ø)
...set-frontend/src/explore/actions/hydrateExplore.ts 60.00% <83.33%> (ø)
.../superset-ui-core/src/color/ColorSchemeRegistry.ts 100.00% <100.00%> (ø)
...components/DashboardBuilder/DashboardContainer.tsx 72.22% <100.00%> (ø)
superset/dashboards/schemas.py 90.42% <100.00%> (-9.04%) ⬇️
superset/utils/dashboard_import_export.py 0.00% <0.00%> (-100.00%) ⬇️
superset/key_value/commands/update.py 0.00% <0.00%> (-88.89%) ⬇️
superset/key_value/commands/delete.py 0.00% <0.00%> (-85.30%) ⬇️
... and 289 more

Help us with your feedback. Take ten seconds to tell us how you rate us.

Copy link
Member

@stephenLYZ stephenLYZ left a comment

Choose a reason for hiding this comment

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

Left some comments. Others look good to me.

Copy link
Member

@stephenLYZ stephenLYZ left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Member

@zhaoyongjie zhaoyongjie left a comment

Choose a reason for hiding this comment

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

locally test. lgtm

@jinghua-qa
Copy link
Member

Regression test finished and did not see issues. LGTM!

@srinify srinify merged commit 6b0c303 into master Jul 25, 2022
@sadpandajoe
Copy link
Member

🏷️ preset:2022.29

sadpandajoe pushed a commit to preset-io/superset that referenced this pull request Jul 25, 2022
* feat(explore): Use v1/explore endpoint data instead of bootstrapData

* Add tests

* Fix ci

* Remove redundant dependency

* Use form_data_key in cypress tests

* Add auth headers to for data request

* Address comments

* Remove displaying danger toast

* Conditionally add auth headers

* Address comments

* Fix typing bug

* fix

* Fix opening dataset

* Fix sqllab chart create

* Run queries in parallel

* Fallback to default color scheme

* Fix dashboard id autofill

* Fix lint

* Fix test

* Fix hydrate action

* Update dashboard colors

* Add color scheme domain

* Add check for default scheme

* Make me pretty

* Clean up

* Nit

* Clean up

* Pretty

* Fix missing sequential

* Lint

* Enhance test

* Lint

Co-authored-by: Kamil Gabryjelski <kamil.gabryjelski@gmail.com>
(cherry picked from commit 6b0c303)
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 2.1.0 and removed 🚢 2.1.3 labels Mar 13, 2024
@mistercrunch mistercrunch deleted the chore/color-scheme-updates branch March 26, 2024 16:08
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 preset:2022.29 size/L 🚢 2.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants