You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@atlas.apache.org by ma...@apache.org on 2022/10/31 09:20:23 UTC
[atlas] branch master updated: ATLAS-4693,ATLAS-4661,ATLAS-4613 : (UI)Switching within Terms page does not land you in the same tab
This is an automated email from the ASF dual-hosted git repository.
mandarambawane pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/atlas.git
The following commit(s) were added to refs/heads/master by this push:
new 3022242bb ATLAS-4693,ATLAS-4661,ATLAS-4613 : (UI)Switching within Terms page does not land you in the same tab
3022242bb is described below
commit 3022242bb00b27c298c953d63256f237e15f3256
Author: Farhan Khan <fa...@freestoneinfotech.com>
AuthorDate: Fri Oct 28 12:36:36 2022 +0530
ATLAS-4693,ATLAS-4661,ATLAS-4613 : (UI)Switching within Terms page does not land you in the same tab
Signed-off-by: Mandar Ambawane <ma...@freestoneinfotech.com>
---
.../glossary/GlossaryDetailLayoutView_tmpl.html | 2 +-
.../search/SearchResultLayoutView_tmpl.html | 6 ++---
.../js/views/glossary/GlossaryDetailLayoutView.js | 27 ++++++++++++++++++++--
.../js/views/search/SearchResultLayoutView.js | 15 ++++++++++--
.../js/views/tag/TagDetailTableLayoutView.js | 2 +-
.../glossary/GlossaryDetailLayoutView_tmpl.html | 2 +-
.../search/SearchResultLayoutView_tmpl.html | 6 ++---
.../js/views/glossary/GlossaryDetailLayoutView.js | 27 ++++++++++++++++++++--
.../js/views/search/SearchResultLayoutView.js | 10 +++++++-
.../js/views/tag/TagDetailTableLayoutView.js | 2 +-
10 files changed, 80 insertions(+), 19 deletions(-)
diff --git a/dashboardv2/public/js/templates/glossary/GlossaryDetailLayoutView_tmpl.html b/dashboardv2/public/js/templates/glossary/GlossaryDetailLayoutView_tmpl.html
index b3c642e9b..8bc3333b7 100644
--- a/dashboardv2/public/js/templates/glossary/GlossaryDetailLayoutView_tmpl.html
+++ b/dashboardv2/public/js/templates/glossary/GlossaryDetailLayoutView_tmpl.html
@@ -72,7 +72,7 @@
<div class="col-sm-12 default-tab">
<ul class="nav nav-tabs" data-id="tab-list">
<li role="entities" class="tab active"><a href="#tab-entities" aria-controls="tab-entities" role="tab" data-toggle="tab">Entities</a></li>
- <li role="entities" class="tab"><a href="#tab-entitiesProperties" aria-controls="tab-entities" role="tab" data-toggle="tab">Properties</a></li>
+ <li role="entitiesProperties" class="tab"><a href="#tab-entitiesProperties" aria-controls="tab-entities" role="tab" data-toggle="tab">Properties</a></li>
<li role="classification"><a href="#tab-tagTable" aria-controls="tab-tagTable" role="tab" data-toggle="tab">Classifications</a></li>
<li role="relatedTerm"><a href="#tab-relatedTerm" aria-controls="tab-relatedTerm" role="tab" data-toggle="tab">Related Terms</a></li>
</ul>
diff --git a/dashboardv2/public/js/templates/search/SearchResultLayoutView_tmpl.html b/dashboardv2/public/js/templates/search/SearchResultLayoutView_tmpl.html
index 9b71d28e1..5c2e9ccc8 100644
--- a/dashboardv2/public/js/templates/search/SearchResultLayoutView_tmpl.html
+++ b/dashboardv2/public/js/templates/search/SearchResultLayoutView_tmpl.html
@@ -53,18 +53,16 @@
<input type="checkbox" data-id="checkDeletedEntity" data-value="includeDE" id="historicalentities" />
<b>Show historical entities</b></label>
</div>
- <div class="inline" data-id="containerCheckBox" style="display: none;">
+ <div class="inline exclude-subclassifications" data-id="containerCheckBox" style="display: none;">
<label class="checkbox-inline btn" for="subclassifications">
<input type="checkbox" data-id="checkSubClassification" data-value="excludeSC" id="subclassifications" />
<b>Exclude sub-classifications</b></label>
</div>
- {{#ifCond fromView '!==' "classification"}}
- <div class="inline" data-id="containerCheckBox" style="display: none;">
+ <div class="inline exclude-subtypes" data-id="containerCheckBox" style="display: none;">
<label class="checkbox-inline btn" for="subtypes">
<input type="checkbox" data-id="checkSubType" data-value="excludeST" id="subtypes" />
<b>Exclude sub-types</b></label>
</div>
- {{/ifCond}}
</div>
</div>
<div id="r_searchResultTableLayoutView">
diff --git a/dashboardv2/public/js/views/glossary/GlossaryDetailLayoutView.js b/dashboardv2/public/js/views/glossary/GlossaryDetailLayoutView.js
index 93b073da9..b78e11afa 100644
--- a/dashboardv2/public/js/views/glossary/GlossaryDetailLayoutView.js
+++ b/dashboardv2/public/js/views/glossary/GlossaryDetailLayoutView.js
@@ -70,7 +70,8 @@ define(['require',
removeTag: '[data-id="removeTagTerm"]',
tagClick: '[data-id="tagClickTerm"]',
addTag: '[data-id="addTagTerm"]',
- textType: '[name="textType"]'
+ textType: '[name="textType"]',
+ tablist: '[data-id="tab-list"] li'
},
/** ui events hash */
events: function() {
@@ -173,6 +174,16 @@ define(['require',
this.isTextTypeChecked = !this.isTextTypeChecked;
this.renderDetails(this.data);
};
+ events["click " + this.ui.tablist] = function(e) {
+ var tabValue = $(e.currentTarget).attr('role');
+ Utils.setUrl({
+ url: Utils.getUrlState.getQueryUrl().queyParams[0],
+ urlParams: { tabActive: tabValue || 'entities' },
+ mergeBrowserUrl: true,
+ trigger: false,
+ updateTabState: true
+ });
+ };
return events;
},
/**
@@ -197,10 +208,17 @@ define(['require',
this.$('.fontLoader-relative').show();
this.getData();
this.bindEvents();
+ this.updateTab();
},
bindEvents: function() {
var that = this;
},
+ updateTab: function() {
+ if (this.value && this.value.tabActive) {
+ this.$('.nav.nav-tabs').find('[role="' + this.value.tabActive + '"]').addClass('active').siblings().removeClass('active');
+ this.$('.tab-content').find('[role="' + this.value.tabActive + '"]').addClass('active').siblings().removeClass('active');
+ }
+ },
getData: function() {
if (this.isGlossaryView) {
if (this.glossaryCollection.fullCollection.length) {
@@ -279,6 +297,7 @@ define(['require',
"glossaryCollection": that.glossaryCollection,
"searchVent": that.searchVent,
"tags": tags,
+ "value": that.value,
"getSelectedTermAttribute": function() {
return that.selectedTermAttribute;
},
@@ -520,7 +539,11 @@ define(['require',
require(['views/search/SearchResultLayoutView'], function(SearchResultLayoutView) {
if (that.RSearchResultLayoutView) {
that.RSearchResultLayoutView.show(new SearchResultLayoutView(_.extend({}, options, {
- "value": { "searchType": "basic", "term": that.data.qualifiedName },
+ "value": {
+ "searchType": "basic",
+ "term": that.data.qualifiedName,
+ "includeDE": options.value.includeDE || false
+ },
"fromView": "glossary"
})));
}
diff --git a/dashboardv2/public/js/views/search/SearchResultLayoutView.js b/dashboardv2/public/js/views/search/SearchResultLayoutView.js
index fd30281f9..5f57c2b2c 100644
--- a/dashboardv2/public/js/views/search/SearchResultLayoutView.js
+++ b/dashboardv2/public/js/views/search/SearchResultLayoutView.js
@@ -70,7 +70,9 @@ define(['require',
showPage: "[data-id='showPage']",
gotoPage: "[data-id='gotoPage']",
gotoPagebtn: "[data-id='gotoPagebtn']",
- activePage: "[data-id='activePage']"
+ activePage: "[data-id='activePage']",
+ excludeSubtypes: ".exclude-subtypes",
+ excludeSubClassifications: ".exclude-subclassifications"
},
templateHelpers: function() {
return {
@@ -622,6 +624,15 @@ define(['require',
that.REntityTableLayoutView.$el.find('.colSort thead tr th:not(.select-all-header-cell)').addClass('dragHandler');
tableDragger(document.querySelector(".colSort"), { dragHandler: ".dragHandler" }).on('drop', tableDropFunction);
}
+ if (Utils.getUrlState.isGlossaryTab()) {
+ this.ui.excludeSubtypes.hide();
+ this.ui.excludeSubClassifications.hide();
+ } else if (this.fromView !== "classification") {
+ this.ui.excludeSubtypes.show();
+ this.ui.excludeSubClassifications.show();
+ } else {
+ this.ui.excludeSubtypes.hide();
+ }
},
renderTableLayoutView: function(col) {
var that = this;
@@ -1284,7 +1295,7 @@ define(['require',
}
if (this.value) {
this.value[val] = flag;
- this.triggerUrl();
+ this.triggerUrl({ mergeBrowserUrl: true });
}
_.extend(this.searchCollection.queryParams, { limit: this.limit, offset: this.offset });
this.fetchCollection();
diff --git a/dashboardv2/public/js/views/tag/TagDetailTableLayoutView.js b/dashboardv2/public/js/views/tag/TagDetailTableLayoutView.js
index c780deb7d..6560068ac 100644
--- a/dashboardv2/public/js/views/tag/TagDetailTableLayoutView.js
+++ b/dashboardv2/public/js/views/tag/TagDetailTableLayoutView.js
@@ -146,7 +146,7 @@ define(['require',
},
triggetUrl: function() {
var paramObj = Utils.getUrlState.getQueryParams();
- if (paramObj && paramObj.tabActive === "classification") {
+ if (paramObj && paramObj.tabActive === "classification" && paramObj.viewType !== "term") {
Utils.setUrl({
url: '#!/detailPage/' + this.guid,
mergeBrowserUrl: false,
diff --git a/dashboardv3/public/js/templates/glossary/GlossaryDetailLayoutView_tmpl.html b/dashboardv3/public/js/templates/glossary/GlossaryDetailLayoutView_tmpl.html
index 5933d1d2f..69d7ef288 100644
--- a/dashboardv3/public/js/templates/glossary/GlossaryDetailLayoutView_tmpl.html
+++ b/dashboardv3/public/js/templates/glossary/GlossaryDetailLayoutView_tmpl.html
@@ -75,7 +75,7 @@
<div class="col-sm-12 default-tab no-padding">
<ul class="nav nav-tabs" data-id="tab-list">
<li role="entities" class="tab active"><a href="#tab-entities" aria-controls="tab-entities" role="tab" data-toggle="tab">Entities</a></li>
- <li role="entities" class="tab"><a href="#tab-entitiesProperties" aria-controls="tab-entities" role="tab" data-toggle="tab">Properties</a></li>
+ <li role="entitiesProperties" class="tab"><a href="#tab-entitiesProperties" aria-controls="tab-entities" role="tab" data-toggle="tab">Properties</a></li>
<li role="classification"><a href="#tab-tagTable" aria-controls="tab-tagTable" role="tab" data-toggle="tab">Classifications</a></li>
<li role="relatedTerm"><a href="#tab-relatedTerm" aria-controls="tab-relatedTerm" role="tab" data-toggle="tab">Related Terms</a></li>
</ul>
diff --git a/dashboardv3/public/js/templates/search/SearchResultLayoutView_tmpl.html b/dashboardv3/public/js/templates/search/SearchResultLayoutView_tmpl.html
index 876f5c26e..d163bfa51 100644
--- a/dashboardv3/public/js/templates/search/SearchResultLayoutView_tmpl.html
+++ b/dashboardv3/public/js/templates/search/SearchResultLayoutView_tmpl.html
@@ -59,18 +59,16 @@
<input type="checkbox" data-id="checkDeletedEntity" data-value="includeDE" id="historicalentities" />
<b>Show historical entities</b></label>
</div>
- <div class="inline" data-id="containerCheckBox" style="display: none;">
+ <div class="inline exclude-subclassifications" data-id="containerCheckBox" style="display: none;">
<label class="checkbox-inline btn" for="subclassifications">
<input type="checkbox" data-id="checkSubClassification" data-value="excludeSC" id="subclassifications" />
<b>Exclude sub-classifications</b></label>
</div>
- {{#ifCond fromView '!==' "classification"}}
- <div class="inline" data-id="containerCheckBox" style="display: none;">
+ <div class="inline exclude-subtypes" data-id="containerCheckBox" style="display: none;">
<label class="checkbox-inline btn" for="subtypes">
<input type="checkbox" data-id="checkSubType" data-value="excludeST" id="subtypes" />
<b>Exclude sub-types</b></label>
</div>
- {{/ifCond}}
</div>
</div>
</div>
diff --git a/dashboardv3/public/js/views/glossary/GlossaryDetailLayoutView.js b/dashboardv3/public/js/views/glossary/GlossaryDetailLayoutView.js
index 11eb6ca2a..96c466152 100644
--- a/dashboardv3/public/js/views/glossary/GlossaryDetailLayoutView.js
+++ b/dashboardv3/public/js/views/glossary/GlossaryDetailLayoutView.js
@@ -71,7 +71,8 @@ define(['require',
tagClick: '[data-id="tagClickTerm"]',
addTag: '[data-id="addTagTerm"]',
backButton: '[data-id="backButton"]',
- textType: '[name="textType"]'
+ textType: '[name="textType"]',
+ tablist: '[data-id="tab-list"] li'
},
/** ui events hash */
events: function() {
@@ -179,6 +180,16 @@ define(['require',
this.isTextTypeChecked = !this.isTextTypeChecked;
this.renderDetails(this.data);
};
+ events["click " + this.ui.tablist] = function(e) {
+ var tabValue = $(e.currentTarget).attr('role');
+ Utils.setUrl({
+ url: Utils.getUrlState.getQueryUrl().queyParams[0],
+ urlParams: { tabActive: tabValue || 'entities' },
+ mergeBrowserUrl: true,
+ trigger: false,
+ updateTabState: true
+ });
+ };
return events;
},
/**
@@ -203,6 +214,7 @@ define(['require',
this.$('.fontLoader-relative').show();
this.getData();
this.bindEvents();
+ this.updateTab();
},
bindEvents: function() {
var that = this;
@@ -212,6 +224,12 @@ define(['require',
})
}
},
+ updateTab: function() {
+ if (this.value && this.value.tabActive) {
+ this.$('.nav.nav-tabs').find('[role="' + this.value.tabActive + '"]').addClass('active').siblings().removeClass('active');
+ this.$('.tab-content').find('[role="' + this.value.tabActive + '"]').addClass('active').siblings().removeClass('active');
+ }
+ },
onBeforeDestroy: function() {
this.options.categoryEvent.off("Success:Term")
},
@@ -293,6 +311,7 @@ define(['require',
"glossaryCollection": that.glossaryCollection,
"searchVent": that.searchVent,
"tags": tags,
+ "value": that.value,
"getSelectedTermAttribute": function() {
return that.selectedTermAttribute;
},
@@ -535,7 +554,11 @@ define(['require',
require(['views/search/SearchResultLayoutView'], function(SearchResultLayoutView) {
if (that.RSearchResultLayoutView) {
that.RSearchResultLayoutView.show(new SearchResultLayoutView(_.extend({}, options, {
- "value": { "searchType": "basic", "term": that.data.qualifiedName },
+ "value": {
+ "searchType": "basic",
+ "term": that.data.qualifiedName,
+ "includeDE": options.value.includeDE || false
+ },
"fromView": "glossary"
})));
}
diff --git a/dashboardv3/public/js/views/search/SearchResultLayoutView.js b/dashboardv3/public/js/views/search/SearchResultLayoutView.js
index e4857249f..3b492e5eb 100644
--- a/dashboardv3/public/js/views/search/SearchResultLayoutView.js
+++ b/dashboardv3/public/js/views/search/SearchResultLayoutView.js
@@ -71,7 +71,9 @@ define(['require',
gotoPage: "[data-id='gotoPage']",
gotoPagebtn: "[data-id='gotoPagebtn']",
activePage: "[data-id='activePage']",
- saveFilter: "[data-id='saveFilter']"
+ saveFilter: "[data-id='saveFilter']",
+ excludeSubtypes: ".exclude-subtypes",
+ excludeSubClassifications: ".exclude-subclassifications"
},
templateHelpers: function() {
return {
@@ -637,6 +639,12 @@ define(['require',
that.REntityTableLayoutView.$el.find('.colSort thead tr th:not(.select-all-header-cell)').addClass('dragHandler');
tableDragger(document.querySelector(".colSort"), { dragHandler: ".dragHandler" }).on('drop', tableDropFunction);
}
+ if (Utils.getUrlState.isGlossaryTab()) {
+ this.ui.excludeSubtypes.hide();
+ this.ui.excludeSubClassifications.hide();
+ } else {
+ this.ui.excludeSubtypes.hide();
+ }
},
renderTableLayoutView: function(col) {
var that = this;
diff --git a/dashboardv3/public/js/views/tag/TagDetailTableLayoutView.js b/dashboardv3/public/js/views/tag/TagDetailTableLayoutView.js
index 809c14392..640485957 100644
--- a/dashboardv3/public/js/views/tag/TagDetailTableLayoutView.js
+++ b/dashboardv3/public/js/views/tag/TagDetailTableLayoutView.js
@@ -146,7 +146,7 @@ define(['require',
},
triggetUrl: function() {
var paramObj = Utils.getUrlState.getQueryParams();
- if (paramObj && paramObj.tabActive === "classification") {
+ if (paramObj && paramObj.tabActive === "classification" && paramObj.viewType !== "term") {
Utils.setUrl({
url: '#!/detailPage/' + this.guid,
mergeBrowserUrl: false,