Pārlūkot izejas kodu

HUE-7820 [assist] Fix issue where some columns won't expand in assist

Johan Ahlen 7 gadi atpakaļ
vecāks
revīzija
9737aec

+ 4 - 0
desktop/core/src/desktop/static/desktop/js/assist/assistDbEntry.js

@@ -310,6 +310,10 @@ var AssistDbEntry = (function () {
         self.hasErrors(false);
         self.loading(false);
         self.loaded = true;
+        if (catalogEntries.length === 0) {
+          self.entries([]);
+          return;
+        }
         var newEntries = [];
         catalogEntries.forEach(function (catalogEntry) {
           newEntries.push(self.createEntry(catalogEntry));

+ 2 - 2
desktop/core/src/desktop/static/desktop/js/dataCatalog.js

@@ -418,7 +418,7 @@ var DataCatalog = (function () {
 
       var entities = sourceMeta.databases
         || sourceMeta.tables_meta || sourceMeta.extended_columns || sourceMeta.fields || sourceMeta.columns
-        || (sourceMeta.value && sourceMeta.value.fields);
+        || (sourceMeta.value && sourceMeta.value.fields) || (sourceMeta.item && sourceMeta.item.fields);
       if (entities) {
         entities.forEach(function (entity) {
           promises.push(self.dataCatalog.getEntry({ path: self.path.concat(entity.name || entity) }).done(function (catalogEntry) {
@@ -809,7 +809,7 @@ var DataCatalog = (function () {
 
   DataCatalogEntry.prototype.hasPossibleChildren = function () {
     var self = this;
-    return (self.path.length < 2) ||
+    return (self.path.length < 3) ||
       (!self.definition && !self.sourceMeta) ||
       (self.sourceMeta && /^(?:struct|array|map)/i.test(self.sourceMeta.type)) ||
       (self.definition && /^(?:struct|array|map)/i.test(self.definition.type));