Skip to content

Commit e182493

Browse files
agl29romainr
authored andcommitted
Adding the view and database icon in the left and right assist
1 parent fecccf0 commit e182493

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

desktop/core/src/desktop/js/ko/components/contextPopover/dataCatalogContext.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,24 @@ class DataCatalogContext {
2727
self.popover = options.popover;
2828
self.catalogEntry = ko.observable(options.catalogEntry);
2929

30+
self.parentIsView = ko.observable(false);
31+
const checkIfParentIsView = catalogEntry => {
32+
if (!catalogEntry) {
33+
self.parentIsView(false);
34+
return;
35+
}
36+
catalogEntry
37+
.getParent()
38+
.then(parentEntry => {
39+
self.parentIsView(parentEntry.isView());
40+
})
41+
.catch(() => {
42+
self.parentIsView(false);
43+
});
44+
};
45+
checkIfParentIsView(self.catalogEntry());
46+
self.catalogEntry.subscribe(checkIfParentIsView);
47+
3048
self.loading = ko.observable(false);
3149
self.hasErrors = ko.observable(false);
3250
self.activePromises = [];

desktop/core/src/desktop/js/ko/components/contextPopover/ko.contextPopover.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ const SUPPORT_TEMPLATES = `
275275
276276
<script type="text/html" id="context-catalog-entry-title">
277277
<div class="hue-popover-title">
278-
<i class="hue-popover-title-icon fa muted" data-bind="css: catalogEntry() && catalogEntry().isView() ? 'fa-eye' : (catalogEntry().isModel() ? 'fa-puzzle-piece' : 'fa-table')"></i>
278+
<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>
279279
<span class="hue-popover-title-text" data-bind="foreach: breadCrumbs">
280280
<!-- ko ifnot: isActive --><div><a href="javascript: void(0);" data-bind="click: makeActive, text: name"></a>.</div><!-- /ko -->
281281
<!-- ko if: isActive -->

0 commit comments

Comments
 (0)