Bläddra i källkod

HUE-9028 [editor] Notify on executable refresh while editing

Johan Ahlen 6 år sedan
förälder
incheckning
01761b405b

+ 2 - 0
desktop/core/src/desktop/js/apps/notebook2/execution/executor.js

@@ -109,6 +109,8 @@ class Executor {
     // Update the executables list
     this.executables = executables.all;
 
+    this.executables.forEach(executable => executable.notify());
+
     return executables.selected[0];
   }
 }

+ 4 - 6
desktop/core/src/desktop/js/ko/bindings/ace/aceGutterHandler.js

@@ -81,20 +81,18 @@ export default class AceGutterHandler {
     });
 
     if (this.executor) {
+      const session = this.editor.getSession();
+
       const executableSub = huePubSub.subscribe(EXECUTABLE_UPDATED_EVENT, executable => {
         if (executable.executor === this.executor) {
           const statement = executable.parsedStatement;
-          const session = this.editor.getSession();
           forEachLine(statement, line => {
+            session.removeGutterDecoration(line, COMPLETED_CSS);
+            session.removeGutterDecoration(line, EXECUTING_CSS);
             if (executable.isRunning()) {
-              session.removeGutterDecoration(line, COMPLETED_CSS);
               session.addGutterDecoration(line, EXECUTING_CSS);
             } else if (executable.isSuccess()) {
-              session.removeGutterDecoration(line, EXECUTING_CSS);
               session.addGutterDecoration(line, COMPLETED_CSS);
-            } else {
-              session.removeGutterDecoration(line, EXECUTING_CSS);
-              session.removeGutterDecoration(line, COMPLETED_CSS);
             }
           });
         }