Remove strain-name component
This commit is contained in:
parent
70ce128103
commit
b8ae6802a5
6 changed files with 8 additions and 32 deletions
|
@ -16,13 +16,14 @@ export default DS.Model.extend({
|
||||||
updatedBy: DS.attr('number'),
|
updatedBy: DS.attr('number'),
|
||||||
deletedBy: DS.attr('number'),
|
deletedBy: DS.attr('number'),
|
||||||
totalMeasurements: 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() {
|
fullName: function() {
|
||||||
return `${this.get('species.speciesName')} (strain ${this.get('strainName')})`;
|
return `${this.get('species.speciesName')} (strain ${this.get('strainName')})`;
|
||||||
}.property('species', 'strainName').readOnly(),
|
}.property('species', 'strainName').readOnly(),
|
||||||
fullNameMU: function() {
|
fullNameMU: function() {
|
||||||
let species = `<em>${this.get('species.speciesName')}</em>`,
|
return `<em>${this.get('species')}</em> ${this.get('strainNameMU')}`;
|
||||||
type = this.get('typeStrain') ? '<sup>T</sup>' : '',
|
}.property('species', 'strainNameMU').readOnly(),
|
||||||
strain = `(strain ${this.get('strainName')}${type})`;
|
|
||||||
return `${species} ${strain}`;
|
|
||||||
}.property('species', 'strainName').readOnly(),
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
{{#each species.strains as |strain index|}}
|
{{#each species.strains as |strain index|}}
|
||||||
{{if index ","}}
|
{{if index ","}}
|
||||||
{{#link-to 'strains.show' strain.id}}
|
{{#link-to 'strains.show' strain.id}}
|
||||||
{{strain-name strain=strain}}
|
{{{strain.strainNameMU}}}
|
||||||
{{/link-to}}
|
{{/link-to}}
|
||||||
{{/each}}
|
{{/each}}
|
||||||
{{#unless species.isNew}}
|
{{#unless species.isNew}}
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
{{#each data.strains as |strain index|}}
|
{{#each data.strains as |strain index|}}
|
||||||
{{if index ","}}
|
{{if index ","}}
|
||||||
{{#link-to 'strains.show' strain.id}}
|
{{#link-to 'strains.show' strain.id}}
|
||||||
{{strain-name strain=strain}}
|
{{{strain.strainNameMU}}}
|
||||||
{{/link-to}}
|
{{/link-to}}
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</td>
|
</td>
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
import Ember from 'ember';
|
|
||||||
|
|
||||||
export default Ember.Component.extend({
|
|
||||||
tagName: 'span',
|
|
||||||
});
|
|
|
@ -1 +0,0 @@
|
||||||
{{strain.strainName}}{{{if strain.typeStrain '<sup>T</sup>'}}}
|
|
|
@ -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');
|
|
||||||
});
|
|
Reference in a new issue