diff --git a/frontend-js/src/main/js/Configuration.js b/frontend-js/src/main/js/Configuration.js index ec10ceb8e8f377cb387712e4b798e8e15dcf19d1..3c423d1a4e374f58a0454ebe71f3339637e34eaf 100644 --- a/frontend-js/src/main/js/Configuration.js +++ b/frontend-js/src/main/js/Configuration.js @@ -176,6 +176,23 @@ Configuration.prototype.getOption = function (type) { return this._options[type]; }; +/** + * + * @param {string} type + * @returns {boolean} + */ +Configuration.prototype.getBooleanValue = function (type) { + var option = this.getOption(type); + if (option === undefined) { + return undefined; + } + if (option.getValueType() === "BOOLEAN") { + return option.getValue().toLowerCase() === "true"; + } else { + throw new Error("Expected option type BOOLEAN but found: " + option.getValueType()); + } +}; + /** * * @returns {ConfigurationOption[]} diff --git a/frontend-js/src/main/js/ConfigurationType.js b/frontend-js/src/main/js/ConfigurationType.js index 33e11d3ba6e4080eb7d18869a9c466ad7bc6030e..a8acf88bbeaff9fbd02726a49c05166c65dceccf 100644 --- a/frontend-js/src/main/js/ConfigurationType.js +++ b/frontend-js/src/main/js/ConfigurationType.js @@ -15,7 +15,35 @@ var ConfigurationType = { REQUEST_ACCOUNT_EMAIL: "REQUEST_ACCOUNT_EMAIL", REQUEST_ACCOUNT_DEFAULT_CONTENT: "REQUEST_ACCOUNT_DEFAULT_CONTENT", SIMPLE_COLOR_VAL: "SIMPLE_COLOR_VAL", + SHOW_ELEMENT_ABBREVIATION: "SHOW_ELEMENT_ABBREVIATION", + SHOW_ELEMENT_ANNOTATIONS: "SHOW_ELEMENT_ANNOTATIONS", + SHOW_ELEMENT_CHARGE: "SHOW_ELEMENT_CHARGE", + SHOW_ELEMENT_COMPARTMENT: "SHOW_ELEMENT_COMPARTMENT", + SHOW_ELEMENT_DESCRIPTION: "SHOW_ELEMENT_DESCRIPTION", + SHOW_ELEMENT_FORMER_SYMBOLS: "SHOW_ELEMENT_FORMER_SYMBOLS", + SHOW_ELEMENT_FORMULA: "SHOW_ELEMENT_FORMULA", + SHOW_ELEMENT_FULL_NAME: "SHOW_ELEMENT_FULL_NAME", + SHOW_ELEMENT_GROUP_SIZE: "SHOW_ELEMENT_GROUP_SIZE", + SHOW_ELEMENT_LINKED_SUBMAP: "SHOW_ELEMENT_LINKED_SUBMAP", + SHOW_ELEMENT_MODIFICATIONS: "SHOW_ELEMENT_MODIFICATIONS", + SHOW_ELEMENT_SYMBOL: "SHOW_ELEMENT_SYMBOL", + SHOW_ELEMENT_SYNONYMS: "SHOW_ELEMENT_SYNONYMS", + SHOW_ELEMENT_TITLE: "SHOW_ELEMENT_TITLE", + SHOW_ELEMENT_TYPE: "SHOW_ELEMENT_TYPE", + SHOW_REACTION_ABBREVIATION: "SHOW_REACTION_ABBREVIATION", + SHOW_REACTION_ANNOTATIONS: "SHOW_REACTION_ANNOTATIONS", + SHOW_REACTION_DESCRIPTION: "SHOW_REACTION_DESCRIPTION", + SHOW_REACTION_FORMULA: "SHOW_REACTION_FORMULA", + SHOW_REACTION_GENE_PROTEIN_REACTION: "SHOW_REACTION_GENE_PROTEIN_REACTION", + SHOW_REACTION_LINKED_SUBMAP: "SHOW_REACTION_LINKED_SUBMAP", + SHOW_REACTION_LOWER_BOUND: "SHOW_REACTION_LOWER_BOUND", + SHOW_REACTION_MECHANICAL_CONFIDENCE_SCORE: "SHOW_REACTION_MECHANICAL_CONFIDENCE_SCORE", + SHOW_REACTION_SUBSYSTEM: "SHOW_REACTION_SUBSYSTEM", + SHOW_REACTION_SYMBOL: "SHOW_REACTION_SYMBOL", + SHOW_REACTION_SYNONYMS: "SHOW_REACTION_SYNONYMS", + SHOW_REACTION_TITLE: "SHOW_REACTION_TITLE", SHOW_REACTION_TYPE: "SHOW_REACTION_TYPE", + SHOW_REACTION_UPPER_BOUND: "SHOW_REACTION_UPPER_BOUND", SEARCH_DISTANCE: "SEARCH_DISTANCE", SEARCH_RESULT_NUMBER: "SEARCH_RESULT_NUMBER", TERMS_OF_USE: "TERMS_OF_USE", diff --git a/frontend-js/src/main/js/gui/leftPanel/GenericSearchPanel.js b/frontend-js/src/main/js/gui/leftPanel/GenericSearchPanel.js index 0b0ee47231ab245c0ce9b27aa357ec0214697c6d..1d27c67effa437ae52060163f427b0b0ab0e5ed6 100644 --- a/frontend-js/src/main/js/gui/leftPanel/GenericSearchPanel.js +++ b/frontend-js/src/main/js/gui/leftPanel/GenericSearchPanel.js @@ -139,7 +139,7 @@ GenericSearchPanel.prototype.createReactionElement = function (reaction) { /** * * @param {Alias} alias - * @param {string} icon + * @param {string} [icon] * @returns {Promise<HTMLTableRowElement>} */ GenericSearchPanel.prototype.createAliasElement = function (alias, icon) { diff --git a/frontend-js/src/main/js/gui/leftPanel/GuiUtils.js b/frontend-js/src/main/js/gui/leftPanel/GuiUtils.js index 58e06c3634af2451a41ad716d55eb78eb709dabe..ad70f0aec174e84ee63e23150493f36e0e017d42 100644 --- a/frontend-js/src/main/js/gui/leftPanel/GuiUtils.js +++ b/frontend-js/src/main/js/gui/leftPanel/GuiUtils.js @@ -5,6 +5,7 @@ var Alias = require('../../map/data/Alias'); var ConfigurationType = require('../../ConfigurationType'); var IdentifiedElement = require('../../map/data/IdentifiedElement'); +var Reaction = require('../../map/data/Reaction'); var SearchBioEntityGroup = require('../../map/data/SearchBioEntityGroup'); @@ -591,14 +592,16 @@ GuiUtils.prototype.createTableRow = function (elements) { * * @param {Reaction|SearchBioEntityGroup} params.reaction * @param {string} [params.icon] - * @param {boolean} [params.showTitle] + * @param {boolean} [params.showTitle=true] * * @returns {Promise<HTMLDivElement>} */ GuiUtils.prototype.createReactionElement = function (params) { - var reaction = params.reaction; - var showTitle = ((params.showTitle === undefined) || params.showTitle); var self = this; + + var reaction = params.reaction; + var showTitle = ((params.showTitle === undefined) || params.showTitle) && + self.getConfiguration().getBooleanValue(ConfigurationType.SHOW_REACTION_TITLE); var div = document.createElement("div"); if (showTitle) { @@ -608,33 +611,55 @@ GuiUtils.prototype.createReactionElement = function (params) { } } - if (reaction.getLinkedSubmodelId() !== null && reaction.getLinkedSubmodelId() !== undefined) { + if (self.getConfiguration().getBooleanValue(ConfigurationType.SHOW_REACTION_LINKED_SUBMAP)) { div.appendChild(self.createSubMapLink("Associated submap: ", reaction.getLinkedSubmodelId())); } if (showTitle) { div.appendChild(self.createNewLine()); } - if (self.getConfiguration().getOption(ConfigurationType.SHOW_REACTION_TYPE).getValue().toLowerCase() === "true") { + if (self.getConfiguration().getBooleanValue(ConfigurationType.SHOW_REACTION_TYPE)) { div.appendChild(self.createParamLine("Type: ", reaction.getType())); } - div.appendChild(self.createParamLine("Symbol: ", reaction.getSymbol())); - div.appendChild(self.createParamLine("Abbreviation: ", reaction.getAbbreviation())); - div.appendChild(self.createParamLine("Formula: ", reaction.getFormula())); - div.appendChild(self.createParamLine("Mechanical Confidence Score: ", reaction.getMechanicalConfidenceScore())); - div.appendChild(self.createParamLine("Lower Bound: ", reaction.getLowerBound())); - div.appendChild(self.createParamLine("Upper Bound: ", reaction.getUpperBound())); - div.appendChild(self.createParamLine("Gene Protein Reaction: ", reaction.getGeneProteinReaction())); - div.appendChild(self.createParamLine("Subsystem: ", reaction.getSubsystem())); - div.appendChild(self.createArrayParamLine("Synonyms: ", reaction.getSynonyms())); - div.appendChild(self.createParamLine("Description: ", reaction.getDescription())); - div.appendChild(self.createAnnotations("Annotations: ", reaction.getReferences())); + if (self.getConfiguration().getBooleanValue(ConfigurationType.SHOW_REACTION_SYMBOL)) { + div.appendChild(self.createParamLine("Symbol: ", reaction.getSymbol())); + } + if (self.getConfiguration().getBooleanValue(ConfigurationType.SHOW_REACTION_ABBREVIATION)) { + div.appendChild(self.createParamLine("Abbreviation: ", reaction.getAbbreviation())); + } + if (self.getConfiguration().getBooleanValue(ConfigurationType.SHOW_REACTION_FORMULA)) { + div.appendChild(self.createParamLine("Formula: ", reaction.getFormula())); + } + if (self.getConfiguration().getBooleanValue(ConfigurationType.SHOW_REACTION_MECHANICAL_CONFIDENCE_SCORE)) { + div.appendChild(self.createParamLine("Mechanical Confidence Score: ", reaction.getMechanicalConfidenceScore())); + } + if (self.getConfiguration().getBooleanValue(ConfigurationType.SHOW_REACTION_LOWER_BOUND)) { + div.appendChild(self.createParamLine("Lower Bound: ", reaction.getLowerBound())); + } + if (self.getConfiguration().getBooleanValue(ConfigurationType.SHOW_REACTION_UPPER_BOUND)) { + div.appendChild(self.createParamLine("Upper Bound: ", reaction.getUpperBound())); + } + if (self.getConfiguration().getBooleanValue(ConfigurationType.SHOW_REACTION_GENE_PROTEIN_REACTION)) { + div.appendChild(self.createParamLine("Gene Protein Reaction: ", reaction.getGeneProteinReaction())); + } + if (self.getConfiguration().getBooleanValue(ConfigurationType.SHOW_REACTION_SUBSYSTEM)) { + div.appendChild(self.createParamLine("Subsystem: ", reaction.getSubsystem())); + } + if (self.getConfiguration().getBooleanValue(ConfigurationType.SHOW_REACTION_SYNONYMS)) { + div.appendChild(self.createArrayParamLine("Synonyms: ", reaction.getSynonyms())); + } + if (self.getConfiguration().getBooleanValue(ConfigurationType.SHOW_REACTION_DESCRIPTION)) { + div.appendChild(self.createParamLine("Description: ", reaction.getDescription())); + } + if (self.getConfiguration().getBooleanValue(ConfigurationType.SHOW_REACTION_ANNOTATIONS)) { + div.appendChild(self.createAnnotations("Annotations: ", reaction.getReferences())); + } return Promise.resolve(div); }; /** * - * @param {Object[]} modifications + * @param {Object[]|Object} modifications * * @returns {HTMLDivElement} */ @@ -643,6 +668,10 @@ GuiUtils.prototype.createModifications = function (modifications) { var result = document.createElement("div"); var modificationsByType = []; if (modifications !== undefined) { + if (modifications.length === undefined) { + modifications = [modifications]; + } + for (var i = 0; i < modifications.length; i++) { var modification = modifications[i]; if (modificationsByType[modification.type] === undefined) { @@ -670,8 +699,9 @@ GuiUtils.prototype.createModifications = function (modifications) { GuiUtils.prototype.createAliasElement = function (params) { var alias = params.alias; var icon = params.icon; - var showTitle = ((params.showTitle === undefined) || params.showTitle); var self = this; + var showTitle = ((params.showTitle === undefined) || params.showTitle) && + (self.getConfiguration().getBooleanValue(ConfigurationType.SHOW_ELEMENT_TITLE)); var div = document.createElement("div"); if (showTitle) { @@ -692,40 +722,62 @@ GuiUtils.prototype.createAliasElement = function (params) { div.appendChild(self.createSubMapLink("In submap: ", alias.getModelId())); } } - if (alias.getLinkedSubmodelId() !== undefined) { + if ((self.getConfiguration().getBooleanValue(ConfigurationType.SHOW_ELEMENT_LINKED_SUBMAP))) { div.appendChild(self.createSubMapLink("Associated submap: ", alias.getLinkedSubmodelId())); } - if (alias instanceof SearchBioEntityGroup && alias.getBioEntities().length > 1) { - div.appendChild(self.createLabelText("Group of " + alias.getBioEntities().length + " elements.")); + if ((self.getConfiguration().getBooleanValue(ConfigurationType.SHOW_ELEMENT_GROUP_SIZE))) { + if (alias instanceof SearchBioEntityGroup && alias.getBioEntities().length > 1) { + div.appendChild(self.createLabelText("Group of " + alias.getBioEntities().length + " elements.")); + } } if (showTitle) { div.appendChild(self.createNewLine(3)); } var promise = Promise.resolve(); - if (alias.getCompartmentId() !== undefined) { - promise = self.getMap().getModel().getByIdentifiedElement(new IdentifiedElement({ - type: "ALIAS", - id: alias.getCompartmentId(), - modelId: alias.getModelId() - }), true).then(function (compartment) { - div.appendChild(self.createParamLine("Compartment: ", compartment.getName())); - }) + if ((self.getConfiguration().getBooleanValue(ConfigurationType.SHOW_ELEMENT_COMPARTMENT))) { + if (alias.getCompartmentId() !== undefined) { + promise = self.getMap().getModel().getByIdentifiedElement(new IdentifiedElement({ + type: "ALIAS", + id: alias.getCompartmentId(), + modelId: alias.getModelId() + }), true).then(function (compartment) { + div.appendChild(self.createParamLine("Compartment: ", compartment.getName())); + }) + } } - return promise.then(function () { - div.appendChild(self.createParamLine("Full name: ", alias.getFullName())); - div.appendChild(self.createParamLine("Symbol: ", alias.getSymbol())); - div.appendChild(self.createParamLine("Abbreviation: ", alias.getAbbreviation())); - div.appendChild(self.createParamLine("Formula: ", alias.getFormula())); - div.appendChild(self.createArrayParamLine("Former symbols: ", alias.getFormerSymbols())); - div.appendChild(self.createModifications(alias.getOther('modifications'))); - div.appendChild(self.createParamLine("Charge: ", alias.getCharge())); - div.appendChild(self.createArrayParamLine("Synonyms: ", alias.getSynonyms())); - div.appendChild(self.createLabelText(alias.getDescription())); - div.appendChild(self.createAnnotations("Annotations: ", alias.getReferences())); - + if ((self.getConfiguration().getBooleanValue(ConfigurationType.SHOW_ELEMENT_FULL_NAME))) { + div.appendChild(self.createParamLine("Full name: ", alias.getFullName())); + } + if ((self.getConfiguration().getBooleanValue(ConfigurationType.SHOW_ELEMENT_SYMBOL))) { + div.appendChild(self.createParamLine("Symbol: ", alias.getSymbol())); + } + if ((self.getConfiguration().getBooleanValue(ConfigurationType.SHOW_ELEMENT_ABBREVIATION))) { + div.appendChild(self.createParamLine("Abbreviation: ", alias.getAbbreviation())); + } + if ((self.getConfiguration().getBooleanValue(ConfigurationType.SHOW_ELEMENT_FORMULA))) { + div.appendChild(self.createParamLine("Formula: ", alias.getFormula())); + } + if ((self.getConfiguration().getBooleanValue(ConfigurationType.SHOW_ELEMENT_FORMER_SYMBOLS))) { + div.appendChild(self.createArrayParamLine("Former symbols: ", alias.getFormerSymbols())); + } + if ((self.getConfiguration().getBooleanValue(ConfigurationType.SHOW_ELEMENT_MODIFICATIONS))) { + div.appendChild(self.createModifications(alias.getOther('modifications'))); + } + if ((self.getConfiguration().getBooleanValue(ConfigurationType.SHOW_ELEMENT_CHARGE))) { + div.appendChild(self.createParamLine("Charge: ", alias.getCharge())); + } + if ((self.getConfiguration().getBooleanValue(ConfigurationType.SHOW_ELEMENT_SYNONYMS))) { + div.appendChild(self.createArrayParamLine("Synonyms: ", alias.getSynonyms())); + } + if ((self.getConfiguration().getBooleanValue(ConfigurationType.SHOW_ELEMENT_DESCRIPTION))) { + div.appendChild(self.createLabelText(alias.getDescription())); + } + if ((self.getConfiguration().getBooleanValue(ConfigurationType.SHOW_ELEMENT_ANNOTATIONS))) { + div.appendChild(self.createAnnotations("Annotations: ", alias.getReferences())); + } return div; }) }; @@ -738,8 +790,10 @@ GuiUtils.prototype.createAliasElement = function (params) { GuiUtils.prototype.createSearchBioEntityGroupElement = function (group) { if (group.getBioEntities()[0] instanceof Alias) { return this.createAliasElement({alias: group, icon: group.getIcon()}); - } else { + } else if (group.getBioEntities()[0] instanceof Reaction) { return this.createReactionElement({reaction: group, icon: group.getIcon()}); + } else { + throw Promise.reject("Unknown element type in the group: " + group.getBioEntities()[0]); } }; diff --git a/frontend-js/src/main/js/map/data/SearchBioEntityGroup.js b/frontend-js/src/main/js/map/data/SearchBioEntityGroup.js index 19b4cbe8401b0fb4de663d1b45885ffa48679676..1e0c1f83bca7a3b119b406a8575758d02fb23179 100644 --- a/frontend-js/src/main/js/map/data/SearchBioEntityGroup.js +++ b/frontend-js/src/main/js/map/data/SearchBioEntityGroup.js @@ -331,7 +331,7 @@ SearchBioEntityGroup.prototype.getMergedParameterByFunction = function (function /** * - * @param {string} functionName + * @param {string|function} functionName * @returns {Array} */ SearchBioEntityGroup.prototype.getIntersectionListByFunction = function (functionName) { diff --git a/frontend-js/src/test/js/Configuration-test.js b/frontend-js/src/test/js/Configuration-test.js index e8aadbf1284d8bee39e41b3fcac7bf81b1fa4185..7061e036c49b2c416145614274c9807de6682f1c 100644 --- a/frontend-js/src/test/js/Configuration-test.js +++ b/frontend-js/src/test/js/Configuration-test.js @@ -7,7 +7,9 @@ var ConfigurationType = require('../../main/js/ConfigurationType'); var ServerConnector = require('./ServerConnector-mock'); var logger = require('./logger'); -var assert = require('assert'); +var chai = require('chai'); +var assert = chai.assert; +var expect = chai.expect; describe('Configuration', function () { describe('constructor', function () { @@ -108,6 +110,49 @@ describe('Configuration', function () { }); }); + describe('getBooleanValue', function () { + var conf = new Configuration({ + options: [{ + "commonName": "OK value", + "group": "Email notification details", + "type": "BOOLEAN_OPTION_OK", + "value": "true", + "valueType": "BOOLEAN" + }, { + "commonName": "FALSE value", + "group": "Email notification details", + "type": "BOOLEAN_OPTION_NOT_OK", + "value": "false", + "valueType": "BOOLEAN" + }, { + "commonName": "FALSE value", + "group": "Email notification details", + "type": "STRING_OPTION", + "value": "false", + "valueType": "STRING" + }], + overlayTypes: {}, + imageFormats: {}, + modelFormats: {}, + elementTypes: {}, + reactionTypes: {}, + miriamTypes: {}, + mapTypes: {}, + modificationStateTypes: {}, + privilegeTypes: {}, + annotators: {} + }); + it('for valid value', function () { + assert.ok(conf.getBooleanValue("BOOLEAN_OPTION_OK")); + assert.notOk(conf.getBooleanValue("BOOLEAN_OPTION_NOT_OK")); + }); + it('for string value', function () { + expect(function () { + conf.getBooleanValue("STRING_OPTION"); + }).to.throw(); + }); + }); + it('getElementTypeTree', function () { return ServerConnector.getConfiguration().then(function (configuration) { diff --git a/frontend-js/src/test/js/gui/leftPanel/GenericSearchPanel-test.js b/frontend-js/src/test/js/gui/leftPanel/GenericSearchPanel-test.js index 557e044d5c3b44f91365e1465569d9b846148857..6755e60ee8c73a4e37e313d22ba1031eddfeb209 100644 --- a/frontend-js/src/test/js/gui/leftPanel/GenericSearchPanel-test.js +++ b/frontend-js/src/test/js/gui/leftPanel/GenericSearchPanel-test.js @@ -38,6 +38,11 @@ describe('GenericSearchPanel', function () { }); it('on searchResults changed', function () { + var originalGetBooleanFun = helper.getConfiguration().getBooleanValue; + helper.getConfiguration().getBooleanValue = function () { + return true; + }; + var map = helper.createCustomMap(); map.getModel().setId(15781); var searchDbOverlay = helper.createSearchDbOverlay(map); @@ -56,6 +61,8 @@ describe('GenericSearchPanel', function () { return searchDbOverlay.searchByCoordinates(searchParams).then(function () { assert.equal(logger.getWarnings().length, 0); assert.ok(testDiv.innerHTML.indexOf("Reaction") >= 0); + }).finally(function () { + helper.getConfiguration().getBooleanValue = originalGetBooleanFun; }); }); @@ -177,6 +184,11 @@ describe('GenericSearchPanel', function () { describe('full name in desc', function () { it('visible', function () { + var originalGetBooleanFun = helper.getConfiguration().getBooleanValue; + helper.getConfiguration().getBooleanValue = function () { + return true; + }; + var map = helper.createCustomMap(); helper.createSearchDbOverlay(map); @@ -190,6 +202,8 @@ describe('GenericSearchPanel', function () { return panel.createAliasElement(alias).then(function (div) { assert.ok(div.innerHTML.indexOf("Full name") >= 0); + }).finally(function () { + helper.getConfiguration().getBooleanValue = originalGetBooleanFun; }); }); @@ -241,7 +255,7 @@ describe('GenericSearchPanel', function () { it("after initialization", function () { var panel = createPanel(); - return panel.refreshSearchAutocomplete("s").then(function () { + return panel.refreshSearchAutocomplete().then(function () { var t = panel.getAutocomplete("s"); assert.ok(t); assert.ok(t.length > 0); diff --git a/frontend-js/src/test/js/gui/leftPanel/GuiUtils-test.js b/frontend-js/src/test/js/gui/leftPanel/GuiUtils-test.js index 93f55f5850b2867e0295e4ea34d38c6a1de1588a..a51191a65ca990256b2b5ed141e5b7c62212d93c 100644 --- a/frontend-js/src/test/js/gui/leftPanel/GuiUtils-test.js +++ b/frontend-js/src/test/js/gui/leftPanel/GuiUtils-test.js @@ -19,6 +19,17 @@ describe('GuiUtils', function () { return result; } + var originalGetBooleanFun; + beforeEach(function () { + originalGetBooleanFun = helper.getConfiguration().getBooleanValue; + helper.getConfiguration().getBooleanValue = function () { + return true; + } + }); + afterEach(function () { + helper.getConfiguration().getBooleanValue = originalGetBooleanFun; + }); + it('constructor', function () { var map = helper.createCustomMap(); helper.createSearchDbOverlay(map); @@ -53,8 +64,7 @@ describe('GuiUtils', function () { map.getModel().setId(15781); helper.createSearchDbOverlay(map); - var guiUtils = createGuiUtils(); - guiUtils.setMap(map); + var guiUtils = createGuiUtils(map); return guiUtils.createAliasElement({alias: alias}).then(function (aliasDiv) { assert.ok(aliasDiv.innerHTML); diff --git a/model/src/main/java/lcsb/mapviewer/model/user/ConfigurationElementType.java b/model/src/main/java/lcsb/mapviewer/model/user/ConfigurationElementType.java index 2a499fd3f634cf3a5d392b7edea6e5587789386d..8d68893ecf8327fb3c0e18a8534dd26844faed24 100644 --- a/model/src/main/java/lcsb/mapviewer/model/user/ConfigurationElementType.java +++ b/model/src/main/java/lcsb/mapviewer/model/user/ConfigurationElementType.java @@ -186,8 +186,8 @@ public enum ConfigurationElementType { DEFAULT_LAYOUT_MANAGEMENT("Default user privilege for: " + PrivilegeType.LAYOUT_MANAGEMENT.getCommonName(), "false", ConfigurationElementEditType.BOOLEAN, true, ConfigurationElementTypeGroup.DEFAULT_USER_PRIVILEGES), - SHOW_REACTION_TYPE("Show reaction type when browsing map", "true", ConfigurationElementEditType.BOOLEAN, false, - ConfigurationElementTypeGroup.LEGEND_AND_LOGO), + SHOW_REACTION_TYPE("Show reaction type", "true", ConfigurationElementEditType.BOOLEAN, false, + ConfigurationElementTypeGroup.SEARCH_VISIBLE_PARAMETERS), GOOGLE_MAPS_API_KEY("By providing this Google Maps Platform API key I declare that I am aware that " + "I am a Customer of the Google Maps Platform and I agree to the terms of the <a href=\"https://cloud.google.com/maps-platform/terms/\" target='_blank'>license of Google Maps Platform</a>." @@ -226,6 +226,66 @@ public enum ConfigurationElementType { DEFAULT_CUSTOM_LAYOUTS("Default user privilege for: " + PrivilegeType.CUSTOM_LAYOUTS.getCommonName(), "0", ConfigurationElementEditType.INTEGER, true, ConfigurationElementTypeGroup.DEFAULT_USER_PRIVILEGES), + + SHOW_REACTION_TITLE("Show reaction title", "true", ConfigurationElementEditType.BOOLEAN, false, + ConfigurationElementTypeGroup.SEARCH_VISIBLE_PARAMETERS), + SHOW_REACTION_LINKED_SUBMAP("Show linked submap for reaction", "true", ConfigurationElementEditType.BOOLEAN, false, + ConfigurationElementTypeGroup.SEARCH_VISIBLE_PARAMETERS), + SHOW_REACTION_SYMBOL("Show reaction symbol", "true", ConfigurationElementEditType.BOOLEAN, false, + ConfigurationElementTypeGroup.SEARCH_VISIBLE_PARAMETERS), + SHOW_REACTION_ABBREVIATION("Show reaction abbreviation", "true", ConfigurationElementEditType.BOOLEAN, false, + ConfigurationElementTypeGroup.SEARCH_VISIBLE_PARAMETERS), + SHOW_REACTION_FORMULA("Show reaction formula", "true", ConfigurationElementEditType.BOOLEAN, false, + ConfigurationElementTypeGroup.SEARCH_VISIBLE_PARAMETERS), + SHOW_REACTION_MECHANICAL_CONFIDENCE_SCORE("Show reaction mechanical confidence score", "true", ConfigurationElementEditType.BOOLEAN, false, + ConfigurationElementTypeGroup.SEARCH_VISIBLE_PARAMETERS), + SHOW_REACTION_LOWER_BOUND("Show reaction lower bound", "true", ConfigurationElementEditType.BOOLEAN, false, + ConfigurationElementTypeGroup.SEARCH_VISIBLE_PARAMETERS), + SHOW_REACTION_UPPER_BOUND("Show reaction upper bound", "true", ConfigurationElementEditType.BOOLEAN, false, + ConfigurationElementTypeGroup.SEARCH_VISIBLE_PARAMETERS), + SHOW_REACTION_GENE_PROTEIN_REACTION("Show reaction gene protein reaction", "true", ConfigurationElementEditType.BOOLEAN, false, + ConfigurationElementTypeGroup.SEARCH_VISIBLE_PARAMETERS), + SHOW_REACTION_SUBSYSTEM("Show reaction subsystem", "true", ConfigurationElementEditType.BOOLEAN, false, + ConfigurationElementTypeGroup.SEARCH_VISIBLE_PARAMETERS), + SHOW_REACTION_SYNONYMS("Show reaction synonyms", "true", ConfigurationElementEditType.BOOLEAN, false, + ConfigurationElementTypeGroup.SEARCH_VISIBLE_PARAMETERS), + SHOW_REACTION_DESCRIPTION("Show reaction description", "true", ConfigurationElementEditType.BOOLEAN, false, + ConfigurationElementTypeGroup.SEARCH_VISIBLE_PARAMETERS), + SHOW_REACTION_ANNOTATIONS("Show reaction annotations", "true", ConfigurationElementEditType.BOOLEAN, false, + ConfigurationElementTypeGroup.SEARCH_VISIBLE_PARAMETERS), + + SHOW_ELEMENT_TYPE("Show element type", "true", ConfigurationElementEditType.BOOLEAN, false, + ConfigurationElementTypeGroup.SEARCH_VISIBLE_PARAMETERS), + SHOW_ELEMENT_TITLE("Show element title", "true", ConfigurationElementEditType.BOOLEAN, false, + ConfigurationElementTypeGroup.SEARCH_VISIBLE_PARAMETERS), + SHOW_ELEMENT_LINKED_SUBMAP("Show linked submap for element", "true", ConfigurationElementEditType.BOOLEAN, false, + ConfigurationElementTypeGroup.SEARCH_VISIBLE_PARAMETERS), + SHOW_ELEMENT_GROUP_SIZE("Show element group size", "true", ConfigurationElementEditType.BOOLEAN, false, + ConfigurationElementTypeGroup.SEARCH_VISIBLE_PARAMETERS), + SHOW_ELEMENT_COMPARTMENT("Show element compartment", "true", ConfigurationElementEditType.BOOLEAN, false, + ConfigurationElementTypeGroup.SEARCH_VISIBLE_PARAMETERS), + SHOW_ELEMENT_FULL_NAME("Show element full name", "true", ConfigurationElementEditType.BOOLEAN, false, + ConfigurationElementTypeGroup.SEARCH_VISIBLE_PARAMETERS), + SHOW_ELEMENT_SYMBOL("Show element symbol", "true", ConfigurationElementEditType.BOOLEAN, false, + ConfigurationElementTypeGroup.SEARCH_VISIBLE_PARAMETERS), + SHOW_ELEMENT_ABBREVIATION("Show element abbreviation", "true", ConfigurationElementEditType.BOOLEAN, false, + ConfigurationElementTypeGroup.SEARCH_VISIBLE_PARAMETERS), + SHOW_ELEMENT_FORMULA("Show element formula", "true", ConfigurationElementEditType.BOOLEAN, false, + ConfigurationElementTypeGroup.SEARCH_VISIBLE_PARAMETERS), + SHOW_ELEMENT_FORMER_SYMBOLS("Show element former symbol", "true", ConfigurationElementEditType.BOOLEAN, false, + ConfigurationElementTypeGroup.SEARCH_VISIBLE_PARAMETERS), + SHOW_ELEMENT_MODIFICATIONS("Show element modifications", "true", ConfigurationElementEditType.BOOLEAN, false, + ConfigurationElementTypeGroup.SEARCH_VISIBLE_PARAMETERS), + SHOW_ELEMENT_CHARGE("Show element charge", "true", ConfigurationElementEditType.BOOLEAN, false, + ConfigurationElementTypeGroup.SEARCH_VISIBLE_PARAMETERS), + SHOW_ELEMENT_SYNONYMS("Show element synonyms", "true", ConfigurationElementEditType.BOOLEAN, false, + ConfigurationElementTypeGroup.SEARCH_VISIBLE_PARAMETERS), + SHOW_ELEMENT_DESCRIPTION("Show element description", "true", ConfigurationElementEditType.BOOLEAN, false, + ConfigurationElementTypeGroup.SEARCH_VISIBLE_PARAMETERS), + SHOW_ELEMENT_ANNOTATIONS("Show element annotations", "true", ConfigurationElementEditType.BOOLEAN, false, + ConfigurationElementTypeGroup.SEARCH_VISIBLE_PARAMETERS), + + ; /** diff --git a/model/src/main/java/lcsb/mapviewer/model/user/ConfigurationElementTypeGroup.java b/model/src/main/java/lcsb/mapviewer/model/user/ConfigurationElementTypeGroup.java index bb7417e9c7dbd82ac7fe75f7f1aa50212c529e7f..3142624c33bfd56ce8df9c74cf72664bafb1026d 100644 --- a/model/src/main/java/lcsb/mapviewer/model/user/ConfigurationElementTypeGroup.java +++ b/model/src/main/java/lcsb/mapviewer/model/user/ConfigurationElementTypeGroup.java @@ -8,6 +8,7 @@ public enum ConfigurationElementTypeGroup { POINT_AND_CLICK("Point and click"), // SERVER_CONFIGURATION("Server configuration"),// LDAP_CONFIGURATION("LDAP configuration"),// + SEARCH_VISIBLE_PARAMETERS("Search panel options"), // ; private String commonName;