You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2018/10/24 21:03:49 UTC

[GitHub] williaster closed pull request #6179: [superset-client][bugfix] fix stop query

williaster closed pull request #6179: [superset-client][bugfix] fix stop query
URL: https://github.com/apache/incubator-superset/pull/6179
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/superset/assets/src/chart/chartAction.js b/superset/assets/src/chart/chartAction.js
index fa6821582a..fb0f3da3b4 100644
--- a/superset/assets/src/chart/chartAction.js
+++ b/superset/assets/src/chart/chartAction.js
@@ -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 =>
diff --git a/superset/assets/src/chart/chartReducer.js b/superset/assets/src/chart/chartReducer.js
index 5f9a421d6a..28953babd8 100644
--- a/superset/assets/src/chart/chartReducer.js
+++ b/superset/assets/src/chart/chartReducer.js
@@ -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) {
diff --git a/superset/assets/src/common.js b/superset/assets/src/common.js
index d183d9c28e..b345999f6b 100644
--- a/superset/assets/src/common.js
+++ b/superset/assets/src/common.js
@@ -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.$ = $;


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org