Browse Source

HUE-5304 [indexer] Add column examples to the index field list

Note: need to restyle to be on one line.
Romain Rigaux 8 years ago
parent
commit
9a4ef1bfba

+ 3 - 3
desktop/core/src/desktop/templates/common_notebook_ko_components.mako

@@ -196,12 +196,12 @@ except ImportError, e:
         % if hasattr(ENABLE_NEW_INDEXER, 'get') and ENABLE_NEW_INDEXER.get():
         <li>
           <a class="download" href="javascript:void(0)" data-bind="click: function() { saveTarget('search-index'); savePath('__hue__'); trySaveResults(); }" title="${ _('Explore result in a dashboard') }">
-            <i class="fa fa-fw fa-area-chart"></i> ${ _('Dashboard') }
+            <!-- ko template: { name: 'app-icon-template', data: { icon: 'dashboard' } } --><!-- /ko --> ${ _('Dashboard') }
           </a>
         </li>
         % endif
         <li>
-          <a class="download" href="javascript:void(0)" data-bind="click: function() { $('#saveResultsModal').modal('show'); }" title="${ _('Save the result in a file, a new table...') }">
+          <a class="download" href="javascript:void(0)" data-bind="click: function() { savePath(''); $('#saveResultsModal').modal('show'); }" title="${ _('Save the result in a file, a new table...') }">
             <i class="fa fa-fw fa-save"></i> ${ _('Save') }
           </a>
         </li>
@@ -272,7 +272,7 @@ except ImportError, e:
               <div class="controls">
                 <label class="radio">
                   <input data-bind="checked: saveTarget" type="radio" name="save-results-type" value="search-index">
-                  &nbsp;${ _('Dashboard') }
+                  &nbsp;${ _('Index') }
                 </label>
                 <div data-bind="visible: saveTarget() == 'search-index'" class="inline">
                   <input data-bind="value: savePath, valueUpdate:'afterkeydown'" type="text" name="target_index" class="input-xlarge margin-left-10" placeholder="${_('Index name')}">

+ 19 - 18
desktop/libs/indexer/src/indexer/templates/importer.mako

@@ -453,14 +453,7 @@ ${ assist.assistPanel() }
             </thead>
             <tbody data-bind="foreach: createWizard.source.sample">
             <tr data-bind="foreach: $data">
-              ##<!-- ko if: $index() < $root.createWizard.source.columns().length -->
-              ##<td data-bind="visible: $root.createWizard.source.columns()[$index()].keep, text: $data"></td>
               <td data-bind="truncatedText: $data"></td>
-
-              ##<!-- ko with: $root.createWizard.source.columns()[$index()] -->
-              ##  <!-- ko template: 'output-generated-field-data-template' --> <!-- /ko -->
-              ##<!-- /ko -->
-              ##<!-- /ko -->
             </tr>
             </tbody>
           </table>
@@ -878,17 +871,8 @@ ${ assist.assistPanel() }
     <!-- ko if: level() > 0 && $parent.type() == 'struct' && $parent.nested().length > 1 -->
       <a data-bind="click: function() { $parent.nested.remove($data); }"><i class="fa fa-minus"></i></a>
     <!-- /ko -->
-    <!-- ko if: $root.createWizard.source.inputFormat() != 'manual' && level() == 0 && (typeof isPartition === 'undefined' || !isPartition()) -->
-      <!-- ko if: $root.createWizard.source.sample() && $root.createWizard.source.sample().length > 0 -->
-        <div class="inline-block muted field-content-preview" data-bind="truncatedText: $root.createWizard.source.sample()[0][$index()]"></div>
-        <!-- ko if: $root.createWizard.source.sample().length > 1 -->
-        <div class="inline-block muted field-content-preview" data-bind="truncatedText: $root.createWizard.source.sample()[1][$index()]"></div>
-        <!-- /ko -->
-      <!-- /ko -->
-      <!-- ko if: !$root.createWizard.source.sample() || $root.createWizard.source.sample().length === 0 -->
-      <div class="inline-block muted field-content-preview">${ _("No sample to be shown") }</div>
-      <!-- /ko -->
-    <!-- /ko -->
+
+    <div data-bind="template: { name:'field-column-example' }"></div>
 
     <!-- ko if: type() == 'array' || type() == 'map' || type() == 'struct' -->
       <div class="operation" data-bind="template: { name: 'table-field-template', foreach: nested }"></div>
@@ -929,6 +913,23 @@ ${ assist.assistPanel() }
   <!-- ko if: operations().length > 0 -->
   <a class="pointer" data-bind="click: $root.createWizard.addOperation" title="${_('Add Operation')}"><i class="fa fa-plus"></i> ${_('Operation to')} <span data-bind="text: name"></span></a>
   <!-- /ko -->
+  
+  <span data-bind="template: { name:'field-column-example' }"></span>
+</script>
+
+
+<script type="text/html" id="field-column-example">
+  <!-- ko if: $root.createWizard.source.inputFormat() != 'manual' && level() == 0 && (typeof isPartition === 'undefined' || !isPartition()) -->
+    <!-- ko if: $root.createWizard.source.sample() && $root.createWizard.source.sample().length > 0 -->
+      <div class="inline-block muted field-content-preview" data-bind="truncatedText: $root.createWizard.source.sample()[0][$index()]"></div>
+      <!-- ko if: $root.createWizard.source.sample().length > 1 -->
+      <div class="inline-block muted field-content-preview" data-bind="truncatedText: $root.createWizard.source.sample()[1][$index()]"></div>
+      <!-- /ko -->
+    <!-- /ko -->
+    <!-- ko if: !$root.createWizard.source.sample() || $root.createWizard.source.sample().length === 0 -->
+    <div class="inline-block muted field-content-preview">${ _("No sample to be shown") }</div>
+    <!-- /ko -->
+  <!-- /ko -->
 </script>