瀏覽代碼

HUE-8503 [dashboard] Query Builder direct dashboard landing

Enrico Berti 7 年之前
父節點
當前提交
42ae4d3

+ 1 - 9
desktop/core/src/desktop/templates/common_dashboard.mako

@@ -108,15 +108,7 @@
 </%def>
 
 <%def name="layout_skeleton(suffix='')">
-  <div class="initial-hint empty-dashboard" data-bind="fadeVisible: !isEditing() && columns().length == 0">
-    <div class="initial-hint-text">${ _('Click on the pencil to get started with your dashboard!') }</div>
-    <img src="${ static('desktop/art/hint_arrow.svg') }" alt="${ _('Hint arrow') }" />
-  </div>
-
-  <div class="initial-hint empty-dashboard-editing" data-bind="fadeVisible: isEditing() && columns().length == 0 && previewColumns() == ''">
-    <div class="initial-hint-text">${ _('Pick an index and Click on a layout to start your dashboard!') }</div>
-    <img src="${ static('desktop/art/hint_arrow.svg') }" alt="${ _('Hint arrow') }" class="flip-horizontal" />
-  </div>
+  <!-- ko hueSpinner: { spin: isEditing() && columns().length == 0 && previewColumns() == '', center: true, size: 'xlarge' } --><!-- /ko -->
 
   % if USE_NEW_ADD_METHOD.get():
   <!-- ko if: $root.isGridster -->

文件差異過大導致無法顯示
+ 0 - 0
desktop/libs/dashboard/src/dashboard/static/dashboard/css/common_dashboard.css


+ 3 - 1
desktop/libs/dashboard/src/dashboard/static/dashboard/js/search.ko.js

@@ -1847,6 +1847,7 @@ var Collection = function (vm, collection) {
 
   self.name.subscribe(function(newValue) { // New Dashboard
     if (newValue && (self.engine() == 'solr' || /^[^\.]+\.[^\.]+$/.test(newValue))) {
+      huePubSub.publish('dashboard.switch.collection');
       self.label(newValue);
       self.switchCollection();
       vm.search();
@@ -2262,7 +2263,8 @@ var SearchViewModel = function (collection_json, query_json, initial_json, has_g
       self.collection.syncFields();
       if (self.collection.engine() === 'solr') {
         self.search(callback);
-      } else if (self.collection.engine() === 'report') {
+      }
+      else {
         callback();
       }
     }

+ 13 - 5
desktop/libs/dashboard/src/dashboard/static/dashboard/less/common_dashboard.less

@@ -660,11 +660,19 @@
     }
   }
 
-  .search-bar .form-search .selectize-control {
-    width: 220px;
-    display: inline-block;
-    vertical-align: top;
-    margin-top: 1px;
+  .search-bar .form-search {
+    .selectize-control {
+      width: 220px;
+      display: inline-block;
+      vertical-align: top;
+      border-radius: 0 !important;
+      .selectize-input {
+        border-radius: 0 !important;
+      }
+    }
+    .simple-ace-single-line {
+      border-left: none !important;
+    }
   }
 
   #addFacetDemiModal .inline-autocomplete-container {

+ 13 - 4
desktop/libs/dashboard/src/dashboard/templates/common_search.mako

@@ -62,7 +62,7 @@ from dashboard.conf import USE_GRIDSTER, USE_NEW_ADD_METHOD, HAS_REPORT_ENABLED,
       </div>
     </div>
     <div class="search-bar-middle">
-      <form class="form-search" data-bind="visible: $root.isEditing() && columns().length == 0, submit: function() { return false }">
+      <form class="form-search" data-bind="visible: $root.isEditing() && columns().length === 0, submit: function() { return false }">
         <!-- ko if: $root.collection.engine() == 'solr' -->
         <!-- ko if: columns().length == 0 -->
         <select data-bind="selectize: $root.initial.collections.sort(), value: $root.collection.name, disable: isSyncingCollections, selectizeOptions: { clearable: true }"></select>
@@ -91,9 +91,10 @@ from dashboard.conf import USE_GRIDSTER, USE_NEW_ADD_METHOD, HAS_REPORT_ENABLED,
       <form class="form-search" style="margin: 0" data-bind="submit: searchBtn, visible: columns().length != 0">
         <div class="search-bar-query-container">
           <div class="search-bar-collection" data-bind="visible: $root.collection.engine() != 'report'">
-            <div class="selectMask">
-              <span data-bind="editable: collection.label, editableOptions: { enabled: true, placement: 'right' }"></span>
-            </div>
+##             <div class="selectMask">
+##               <span data-bind="editable: collection.label, editableOptions: { enabled: true, placement: 'right' }"></span>
+##             </div>
+            <select data-bind="selectize: $root.initial.collections.sort(), value: $root.collection.name, disable: isSyncingCollections, selectizeOptions: { clearable: true }"></select>
           </div>
           <!-- ko if: $root.collection.engine() !== 'report' -->
           <div class="search-bar-query" data-bind="foreach: query.qs">
@@ -243,6 +244,7 @@ from dashboard.conf import USE_GRIDSTER, USE_NEW_ADD_METHOD, HAS_REPORT_ENABLED,
 
 % if not is_report:
 <%dashboard:layout_toolbar>
+  <%def name="skipLayout()"></%def>
   <%def name="results()">
     <div data-bind="css: { 'draggable-widget': true, 'disabled': !availableDraggableResultset() },
                     draggable: {data: draggableResultset(), isEnabled: availableDraggableResultset, options: getDraggableOptions({ data: draggableResultset(), stop: function() { $root.collection.template.isGridLayout(true); checkResultHighlightingAvailability(); } }) }"
@@ -4155,6 +4157,9 @@ function loadSearch(collection, query, initial) {
         magicSearchLayout(searchViewModel);
       }
     }
+    else {
+      queryBuilderSearchLayout(searchViewModel);
+    }
   });
 
   searchViewModel.isRetrievingResults.subscribe(function(value){
@@ -4220,6 +4225,10 @@ function loadSearch(collection, query, initial) {
   searchViewModel.collection.autorefreshSeconds.subscribe(function (value) {
     checkAutoRefresh();
   });
+
+  huePubSub.subscribe('dashboard.switch.collection', function(){
+    queryBuilderSearchLayout(searchViewModel);
+  }, 'dashboard');
 }
 
 $(document).ready(function () {

部分文件因文件數量過多而無法顯示