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 ...@@ -4,6 +4,7 @@ minerva (12.2.3) stable; urgency=medium
certificate on https://ctdbase.org/ certificate on https://ctdbase.org/
* Bug fix: remove button is disabled after starting removing of the data * Bug fix: remove button is disabled after starting removing of the data
overlay (#791) 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 -- Piotr Gawron <piotr.gawron@uni.lu> Wed, 24 Apr 2019 17:00:00 +0200
......
{ {
"name": "minerva-frontend", "name": "minerva-frontend",
"version": "1.0.0", "version": "1.0.0",
"description": "frontentd for minerva google maps interface", "description": "frontend for minerva google maps interface",
"main": "minerva.js", "main": "minerva.js",
"scripts": { "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", "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 @@ ...@@ -14,7 +14,7 @@
"deploy": "node scripts/deploy.js", "deploy": "node scripts/deploy.js",
"refresh-mock-requests": "node scripts/refresh_mock_requests.js", "refresh-mock-requests": "node scripts/refresh_mock_requests.js",
"lint": "jshint src/.", "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", "author": "Piotr Gawron",
"devDependencies": { "devDependencies": {
......
...@@ -30,7 +30,6 @@ function AbstractDbPanel(params) { ...@@ -30,7 +30,6 @@ function AbstractDbPanel(params) {
this._createEventHandlers(); this._createEventHandlers();
this._tabIdCount = 0; this._tabIdCount = 0;
} }
AbstractDbPanel.prototype = Object.create(Panel.prototype); AbstractDbPanel.prototype = Object.create(Panel.prototype);
...@@ -243,6 +242,18 @@ AbstractDbPanel.prototype.refreshSearchResults = function () { ...@@ -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) { ...@@ -290,7 +301,7 @@ AbstractDbPanel.prototype.addResultTab = function (query, elements) {
var identifiedElements = []; var identifiedElements = [];
for (var i = 0; i < elements.length; i++) { for (var i = 0; i < elements.length; i++) {
if (elements[i].element instanceof SearchBioEntityGroup) { 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])); identifiedElements.push(new IdentifiedElement(elements[i].element.getBioEntities()[j]));
} }
} else { } else {
......
...@@ -92,12 +92,14 @@ ChemicalPanel.prototype.searchByQuery = function () { ...@@ -92,12 +92,14 @@ ChemicalPanel.prototype.searchByQuery = function () {
*/ */
ChemicalPanel.prototype.init = function () { ChemicalPanel.prototype.init = function () {
var self = this; var self = this;
return self.getToolTipForAnnotation(self.getProject().getDisease()).then(function (toolTip) { return AbstractDbPanel.prototype.init.call(this).then(function () {
self.setHelpTip(toolTip); return self.getToolTipForAnnotation(self.getProject().getDisease()).then(function (toolTip) {
var query = ServerConnector.getSessionData().getChemicalQuery(); self.setHelpTip(toolTip);
if (query !== undefined) { var query = ServerConnector.getSessionData().getChemicalQuery();
return self.getOverlayDb().searchByEncodedQuery(query); if (query !== undefined) {
} return self.getOverlayDb().searchByEncodedQuery(query);
}
});
}); });
}; };
......
...@@ -83,12 +83,13 @@ DrugPanel.prototype.searchByQuery = function () { ...@@ -83,12 +83,13 @@ DrugPanel.prototype.searchByQuery = function () {
* @returns {Promise} * @returns {Promise}
*/ */
DrugPanel.prototype.init = function () { DrugPanel.prototype.init = function () {
var query = ServerConnector.getSessionData().getDrugQuery(); var self = this;
if (query !== undefined) { return AbstractDbPanel.prototype.init.call(this).then(function () {
return this.getOverlayDb().searchByEncodedQuery(query); var query = ServerConnector.getSessionData().getDrugQuery();
} else { if (query !== undefined) {
return Promise.resolve(); return self.getOverlayDb().searchByEncodedQuery(query);
} }
});
}; };
/** /**
......
...@@ -239,18 +239,19 @@ GenericSearchPanel.prototype.refreshSearchAutocomplete = function () { ...@@ -239,18 +239,19 @@ GenericSearchPanel.prototype.refreshSearchAutocomplete = function () {
* @returns {Promise} * @returns {Promise}
*/ */
GenericSearchPanel.prototype.init = function () { GenericSearchPanel.prototype.init = function () {
var query = ServerConnector.getSessionData().getSearchQuery(); var self = this;
if (query !== undefined) { return AbstractDbPanel.prototype.init.call(this).then(function () {
return this.getOverlayDb().searchByEncodedQuery(query, false).catch(function (error) { var query = ServerConnector.getSessionData().getSearchQuery();
if (error instanceof InvalidArgumentError) { if (query !== undefined) {
logger.warn(error.message); return self.getOverlayDb().searchByEncodedQuery(query, false).catch(function (error) {
} else { if (error instanceof InvalidArgumentError) {
throw error; logger.warn(error.message);
} } else {
}); throw error;
} else { }
return Promise.resolve(); });
} }
});
}; };
......
...@@ -77,12 +77,13 @@ MiRnaPanel.prototype.searchByQuery = function() { ...@@ -77,12 +77,13 @@ MiRnaPanel.prototype.searchByQuery = function() {
* @returns {Promise} * @returns {Promise}
*/ */
MiRnaPanel.prototype.init = function() { MiRnaPanel.prototype.init = function() {
var query = ServerConnector.getSessionData().getMiRnaQuery(); var self = this;
if (query !== undefined) { return AbstractDbPanel.prototype.init.call(this).then(function () {
return this.getOverlayDb().searchByEncodedQuery(query); var query = ServerConnector.getSessionData().getMiRnaQuery();
} else { if (query !== undefined) {
return Promise.resolve(); 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