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

Merge branch '835-add-gene-mapping' into 'devel_13.1.x'

Resolve "MINERVANET - Error Report 77"

See merge request minerva/core!826
parents b2b9808d 82830773
minerva (13.1.1) stable; urgency=medium
* Bug fix: adding gene mapping before the genome caused an error (#835)
-- Piotr Gawron <piotr.gawron@uni.lu> Fri, 28 Jun 2019 17:00:00 +0200
minerva (13.1.0) stable; urgency=medium
* Feature: annotators are more flexible - you can define set of input and
outputs used by annotator (#617)
......
......@@ -175,7 +175,8 @@ EditGenomeDialog.prototype.createGeneMappingTabContent = function () {
var result = Functions.createElement({
type: "div",
style: "margin-top:10px;"
style: "margin-top:10px;",
className: "minerva-gene-mapping-tab"
});
var geneMappingTable = Functions.createElement({
......@@ -513,6 +514,10 @@ EditGenomeDialog.prototype.refresh = function () {
//it should be simplified, but I couldn't make it work
dataTable.clear().rows.add(data).page(page).draw(false).page(page).draw(false);
if (self.isNew()) {
guiUtils.disableTab($(".minerva-gene-mapping-tab", self.getElement())[0], "First add a genome to be able to add mapping");
}
return self._fillOrganismSelect(genome);
});
};
......
......@@ -491,7 +491,7 @@ public abstract class BaseRestImpl {
return result;
}
protected Integer parseInteger(Object value) throws QueryException {
protected Integer parseInteger(Object value, String fieldName) throws QueryException {
if (value instanceof Integer) {
return (Integer) value;
} else if (value instanceof Double) {
......@@ -506,12 +506,16 @@ public abstract class BaseRestImpl {
try {
return Integer.parseInt((String) value);
} catch (NumberFormatException e) {
throw new QueryException("Invalid integer value: " + value);
throw new QueryException("Invalid " + fieldName + " value: " + value);
}
}
} else {
throw new QueryException("Invalid integer value: " + value);
throw new QueryException("Invalid " + fieldName + " value: " + value);
}
}
protected Integer parseInteger(Object value) throws QueryException {
return parseInteger(value, "integer");
}
}
......@@ -256,8 +256,9 @@ public class ReferenceGenomeRestImpl extends BaseRestImpl {
if (!getUserService().userHasPrivilege(token, PrivilegeType.MANAGE_GENOMES)) {
throw new SecurityException("Access denied");
}
int id = Integer.parseInt(genomeId);
int id = parseInteger(genomeId, "genomeId");
try {
ReferenceGenome genome = referenceGenomeService.getReferenceGenomeById(id, token);
String name = getFirstValue(formData.get("name"));
......
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