From 1f2f47521d1a5059f8f043ff36e0e97bf06f995a Mon Sep 17 00:00:00 2001 From: Mark Williams Date: Mon, 2 Dec 2024 15:52:28 +0000 Subject: [PATCH] LIMS-1064: Display dropdown or span depending on number of schema options --- client/src/js/modules/shipment/views/containerplate.js | 9 +++++++++ .../src/js/templates/shipment/containerplateimage.html | 4 +--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/client/src/js/modules/shipment/views/containerplate.js b/client/src/js/modules/shipment/views/containerplate.js index aa5fd157f..524e470ce 100644 --- a/client/src/js/modules/shipment/views/containerplate.js +++ b/client/src/js/modules/shipment/views/containerplate.js @@ -264,6 +264,7 @@ define(['marionette', sampleStatusAuto: 'input[id=sample_status_auto]', schema: 'select[name=schema]', + schemaspan: '.schemaspan', class: 'select[name=class]', }, @@ -656,6 +657,14 @@ define(['marionette', }, updateSchemas: function() { + if (this.autoscoreschemas.length === 1) { + this.ui.schemaspan.html(this.autoscoreschemas.at(0).get('SCHEMANAME')) + this.ui.schemaspan.show() + this.ui.schema.hide() + } else { + this.ui.schemaspan.hide() + this.ui.schema.show() + } this.ui.schema.html(this.autoscoreschemas.opts()) this.selectSchema() }, diff --git a/client/src/js/templates/shipment/containerplateimage.html b/client/src/js/templates/shipment/containerplateimage.html index 028a8988d..180d26d58 100644 --- a/client/src/js/templates/shipment/containerplateimage.html +++ b/client/src/js/templates/shipment/containerplateimage.html @@ -45,10 +45,8 @@

Container: <%-NAME%>

- - Class: