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

HUE-6564 [indexer] New indexes not showing up and remove cache from assist

Enrico Berti пре 8 година
родитељ
комит
b8a2fa3
1 измењених фајлова са 16 додато и 4 уклоњено
  1. 16 4
      desktop/core/src/desktop/templates/assist.mako

+ 16 - 4
desktop/core/src/desktop/templates/assist.mako

@@ -1335,12 +1335,24 @@ from notebook.conf import get_ordered_interpreters
         };
 
         huePubSub.subscribe('assist.clickCollectionItem', function (entry) {
-          var link = '/indexer/#edit/' + entry.definition.name;
-          if (IS_HUE_4){
-            huePubSub.publish('open.link', link);
+          var hash = '#edit/' + entry.definition.name;
+          if (IS_HUE_4) {
+            if (window.location.pathname.startsWith('/hue/indexer') && !window.location.pathname.startsWith('/hue/indexer/importer')) {
+              window.location.hash = hash;
+            }
+            else {
+              huePubSub.subscribeOnce('app.gained.focus', function(app){
+                if (app === 'indexes'){
+                  window.setTimeout(function(){
+                    window.location.hash = hash;
+                  }, 0)
+                }
+              });
+              huePubSub.publish('open.link', '/indexer');
+            }
           }
           else {
-            window.open(link);
+            window.open('/indexer/' + hash);
           }
         });