-
Notifications
You must be signed in to change notification settings - Fork 13.9k
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
Conversation
…or-superset into chore/color-scheme-updates
…or-superset into chore/color-scheme-updates
} | ||
const genColorMap = (scheme: string, update = false) => { | ||
// TODO: to check why colorMap is always empty | ||
const colorMap = getSharedLabelColor().getColorMap( |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 Report
@@ 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
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. |
superset-frontend/src/dashboard/components/DashboardBuilder/DashboardContainer.tsx
Outdated
Show resolved
Hide resolved
superset-frontend/src/dashboard/components/DashboardBuilder/DashboardContainer.tsx
Show resolved
Hide resolved
superset-frontend/src/dashboard/components/PropertiesModal/index.tsx
Outdated
Show resolved
Hide resolved
superset-frontend/src/explore/components/controls/ColorSchemeControl/index.jsx
Outdated
Show resolved
Hide resolved
…e/color-scheme-updates
There was a problem hiding this 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.
superset-frontend/src/dashboard/components/PropertiesModal/index.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
locally test. lgtm
…e/color-scheme-updates
Regression test finished and did not see issues. LGTM! |
…e/color-scheme-updates
🏷️ preset:2022.29 |
* 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)
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