From dee27a32fd610278c7a05a1aadefa20c6bbd81cc Mon Sep 17 00:00:00 2001
From: Piotr Gawron <piotr.gawron@uni.lu>
Date: Fri, 21 Sep 2018 14:47:41 +0200
Subject: [PATCH] possibility to configure which options should be visible in
 search results added

---
 frontend-js/src/main/js/Configuration.js      |  17 +++
 frontend-js/src/main/js/ConfigurationType.js  |  28 ++++
 .../js/gui/leftPanel/GenericSearchPanel.js    |   2 +-
 .../src/main/js/gui/leftPanel/GuiUtils.js     | 138 ++++++++++++------
 .../main/js/map/data/SearchBioEntityGroup.js  |   2 +-
 frontend-js/src/test/js/Configuration-test.js |  47 +++++-
 .../gui/leftPanel/GenericSearchPanel-test.js  |  16 +-
 .../test/js/gui/leftPanel/GuiUtils-test.js    |  14 +-
 .../model/user/ConfigurationElementType.java  |  64 +++++++-
 .../user/ConfigurationElementTypeGroup.java   |   1 +
 10 files changed, 279 insertions(+), 50 deletions(-)

diff --git a/frontend-js/src/main/js/Configuration.js b/frontend-js/src/main/js/Configuration.js
index ec10ceb8e8..3c423d1a4e 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 33e11d3ba6..a8acf88bbe 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 0b0ee47231..1d27c67eff 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 58e06c3634..ad70f0aec1 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 19b4cbe840..1e0c1f83bc 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 e8aadbf128..7061e036c4 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 557e044d5c..6755e60ee8 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 93f55f5850..a51191a65c 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 2a499fd3f6..8d68893ecf 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 bb7417e9c7..3142624c33 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;
-- 
GitLab