Browse Source

HUE-8155 [metastore] Prevent calling navigator when it's not configured

Johan Ahlen 7 years ago
parent
commit
cbf5c2689b

+ 6 - 1
desktop/core/src/desktop/static/desktop/js/dataCatalog.js

@@ -1022,7 +1022,7 @@ var DataCatalog = (function () {
       var self = this;
       return HAS_NAVIGATOR
         && (self.getSourceType() === 'hive' || self.getSourceType() === 'impala')
-        && self.isDatabase() || self.isTableOrView() || self.isColumn();
+        && (self.isDatabase() || self.isTableOrView() || self.isColumn());
     };
 
     /**
@@ -2027,6 +2027,11 @@ var DataCatalog = (function () {
       }
 
       var deferred = $.Deferred();
+
+      if (!HAS_NAVIGATOR) {
+        return deferred.reject().promise();
+      }
+
       self.allNavigatorTagsPromise = deferred.promise();
 
       var reloadAllTags = function () {

+ 1 - 1
desktop/core/src/desktop/templates/ko_components/ko_global_search.mako

@@ -457,7 +457,7 @@ from desktop.views import _ko
           self.updateCategories(HUE_DOC_CATEGORY, categories);
         }));
 
-        if (!docOnly) {
+        if (!docOnly && HAS_NAVIGATOR) {
           var clearNavTimeout = window.setTimeout(function () {
             self.updateCategories(NAV_CATEGORY, []);
           }, 300);