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

Merge branch '793-search-hint' into 'devel_12.2.x'

left panel search hint should be always visible

See merge request minerva/core!753
parents 76966e4d 4b3341d0
......@@ -4,6 +4,7 @@ minerva (12.2.3) stable; urgency=medium
certificate on https://ctdbase.org/
* Bug fix: remove button is disabled after starting removing of the data
overlay (#791)
* Bug fix: search autocomplete hint could be initially hidden (#793)
-- Piotr Gawron <piotr.gawron@uni.lu> Wed, 24 Apr 2019 17:00:00 +0200
......
{
"name": "minerva-frontend",
"version": "1.0.0",
"description": "frontentd for minerva google maps interface",
"description": "frontend for minerva google maps interface",
"main": "minerva.js",
"scripts": {
"build:css": "cleancss --skip-rebase -o dist/minerva.css node_modules/openlayers/dist/ol.css node_modules/dual-listbox/dist/*.css node_modules/multi-checkbox-list/dist/*.css src/main/css/*.css",
......@@ -14,7 +14,7 @@
"deploy": "node scripts/deploy.js",
"refresh-mock-requests": "node scripts/refresh_mock_requests.js",
"lint": "jshint src/.",
"test": "istanbul cover node_modules/mocha/bin/_mocha -- --recursive src/test/js --retries 4"
"test": "istanbul cover node_modules/mocha/bin/_mocha -- --recursive src/test/js --retries 4 --timeout 4000"
},
"author": "Piotr Gawron",
"devDependencies": {
......
......@@ -30,7 +30,6 @@ function AbstractDbPanel(params) {
this._createEventHandlers();
this._tabIdCount = 0;
}
AbstractDbPanel.prototype = Object.create(Panel.prototype);
......@@ -243,6 +242,18 @@ AbstractDbPanel.prototype.refreshSearchResults = function () {
});
};
/**
*
* @return {Promise}
*/
AbstractDbPanel.prototype.init = function () {
var self = this;
self.clearResults();
return self.addResultTab("{}", []).then(function () {
self.onresize();
});
};
/**
*
*/
......@@ -290,7 +301,7 @@ AbstractDbPanel.prototype.addResultTab = function (query, elements) {
var identifiedElements = [];
for (var i = 0; i < elements.length; i++) {
if (elements[i].element instanceof SearchBioEntityGroup) {
for (var j=0;j<elements[i].element.getBioEntities().length;j++) {
for (var j = 0; j < elements[i].element.getBioEntities().length; j++) {
identifiedElements.push(new IdentifiedElement(elements[i].element.getBioEntities()[j]));
}
} else {
......
......@@ -92,12 +92,14 @@ ChemicalPanel.prototype.searchByQuery = function () {
*/
ChemicalPanel.prototype.init = function () {
var self = this;
return self.getToolTipForAnnotation(self.getProject().getDisease()).then(function (toolTip) {
self.setHelpTip(toolTip);
var query = ServerConnector.getSessionData().getChemicalQuery();
if (query !== undefined) {
return self.getOverlayDb().searchByEncodedQuery(query);
}
return AbstractDbPanel.prototype.init.call(this).then(function () {
return self.getToolTipForAnnotation(self.getProject().getDisease()).then(function (toolTip) {
self.setHelpTip(toolTip);
var query = ServerConnector.getSessionData().getChemicalQuery();
if (query !== undefined) {
return self.getOverlayDb().searchByEncodedQuery(query);
}
});
});
};
......
......@@ -83,12 +83,13 @@ DrugPanel.prototype.searchByQuery = function () {
* @returns {Promise}
*/
DrugPanel.prototype.init = function () {
var query = ServerConnector.getSessionData().getDrugQuery();
if (query !== undefined) {
return this.getOverlayDb().searchByEncodedQuery(query);
} else {
return Promise.resolve();
}
var self = this;
return AbstractDbPanel.prototype.init.call(this).then(function () {
var query = ServerConnector.getSessionData().getDrugQuery();
if (query !== undefined) {
return self.getOverlayDb().searchByEncodedQuery(query);
}
});
};
/**
......
......@@ -239,18 +239,19 @@ GenericSearchPanel.prototype.refreshSearchAutocomplete = function () {
* @returns {Promise}
*/
GenericSearchPanel.prototype.init = function () {
var query = ServerConnector.getSessionData().getSearchQuery();
if (query !== undefined) {
return this.getOverlayDb().searchByEncodedQuery(query, false).catch(function (error) {
if (error instanceof InvalidArgumentError) {
logger.warn(error.message);
} else {
throw error;
}
});
} else {
return Promise.resolve();
}
var self = this;
return AbstractDbPanel.prototype.init.call(this).then(function () {
var query = ServerConnector.getSessionData().getSearchQuery();
if (query !== undefined) {
return self.getOverlayDb().searchByEncodedQuery(query, false).catch(function (error) {
if (error instanceof InvalidArgumentError) {
logger.warn(error.message);
} else {
throw error;
}
});
}
});
};
......
......@@ -77,12 +77,13 @@ MiRnaPanel.prototype.searchByQuery = function() {
* @returns {Promise}
*/
MiRnaPanel.prototype.init = function() {
var query = ServerConnector.getSessionData().getMiRnaQuery();
if (query !== undefined) {
return this.getOverlayDb().searchByEncodedQuery(query);
} else {
return Promise.resolve();
}
var self = this;
return AbstractDbPanel.prototype.init.call(this).then(function () {
var query = ServerConnector.getSessionData().getMiRnaQuery();
if (query !== undefined) {
return self.getOverlayDb().searchByEncodedQuery(query);
}
});
};
/**
......
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