Эх сурвалжийг харах

HUE-3496 [editor] Query variables are not persisted

Romain Rigaux 9 жил өмнө
parent
commit
b303a4b

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

@@ -317,7 +317,7 @@
       }, 100);
       }, 100);
     });
     });
 
 
-    self.variables = ko.observableArray([]);
+    self.variables = ko.mapping.fromJS(typeof snippet.variables != "undefined" && snippet.variables != null ? snippet.variables : []);
     self.variableNames = ko.computed(function () {
     self.variableNames = ko.computed(function () {
       var re = /(?:^|\W)\${(\w+)(?!\w)}/g;
       var re = /(?:^|\W)\${(\w+)(?!\w)}/g;
 
 

+ 1 - 1
desktop/libs/notebook/src/notebook/templates/editor_components.mako

@@ -733,7 +733,7 @@ ${ hueIcons.symbols() }
         <li>
         <li>
           <div class="input-prepend margin-top-10">
           <div class="input-prepend margin-top-10">
             <span class="muted add-on" data-bind="text: name"></span>
             <span class="muted add-on" data-bind="text: name"></span>
-            <input class="input-medium" type="text" placeholder="${ _("Variable value") }" data-bind="autogrowInput: { minWidth: 150, maxWidth: 270, comfortZone: 15 }">
+            <input class="input-medium" type="text" placeholder="${ _("Variable value") }" data-bind="value: value, autogrowInput: { minWidth: 150, maxWidth: 270, comfortZone: 15 }">
           </div>
           </div>
         </li>
         </li>
       </ul>
       </ul>