Sfoglia il codice sorgente

HUE-6077 [frontend] Fixed home linking

Enrico Berti 8 anni fa
parent
commit
50f60e5

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

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

+ 5 - 8
desktop/core/src/desktop/templates/hue.mako

@@ -529,7 +529,7 @@ ${ assist.assistPanel() }
         oozie_bundle: '/oozie/editor/bundle/*',
         jobbrowser: '/jobbrowser/apps',
         filebrowser: '/filebrowser/view=*',
-        home: '/home',
+        home: '/home*',
         indexer: '/indexer/indexer/',
         collections: '/dashboard/admin/collections',
         indexes: '/indexer/',
@@ -553,7 +553,7 @@ ${ assist.assistPanel() }
         sqoop: '/sqoop',
       };
 
-      var SKIP_CACHE = ['oozie_workflow', 'oozie_coordinator', 'oozie_bundle', 'dashboard', 'filebrowser', 'useradmin_users', 'useradmin_groups', 'useradmin_permissions', 'useradmin_configurations', 'useradmin_newuser', 'useradmin_addldap', 'useradmin_edituser'];
+      var SKIP_CACHE = ['home', 'oozie_workflow', 'oozie_coordinator', 'oozie_bundle', 'dashboard', 'filebrowser', 'useradmin_users', 'useradmin_groups', 'useradmin_permissions', 'useradmin_configurations', 'useradmin_newuser', 'useradmin_addldap', 'useradmin_edituser'];
 
       var OnePageViewModel = function () {
         var self = this;
@@ -853,13 +853,10 @@ ${ assist.assistPanel() }
           }
         });
 
-        page('/home', function(ctx){
+        page('/home*', function(ctx){
+          self.currentQueryString(ctx.querystring);
+          self.currentContextParams(ctx.params);
           self.loadApp('home');
-          if (window.location.getParameter('uuid') !== '') {
-            self.getActiveAppViewModel(function (viewModel) {
-              viewModel.openUuid(window.location.getParameter('uuid'));
-            });
-          }
         });
 
         page('/dashboard/*', function(ctx){

+ 1 - 1
desktop/core/src/desktop/urls.py

@@ -62,7 +62,7 @@ dynamic_patterns = patterns('desktop.auth.views',
 
 if USE_NEW_EDITOR.get():
   dynamic_patterns += patterns('desktop.views',
-    (r'^home$','home2'),
+    (r'^home/?$','home2'),
     (r'^home2$','home'),
     (r'^home_embeddable$','home_embeddable'),
   )