Browse Source

HUE-6041 [importer] Custom field separator should be propagated to all instances of it

Enrico Berti 8 năm trước cách đây
mục cha
commit
226bb5ef38
1 tập tin đã thay đổi với 5 bổ sung5 xóa
  1. 5 5
      desktop/libs/indexer/src/indexer/templates/importer.mako

+ 5 - 5
desktop/libs/indexer/src/indexer/templates/importer.mako

@@ -579,13 +579,13 @@ ${ assist.assistPanel() }
               </div>
               <span class="inline-labels" data-bind="visible: tableFormat() == 'text' && useCustomDelimiters()">
                 <label for="fieldDelimiter" class="control-label"><div>${ _('Field') }</div>
-                  <select id="fieldDelimiter" data-bind="selectize: $root.createWizard.customDelimiters, selectizeOptions: { create: true, maxLength: 2 }, value: customFieldDelimiter, optionsValue: 'value', optionsText: 'name'"></select>
+                  <select id="fieldDelimiter" data-bind="selectize: $root.createWizard.customDelimiters, selectizeOptions: { onOptionAdd: function(value){ $root.createWizard.customDelimiters.push({ 'value': value, 'name': value }) }, create: true, maxLength: 2 }, value: customFieldDelimiter, optionsValue: 'value', optionsText: 'name'"></select>
                 </label>
                 <label for="collectionDelimiter" class="control-label"><div>${ _('Array, Map') }</div>
-                  <select id="collectionDelimiter" data-bind="selectize: $root.createWizard.customDelimiters, selectizeOptions: { create: true, maxLength: 2 }, value: customCollectionDelimiter, optionsValue: 'value', optionsText: 'name'"></select>
+                  <select id="collectionDelimiter" data-bind="selectize: $root.createWizard.customDelimiters, selectizeOptions: { onOptionAdd: function(value){ $root.createWizard.customDelimiters.push({ 'value': value, 'name': value }) }, create: true, maxLength: 2 }, value: customCollectionDelimiter, optionsValue: 'value', optionsText: 'name'"></select>
                 </label>
                 <label for="structDelimiter" class="control-label"><div>${ _('Struct') }</div>
-                  <select id="structDelimiter" data-bind="selectize: $root.createWizard.customDelimiters, selectizeOptions: { create: true, maxLength: 2 }, value: customMapDelimiter, optionsValue: 'value', optionsText: 'name'"></select>
+                  <select id="structDelimiter" data-bind="selectize: $root.createWizard.customDelimiters, selectizeOptions: { onOptionAdd: function(value){ $root.createWizard.customDelimiters.push({ 'value': value, 'name': value }) }, create: true, maxLength: 2 }, value: customMapDelimiter, optionsValue: 'value', optionsText: 'name'"></select>
                 </label>
               </span>
             </span>
@@ -881,7 +881,7 @@ ${ assist.assistPanel() }
 <script type="text/html" id="arg-text-delimiter">
   <label>
     <div data-bind="text: description"></div>
-    <select data-bind="selectize: $root.createWizard.customDelimiters, selectizeOptions: { create: true, maxLength: 2 }, value: value, optionsValue: 'value', optionsText: 'name', attr: {placeholder: description}"></select>
+    <select data-bind="selectize: $root.createWizard.customDelimiters, selectizeOptions: { onOptionAdd: function(value){ $root.createWizard.customDelimiters.push({ 'value': value, 'name': value }) }, create: true, maxLength: 2 }, value: value, optionsValue: 'value', optionsText: 'name', attr: {placeholder: description}"></select>
   </label>
 </script>
 
@@ -1464,7 +1464,7 @@ ${ assist.assistPanel() }
       self.source = new Source(vm, self);
       self.destination = new Destination(vm, self);
 
-      self.customDelimiters = ko.observable([
+      self.customDelimiters = ko.observableArray([
         {'value': ',', 'name': 'Comma (,)'},
         {'value': '\\t', 'name': '^Tab (\\t)'},
         {'value': '\\n', 'name': 'New line'},