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 142a6c852dac717742e96cab72637cc16f4dec86..c1a5e7395578f2cbf8a7a3df250c68882e00be9a 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 @@ -276,7 +276,7 @@ $.extend(StandardProfile.prototype, DefaultProfile.prototype, { "LABEL" : "Products", "TYPE": "PRODUCT", "MIN_COUNT" : 0, - "ANNOTATION_PROPERTIES" : [{"TYPE" : "QUANTITY", "MANDATORY" : false }, {"TYPE" : "COMMENTS", "MANDATORY" : false }] + "ANNOTATION_PROPERTIES" : [{"TYPE" : "QUANTITY", "MANDATORY" : true }, {"TYPE" : "COMMENTS", "MANDATORY" : false }] }] }, "ORDER" : { @@ -287,7 +287,7 @@ $.extend(StandardProfile.prototype, DefaultProfile.prototype, { "LABEL" : "Requests", "TYPE": "REQUEST", "MIN_COUNT" : 0, - "ANNOTATION_PROPERTIES" : [{"TYPE" : "QUANTITY", "MANDATORY" : false }, {"TYPE" : "COMMENTS", "MANDATORY" : false }] + "ANNOTATION_PROPERTIES" : [] }] }, "SUPPLIER" : { @@ -296,7 +296,14 @@ $.extend(StandardProfile.prototype, DefaultProfile.prototype, { }, "PRODUCT" : { "SAMPLE_CHILDREN_DISABLED" : true, - "SAMPLE_PARENTS_DISABLED" : true, + "SAMPLE_PARENTS_TITLE" : "Suppliers", + "SAMPLE_PARENTS_ANY_TYPE_DISABLED" : true, + "SAMPLE_PARENTS_HINT" : [{ + "LABEL" : "Suppliers", + "TYPE": "SUPPLIER", + "MIN_COUNT" : 1, + "ANNOTATION_PROPERTIES" : [] + }] }, "EXPERIMENTAL_STEP" : { "SAMPLE_PARENTS_HINT" : [ diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/SampleFormController.js b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/SampleFormController.js index 6574545cdbc582d1a18a635f9f36282c6f6ee8d6..8a0a9e163a970df940f63ae0a8a80e8f2225397c 100644 --- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/SampleFormController.js +++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/SampleForm/SampleFormController.js @@ -112,16 +112,15 @@ function SampleFormController(mainController, mode, sample) { // Parents/Children Links // if(!this._sampleFormModel.sampleLinksParents.isValid()) { - Util.showError("Missing Parents."); return; } var sampleParentsFinal = this._sampleFormModel.sampleLinksParents.getSamplesIdentifiers(); if(!this._sampleFormModel.sampleLinksChildren.isValid()) { - Util.showError("Missing Children."); return; } var sampleChildrenFinal = this._sampleFormModel.sampleLinksChildren.getSamplesIdentifiers(); + var sampleChildrenRemovedFinal = this._sampleFormModel.sampleLinksChildren.getSamplesRemovedIdentifiers(); // 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 ccf8fe3629a36454c07403bb945c039b87e1f9b3..f1a6d27212815f4fd26b02c0545d9419897d01fa 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 @@ -38,6 +38,29 @@ function LinksController(title, sampleTypeHints, isDisabled, samplesToEdit, show // API - Used by Sample Form // this.isValid = function() { + if(sampleTypeHints) { + for(var typeIdx = 0; typeIdx < sampleTypeHints.length; typeIdx++) { + var sampleTypeHint = sampleTypeHints[typeIdx]; + var sampleTypeCode = sampleTypeHint["TYPE"]; + var sampleTypeMinCount = sampleTypeHint["MIN_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 + "."); + return false; + } + + if(sampleTypeCount > 0) { + for(var sampleIdx = 0; sampleIdx < linksModel.samplesByType[sampleTypeCode].length; sampleIdx++) { + var sampleWithAnnotations = linksModel.samplesByType[sampleTypeCode][sampleIdx]; + for(var annotIdx = 0; annotIdx < sampleTypeAnnotations.length; annotIdx++) { + //TO-DO, Not enough information to validate required annotations here + } + } + } + } + } + return true; }