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

HUE-7820 [assist] Show the proper database comment in the context popover

Johan Ahlen пре 7 година
родитељ
комит
70653065cf
1 измењених фајлова са 4 додато и 7 уклоњено
  1. 4 7
      desktop/core/src/desktop/templates/ko_components/ko_context_popover.mako

+ 4 - 7
desktop/core/src/desktop/templates/ko_components/ko_context_popover.mako

@@ -598,7 +598,6 @@ from metadata.conf import has_navigator
         });
         });
       };
       };
 
 
-
       function TableAndColumnContextTabs(data, sourceType, defaultDatabase, isColumn, isComplex) {
       function TableAndColumnContextTabs(data, sourceType, defaultDatabase, isColumn, isComplex) {
         var self = this;
         var self = this;
         self.tabs = ko.observableArray();
         self.tabs = ko.observableArray();
@@ -929,11 +928,9 @@ from metadata.conf import has_navigator
         self.disposals = [];
         self.disposals = [];
         self.dbComment = ko.observable('');
         self.dbComment = ko.observable('');
         var dbName = data.identifierChain[data.identifierChain.length - 1].name;
         var dbName = data.identifierChain[data.identifierChain.length - 1].name;
-        $.getJSON('/metastore/databases/' + dbName + '/metadata', function (data) {
-          if (data && data.status == 0 && data.data.comment) {
-              self.dbComment(data.data.comment);
-          }
-        });
+        var catalogEntry = DataCatalog.getEntry({ sourceType: sourceType, path: [dbName], definition: { type: 'database' }})
+
+        catalogEntry.getComment().done(self.dbComment);
         self.tabs = [
         self.tabs = [
           { id: 'details', label: '${ _("Details") }', comment : self.dbComment, template: 'context-popover-database-details', templateData: new GenericTabContents(data.identifierChain, sourceType, defaultDatabase, ApiHelper.getInstance().fetchAutocomplete) }
           { id: 'details', label: '${ _("Details") }', comment : self.dbComment, template: 'context-popover-database-details', templateData: new GenericTabContents(data.identifierChain, sourceType, defaultDatabase, ApiHelper.getInstance().fetchAutocomplete) }
         ];
         ];
@@ -942,7 +939,7 @@ from metadata.conf import has_navigator
         var showInAssistPubSub = huePubSub.subscribe('context.popover.show.in.assist', function () {
         var showInAssistPubSub = huePubSub.subscribe('context.popover.show.in.assist', function () {
           huePubSub.publish('assist.db.highlight', {
           huePubSub.publish('assist.db.highlight', {
             sourceType: sourceType,
             sourceType: sourceType,
-            path: [ dbName ]
+            path: catalogEntry.path
           });
           });
         });
         });