From 9d57e1bbfbdf8958e9a7f73ca9b1948ce4911d30 Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Tue, 17 Nov 2015 13:16:00 -0700 Subject: [PATCH] Fix up full name, again --- app/models/strain.js | 8 ++------ app/pods/components/full-strain-name/template.hbs | 1 - .../protected/strains/index/strain-table/component.js | 2 +- .../protected/strains/index/strain-table/template.hbs | 2 +- 4 files changed, 4 insertions(+), 9 deletions(-) delete mode 100644 app/pods/components/full-strain-name/template.hbs diff --git a/app/models/strain.js b/app/models/strain.js index 8643017..04489a0 100644 --- a/app/models/strain.js +++ b/app/models/strain.js @@ -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(`${this.get('species.speciesName')} ${this.get('strainName')}`); + const type = this.get('typeStrain') ? 'T' : ''; + return htmlSafe(`${this.get('species.speciesName')} ${this.get('strainName')}${type}`); }), }); diff --git a/app/pods/components/full-strain-name/template.hbs b/app/pods/components/full-strain-name/template.hbs deleted file mode 100644 index ecab987..0000000 --- a/app/pods/components/full-strain-name/template.hbs +++ /dev/null @@ -1 +0,0 @@ -{{strain.fullNameMU}}{{{if strain.typeStrain 'T' ''}}} diff --git a/app/pods/protected/strains/index/strain-table/component.js b/app/pods/protected/strains/index/strain-table/component.js index 7b3b21c..1de7256 100644 --- a/app/pods/protected/strains/index/strain-table/component.js +++ b/app/pods/protected/strains/index/strain-table/component.js @@ -6,7 +6,7 @@ const { Component, computed: { sort } } = Ember; export default Component.extend(SetupMetaData, { strains: null, - sortParams: ['fullName'], + sortParams: ['sortOrder'], sortedStrains: sort('strains', 'sortParams'), }); diff --git a/app/pods/protected/strains/index/strain-table/template.hbs b/app/pods/protected/strains/index/strain-table/template.hbs index 8afca9d..afb8cf2 100644 --- a/app/pods/protected/strains/index/strain-table/template.hbs +++ b/app/pods/protected/strains/index/strain-table/template.hbs @@ -14,7 +14,7 @@ {{#link-to 'protected.strains.show' strain classBinding="strain.typeStrain:type-strain"}} - {{full-strain-name strain=strain}} + {{strain.fullNameMU}} {{/link-to}}