Skip to content

Commit d262edf

Browse files
ndg63276Mark Williams
andauthored
LIMS-1064: Display dropdown or span depending on number of schema options (#870)
Co-authored-by: Mark Williams <mark.williams@diamond.ac.uk>
1 parent ce200fe commit d262edf

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

client/src/js/modules/shipment/views/containerplate.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ define(['marionette',
264264

265265
sampleStatusAuto: 'input[id=sample_status_auto]',
266266
schema: 'select[name=schema]',
267+
schemaspan: '.schemaspan',
267268
class: 'select[name=class]',
268269
},
269270

@@ -656,6 +657,14 @@ define(['marionette',
656657
},
657658

658659
updateSchemas: function() {
660+
if (this.autoscoreschemas.length === 1) {
661+
this.ui.schemaspan.html(this.autoscoreschemas.at(0).get('SCHEMANAME'))
662+
this.ui.schemaspan.show()
663+
this.ui.schema.hide()
664+
} else {
665+
this.ui.schemaspan.hide()
666+
this.ui.schema.show()
667+
}
659668
this.ui.schema.html(this.autoscoreschemas.opts())
660669
this.selectSchema()
661670
},

client/src/js/templates/shipment/containerplateimage.html

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,8 @@ <h1 class="no_mobile">Container: <span class="NAME"><%-NAME%></span></h1>
4545
<div>
4646
<label>
4747
<input type="radio" value="sample_status_auto" name="sample_status" id="sample_status_auto"/>
48-
CHIMP Auto Scores
48+
<select name="schema"></select><span class="schemaspan"></span> Auto Scores
4949
</label>
50-
<!--There is only ever one option in schema but it was too hard to remove the code see ticket LIMS-1064 -->
51-
<select name="schema" style="display:none"></select>
5250
Class: <select name="class"></select>
5351
</div>
5452
<div class="sta small"></div>

0 commit comments

Comments
 (0)