mirror of
https://github.com/apache/superset.git
synced 2024-09-12 00:29:39 -04:00
Fix Chart Error Message Display (#3287)
This commit is contained in:
parent
9a4e4d0443
commit
025ef5a0f1
@ -43,6 +43,11 @@ export function chartRenderingFailed(error) {
|
||||
return { type: CHART_RENDERING_FAILED, error };
|
||||
}
|
||||
|
||||
export const REMOVE_CHART_ALERT = 'REMOVE_CHART_ALERT';
|
||||
export function removeChartAlert() {
|
||||
return { type: REMOVE_CHART_ALERT };
|
||||
}
|
||||
|
||||
export const RUN_QUERY = 'RUN_QUERY';
|
||||
export function runQuery(formData, force = false) {
|
||||
return function (dispatch, getState) {
|
||||
|
@ -141,11 +141,6 @@ export function removeControlPanelAlert() {
|
||||
return { type: REMOVE_CONTROL_PANEL_ALERT };
|
||||
}
|
||||
|
||||
export const REMOVE_CHART_ALERT = 'REMOVE_CHART_ALERT';
|
||||
export function removeChartAlert() {
|
||||
return { type: REMOVE_CHART_ALERT };
|
||||
}
|
||||
|
||||
export const UPDATE_CHART_TITLE = 'UPDATE_CHART_TITLE';
|
||||
export function updateChartTitle(slice_name) {
|
||||
return { type: UPDATE_CHART_TITLE, slice_name };
|
||||
|
@ -325,9 +325,9 @@ ChartContainer.propTypes = propTypes;
|
||||
function mapStateToProps({ explore, chart }) {
|
||||
const formData = getFormDataFromControls(explore.controls);
|
||||
return {
|
||||
alert: explore.chartAlert,
|
||||
can_overwrite: explore.can_overwrite,
|
||||
can_download: explore.can_download,
|
||||
alert: chart.chartAlert,
|
||||
can_overwrite: !!explore.can_overwrite,
|
||||
can_download: !!explore.can_download,
|
||||
datasource: explore.datasource,
|
||||
column_formats: explore.datasource ? explore.datasource.column_formats : null,
|
||||
containerId: explore.slice ? `slice-container-${explore.slice.slice_id}` : 'slice-container',
|
||||
|
@ -238,7 +238,7 @@ function mapStateToProps({ explore, saveModal }) {
|
||||
can_overwrite: explore.can_overwrite,
|
||||
user_id: explore.user_id,
|
||||
dashboards: saveModal.dashboards,
|
||||
alert: explore.saveModalAlert,
|
||||
alert: saveModal.saveModalAlert,
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -35,12 +35,12 @@ const bootstrappedState = Object.assign(
|
||||
isStarred: false,
|
||||
triggerQuery: true,
|
||||
triggerRender: false,
|
||||
alert: null,
|
||||
},
|
||||
);
|
||||
|
||||
const initState = {
|
||||
chart: {
|
||||
chartAlert: null,
|
||||
chartStatus: null,
|
||||
chartUpdateEndTime: null,
|
||||
chartUpdateStartTime: now(),
|
||||
@ -49,6 +49,7 @@ const initState = {
|
||||
},
|
||||
saveModal: {
|
||||
dashboards: [],
|
||||
saveModalAlert: null,
|
||||
},
|
||||
explore: bootstrappedState,
|
||||
};
|
||||
|
@ -63,6 +63,12 @@ export default function chartReducer(state = {}, action) {
|
||||
}
|
||||
return newState;
|
||||
},
|
||||
[actions.REMOVE_CHART_ALERT]() {
|
||||
if (state.chartAlert !== null) {
|
||||
return Object.assign({}, state, { chartAlert: null });
|
||||
}
|
||||
return state;
|
||||
},
|
||||
};
|
||||
|
||||
if (action.type in actionHandlers) {
|
||||
|
@ -65,12 +65,6 @@ export default function exploreReducer(state = {}, action) {
|
||||
const updatedSlice = Object.assign({}, state.slice, { slice_name: action.slice_name });
|
||||
return Object.assign({}, state, { slice: updatedSlice });
|
||||
},
|
||||
[actions.REMOVE_CHART_ALERT]() {
|
||||
if (state.chartAlert !== null) {
|
||||
return Object.assign({}, state, { chartAlert: null });
|
||||
}
|
||||
return state;
|
||||
},
|
||||
[actions.RESET_FIELDS]() {
|
||||
const controls = getControlsState(state, getFormDataFromControls(state.controls));
|
||||
return Object.assign({}, state, { controls });
|
||||
|
Loading…
Reference in New Issue
Block a user