Browse Source

HUE-6194 [assist] Bind active tables to the correct source type

Johan Ahlen 8 years ago
parent
commit
f818450

+ 3 - 0
desktop/core/src/desktop/static/desktop/js/assist/assistDbSource.js

@@ -188,6 +188,9 @@ var AssistDbSource = (function () {
     huePubSub.subscribe('editor.active.locations', function (activeLocations) {
       var activeTables = [];
       // TODO: Test multiple snippets
+      if (self.sourceType !== activeLocations.type) {
+        return;
+      }
       activeLocations.locations.forEach(function (location) {
         if (location.type === 'table') {
           activeTables.push(location.identifierChain.length == 2 ? { table: location.identifierChain[1].name, db: location.identifierChain[0].name} : { table: location.identifierChain[0].name });