Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LIMS-1064: Display dropdown or span depending on number of schema options #870

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions client/src/js/modules/shipment/views/containerplate.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ define(['marionette',

sampleStatusAuto: 'input[id=sample_status_auto]',
schema: 'select[name=schema]',
schemaspan: '.schemaspan',
class: 'select[name=class]',
},

Expand Down Expand Up @@ -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()
},
Expand Down
4 changes: 1 addition & 3 deletions client/src/js/templates/shipment/containerplateimage.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,8 @@ <h1 class="no_mobile">Container: <span class="NAME"><%-NAME%></span></h1>
<div>
<label>
<input type="radio" value="sample_status_auto" name="sample_status" id="sample_status_auto"/>
CHIMP Auto Scores
<select name="schema"></select><span class="schemaspan"></span> Auto Scores
</label>
<!--There is only ever one option in schema but it was too hard to remove the code see ticket LIMS-1064 -->
<select name="schema" style="display:none"></select>
Class: <select name="class"></select>
</div>
<div class="sta small"></div>
Expand Down
Loading