Browse Source

HUE-7949 [dashboard] Disable Gridster drag and resize when in Query Builder mode

Enrico Berti 7 years ago
parent
commit
73ddafd

File diff suppressed because it is too large
+ 0 - 0
desktop/core/src/desktop/static/desktop/css/hue-embedded.css


File diff suppressed because it is too large
+ 0 - 0
desktop/core/src/desktop/static/desktop/css/hue.css


File diff suppressed because it is too large
+ 0 - 0
desktop/core/src/desktop/static/desktop/css/hue3-extra.css


+ 6 - 1
desktop/core/src/desktop/static/desktop/less/components/hue-gridster.less

@@ -33,7 +33,12 @@
       .grid-left-bar, .edit-dimensions {
         opacity: 0;
         .hue-ease-transition(opacity);
-        &.query-builder {
+      }
+      .query-builder {
+        h2 {
+          cursor: default;
+        }
+        .edit-dimensions {
           opacity: 1;
         }
       }

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

@@ -208,7 +208,7 @@
 <script id="widget-template-gridster${ suffix }" type="text/html">
   <li>
     <!-- ko ifnot: widget -->
-    <div class="empty-gridster-widget card card-widget" data-bind="droppable: { data: function(w) { showAddFacetDemiModal(w, $data); }, options: { greedy:true, hoverClass: 'droppable-hover' }}">
+    <div class="empty-gridster-widget card card-widget" data-bind="droppable: { data: function(w) { showAddFacetDemiModal(w, $data); }, options: { greedy:true, hoverClass: 'droppable-hover' }}, css: { 'query-builder': $root.isQueryBuilder }">
       <h2 class="card-heading simple">
         ${ _('Empty widget') }
         <div class="inline pull-right margin-right-10" data-bind="visible: ($root.isEditing() || $root.isToolbarVisible()) && !$root.isQueryBuilder()">
@@ -218,7 +218,7 @@
     </div>
     <!-- /ko -->
   <!-- ko with: widget -->
-    <div data-bind="template: 'widget-template${ suffix }'"></div>
+    <div data-bind="template: 'widget-template${ suffix }', css: { 'query-builder': $root.isQueryBuilder }"></div>
     <div class="clearfix"></div>
   <!-- /ko -->
   </li>

+ 6 - 1
desktop/libs/dashboard/src/dashboard/templates/common_search.mako

@@ -599,7 +599,7 @@ ${ dashboard.layout_skeleton(suffix='search') }
   <!-- /ko -->
 
   <!-- ko if: !$parents[1].isLoading() || widgetType() == 'hit-widget' -->
-  <div class="edit-dimensions" data-bind="css: { 'query-builder': $root.isQueryBuilder }">
+  <div class="edit-dimensions">
     <div data-bind="sortable: { data: properties.facets, allowDrop: false, options: { axis: 'x', containment: 'parent', handle: '.move-dimension'}}" class="inline-block">
       <div class="badge dimensions-badge-container" data-bind="css: { 'is-editing': isEditing }, click: function(){ $parent.isAdding(false); $parent.properties.facets().forEach(function(f){ f.isEditing(false); }); isEditing(true); }" title="${ _('Edit') }">
         <span data-bind="text: getPrettyMetric($data)"></span>
@@ -4112,6 +4112,11 @@ $(document).ready(function () {
 
   huePubSub.subscribeOnce('gridster.added.widget', function () {
     $(window).trigger('resize');
+    if (searchViewModel.isQueryBuilder()) {
+      var $gridster = $('.gridster>ul').data('gridster');
+      $gridster.disable_resize();
+      $gridster.disable();
+    }
   });
 
   huePubSub.subscribe('gridster.added.widget', removePreviewHolder, 'dashboard');

Some files were not shown because too many files changed in this diff