Browse Source

Datahub left menu are not working redirecting to wrong link (#4027)

Co-authored-by: Mohammed Tabraiz <tabraiz@cloudera.com>
Tabraiz 8 months ago
parent
commit
f576014ba9
1 changed files with 6 additions and 3 deletions
  1. 6 3
      desktop/core/src/desktop/js/onePageViewModel.js

+ 6 - 3
desktop/core/src/desktop/js/onePageViewModel.js

@@ -959,13 +959,16 @@ class OnePageViewModel {
 
 
     huePubSub.subscribe('open.link', href => {
     huePubSub.subscribe('open.link', href => {
       if (href) {
       if (href) {
+        const prefix = '/hue';
         if (href.startsWith('/')) {
         if (href.startsWith('/')) {
-          if (window.HUE_BASE_URL && !href.startsWith(window.HUE_BASE_URL)) {
+          if (window.HUE_BASE_URL.length && href.startsWith(window.HUE_BASE_URL)) {
+            page(href);
+          } else if (href.startsWith(prefix)) {
             page(window.HUE_BASE_URL + href);
             page(window.HUE_BASE_URL + href);
           } else {
           } else {
-            page(href); // Already includes the base_url
+            page(window.HUE_BASE_URL + prefix + href);
           }
           }
-        } else if (href.indexOf('#') === 0) {
+        } else if (href.indexOf('#') == 0) {
           // Only place that seem to use this is hbase onclick row
           // Only place that seem to use this is hbase onclick row
           window.location.hash = href;
           window.location.hash = href;
         } else {
         } else {