Browse Source

HUE-3321 [editor] Don't save the settings visibility state with the editor

Johan Ahlen 9 năm trước cách đây
mục cha
commit
4b44d80836

+ 5 - 5
desktop/libs/notebook/src/notebook/static/notebook/js/notebook.ko.js

@@ -22,8 +22,8 @@
   }
 }(this, function (ko, AssistHelper, Autocompleter) {
 
-  var SPARK_MAPPING = {
-    ignore: ["ace", "images", "autocompleter", "selectedStatement", "assistHelpers", "user", "inFocus", "history", "availableSnippets"]
+  var NOTEBOOK_MAPPING = {
+    ignore: ["ace", "autocompleter", "availableSnippets", "history", "images", "inFocus", "isResultSettingsVisible", "selectedStatement", "settingsVisible", "user"]
   };
 
   var Result = function (snippet, result) {
@@ -555,7 +555,7 @@
       .always(function() {
         if (notebook.type() != 'notebook') {
           $.post("/notebook/api/historify", {
-            notebook: ko.mapping.toJSON(notebook, SPARK_MAPPING)
+            notebook: ko.mapping.toJSON(notebook, NOTEBOOK_MAPPING)
           }, function(data){
             if (vm.editorMode && data && data.status == 0 && data.id){
               hueUtils.changeURL('/notebook/editor?editor=' + data.id);
@@ -1029,7 +1029,7 @@
 
     self.save = function () {
       $.post("/notebook/api/notebook/save", {
-        "notebook": ko.mapping.toJSON(self, SPARK_MAPPING),
+        "notebook": ko.mapping.toJSON(self, NOTEBOOK_MAPPING),
         "editorMode": vm.editorMode
       }, function (data) {
         if (data.status == 0) {
@@ -1052,7 +1052,7 @@
 
     self.close = function () {
       $.post("/notebook/api/notebook/close", {
-        "notebook": ko.mapping.toJSON(self, SPARK_MAPPING),
+        "notebook": ko.mapping.toJSON(self, NOTEBOOK_MAPPING),
         "editorMode": vm.editorMode
       });
     };