[superset-client][bugfix] fix stop query (#6179)

This commit is contained in:
Chris Williams 2018-10-24 14:03:43 -07:00 committed by GitHub
parent 6ec9e1a4e9
commit 60796da38c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 7 deletions

View File

@ -174,7 +174,7 @@ export function runQuery(formData, force = false, timeout = 60, key) {
if (response.statusText === 'timeout') {
return dispatch(chartUpdateTimeout(response.statusText, timeout, key));
} else if (response.statusText === 'AbortError') {
} else if (response.name === 'AbortError') {
return dispatch(chartUpdateStopped(key));
}
return getClientErrorObject(response).then(parsedResponse =>

View File

@ -10,7 +10,7 @@ export const chart = {
chartUpdateEndTime: null,
chartUpdateStartTime: 0,
latestQueryFormData: {},
queryRequest: null,
queryController: null,
queryResponse: null,
triggerQuery: true,
lastRendered: 0,
@ -32,12 +32,13 @@ export default function chartReducer(charts = {}, action) {
};
},
[actions.CHART_UPDATE_STARTED](state) {
return { ...state,
return {
...state,
chartStatus: 'loading',
chartAlert: null,
chartUpdateEndTime: null,
chartUpdateStartTime: now(),
queryRequest: action.queryRequest,
queryController: action.queryController,
};
},
[actions.CHART_UPDATE_STOPPED](state) {

View File

@ -6,9 +6,6 @@ import { toggleCheckbox } from './modules/utils';
import setupClient from './setup/setupClient';
import setupColors from './setup/setupColors';
setupClient();
setupColors();
$(document).ready(function () {
$(':checkbox[data-checkbox-api-prefix]').change(function () {
const $this = $(this);
@ -31,6 +28,9 @@ $(document).ready(function () {
});
export function appSetup() {
setupClient();
setupColors();
// A set of hacks to allow apps to run within a FAB template
// this allows for the server side generated menus to function
window.$ = $;