Browse Source

HUE-7949 [dashboard] Turn on the new simplified layout

Romain Rigaux 7 years ago
parent
commit
d67c6e26d4

+ 2 - 2
desktop/conf.dist/hue.ini

@@ -877,8 +877,8 @@
   # Activate the static report layout (beta).
   ## has_report_enabled=false
 
-  # Activate the new grid layout system (beta).
-  ## use_gridster=false
+  # Activate the new grid layout system.
+  ## use_gridster=true
 
   # Activate the widget filter and comparison (beta).
   ## has_widget_filter=false

+ 2 - 2
desktop/conf/pseudo-distributed.ini.tmpl

@@ -879,8 +879,8 @@
   # Activate the static report layout (beta).
   ## has_report_enabled=false
 
-  # Activate the new grid layout system (beta).
-  ## use_gridster=false
+  # Activate the new grid layout system.
+  ## use_gridster=true
 
   # Activate the widget filter and comparison (beta).
   ## has_widget_filter=false

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

@@ -273,13 +273,13 @@ except ImportError, e:
               <div class="controls">
                 <label class="radio">
                   <input data-bind="checked: saveTarget" type="radio" name="save-results-type" value="search-index">
-                  &nbsp;${ _('Collection') }
+                  &nbsp;${ _('Index') }
                 </label>
                 <div class="inline-block" data-bind="tooltip: { title: '${ _ko("Index the data to make Dashboard explorations faster") }', placement: 'top' }">
                   <i class="fa fa-fw fa-question-circle muted"></i>
                 </div>
                 <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="${_('Collection name')}">
+                  <input data-bind="value: savePath, valueUpdate: 'afterkeydown'" type="text" name="target_index" class="input-xlarge margin-left-10" placeholder="${_('Index name')}">
                 </div>
               </div>
             </div>

+ 2 - 2
desktop/libs/dashboard/src/dashboard/conf.py

@@ -60,8 +60,8 @@ HAS_REPORT_ENABLED = Config(
 
 USE_GRIDSTER = Config(
   key="use_gridster",
-  help=_t("Activate the new grid layout system (beta)."),
-  default=False,
+  help=_t("Activate the new grid layout system."),
+  default=True,
   type=coerce_bool
 )
 

+ 3 - 2
desktop/libs/indexer/src/indexer/templates/importer.mako

@@ -329,10 +329,11 @@ ${ assist.assistPanel() }
           </div>
 
           <div class="control-group" data-bind="visible: createWizard.source.inputFormat() == 'query'">
-            <label for="path" class="control-label"><div>${ _('Query') }</div>
+            <label for="path" class="control-label"><div>${ _('Query') }
               <!-- ko if: createWizard.source.query() && createWizard.source.query().name -->
               <span data-bind="text: createWizard.source.query().name"></span>
               <!-- /ko -->
+              </div>
               ## No dropdown for now
               ## <select placeholder="${ _('Search your documents...') }" data-bind="documentChooser: { dependentValue: createWizard.source.draggedQuery, mappedDocument: createWizard.source.query }"></select>
             </label>
@@ -890,7 +891,7 @@ ${ assist.assistPanel() }
   <!-- /ko -->
   <!-- ko if: $root.createWizard.source.inputFormat() == 'rdbms' -->
   <label class="margin-left-5">${ _('Type') }&nbsp;
-    <input type="text" class="input-small" placeholder="${ _('Field Type') }" data-bind="value: type, enable:false">
+    <input type="text" class="input-small" placeholder="${ _('Field Type') }" data-bind="value: type, enable: false">
   </label>
   <!-- /ko -->
   <a href="javascript:void(0)" title="${ _('Show field properties') }" data-bind="css: {'inactive-action': !showProperties()}, click: function() {showProperties(!showProperties()) }"><i class="fa fa-sliders"></i></a>

+ 6 - 3
desktop/libs/notebook/src/notebook/api.py

@@ -39,6 +39,7 @@ from notebook.connectors.oozie_batch import OozieApi
 from notebook.decorators import api_error_handler, check_document_access_permission, check_document_modify_permission
 from notebook.models import escape_rows, make_notebook
 from notebook.views import upgrade_session_properties
+from indexer.solr_client import SolrClient
 
 
 LOG = logging.getLogger(__name__)
@@ -716,7 +717,10 @@ def export_result(request):
         response['status'] = 0
       else:
         sample = get_api(request, snippet).fetch_result(notebook, snippet, rows=4, start_over=True)
-
+        for col in sample['meta']:
+          col['type'] = HiveFormat.FIELD_TYPE_TRANSLATE.get(col['type'], 'string')
+          SolrClient._port_field_types(col)
+          
         response['status'] = 0
         response['id'] = notebook_id
         response['name'] = _get_snippet_name(notebook)
@@ -725,8 +729,7 @@ def export_result(request):
         response['target_path'] = destination
         response['sample'] = list(sample['data'])
         response['columns'] = [
-            Field(col['name'], HiveFormat.FIELD_TYPE_TRANSLATE.get(col['type'], 'string')).to_dict()
-            for col in sample['meta']
+            Field(col['name'], col['type']).to_dict() for col in sample['meta']
         ]
     else:
       notebook_id = notebook['id'] or request.GET.get('editor', request.GET.get('notebook'))