Browse Source

HUE-3384 [editor] Need better error message when canceling instead of None

Romain Rigaux 9 years ago
parent
commit
4a8da8b

+ 3 - 1
desktop/libs/notebook/src/notebook/static/notebook/js/notebook.ko.js

@@ -701,7 +701,9 @@
         notebook: ko.mapping.toJSON(notebook.getContext()),
         snippet: ko.mapping.toJSON(self.getContext())
       }, function (data) {
-        if (data.status == 0) {
+        if (self.status() == 'canceled') {
+          // Query was canceled in the meantime, do nothing
+        } else if (data.status == 0) {
           self.status(data.query_status.status);
           self.getLogs();
 

+ 5 - 0
desktop/libs/notebook/src/notebook/templates/editor_components.mako

@@ -942,6 +942,11 @@ ${ require.config() }
         <li data-bind="text: message"></li>
       </ul>
     </div>
+    <div class="snippet-error-container alert alert-error alert-error-gradient" data-bind="visible: status() == 'canceled'">
+      <ul class="unstyled">
+        <li>${ _("The statement was canceled.") }</li>
+      </ul>
+    </div>
   </div>
 </script>