Use API sort order for species

This commit is contained in:
Matthew Dillon 2015-11-17 15:53:22 -07:00
parent a669945c35
commit e33852120a
3 changed files with 7 additions and 3 deletions

View file

@ -6,7 +6,7 @@ const { Component, computed: { sort } } = Ember;
export default Component.extend(SetupMetaData, { export default Component.extend(SetupMetaData, {
species: null, species: null,
sortParams: ['speciesName', 'strainCount'], sortParams: ['sortOrder'],
sortedSpecies: sort('species', 'sortParams'), sortedSpecies: sort('species', 'sortParams'),
}); });

View file

@ -1,7 +1,7 @@
import Ember from 'ember'; import Ember from 'ember';
import SetupMetaData from '../../../../mixins/setup-metadata'; import SetupMetaData from '../../../../mixins/setup-metadata';
const { Component } = Ember; const { Component, computed: { sort } } = Ember;
export default Component.extend(SetupMetaData, { export default Component.extend(SetupMetaData, {
// Read-only attributes // Read-only attributes
@ -19,6 +19,10 @@ export default Component.extend(SetupMetaData, {
"save-measurement": null, "save-measurement": null,
"delete-measurement": null, "delete-measurement": null,
// CPs
sortParams: ['sortOrder'],
sortedSpeciesList: sort('speciesList', 'sortParams'),
// Property mapping // Property mapping
propertiesList: ['strainName', 'typeStrain', 'species', 'isolatedFrom', 'accessionNumbers', 'genbank', 'wholeGenomeSequence', 'notes'], propertiesList: ['strainName', 'typeStrain', 'species', 'isolatedFrom', 'accessionNumbers', 'genbank', 'wholeGenomeSequence', 'notes'],
strainName: null, strainName: null,

View file

@ -17,7 +17,7 @@
<label>Species</label> <label>Species</label>
{{ {{
x-select x-select
options=speciesList options=sortedSpeciesList
nameAttr='speciesName' nameAttr='speciesName'
selected=species.id selected=species.id
update=(action "speciesDidChange") update=(action "speciesDidChange")