Преглед изворни кода

HUE-6242 [home] Keep the optional document filter get parameter while browsing

Romain Rigaux пре 8 година
родитељ
комит
ffd82e7

+ 3 - 3
desktop/core/src/desktop/templates/common_home.mako

@@ -112,17 +112,17 @@
       loadUrlParam();
 
       viewModel.activeEntry.subscribe(function (newEntry) {
+        var filterType = window.location.getParameter('type') != '' ? '&type=' + window.location.getParameter('type') : '';
         if (typeof newEntry !== 'undefined' && newEntry.definition().uuid && ! newEntry.isRoot()) {
           if (window.location.getParameter('uuid') == '' || window.location.getParameter('uuid') !== newEntry.definition().uuid){
-            hueUtils.changeURL('${ is_embeddable and '/hue' or ''}/home/?uuid=' + newEntry.definition().uuid);
+            hueUtils.changeURL('${ is_embeddable and '/hue' or ''}/home/?uuid=' + newEntry.definition().uuid + filterType);
           }
         } else if (typeof newEntry === 'undefined' || newEntry.isRoot()) {
-          hueUtils.changeURL('${ is_embeddable and '/hue' or ''}/home/');
+          hueUtils.changeURL('${ is_embeddable and '/hue' or ''}/home/' + (filterType ? '?' + filterType : ''));
         }
       });
 
       ko.applyBindings(viewModel, $('#homeComponents')[0]);
-
     });
   })();
 

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

@@ -88,7 +88,7 @@ from desktop.views import commonheader, commonfooter, _ko
       <i class="fa fa-file-o"></i>
     </a>
     <!-- ko if: IS_HUE_4 -->
-    <a class="btn" href="/home?type=dashboard" title="${ _('Dashboards') }" rel="tooltip" data-placement="bottom" data-bind="css: {'btn': true}">
+    <a class="btn" href="/home?type=search-dashboard" title="${ _('Dashboards') }" rel="tooltip" data-placement="bottom" data-bind="css: {'btn': true}">
       <i class="fa fa-tags"></i>
     </a>
     <!-- /ko -->