Commit 83d478a2 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

Merge branch 'devel_12.1.x' into merge_12.1.6

parents d4e295ac 0f014818
minerva (12.2.0~beta.0) unstable; urgency=medium
* Feature: bug report utility
* Small improvement: JS plugin can create listener that is triggered on
* Small improvement: JS plugin can create listener that is triggered on
search results focus change
-- Piotr Gawron <piotr.gawron@uni.lu> Wed, 23 Jan 2019 15:00:00 +0200
......@@ -14,68 +14,80 @@ minerva (12.2.0~alpha.1) unstable; urgency=medium
minerva (12.2.0~alpha.0) unstable; urgency=medium
* Feature: url GET parameters support all kind of search and selected overlays
highlight
* Feature: user can create custom logging configuration in file
* Feature: user can create custom logging configuration in file
/etc/minerva/log4j.properties
* Feature: plugin panel in admin allows to configure set of available plugins
* Feature: import export from SBML supports RENDER package
* Feature: import export from SBML supports MULTI package
* Feature: API tool providing possibility to transform different types of
* Feature: API tool providing possibility to transform different types of
file formats
* Feature: current state of the browsed map is reflected in the url (position,
* Feature: current state of the browsed map is reflected in the url (position,
zoom, overlays, search queries, etc.)
* Small improvement: export to SBML includes unit factors
* Small improvement: mesh identifiers are resolved to meshb.nlm.nih.gov urls
* Small improvement: genetics information allows to provide information about
* Small improvement: genetics information allows to provide information about
modification on peptide level that could be visualized in MolArt
* Small improvement: allow to control the background and font color of areas
* Small improvement: allow to control the background and font color of areas
drawn from text areas in CellDesigner "layers"
* Small improvement: config logo location is relative to the root minerva
* Small improvement: config logo location is relative to the root minerva
deployment directory
* Small improvement: there is branding minerva logo in the left panel
* Small improvement: there is possibility to download part of the map limited
to set of reactions/elements
* Small improvement: allow admin to configure parameters displayed in the
left panel
* Small improvement: arrows for Transcription Starting Sites looks more like
in CellDesigner
* Small improvement: popup window appear with info about exceeding max number
of search results when necessary
* Small improvement: plugins can define default width of the container tab
* Small improvement: new miriam type is handled: ClinicalTrials.gov
* Small improvement: click on the border of compartment select the
compartment
* Small improvement: there is possibility to download part of the map limited
to set of reactions/elements
* Small improvement: allow admin to configure parameters displayed in the
left panel
* Small improvement: arrows for Transcription Starting Sites looks more like
in CellDesigner
* Small improvement: popup window appear with info about exceeding max number
of search results when necessary
* Small improvement: plugins can define default width of the container tab
* Small improvement: new miriam type is handled: ClinicalTrials.gov
* Small improvement: click on the border of compartment select the
compartment
* Small improvement: there is max size of the map in configuration panel that
disables upload of too big files
* Small improvement: hitting enter on login page logs in the user (no need to
* Small improvement: hitting enter on login page logs in the user (no need to
click on the login button)
* Small improvement: refresh button in overlays panel (useful when data
* Small improvement: refresh button in overlays panel (useful when data
overlays are uploaded separately in using API calls)
* Small improvement: list of publications is downloadable
* Small improvement: export of reactions support filtering by reaction type
* Small improvement: 'BACK TO MAP' link is available only when guest account
* Small improvement: 'BACK TO MAP' link is available only when guest account
has proper access level
* Small improvement: 'REQUEST AN ACCOUNT' link is available only the contact
email account is provided
* Small improvement: Plugin API allows to show/hide data overlays
email account is provided
* Small improvement: Plugin API allows to show/hide data overlays
* Bug fix: export to CellDesigner align inhibition reaction properly
* Bug fix: export/import to/from SBML handles Heterodimer Association
reaction properly
* Bug fix: logo doesn't need to be square
* Bug fix: when clicking on a search link (in overview window), input in the
* Bug fix: when clicking on a search link (in overview window), input in the
left tab was not modified
* Bug fix: in admin panel changing of genome version is blocking interface
* Bug fix: in admin panel changing of genome version is blocking interface
until data about url is retrieved
* Bug fix: export of species inside complex into CellDesigner was causing
problems when reading the file in CellDesigner
* Bug fix: export of species inside complex into CellDesigner was causing
problems when reading the file in CellDesigner
* Bug fix: export to SBGN did not export compartments
* Bug fix: export of complex states to SBGN did not work
* Bug fix: type of the data overlay can be defined in the file content
* Bug fix: type of the data overlay can be defined in the file content
(useful when uploading genetic variants)
* Bug fix: CLEAR button clears comment checkbox if necessary
* Bug fix: minerva install problem on ubuntu 16 fixed
-- Piotr Gawron <piotr.gawron@uni.lu> Fri, 11 Jan 2019 12:00:00 +0200
minerva (12.1.6) stable; urgency=medium
* Bug fix: logo on login page was broken with image link being full url
* Bug fix: plugin API had sometimes problems with fetching reactions
properly
* Bug fix: upload of data overlays without privileges triggers proper
error message also in situation when user cannot create projects
* Bug fix: first login on website when there is Term of use to accept
raised error for regular users
* Bug fix: fetching some drugs via API could cause 500
-- Piotr Gawron <piotr.gawron@uni.lu> Mon, 28 Jan 2019 16:00:00 +0200
minerva (12.1.5) stable; urgency=medium
* Bug fix: Drugbank changed output format which crashed drug connector
* Bug fix: word wrapping fixed in overlay table for long overlay names
......
......@@ -208,6 +208,13 @@ public class PubmedParser extends CachableInterface implements IExternalService
return result;
}
public Article getPubmedArticleById(String id) throws PubmedSearchException {
if (id==null) {
return null;
}
return getPubmedArticleById(Integer.valueOf(id.trim()));
}
/**
* This method return html \< a\ > tag with link for pubmed id (with some
* additional information).
......
......@@ -37,6 +37,7 @@ var SbmlParameter = require('./map/data/SbmlParameter');
var SecurityError = require('./SecurityError');
var SessionData = require('./SessionData');
var User = require('./map/data/User');
var PrivilegeType = require('./map/data/PrivilegeType');
var GuiConnector = require('./GuiConnector');
......@@ -1299,9 +1300,17 @@ ServerConnector.updateUser = function (user) {
connectedToLdap: user.isConnectedToLdap()
}
};
return self.sendPatchRequest(self.getUserUrl(queryParams), filterParams).then(function () {
var canModifyPrivileges = false;
return self.sendPatchRequest(self.getUserUrl(queryParams), filterParams).then(function (response) {
canModifyPrivileges = JSON.parse(response).privileges.some(function (privilege) {
return privilege.type === PrivilegeType.USER_MANAGEMENT
|| privilege.type === PrivilegeType.PROJECT_MANAGEMENT;
});
return self.getConfiguration();
}).then(function (configuration) {
if (!canModifyPrivileges) {
return Promise.resolve(user);
}
return self.updateUserPrivileges({user: user, privileges: user.privilegesToExport(configuration)});
});
};
......
......@@ -237,17 +237,17 @@ MapModel.prototype.getCompleteReactionById = function (id) {
var i;
result = self._reactions[id];
for (i = 0; i < result.getReactants().length; i++) {
if (!(result.getReactants()[i] instanceof Alias)) {
if (!(result.getReactants()[i].getAlias() instanceof Alias)) {
result.getReactants()[i].setAlias(self._aliases[result.getReactants()[i].getAlias()]);
}
}
for (i = 0; i < result.getProducts().length; i++) {
if (!(result.getProducts()[i] instanceof Alias)) {
if (!(result.getProducts()[i].getAlias() instanceof Alias)) {
result.getProducts()[i].setAlias(self._aliases[result.getProducts()[i].getAlias()]);
}
}
for (i = 0; i < result.getModifiers().length; i++) {
if (!(result.getModifiers()[i] instanceof Alias)) {
if (!(result.getModifiers()[i].getAlias() instanceof Alias)) {
result.getModifiers()[i].setAlias(self._aliases[result.getModifiers()[i].getAlias()]);
}
}
......
......@@ -434,7 +434,7 @@ AliasInfoWindow.prototype.createGenomicDiv = function (params) {
}
if (geneticInformation) {
if (genomeUrls.length === 0) {
contentElement.innerHTML = "No reference genome data available on minerva platform";
contentElement.innerHTML = "No organism defined for this project, cannot display variant data";
} else {
for (i = 0; i < overlaysData.length; i++) {
if (globalGeneVariants[i].length > 0) {
......
......@@ -632,6 +632,9 @@ function createFooter() {
var logoLink = configuration.getOption(ConfigurationType.LOGO_LINK).getValue();
var logoText = configuration.getOption(ConfigurationType.LOGO_TEXT).getValue();
var logoImg = configuration.getOption(ConfigurationType.LOGO_IMG).getValue();
if (!/^(f|ht)tps?:\/\//i.test(logoImg)) {
logoImg = GuiConnector.getImgPrefix() + logoImg;
}
return functions.createElement({
type: "div",
className: "minerva-footer-table",
......
......@@ -2,6 +2,7 @@
require("../../mocha-config");
var Alias = require('../../../../main/js/map/data/Alias');
var IdentifiedElement = require('../../../../main/js/map/data/IdentifiedElement');
var MapModel = require('../../../../main/js/map/data/MapModel');
var NetworkError = require('../../../../main/js/NetworkError');
......@@ -95,21 +96,45 @@ describe('MapModel', function () {
});
});
it("getReactionById 1", function () {
var model = helper.createModel();
var reaction = helper.createReaction();
describe("getReactionById", function () {
it("not existing", function () {
var model = helper.createModel();
var reaction = helper.createReaction();
return model.getReactionById(reaction.getId()).then(function (result) {
assert.equal(null, result);
}, function (exception) {
assert.ok(exception instanceof NetworkError);
// check if this is exception about not finding file
model.addReaction(reaction);
return model.getReactionById(reaction.getId());
}).then(function (result) {
assert.equal(reaction, result);
});
});
return model.getReactionById(reaction.getId()).then(function (result) {
assert.equal(null, result);
}, function (exception) {
assert.ok(exception instanceof NetworkError);
// check if this is exception about not finding file
model.addReaction(reaction);
return model.getReactionById(reaction.getId());
}).then(function (result) {
assert.equal(reaction, result);
it("check reactants", function () {
var model;
return ServerConnector.getProject().then(function (project) {
model = project.getModels()[0];
return model.getReactionById(153510, true);
}).then(function (result) {
assert.ok(result.getReactants()[0].getAlias() instanceof Alias);
assert.ok(result.getProducts()[0].getAlias() instanceof Alias);
assert.ok(result.getModifiers()[0].getAlias() instanceof Alias);
//let assume we downloaded it partially
result.setIsComplete(false);
return model.getReactionById(153510, true);
}).then(function (result) {
assert.ok(result.getReactants()[0].getAlias() instanceof Alias);
assert.ok(result.getProducts()[0].getAlias() instanceof Alias);
assert.ok(result.getModifiers()[0].getAlias() instanceof Alias);
});
});
});
it("addReaction 2", function () {
......
......@@ -271,7 +271,7 @@ describe('AliasInfoWindow', function () {
return win.createGenomicDiv({overlays: [overlay]});
}).then(function (div) {
assert.ok(div);
assert.ok(div.innerHTML.indexOf("No reference genome data available on minerva platform") === -1);
assert.ok(div.innerHTML.indexOf("No organism defined for this project, cannot display variant data") === -1);
win.destroy();
});
......@@ -301,7 +301,7 @@ describe('AliasInfoWindow', function () {
return win.createGenomicDiv({overlays: overlays});
}).then(function (div) {
assert.ok(div);
assert.ok(div.innerHTML.indexOf("No reference genome data available on minerva platform") === -1);
assert.ok(div.innerHTML.indexOf("No organism defined for this project, cannot display variant data") === -1);
win.destroy();
});
......@@ -340,7 +340,7 @@ describe('AliasInfoWindow', function () {
return win.createGenomicDiv({overlays: [overlay]});
}).then(function (div) {
assert.ok(div);
assert.ok(div.innerHTML.indexOf("No reference genome data available on minerva platform") >= -1);
assert.ok(div.innerHTML.indexOf("No organism defined for this project, cannot display variant data") >= -1);
win.destroy();
});
......
......@@ -61,7 +61,7 @@ public abstract class BaseRestImpl {
/**
* Default class logger.
*/
private Logger logger = Logger.getLogger(BaseRestImpl.class);
private static Logger logger = Logger.getLogger(BaseRestImpl.class);
@Autowired
private IModelService modelService;
......@@ -121,7 +121,7 @@ public abstract class BaseRestImpl {
}
if (MiriamType.PUBMED.equals(annotation.getDataType())) {
try {
Article article = pubmedParser.getPubmedArticleById(Integer.valueOf(annotation.getResource()));
Article article = pubmedParser.getPubmedArticleById(annotation.getResource());
result.put("article", article);
} catch (PubmedSearchException e) {
logger.error("Problem with accessing info about pubmed", e);
......@@ -391,4 +391,20 @@ public abstract class BaseRestImpl {
this.configurationService = configurationService;
}
public MiriamConnector getMiriamConnector() {
return miriamConnector;
}
public void setMiriamConnector(MiriamConnector miriamConnector) {
this.miriamConnector = miriamConnector;
}
public PubmedParser getPubmedParser() {
return pubmedParser;
}
public void setPubmedParser(PubmedParser pubmedParser) {
this.pubmedParser = pubmedParser;
}
}
......@@ -35,10 +35,6 @@ public class FileRestImpl extends BaseRestImpl {
public Map<String, Object> createFile(String token, String filename, String length) throws SecurityException {
User user = getUserService().getUserByToken(token);
if (!getUserService().userHasPrivilege(user, PrivilegeType.ADD_MAP)
&& overlayService.getAvailableCustomLayoutsNumber(user) == 0) {
throw new SecurityException("Access denied");
}
UploadedFileEntry entry = new UploadedFileEntry();
entry.setOriginalFileName(filename);
entry.setFileContent(new byte[] {});
......
......@@ -6,12 +6,26 @@ import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.CALLS_REAL_METHODS;
import java.util.Map;
import org.apache.log4j.Logger;
import org.junit.Test;
import org.mockito.Mockito;
import org.springframework.beans.factory.annotation.Autowired;
import lcsb.mapviewer.annotation.services.MiriamConnector;
import lcsb.mapviewer.annotation.services.PubmedParser;
import lcsb.mapviewer.model.map.MiriamData;
import lcsb.mapviewer.model.map.MiriamType;
public class BaseRestImplTest extends RestTestFunctions {
Logger logger = Logger.getLogger(BaseRestImplTest.class);
@Autowired
MiriamConnector mc;
@Autowired
PubmedParser pubmedParser;
@Test
public void testMathMLToPresentationML() throws Exception {
......@@ -39,6 +53,15 @@ public class BaseRestImplTest extends RestTestFunctions {
assertFalse(presentationXml.startsWith("<?xml"));
}
@Test
public void testCreateAnnotationWithWhitespace() throws Exception {
BaseRestImpl controller = Mockito.mock(BaseRestImpl.class, CALLS_REAL_METHODS);
controller.setMiriamConnector(mc);
controller.setPubmedParser(pubmedParser);
Map<String, Object> response = controller.createAnnotation(new MiriamData(MiriamType.PUBMED,"28255955 "));
assertNotNull(response);
}
}
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