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

SSDM-1614 : YEASTLAB - ELN UI - Show Names (Polishments)

SVN: 33734
parent e9edb006
No related branches found
No related tags found
No related merge requests found
...@@ -55,8 +55,15 @@ function SampleLinksWidget(containerId, profile, serverFacade, title, sampleType ...@@ -55,8 +55,15 @@ function SampleLinksWidget(containerId, profile, serverFacade, title, sampleType
} }
this._readState = function() { this._readState = function() {
var stateField = mainController.currentView._sampleFormModel.sample.properties["ANNOTATIONS_STATE"]; var isStateFieldAvailable = false;
if(!this.isDisabled && stateField.length === 0) {
if(mainController.currentView._sampleFormModel.sample) {
var availableFields = profile.getAllPropertiCodesForTypeCode(mainController.currentView._sampleFormModel.sample.sampleTypeCode);
var pos = $.inArray("ANNOTATIONS_STATE", availableFields);
isStateFieldAvailable = (pos !== -1);
}
if(!isStateFieldAvailable) {
if(this.sampleTypeHints && this.sampleTypeHints.length !== 0) { //Indicates annotations are needed if(this.sampleTypeHints && this.sampleTypeHints.length !== 0) { //Indicates annotations are needed
Util.showError("You need a property with code ANNOTATIONS_STATE on this entity to store the state of the annotations."); Util.showError("You need a property with code ANNOTATIONS_STATE on this entity to store the state of the annotations.");
} }
...@@ -66,6 +73,7 @@ function SampleLinksWidget(containerId, profile, serverFacade, title, sampleType ...@@ -66,6 +73,7 @@ function SampleLinksWidget(containerId, profile, serverFacade, title, sampleType
fieldset.hide(); fieldset.hide();
//Update Values //Update Values
var stateField = mainController.currentView._sampleFormModel.sample.properties["ANNOTATIONS_STATE"];
this.stateObj = FormUtil.getAnnotationsFromField(stateField); this.stateObj = FormUtil.getAnnotationsFromField(stateField);
} }
} }
......
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