diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/config/StandardProfile.js b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/config/StandardProfile.js index c1a5e7395578f2cbf8a7a3df250c68882e00be9a..4841d7c28bc60aa004e01f3caf2232875c8d41c4 100644 --- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/config/StandardProfile.js +++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/config/StandardProfile.js @@ -302,6 +302,7 @@ $.extend(StandardProfile.prototype, DefaultProfile.prototype, { "LABEL" : "Suppliers", "TYPE": "SUPPLIER", "MIN_COUNT" : 1, + "MAX_COUNT" : 1, "ANNOTATION_PROPERTIES" : [] }] }, diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/widgets/LinksController.js b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/widgets/LinksController.js index 906b28d4d6fc22b894beaf38934f3b350d5a7de2..88aec145d59afef319f1e23ae023139121add4bd 100644 --- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/widgets/LinksController.js +++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/widgets/LinksController.js @@ -46,10 +46,15 @@ function LinksController(title, sampleTypeHints, isDisabled, samplesToEdit, show var sampleTypeHint = sampleTypeHints[typeIdx]; var sampleTypeCode = sampleTypeHint["TYPE"]; var sampleTypeMinCount = sampleTypeHint["MIN_COUNT"]; + var sampleTypeMaxCount = sampleTypeHint["MAX_COUNT"]; var sampleTypeAnnotations = sampleTypeHint["ANNOTATION_PROPERTIES"]; var sampleTypeCount = (linksModel.samplesByType[sampleTypeCode])?linksModel.samplesByType[sampleTypeCode].length:0; if(sampleTypeCount < sampleTypeMinCount) { - Util.showError("Currently you only have " + sampleTypeCount + " of the " + sampleTypeMinCount + " required " + sampleTypeCode + "."); + Util.showError("Currently only have " + sampleTypeCount + " of the " + sampleTypeMinCount + " required " + sampleTypeCode + "."); + return false; + } + if(sampleTypeMaxCount && sampleTypeCount > sampleTypeMaxCount) { + Util.showError("Currently have " + sampleTypeCount + " of the maximum " + sampleTypeMaxCount + " for " + sampleTypeCode + "."); return false; } @@ -68,7 +73,7 @@ function LinksController(title, sampleTypeHints, isDisabled, samplesToEdit, show var sampleTypeAnnotationType = sampleTypeAnnotation["TYPE"]; var sampleTypeAnnotationIsMandatory = sampleTypeAnnotation["MANDATORY"]; if(sampleTypeAnnotationIsMandatory && !sampleFromIdxAnnotations[sampleTypeAnnotationType]) { - Util.showError("You are missing an annotation " + sampleTypeAnnotationType + " on " + sampleFromIdx.code +"."); + Util.showError("Missing an annotation " + sampleTypeAnnotationType + " on " + sampleFromIdx.code +"."); return false; } }