Merge branch 'master' into clostridium
* master: Fix up full name, again Force sort order for compare
This commit is contained in:
commit
7c503876ac
6 changed files with 13 additions and 12 deletions
|
@ -23,12 +23,8 @@ export default Model.extend({
|
|||
sortOrder : attr('number'),
|
||||
canEdit : attr('boolean'),
|
||||
|
||||
// Used internally for sorting
|
||||
fullName: computed('species', 'strainName', function() {
|
||||
return `${this.get('species.speciesName')} ${this.get('strainNameMU')}`;
|
||||
}),
|
||||
|
||||
fullNameMU: computed('species', 'strainName', function() {
|
||||
return htmlSafe(`<em>${this.get('species.speciesName')}</em> ${this.get('strainName')}`);
|
||||
const type = this.get('typeStrain') ? '<sup>T</sup>' : '';
|
||||
return htmlSafe(`<em>${this.get('species.speciesName')}</em> ${this.get('strainName')}${type}`);
|
||||
}),
|
||||
});
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
{{strain.fullNameMU}}{{{if strain.typeStrain '<sup>T</sup>' ''}}}
|
|
@ -1,6 +1,6 @@
|
|||
import Ember from 'ember';
|
||||
|
||||
const { Component } = Ember;
|
||||
const { Component, computed: { sort } } = Ember;
|
||||
|
||||
export default Component.extend({
|
||||
characteristics: null,
|
||||
|
@ -10,6 +10,12 @@ export default Component.extend({
|
|||
"update-strains": null,
|
||||
"update-characteristics": null,
|
||||
|
||||
|
||||
charSortParams: ['characteristicTypeName', 'sortOrder', 'characteristicName'],
|
||||
sortedCharacteristics: sort('characteristics', 'charSortParams'),
|
||||
strainSortParams: ['sortOrder'],
|
||||
sortedStrains: sort('strains', 'sortParams'),
|
||||
|
||||
selectedStrains: [],
|
||||
selectedCharacteristics: [],
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<label>Strains</label>
|
||||
{{
|
||||
x-select
|
||||
options=strains
|
||||
options=sortedStrains
|
||||
nameAttr='fullNameMU'
|
||||
multiple=true
|
||||
selected=selectedStrains
|
||||
|
@ -26,7 +26,7 @@
|
|||
<label>Characteristics</label>
|
||||
{{
|
||||
x-select
|
||||
options=characteristics
|
||||
options=sortedCharacteristics
|
||||
nameAttr='characteristicName'
|
||||
multiple=true
|
||||
selected=selectedCharacteristics
|
||||
|
|
|
@ -6,7 +6,7 @@ const { Component, computed: { sort } } = Ember;
|
|||
export default Component.extend(SetupMetaData, {
|
||||
strains: null,
|
||||
|
||||
sortParams: ['fullName'],
|
||||
sortParams: ['sortOrder'],
|
||||
sortedStrains: sort('strains', 'sortParams'),
|
||||
|
||||
});
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
<tr>
|
||||
<td>
|
||||
{{#link-to 'protected.strains.show' strain classBinding="strain.typeStrain:type-strain"}}
|
||||
{{full-strain-name strain=strain}}
|
||||
{{strain.fullNameMU}}
|
||||
{{/link-to}}
|
||||
</td>
|
||||
<td>
|
||||
|
|
Reference in a new issue