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

HUE-7210 [metastore] Fix the metastore refresh button

Johan Ahlen пре 8 година
родитељ
комит
5bd9ec0

+ 1 - 1
apps/metastore/src/metastore/static/metastore/js/metastore.ko.js

@@ -71,7 +71,7 @@ var MetastoreViewModel = (function () {
     self.loadDatabases();
 
     huePubSub.subscribe('assist.db.refresh', function (options) {
-      if (['hive', 'impala'].indexOf(options.sourceType) == -1) {
+      if (typeof options.sourceTypes !== 'undefined' && options.sourceTypes.indexOf('hive') === -1 && options.sourceTypes.indexOf('impala') === -1 ) {
         return;
       }
       self.reloading(true);

+ 1 - 1
desktop/core/src/desktop/static/desktop/js/assist/assistDbSource.js

@@ -304,7 +304,7 @@ var AssistDbSource = (function () {
     };
 
     huePubSub.subscribe('assist.db.refresh', function (options) {
-      if (options.sourceTypes.indexOf(self.sourceType) !== -1) {
+      if (typeof options.sourceTypes === 'undefined' || options.sourceTypes.indexOf(self.sourceType) !== -1) {
         window.setTimeout(function () {
           self.reload(options.allCacheTypes);
         }, 0);

+ 1 - 1
desktop/libs/notebook/src/notebook/static/notebook/js/notebook.ko.js

@@ -2844,7 +2844,7 @@ var EditorViewModel = (function() {
       var notebook = self.selectedNotebook();
       if (notebook) {
         notebook.snippets().forEach(function (snippet) {
-          if (['hive', 'impala'].indexOf(snippet.type()) !== -1) {
+          if (options.sourceTypes.indexOf(snippet.type()) !== -1) {
             snippet.updateDatabases();
           }
         });