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

additional configuration param allowing to hide reaction type in left panel

parent 32d1fd3b
Pipeline #4424 passed with stage
in 2 minutes and 1 second
......@@ -45,38 +45,30 @@
"litemol": "github:dsehnal/LiteMol#a5419c696faa84530dd93acd55b747cf8136902b"
},
"dependencies": {
"ProtVista": {
"version": "git://github.com/davidhoksza/protvista.git#4e4bb737ba1e183291505bd25f8bae2e651ce21e",
"dev": true,
"requires": {
"d3": "3.5.17",
"file-saver": "1.3.3",
"jquery": "2.2.4",
"jszip": "3.1.4",
"underscore": "1.8.3"
},
"dependencies": {
"jquery": {
"version": "2.2.4",
"resolved": "https://registry.npmjs.org/jquery/-/jquery-2.2.4.tgz",
"integrity": "sha1-LInWiJterFIqfuoywUUhVZxsvwI=",
"dev": true
}
}
},
"jquery": {
"version": "3.3.1",
"resolved": "https://registry.npmjs.org/jquery/-/jquery-3.3.1.tgz",
"integrity": "sha512-Ubldcmxp5np52/ENotGxlLe6aGMvmF4R8S6tZjsP6Knsaxd/xp3Zrh50cG93lR6nPXyUFwzN3ZSOQI0wRJNdGg==",
"dev": true
},
"litemol": {
"version": "github:dsehnal/LiteMol#a5419c696faa84530dd93acd55b747cf8136902b",
"dev": true,
"requires": {
"@types/react": "15.6.15",
"@types/react-dom": "15.5.7"
}
}
}
},
"ProtVista": {
"version": "git://github.com/davidhoksza/protvista.git#4e4bb737ba1e183291505bd25f8bae2e651ce21e",
"dev": true,
"requires": {
"d3": "3.5.17",
"file-saver": "1.3.3",
"jquery": "2.2.4",
"jszip": "3.1.4",
"underscore": "1.8.3"
},
"dependencies": {
"jquery": {
"version": "2.2.4",
"resolved": "https://registry.npmjs.org/jquery/-/jquery-2.2.4.tgz",
"integrity": "sha1-LInWiJterFIqfuoywUUhVZxsvwI=",
"dev": true
}
}
},
......@@ -2058,6 +2050,14 @@
"immediate": "3.0.6"
}
},
"litemol": {
"version": "github:dsehnal/LiteMol#a5419c696faa84530dd93acd55b747cf8136902b",
"dev": true,
"requires": {
"@types/react": "15.6.15",
"@types/react-dom": "15.5.7"
}
},
"lodash": {
"version": "4.17.4",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz",
......
......@@ -14,6 +14,7 @@ var ConfigurationType = {
REQUEST_ACCOUNT_EMAIL: "REQUEST_ACCOUNT_EMAIL",
REQUEST_ACCOUNT_DEFAULT_CONTENT: "REQUEST_ACCOUNT_DEFAULT_CONTENT",
SIMPLE_COLOR_VAL: "SIMPLE_COLOR_VAL",
SHOW_REACTION_TYPE: "SHOW_REACTION_TYPE",
SEARCH_DISTANCE: "SEARCH_DISTANCE",
SEARCH_RESULT_NUMBER: "SEARCH_RESULT_NUMBER",
USER_MANUAL_FILE: "USER_MANUAL_FILE"
......
......@@ -3,6 +3,7 @@
/* exported logger */
var Alias = require('../../map/data/Alias');
var ConfigurationType= require('../../ConfigurationType');
var GuiConnector = require('../../GuiConnector');
var AbstractGuiElement = require('../AbstractGuiElement');
......@@ -433,7 +434,9 @@ GuiUtils.prototype.createReactionElement = function (params) {
div.appendChild(self.createNewLine());
}
div.appendChild(self.createParamLine("Type: ", reaction.getType()));
if (self.getConfiguration().getOption(ConfigurationType.SHOW_REACTION_TYPE).getValue().toLowerCase()==="true") {
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()));
......
......@@ -51,7 +51,7 @@ ReactionInfoWindow.prototype.createContentDiv = function () {
var reaction = self.getReactionData();
var result = document.createElement("div");
var title = document.createElement("h3");
title.innerHTML = reaction.getType() + ": " + reaction.getReactionId();
title.innerHTML = "Reaction: " + reaction.getReactionId();
result.appendChild(title);
if (reaction.getKineticLaw() === undefined) {
......
......@@ -3,6 +3,7 @@
require('../../mocha-config.js');
var Alias = require('../../../../main/js/map/data/Alias');
var ConfigurationType = require('../../../../main/js/ConfigurationType');
var GenericSearchPanel = require('../../../../main/js/gui/leftPanel/GenericSearchPanel');
var AbstractDbOverlay = require('../../../../main/js/map/overlay/AbstractDbOverlay');
var PanelControlElementType = require('../../../../main/js/gui/PanelControlElementType');
......@@ -94,6 +95,7 @@ describe('GenericSearchPanel', function () {
describe('createReactionElement', function () {
it('type in desc', function () {
helper.getConfiguration().getOption(ConfigurationType.SHOW_REACTION_TYPE).setValue("true");
var map = helper.createCustomMap();
helper.createSearchDbOverlay(map);
......@@ -106,6 +108,10 @@ describe('GenericSearchPanel', function () {
reaction.setType(reactionType);
assert.ok(panel.createReactionElement(reaction).innerHTML.indexOf(reactionType) >= 0);
helper.getConfiguration().getOption(ConfigurationType.SHOW_REACTION_TYPE).setValue("false");
assert.notOk(panel.createReactionElement(reaction).innerHTML.indexOf(reactionType) >= 0);
});
});
......
......@@ -11,6 +11,13 @@ var assert = chai.assert;
var logger = require('../../logger');
describe('GuiUtils', function () {
function createGuiUtils(map) {
var result = new GuiUtils(helper.getConfiguration());
if (map !== undefined) {
result.setMap(map);
}
return result;
}
it('constructor', function () {
var map = helper.createCustomMap();
......@@ -46,7 +53,7 @@ describe('GuiUtils', function () {
map.getModel().setId(15781);
helper.createSearchDbOverlay(map);
var guiUtils = new GuiUtils();
var guiUtils = createGuiUtils();
guiUtils.setMap(map);
var aliasDiv = guiUtils.createAliasElement({
......@@ -104,16 +111,15 @@ describe('GuiUtils', function () {
var map = helper.createCustomMap();
helper.createSearchDbOverlay(map);
var guiUtils = new GuiUtils();
guiUtils.setMap(map);
var guiUtils = createGuiUtils(map);
var reaction = helper.createReaction(map);
var reactionType = "XX TYPE";
reaction.setType(reactionType);
var reactionId = "XX ID";
reaction.setReactionId(reactionId);
assert.ok(guiUtils.createReactionElement({
reaction: reaction
}).innerHTML.indexOf(reactionType) >= 0);
}).innerHTML.indexOf(reactionId) >= 0);
});
});
......
......@@ -185,6 +185,9 @@ 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),
;
/**
......
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