浏览代码

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

Johan Ahlen 8 年之前
父节点
当前提交
f818450
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      desktop/core/src/desktop/static/desktop/js/assist/assistDbSource.js

+ 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 });