From 43800d6dd83d3468225dc36884f5ea1af09b92f4 Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Thu, 18 Jun 2015 12:46:08 -0800 Subject: [PATCH] strain whole genome sequence --- app/models/strain.js | 33 ++++++++++--------- .../components/strain-details/template.hbs | 15 +++++++-- server/mocks/strains.js | 4 +++ 3 files changed, 34 insertions(+), 18 deletions(-) diff --git a/app/models/strain.js b/app/models/strain.js index a3621e9..7f69f45 100644 --- a/app/models/strain.js +++ b/app/models/strain.js @@ -2,22 +2,23 @@ import DS from 'ember-data'; import Ember from 'ember'; export default DS.Model.extend({ - measurements : DS.hasMany('measurements', { async: true }), - species : DS.belongsTo('species', { async: true }), - strainName : DS.attr('string'), - typeStrain : DS.attr('boolean'), - accessionNumbers : DS.attr('string'), - genbank : DS.attr('string'), - isolatedFrom : DS.attr('string'), - notes : DS.attr('string'), - createdAt : DS.attr('date'), - updatedAt : DS.attr('date'), - deletedAt : DS.attr('date'), - createdBy : DS.attr('number'), - updatedBy : DS.attr('number'), - deletedBy : DS.attr('number'), - totalMeasurements: DS.attr('number'), - sortOrder : DS.attr('number'), + measurements : DS.hasMany('measurements', { async: true }), + species : DS.belongsTo('species', { async: true }), + strainName : DS.attr('string'), + typeStrain : DS.attr('boolean'), + accessionNumbers : DS.attr('string'), + genbank : DS.attr('string'), + wholeGenomeSequence: DS.attr('string'), + isolatedFrom : DS.attr('string'), + notes : DS.attr('string'), + createdAt : DS.attr('date'), + updatedAt : DS.attr('date'), + deletedAt : DS.attr('date'), + createdBy : DS.attr('number'), + updatedBy : DS.attr('number'), + deletedBy : DS.attr('number'), + totalMeasurements : DS.attr('number'), + sortOrder : DS.attr('number'), strainNameMU: function() { let type = this.get('typeStrain') ? 'T' : ''; diff --git a/app/pods/components/strain-details/template.hbs b/app/pods/components/strain-details/template.hbs index f2d648f..9d6e9ca 100644 --- a/app/pods/components/strain-details/template.hbs +++ b/app/pods/components/strain-details/template.hbs @@ -5,7 +5,7 @@ {{#if isEditing}} {{input value=strain.strainName}} {{else}} - {{strain.strainName}} + {{strain.strainNameMU}} {{/if}} {{display-errors a=strain.errors.strainName}} @@ -43,7 +43,7 @@ {{! ROW 2 }} -
+
Accession Numbers
@@ -66,6 +66,17 @@ {{display-errors a=strain.errors.genbank}}
+
+
Whole Genome Sequence
+
+ {{#if isEditing}} + {{input value=strain.wholeGenomeSequence}} + {{else}} + {{strain.wholeGenomeSequence}} + {{/if}} + {{display-errors a=strain.errors.wholeGenomeSequence}} +
+
{{! ROW 3 }} diff --git a/server/mocks/strains.js b/server/mocks/strains.js index 2a39419..d98fc96 100644 --- a/server/mocks/strains.js +++ b/server/mocks/strains.js @@ -10,6 +10,7 @@ module.exports = function(app) { typeStrain: true, accessionNumbers: "Test Accession", genbank: "Test Genbank", + wholeGenomeSequence: "Seq123", isolatedFrom: "Location 1", measurements: [1,2,3,4,5], createdAt: "0001-01-01T00:00:00Z", @@ -29,6 +30,7 @@ module.exports = function(app) { typeStrain: false, accessionNumbers: "Test Accession", genbank: "Test Genbank", + wholeGenomeSequence: null, isolatedFrom: "Location 2", measurements: [6,7,8,9,10], createdAt: "0001-01-01T00:00:00Z", @@ -48,6 +50,7 @@ module.exports = function(app) { typeStrain: true, accessionNumbers: "Test Accession", genbank: "Test Genbank", + wholeGenomeSequence: "Seq123", isolatedFrom: "Location 1", measurements: [], createdAt: "0001-01-01T00:00:00Z", @@ -67,6 +70,7 @@ module.exports = function(app) { typeStrain: true, accessionNumbers: "Test Accession", genbank: "Test Genbank", + wholeGenomeSequence: "Seq123", isolatedFrom: "Location 2", measurements: [], createdAt: "0001-01-01T00:00:00Z",