Przeglądaj źródła

HUE-5967 [search] Remove fullscreen in Hue4 and fix url change

Enrico Berti 8 lat temu
rodzic
commit
4da7b48

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

@@ -2257,7 +2257,7 @@ var SearchViewModel = function (collection_json, query_json, initial_json) {
           self.collection.id(data.id);
           $(document).trigger("info", data.message);
           if (window.location.search.indexOf("collection") == -1) {
-            hueUtils.changeURL('/dashboard/?collection=' + data.id);
+            hueUtils.changeURL((IS_HUE_4 ? '/hue' : '') + '/dashboard/?collection=' + data.id);
           }
         }
         else {
@@ -2401,6 +2401,10 @@ var SearchViewModel = function (collection_json, query_json, initial_json) {
     self.showCores(false);
     self.isSyncingCollections(false);
     self.isPlayerMode(false);
+
+    if (window.location.search.indexOf("collection") > -1) {
+      hueUtils.changeURL((IS_HUE_4 ? '/hue' : '') + '/dashboard/new_search');
+    }
   }
 
   self.build();

+ 2 - 12
desktop/libs/dashboard/src/dashboard/templates/common_search.mako

@@ -68,9 +68,11 @@ from desktop.views import commonheader, commonfooter, _ko
       <i class="fa fa-save"></i>
     </a>
     % endif
+    %if not is_embeddable:
     <a class="btn pointer" title="${ _('Player mode') }" rel="tooltip" data-placement="bottom" data-bind="click: function(){ hueUtils.goFullScreen(); $root.isEditing(false); $root.isPlayerMode(true); }">
       <i class="fa fa-expand"></i>
     </a>
+    %endif
     &nbsp;&nbsp;&nbsp;
     <a class="btn pointer" title="${ _('General Settings') }" rel="tooltip" data-placement="bottom" data-toggle="modal" data-target="#settingsDemiModal"
         data-bind="css: {'btn': true}, visible: columns().length != 0">
@@ -3570,18 +3572,6 @@ $(document).ready(function () {
     }, 200);
   });
 
-/*
-function newSearch() {
-  ko.cleanNode($('#searchComponents')[0]);
-  viewModel = new SearchViewModel(${ collection.get_json(user) | n,unicode }, ${ query | n,unicode }, ${ initial | n,unicode });
-  ko.applyBindings(viewModel, $('#searchComponents')[0]);
-
-  viewModel.init();
-  //viewModel.collection.facets.removeAll();
-  //viewModel.columns([]);
-
-  viewModel.search();
-}*/
 
   var _query = ${ query | n,unicode };