From e33852120a1496c9978eb81f676ec1360b077e6c Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Tue, 17 Nov 2015 15:53:22 -0700 Subject: [PATCH] Use API sort order for species --- app/pods/protected/species/index/species-table/component.js | 2 +- app/pods/protected/strains/strain-form/component.js | 6 +++++- app/pods/protected/strains/strain-form/template.hbs | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/pods/protected/species/index/species-table/component.js b/app/pods/protected/species/index/species-table/component.js index 528c48d..53e46a1 100644 --- a/app/pods/protected/species/index/species-table/component.js +++ b/app/pods/protected/species/index/species-table/component.js @@ -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'), }); diff --git a/app/pods/protected/strains/strain-form/component.js b/app/pods/protected/strains/strain-form/component.js index 420db5f..ebb157c 100644 --- a/app/pods/protected/strains/strain-form/component.js +++ b/app/pods/protected/strains/strain-form/component.js @@ -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, diff --git a/app/pods/protected/strains/strain-form/template.hbs b/app/pods/protected/strains/strain-form/template.hbs index 6bbfb42..9747a86 100644 --- a/app/pods/protected/strains/strain-form/template.hbs +++ b/app/pods/protected/strains/strain-form/template.hbs @@ -17,7 +17,7 @@ {{ x-select - options=speciesList + options=sortedSpeciesList nameAttr='speciesName' selected=species.id update=(action "speciesDidChange")