From dd0ccb13c36044d24c2afe3d25b9edaea94bb71c Mon Sep 17 00:00:00 2001 From: Piotr Gawron <piotr.gawron@uni.lu> Date: Wed, 5 Jun 2019 19:50:56 +0200 Subject: [PATCH] submap description is available --- CHANGELOG | 2 ++ .../main/js/gui/leftPanel/ProjectInfoPanel.js | 16 +++++++++++++++ .../src/main/js/gui/leftPanel/SubmapPanel.js | 13 +++++++++++- frontend-js/src/main/js/map/data/MapModel.js | 20 +++++++++++++++++++ .../api/projects/models/ModelRestImpl.java | 1 + 5 files changed, 51 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 89c6d061ae..5c753265b4 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -7,6 +7,8 @@ minerva (12.3.1~beta.1) unstable; urgency=low * Bug fix: list of availbale annotators is sorted alphabetically (#815) * Bug fix: protein types are sorted properly in "Select valid annotations" dialog (#815) + * Bug fix: if there is a description of (sub)map then it is available in + info/submap panel (#824) minerva (13.1.0~beta.0) unstable; urgency=low * Feature: annotators are more flexible - you can define set of input and diff --git a/frontend-js/src/main/js/gui/leftPanel/ProjectInfoPanel.js b/frontend-js/src/main/js/gui/leftPanel/ProjectInfoPanel.js index 4c61b833f0..0ed1dc7a4c 100644 --- a/frontend-js/src/main/js/gui/leftPanel/ProjectInfoPanel.js +++ b/frontend-js/src/main/js/gui/leftPanel/ProjectInfoPanel.js @@ -235,6 +235,22 @@ ProjectInfoPanel.prototype._createInfoPanelGui = function () { authorsTab.appendChild(guiUtils.createAuthorsList(self.getProject().getModels()[0].getAuthors())); } + if (self.getProject().getModels()[0].getDescription() !== null && self.getProject().getModels()[0].getDescription() !== "") { + var descriptionTab = Functions.createElement({ + type: "div" + }); + infoDiv.appendChild(descriptionTab); + + descriptionTab.appendChild(Functions.createElement({ + type: "h4", + content: 'Description:' + })); + descriptionTab.appendChild(Functions.createElement({ + type: "p", + content: self.getProject().getModels()[0].getDescription() + })); + } + }; diff --git a/frontend-js/src/main/js/gui/leftPanel/SubmapPanel.js b/frontend-js/src/main/js/gui/leftPanel/SubmapPanel.js index 150c09f771..dfe1ea7c4d 100644 --- a/frontend-js/src/main/js/gui/leftPanel/SubmapPanel.js +++ b/frontend-js/src/main/js/gui/leftPanel/SubmapPanel.js @@ -64,7 +64,8 @@ SubmapPanel.prototype.createRow = function (model) { var nameTd = Functions.createElement({type: "td", content: model.getName(), style: "position:relative"}); - if (model.getReferences().length > 0 || model.getAuthors().length > 0) { + if (model.getReferences().length > 0 || model.getAuthors().length > 0 || + (model.getDescription() !== null && model.getDescription() !== "")) { var referencesTab = Functions.createElement({ type: "div", className: "minerva-search-data-hidden" @@ -88,6 +89,16 @@ SubmapPanel.prototype.createRow = function (model) { referencesTab.appendChild(authors); referencesTab.appendChild(guiUtils.createAuthorsList(model.getAuthors())); } + if (model.getDescription() !== null && model.getDescription() !== "") { + referencesTab.appendChild(Functions.createElement({ + type: "div", + content: 'Description:' + })); + referencesTab.appendChild(Functions.createElement({ + type: "p", + content: model.getDescription() + })); + } var expandButton = Functions.createElement({ type: "button", diff --git a/frontend-js/src/main/js/map/data/MapModel.js b/frontend-js/src/main/js/map/data/MapModel.js index 0149eed1f9..ed7ff8b9c8 100644 --- a/frontend-js/src/main/js/map/data/MapModel.js +++ b/frontend-js/src/main/js/map/data/MapModel.js @@ -23,6 +23,7 @@ var Reaction = require('./Reaction'); * @typedef {Object} MapModelOptions * @property {number} idObject * @property {string} name + * @property {string} description * @property {number} tileSize * @property {number} width * @property {number} height @@ -90,6 +91,7 @@ function MapModel(configuration) { this.setAuthors(configuration.getAuthors()); this.setModificationDates(configuration.getModificationDates()); this.setCreationDate(configuration.getCreationDate()); + this.setDescription(configuration.getDescription()); } else { this.setId(configuration.idObject); this.setName(configuration.name); @@ -106,6 +108,7 @@ function MapModel(configuration) { this.setAuthors(configuration.authors); this.setModificationDates(configuration.modificationDates); this.setCreationDate(configuration.creationDate); + this.setDescription(configuration.description); } } } @@ -980,4 +983,21 @@ MapModel.prototype.setCreationDate = function (creationDate) { this._creationDate = creationDate; }; +/** + * + * @returns {string|null} + */ +MapModel.prototype.getDescription = function () { + return this._description; +}; + +/** + * + * @param {string} description + */ +MapModel.prototype.setDescription = function (description) { + this._description = description; +}; + + module.exports = MapModel; diff --git a/rest-api/src/main/java/lcsb/mapviewer/api/projects/models/ModelRestImpl.java b/rest-api/src/main/java/lcsb/mapviewer/api/projects/models/ModelRestImpl.java index 133f407c2f..17926f3816 100644 --- a/rest-api/src/main/java/lcsb/mapviewer/api/projects/models/ModelRestImpl.java +++ b/rest-api/src/main/java/lcsb/mapviewer/api/projects/models/ModelRestImpl.java @@ -116,6 +116,7 @@ public class ModelRestImpl extends BaseRestImpl { result.put("authors", submodel.getAuthors()); result.put("creationDate", super.prepareDate(submodel.getCreationDate())); result.put("modificationDates", super.prepareDates(submodel.getModificationDates())); + result.put("description", submodel.getNotes()); return result; } } -- GitLab