Remove strain-name component

This commit is contained in:
Matthew Dillon 2015-06-12 11:44:23 -08:00
parent 70ce128103
commit b8ae6802a5
6 changed files with 8 additions and 32 deletions
app
models
pods/components
species-details
species-index-row
strain-name
tests/unit/pods/components/strain-name

View file

@ -16,13 +16,14 @@ export default DS.Model.extend({
updatedBy: DS.attr('number'),
deletedBy: DS.attr('number'),
totalMeasurements: DS.attr('number'),
strainNameMU: function() {
let type = this.get('typeStrain') ? '<sup>T</sup>' : '';
return `${this.get('strainName')}${type}`;
}.property('strainName', 'typeStrain').readOnly(),
fullName: function() {
return `${this.get('species.speciesName')} (strain ${this.get('strainName')})`;
}.property('species', 'strainName').readOnly(),
fullNameMU: function() {
let species = `<em>${this.get('species.speciesName')}</em>`,
type = this.get('typeStrain') ? '<sup>T</sup>' : '',
strain = `(strain ${this.get('strainName')}${type})`;
return `${species} ${strain}`;
}.property('species', 'strainName').readOnly(),
return `<em>${this.get('species')}</em> ${this.get('strainNameMU')}`;
}.property('species', 'strainNameMU').readOnly(),
});

View file

@ -18,7 +18,7 @@
{{#each species.strains as |strain index|}}
{{if index ","}}
{{#link-to 'strains.show' strain.id}}
{{strain-name strain=strain}}
{{{strain.strainNameMU}}}
{{/link-to}}
{{/each}}
{{#unless species.isNew}}

View file

@ -9,7 +9,7 @@
{{#each data.strains as |strain index|}}
{{if index ","}}
{{#link-to 'strains.show' strain.id}}
{{strain-name strain=strain}}
{{{strain.strainNameMU}}}
{{/link-to}}
{{/each}}
</td>

View file

@ -1,5 +0,0 @@
import Ember from 'ember';
export default Ember.Component.extend({
tagName: 'span',
});

View file

@ -1 +0,0 @@
{{strain.strainName}}{{{if strain.typeStrain '<sup>T</sup>'}}}

View file

@ -1,19 +0,0 @@
import { moduleForComponent, test } from 'ember-qunit';
moduleForComponent('strain-name', 'Unit | Component | strain name', {
// Specify the other units that are required for this test
// needs: ['component:foo', 'helper:bar'],
unit: true
});
test('it renders', function(assert) {
assert.expect(2);
// Creates the component instance
var component = this.subject();
assert.equal(component._state, 'preRender');
// Renders the component to the page
this.render();
assert.equal(component._state, 'inDOM');
});