mirror of
https://github.com/apache/superset.git
synced 2026-05-12 19:35:17 +00:00
fix(Dashboard): Retain colors when color scheme not set (#30646)
This commit is contained in:
@@ -76,6 +76,9 @@ const propTypes = {
|
||||
actions: PropTypes.object.isRequired,
|
||||
datasource_type: PropTypes.string.isRequired,
|
||||
dashboardId: PropTypes.number,
|
||||
colorScheme: PropTypes.string,
|
||||
ownColorScheme: PropTypes.string,
|
||||
dashboardColorScheme: PropTypes.string,
|
||||
isDatasourceMetaLoading: PropTypes.bool.isRequired,
|
||||
chart: chartPropShape.isRequired,
|
||||
slice: PropTypes.object,
|
||||
@@ -563,6 +566,7 @@ function ExploreViewContainer(props) {
|
||||
canOverwrite={props.can_overwrite}
|
||||
canDownload={props.can_download}
|
||||
dashboardId={props.dashboardId}
|
||||
colorScheme={props.dashboardColorScheme}
|
||||
isStarred={props.isStarred}
|
||||
slice={props.slice}
|
||||
sliceName={props.sliceName}
|
||||
@@ -741,6 +745,9 @@ function mapStateToProps(state) {
|
||||
},
|
||||
);
|
||||
const chart = charts[slice_id];
|
||||
const colorScheme = explore.form_data?.color_scheme;
|
||||
const ownColorScheme = explore.form_data?.own_color_scheme;
|
||||
const dashboardColorScheme = explore.form_data?.dashboard_color_scheme;
|
||||
|
||||
let dashboardId = Number(explore.form_data?.dashboardId);
|
||||
if (Number.isNaN(dashboardId)) {
|
||||
@@ -753,6 +760,9 @@ function mapStateToProps(state) {
|
||||
datasource_type: datasource.type,
|
||||
datasourceId: datasource.datasource_id,
|
||||
dashboardId,
|
||||
colorScheme,
|
||||
ownColorScheme,
|
||||
dashboardColorScheme,
|
||||
controls: explore.controls,
|
||||
can_add: !!explore.can_add,
|
||||
can_download: !!explore.can_download,
|
||||
|
||||
Reference in New Issue
Block a user