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, {
species: null,
sortParams: ['speciesName', 'strainCount'],
sortParams: ['sortOrder'],
sortedSpecies: sort('species', 'sortParams'),
});

View file

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

View file

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