ATLAS-4693,ATLAS-4661,ATLAS-4613 : (UI)Switching within Terms page does not land you in the same tab

Signed-off-by: Mandar Ambawane <mandar.ambawane@freestoneinfotech.com>
This commit is contained in:
Farhan Khan 2022-10-28 12:36:36 +05:30 committed by Mandar Ambawane
parent 5a55dbdf1c
commit 3022242bb0
10 changed files with 80 additions and 19 deletions

View File

@ -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>

View File

@ -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">

View File

@ -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"
})));
}

View File

@ -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();

View File

@ -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,

View File

@ -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>

View File

@ -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>

View File

@ -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"
})));
}

View File

@ -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;

View File

@ -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,