fabianmenges commented on a change in pull request #3518: Full Annotation 
Framework
URL: 
https://github.com/apache/incubator-superset/pull/3518#discussion_r157033101
 
 

 ##########
 File path: superset/assets/javascripts/modules/superset.js
 ##########
 @@ -215,13 +237,22 @@ const px = function (state) {
         container.fadeTo(0.5, 0.25);
         sliceCell.addClass('slice-cell-highlight');
         container.css('height', this.height());
+        const asyncAnnotations = (formData.annotation_layers || [])
+          .map(x => runAnnotationQuery(x, timeout, formData));
         $.ajax({
           url: this.jsonEndpoint(formDataExtra),
           timeout: timeout * 1000,
           success: (queryResponse) => {
             try {
-              vizMap[formData.viz_type](this, queryResponse);
               this.done(queryResponse);
+              // render when all the annotations are available
+              Promise.all(asyncAnnotations)
+                .then((annotations) => {
+                  this.annotationData = annotations
+                    .reduce((data, a) => ({ ...data, ...a }), {});
+                  return Promise.resolve();
+                })
+                .then(() => vizMap[formData.viz_type](this, queryResponse));
 
 Review comment:
   This has been addressed

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to