Skip to content
Snippets Groups Projects
Commit ef1d7ba9 authored by David Hoksza's avatar David Hoksza
Browse files

Fixes to the annotations categorization in the frontend

parent d78dad75
No related branches found
No related tags found
1 merge request!201Cellwall annotations
Pipeline #
......@@ -21,6 +21,7 @@
<bean id="EntrezAnnotator" class="lcsb.mapviewer.annotation.services.annotators.EntrezAnnotator"/>
<bean id="GoAnnotator" class="lcsb.mapviewer.annotation.services.annotators.GoAnnotator"/>
<bean id="HgncAnnotator" class="lcsb.mapviewer.annotation.services.annotators.HgncAnnotator"/>
<bean id="KeggAnnotator" class="lcsb.mapviewer.annotation.services.annotators.KeggAnnotator"/>
<bean id="ReconAnnotator" class="lcsb.mapviewer.annotation.services.annotators.ReconAnnotator"/>
<bean id="PdbAnnotator" class="lcsb.mapviewer.annotation.services.annotators.PdbAnnotator"/>
<bean id="StitchAnnotator" class="lcsb.mapviewer.annotation.services.annotators.StitchAnnotator"/>
......
......@@ -519,4 +519,14 @@ h1 {
.minerva-datatable-toolbar {
float: left;
}
\ No newline at end of file
}
.minerva-annotation-group {
padding-bottom: 10px;
}
.minerva-annotation-group .minerva-annotation-group-header {
font-weight: bold
}
......@@ -183,19 +183,23 @@ GuiUtils.prototype.createAnnotationList = function (annotations, options) {
var grouppedAnnotations = {};
for (var i = 0; i < annotations.length; i++) {
var desc = annotations[i].description;
var desc = annotations[i].getDescription();
if (desc == "") desc = "Annotated by curator"
if (!(desc in grouppedAnnotations)) grouppedAnnotations[desc] = [];
grouppedAnnotations[desc].push(annotations[i])
}
var cntAnnotations = 0;
for (var i = 0; i < grouppedAnnotations.keys().length; i++) {
// for (var i = 0; i < grouppedAnnotations.keys().length; i++) {
Object.keys(grouppedAnnotations).sort().forEach(function(desc){
var desc = grouppedAnnotations.keys()[i];
// var desc = grouppedAnnotations.keys()[i];
var groupContainer = (inline ? document.createElement("span") : document.createElement("div"));
var descContainer = (inline ? document.createElement("span") : document.createElement("div"));
descContainer.innerHTML = (inline ? desc + ': ' : desc);
if (inline) groupContainer.className = "minerva-annotation-group";
descContainer.className = "minerva-annotation-group-header";
if (!inline) groupContainer.className = "minerva-annotation-group";
groupContainer.appendChild(descContainer);
if (inline){
......@@ -221,7 +225,7 @@ GuiUtils.prototype.createAnnotationList = function (annotations, options) {
var row = document.createElement("div");
row.style.height = "26px";
if (i % 2 === 0) {
if (j % 2 === 0) {
row.className = "minerva-annotation-row-odd";
} else {
row.className = "minerva-annotation-row-even";
......@@ -248,7 +252,7 @@ GuiUtils.prototype.createAnnotationList = function (annotations, options) {
}
result.appendChild(groupContainer);
}
});
// for (var i = 0; i < annotations.length; i++) {
// var element = annotations[i];
......
......@@ -15,6 +15,7 @@ function Annotation(javaObject) {
}
this.setType(javaObject.getType());
this.setResource(javaObject.getResource());
this.setDescription(javaObject.getDescription());
} else {
this.setLink(javaObject.link);
this.setId(javaObject.id);
......@@ -23,6 +24,7 @@ function Annotation(javaObject) {
}
this.setType(javaObject.type);
this.setResource(javaObject.resource);
this.setDescription(javaObject.description);
}
}
......@@ -72,4 +74,12 @@ Annotation.prototype.getArticle = function() {
return this._article;
};
Annotation.prototype.setDescription = function(description) {
this._description = description;
};
Annotation.prototype.getDescription = function() {
return this._description;
};
module.exports = Annotation;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment