Skip to content

Commit

Permalink
Adding the view and database icon in the left and right assist
Browse files Browse the repository at this point in the history
  • Loading branch information
agl29 authored and romainr committed Feb 27, 2021
1 parent fecccf0 commit e182493
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
Expand Up @@ -27,6 +27,24 @@ class DataCatalogContext {
self.popover = options.popover;
self.catalogEntry = ko.observable(options.catalogEntry);

self.parentIsView = ko.observable(false);
const checkIfParentIsView = catalogEntry => {
if (!catalogEntry) {
self.parentIsView(false);
return;
}
catalogEntry
.getParent()
.then(parentEntry => {
self.parentIsView(parentEntry.isView());
})
.catch(() => {
self.parentIsView(false);
});
};
checkIfParentIsView(self.catalogEntry());
self.catalogEntry.subscribe(checkIfParentIsView);

self.loading = ko.observable(false);
self.hasErrors = ko.observable(false);
self.activePromises = [];
Expand Down
Expand Up @@ -275,7 +275,7 @@ const SUPPORT_TEMPLATES = `
<script type="text/html" id="context-catalog-entry-title">
<div class="hue-popover-title">
<i class="hue-popover-title-icon fa muted" data-bind="css: catalogEntry() && catalogEntry().isView() ? 'fa-eye' : (catalogEntry().isModel() ? 'fa-puzzle-piece' : 'fa-table')"></i>
<i class="hue-popover-title-icon fa muted" data-bind="css: catalogEntry() && (catalogEntry().isView() || parentIsView()) ? 'fa-eye' : (catalogEntry().isDatabase() ? 'fa-database' : (catalogEntry().isModel() ? 'fa-puzzle-piece' : 'fa-table'))"></i>
<span class="hue-popover-title-text" data-bind="foreach: breadCrumbs">
<!-- ko ifnot: isActive --><div><a href="javascript: void(0);" data-bind="click: makeActive, text: name"></a>.</div><!-- /ko -->
<!-- ko if: isActive -->
Expand Down

0 comments on commit e182493

Please sign in to comment.