Skip to content
Snippets Groups Projects
Commit 2c03bb33 authored by juanf's avatar juanf
Browse files

SSDM-278: ELN UI - If Annotations are not configured is not necessary to have...

SSDM-278: ELN UI - If Annotations are not configured is not necessary to have a property ANNOTATIONS_STATE

SVN: 31478
parent 0c428b60
No related branches found
No related tags found
No related merge requests found
......@@ -35,12 +35,26 @@ function SampleLinksWidget(containerId, profile, serverFacade, title, sampleType
this.samplesToEdit = (samplesToEdit)?samplesToEdit:new Array(); //Only used to populate the widget
this.samples = {};
this.samplesRemoved = {};
this.stateObj = null;
this.stateObj = {};
this._lastUsedId = null;
this._lastIndex = 0;
this._enableAnnotations = function() {
var enableAnnotations = false;
for(var i = 0; i < this.sampleTypeHints.length; i++) {
var sampleTypeHint = this.sampleTypeHints[i];
if(sampleTypeHint["ANNOTATION_PROPERTIES"].length > 0) {
enableAnnotations = true;
}
}
return enableAnnotations;
}
this._writeState = function(permId, propertyTypeCode, propertyTypeValue) {
if(!this._enableAnnotations()) {
return;
}
this._readState();
var sampleTypeAnnotations = this.stateObj[permId];
......@@ -72,6 +86,9 @@ function SampleLinksWidget(containerId, profile, serverFacade, title, sampleType
}
this._readState = function() {
if(!this._enableAnnotations()) {
return;
}
var stateField = $("#ANNOTATIONS_STATE");
if(stateField.length === 0) {
Util.showError("You need a property with code ANNOTATIONS_STATE on this entity to store the state of the annotations.");
......
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