Commit debb6e0b authored by Piotr Gawron's avatar Piotr Gawron
Browse files

Merge branch '1365-change-active-tab-when-choosing-a-show-all-element-from-pin-popup' into 'master'

Resolve "Change active tab when choosing a "Show all" element from pin popup"

Closes #1365

See merge request !1298
parents 13f599e5 8ff3c1e0
Pipeline #40192 failed with stage
in 31 minutes and 51 seconds
......@@ -13,6 +13,8 @@ minerva (16.0.0~alpha.2) stable; urgency=medium
retrying before submitting error report (#738)
* Bug fix: arrows without a "process" box had an irregular empty space in
their lines (#1471)
* Bug fix: when selecting drug in the alias window the input text is updated
(#1365)
-- Piotr Gawron <piotr.gawron@uni.lu> Fri, 26 Mar 2021 10:00:00 +0200
......
......@@ -66,7 +66,7 @@ AbstractDbPanel.prototype._createEventHandlers = function () {
minLength: 1,
hint: true
}, {
displayKey: function(suggestion) {
displayKey: function (suggestion) {
return suggestion;
},
source: function (query, callback) {
......@@ -87,6 +87,14 @@ AbstractDbPanel.prototype._createEventHandlers = function () {
self.getOverlayDb().addListener("onSearch", function (data) {
if (data.arg.type === AbstractDbOverlay.QueryType.SEARCH_BY_COORDINATES) {
$(searchInput).val("");
} else if (data.arg.type === AbstractDbOverlay.QueryType.SEARCH_BY_QUERY) {
$(searchInput).val(data.arg.query);
if (data.arg.query !== '') {
var link = $("a[href='#" + self.getElement().id + "']", self.getElement().parentNode.parentNode)[0];
if (link !== undefined) {
link.click();
}
}
}
});
};
......
......@@ -922,7 +922,7 @@ CustomMap.prototype.getOverlayDataForIdentifiedElement = function (identifiedEle
generalFlag = false;
}
overlays.push(overlay);
promises.push(overlay.getDetailDataByIdentifiedElement(identifiedElement, !overlay.allowSearchById()
promises.push(overlay.getDetailDataByIdentifiedElement(identifiedElement, overlay.allowSearchById()
|| generalFlag));
}
......
......@@ -182,7 +182,7 @@ AbstractInfoWindow.prototype.createOverlayInfoDiv = function (overlay, data) {
return null;
}
} else if (overlay.name === "chemical") {
if (this.alias.getType().toUpperCase() === "RNA" ||
if (alias.getType().toUpperCase() === "RNA" ||
alias.getType().toUpperCase() === "PROTEIN" ||
alias.getType().toUpperCase() === "GENE") {
return this._createChemicalInfoDiv(overlay, data);
......
......@@ -44,43 +44,6 @@ describe('DrugDbOverlay', function () {
assert.equal(elements.length, 1);
});
});
it("check if info window updated", function () {
helper.setUrl("http://test-page/?id=drug_target_sample");
var map, searchDb, alias, marker, infoWindow;
var ie = new IdentifiedElement({
id: 436152,
modelId: 20637,
type: 'ALIAS'
});
return ServerConnector.getProject("drug_target_sample").then(function (project) {
map = helper.createCustomMap(project);
searchDb = helper.createDrugDbOverlay(map);
return map.getModel().getByIdentifiedElement(ie);
}).then(function (result) {
alias = result;
marker = map.getMapCanvas().createMarker({icon: "empty.png", position: new Point(0, 0)});
return map.openInfoWindowForIdentifiedElement(ie, marker)
}).then(function (result) {
infoWindow = result;
assert.notOk(infoWindow.getContent().innerHTML.indexOf("NADH") >= 0);
return searchDb.searchByQuery("NADH");
}).then(function (drugs) {
assert.equal(drugs.length, 1);
assert.equal(searchDb.getQueries().length, 1);
return searchDb.getElementsByQuery(searchDb.getQueries()[0]);
}).then(function (elements) {
assert.ok(elements.length > 1);
return searchDb.getIdentifiedElements();
}).then(function (elements) {
assert.ok(infoWindow.getContent().innerHTML.indexOf("NADH") >= 0);
assert.equal(elements.length, 1);
}).finally(function(){
return map.destroy();
});
});
});
it("searchNamesByTarget", function () {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment