superset-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] mistercrunch commented on a change in pull request #3518: Full Annotation Framework
Date Thu, 01 Jan 1970 00:00:00 GMT
mistercrunch commented on a change in pull request #3518: Full Annotation Framework
URL: https://github.com/apache/incubator-superset/pull/3518#discussion_r157354083
 
 

 ##########
 File path: superset/assets/javascripts/chart/chartReducer.js
 ##########
 @@ -87,6 +87,53 @@ export default function chartReducer(charts = {}, action) {
     [actions.RENDER_TRIGGERED](state) {
       return { ...state, lastRendered: action.value };
     },
+    [actions.ANNOTATION_QUERY_STARTED](state) {
+      if (state.annotationQuery &&
+        state.annotationQuery[action.annotation.name]) {
+        state.annotationQuery[action.annotation.name].abort();
+      }
+      const annotationQuery = {
+        ...state.annotationQuery,
+        [action.annotation.name]: action.queryRequest,
+      };
+      return {
+        ...state,
+        annotationQuery,
+      };
+    },
+    [actions.ANNOTATION_QUERY_SUCCESS](state) {
+      const annotationData = {
+        ...state.annotationData,
+        [action.annotation.name]: action.queryResponse.data,
 
 Review comment:
   I wonder if we should use a `shortid` like we do in other places in the code. Otherwise
we have to make sure names are unique as they get inputed

----------------------------------------------------------------
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

Mime
View raw message