Selaa lähdekoodia

HUE-7820 [assist] Fix broken context menu for SQL assist entries

Johan Ahlen 7 vuotta sitten
vanhempi
commit
cc2731e

+ 2 - 2
desktop/core/src/desktop/templates/assist.mako

@@ -84,7 +84,7 @@ from desktop.views import _ko
   </script>
 
   <script type="text/html" id="sql-context-items">
-    <!-- ko if: typeof definition !== 'undefined' -->
+    <!-- ko if: typeof catalogEntry !== 'undefined' -->
       <!-- ko if: sourceType === 'solr' -->
         <li><a href="javascript:void(0);" data-bind="click: function (data) { showContextPopover(data, { target: $parentContext.$contextSourceElement }, { left: 4, top: 2 }); }"><i class="fa fa-fw fa-info"></i> ${ _('Show details') }</a></li>
         <!-- ko if: catalogEntry.isTableOrView() -->
@@ -102,7 +102,7 @@ from desktop.views import _ko
         <li><a href="javascript:void(0);" data-bind="click: dblClick"><i class="fa fa-fw fa-paste"></i> ${ _('Insert at cursor') }</a></li>
         <!-- /ko -->
         % if not IS_EMBEDDED.get():
-        <!-- ko if: definition.isView || definition.isTable || definition.isDatabase -->
+        <!-- ko if: catalogEntry.path.length <=2 -->
         <li><a href="javascript:void(0);" data-bind="click: openInMetastore"><i class="fa fa-fw fa-table"></i> ${ _('Open in Browser') }</a></li>
         <!-- /ko -->
         % endif

+ 1 - 1
desktop/core/src/desktop/templates/ko_components/ko_nav_tags.mako

@@ -94,7 +94,7 @@ from django.utils.translation import ugettext as _
               silenceErrors: true,
               noCache: true
             }).done(function (data) {
-              fetchDeferral.resolve(data.entity);
+              fetchDeferral.resolve(data);
             }).fail(fetchDeferral.reject);
           });
           return fetchDeferral;