superset-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From grace...@apache.org
Subject [incubator-superset] branch master updated: [Explore] Fix Stop Query Button behavior (#4301)
Date Wed, 31 Jan 2018 17:34:16 GMT
This is an automated email from the ASF dual-hosted git repository.

graceguo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git


The following commit(s) were added to refs/heads/master by this push:
     new 1a7ef47  [Explore] Fix Stop Query Button behavior (#4301)
1a7ef47 is described below

commit 1a7ef4758b91eb99c086f1bfcc785161c26af35c
Author: Grace Guo <grace.guo@airbnb.com>
AuthorDate: Wed Jan 31 09:34:08 2018 -0800

    [Explore] Fix Stop Query Button behavior (#4301)
---
 superset/assets/javascripts/chart/chartAction.js                 | 9 ++++-----
 .../javascripts/explore/components/ExploreViewContainer.jsx      | 2 +-
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/superset/assets/javascripts/chart/chartAction.js b/superset/assets/javascripts/chart/chartAction.js
index 3682949..089a1dd 100644
--- a/superset/assets/javascripts/chart/chartAction.js
+++ b/superset/assets/javascripts/chart/chartAction.js
@@ -15,10 +15,7 @@ export function chartUpdateSucceeded(queryResponse, key) {
 }
 
 export const CHART_UPDATE_STOPPED = 'CHART_UPDATE_STOPPED';
-export function chartUpdateStopped(queryRequest, key) {
-  if (queryRequest) {
-    queryRequest.abort();
-  }
+export function chartUpdateStopped(key) {
   return { type: CHART_UPDATE_STOPPED, key };
 }
 
@@ -146,7 +143,9 @@ export function runQuery(formData, force = false, timeout = 60, key) {
         });
         if (err.statusText === 'timeout') {
           dispatch(chartUpdateTimeout(err.statusText, timeout, key));
-        } else if (err.statusText !== 'abort') {
+        } else if (err.statusText === 'abort') {
+          dispatch(chartUpdateStopped(key));
+        } else {
           let errObject;
           if (err.responseJSON) {
             errObject = err.responseJSON;
diff --git a/superset/assets/javascripts/explore/components/ExploreViewContainer.jsx b/superset/assets/javascripts/explore/components/ExploreViewContainer.jsx
index bf9afd4..9b1ec16 100644
--- a/superset/assets/javascripts/explore/components/ExploreViewContainer.jsx
+++ b/superset/assets/javascripts/explore/components/ExploreViewContainer.jsx
@@ -97,7 +97,7 @@ class ExploreViewContainer extends React.Component {
   }
 
   onStop() {
-    this.props.actions.chartUpdateStopped(this.props.chart.queryRequest);
+    return this.props.chart.queryRequest.abort();
   }
 
   getWidth() {

-- 
To stop receiving notification emails like this one, please contact
graceguo@apache.org.

Mime
View raw message