Browse Source

HUE-5284 [notebook] Reset snippet status when switching its type

Romain Rigaux 9 years ago
parent
commit
5d5a5aa

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

@@ -260,6 +260,9 @@ var EditorViewModel = (function() {
     self.id = ko.observable(typeof snippet.id != "undefined" && snippet.id != null ? snippet.id : UUID());
     self.name = ko.observable(typeof snippet.name != "undefined" && snippet.name != null ? snippet.name : '');
     self.type = ko.observable(typeof snippet.type != "undefined" && snippet.type != null ? snippet.type : 'hive');
+    self.type.subscribe(function(newVal) {
+      self.status('ready');
+    });
 
     self.isBatchable = ko.computed(function() {
       return self.type() == 'hive'