Browse Source

HUE-8269 [dashboard] Hide the new add form if not specifically configured

Enrico Berti 7 years ago
parent
commit
10eeec35eb

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

@@ -221,6 +221,7 @@
         </div>
       </h2>
       <div class="empty-content" data-bind="droppable: { data: function(w) { huePubSub.publish('gridster.empty.drop', { widget: w, target: $data }); }, options: { greedy:true, hoverClass: 'droppable-hover', drop: function(){ huePubSub.publish('gridster.added.widget'); } }}, css: { 'query-builder': $root.isQueryBuilder }">
+        % if USE_NEW_ADD_METHOD.get():
         <!-- ko with: emptyProperties -->
         <div class="edit-dimensions">
           <div class="badge dimensions-badge-container dimensions-badge-container-add is-adding">
@@ -320,6 +321,7 @@
           </div>
         </div>
         <!-- /ko -->
+        % endif
       </div>
       <div class="clearfix"></div>
     </div>

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

@@ -4531,7 +4531,7 @@ $(document).ready(function () {
                 widget: null,
                 emptyProperties: new EmptyGridsterWidget(searchViewModel),
                 callback: function (el) {
-                  if (["resultset-widget", "html-resultset-widget", "filter-widget", "leafletmap-widget"].indexOf(tempDraggable.widgetType()) > -1) {
+                  if (!searchViewModel.hasNewAdd() || (searchViewModel.hasNewAdd() &&  ["resultset-widget", "html-resultset-widget", "filter-widget", "leafletmap-widget"].indexOf(tempDraggable.widgetType()) > -1)) {
                     showAddFacetDemiModal(tempDraggable, searchViewModel.gridItems()[searchViewModel.gridItems().length - 1]);
                   }
                   tempDraggable = null;