Housekeeping
This commit is contained in:
		
							parent
							
								
									d80ce9286b
								
							
						
					
					
						commit
						0d840b4586
					
				
					 15 changed files with 91 additions and 141 deletions
				
			
		| 
						 | 
				
			
			@ -3,12 +3,12 @@ import DS from 'ember-data';
 | 
			
		|||
export default DS.Model.extend({
 | 
			
		||||
  characteristicName: DS.attr('string'),
 | 
			
		||||
  characteristicType: DS.attr('string'),
 | 
			
		||||
  strains: DS.hasMany('strain', { async: true }),
 | 
			
		||||
  measurements: DS.hasMany('measurements', { async: true }),
 | 
			
		||||
  createdAt: DS.attr('date'),
 | 
			
		||||
  updatedAt: DS.attr('date'),
 | 
			
		||||
  deletedAt: DS.attr('date'),
 | 
			
		||||
  createdBy: DS.attr('number'),
 | 
			
		||||
  updatedBy: DS.attr('number'),
 | 
			
		||||
  deletedBy: DS.attr('number')
 | 
			
		||||
  strains           : DS.hasMany('strain', { async: true }),
 | 
			
		||||
  measurements      : DS.hasMany('measurements', { async: true }),
 | 
			
		||||
  createdAt         : DS.attr('date'),
 | 
			
		||||
  updatedAt         : DS.attr('date'),
 | 
			
		||||
  deletedAt         : DS.attr('date'),
 | 
			
		||||
  createdBy         : DS.attr('number'),
 | 
			
		||||
  updatedBy         : DS.attr('number'),
 | 
			
		||||
  deletedBy         : DS.attr('number')
 | 
			
		||||
});
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,31 +1,20 @@
 | 
			
		|||
import DS from 'ember-data';
 | 
			
		||||
 | 
			
		||||
export default DS.Model.extend({
 | 
			
		||||
  strain: DS.belongsTo('strain', { async: true }),
 | 
			
		||||
  characteristic: DS.belongsTo('characteristic', { async: true }),
 | 
			
		||||
  strain             : DS.belongsTo('strain', { async: true }),
 | 
			
		||||
  characteristic     : DS.belongsTo('characteristic', { async: true }),
 | 
			
		||||
  textMeasurementType: DS.attr('string'),
 | 
			
		||||
  txtValue: DS.attr('string'),
 | 
			
		||||
  numValue: DS.attr('number'),
 | 
			
		||||
  confidenceInterval: DS.attr('number'),
 | 
			
		||||
  unitType: DS.attr('string'),
 | 
			
		||||
  notes: DS.attr('string'),
 | 
			
		||||
  testMethod: DS.attr('string'),
 | 
			
		||||
  createdAt: DS.attr('date'),
 | 
			
		||||
  updatedAt: DS.attr('date'),
 | 
			
		||||
  createdBy: DS.attr('number'),
 | 
			
		||||
  updatedBy: DS.attr('number'),
 | 
			
		||||
  // computedType: Ember.computed('textMeasurementType', 'txtValue', 'numValue', function() {
 | 
			
		||||
  //   if (this.get('textMeasurementType')) {
 | 
			
		||||
  //     return 'Fixed-text';
 | 
			
		||||
  //   }
 | 
			
		||||
  //   if (this.get('txtValue')) {
 | 
			
		||||
  //     return 'Free-text';
 | 
			
		||||
  //   }
 | 
			
		||||
  //   if (this.get('numValue')) {
 | 
			
		||||
  //     return 'Numerical';
 | 
			
		||||
  //   }
 | 
			
		||||
  //   return "error";
 | 
			
		||||
  // }),
 | 
			
		||||
  txtValue           : DS.attr('string'),
 | 
			
		||||
  numValue           : DS.attr('number'),
 | 
			
		||||
  confidenceInterval : DS.attr('number'),
 | 
			
		||||
  unitType           : DS.attr('string'),
 | 
			
		||||
  notes              : DS.attr('string'),
 | 
			
		||||
  testMethod         : DS.attr('string'),
 | 
			
		||||
  createdAt          : DS.attr('date'),
 | 
			
		||||
  updatedAt          : DS.attr('date'),
 | 
			
		||||
  createdBy          : DS.attr('number'),
 | 
			
		||||
  updatedBy          : DS.attr('number'),
 | 
			
		||||
 | 
			
		||||
  value: function() {
 | 
			
		||||
    if (this.get('textMeasurementType')) {
 | 
			
		||||
      return this.get('textMeasurementType');
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2,16 +2,16 @@ import DS from 'ember-data';
 | 
			
		|||
import config from '../config/environment';
 | 
			
		||||
 | 
			
		||||
export default DS.Model.extend({
 | 
			
		||||
  speciesName: DS.attr('string'),
 | 
			
		||||
  typeSpecies: DS.attr('boolean'),
 | 
			
		||||
  etymology: DS.attr('string'),
 | 
			
		||||
  genusName: DS.attr('string', { defaultValue: config.genus }),
 | 
			
		||||
  strains: DS.hasMany('strain', { async: true }),
 | 
			
		||||
  speciesName : DS.attr('string'),
 | 
			
		||||
  typeSpecies : DS.attr('boolean'),
 | 
			
		||||
  etymology   : DS.attr('string'),
 | 
			
		||||
  genusName   : DS.attr('string', { defaultValue: config.APP.genus }),
 | 
			
		||||
  strains     : DS.hasMany('strain', { async: true }),
 | 
			
		||||
  totalStrains: DS.attr('number'),
 | 
			
		||||
  createdAt: DS.attr('date'),
 | 
			
		||||
  updatedAt: DS.attr('date'),
 | 
			
		||||
  deletedAt: DS.attr('date'),
 | 
			
		||||
  createdBy: DS.attr('number'),
 | 
			
		||||
  updatedBy: DS.attr('number'),
 | 
			
		||||
  deletedBy: DS.attr('number'),
 | 
			
		||||
  createdAt   : DS.attr('date'),
 | 
			
		||||
  updatedAt   : DS.attr('date'),
 | 
			
		||||
  deletedAt   : DS.attr('date'),
 | 
			
		||||
  createdBy   : DS.attr('number'),
 | 
			
		||||
  updatedBy   : DS.attr('number'),
 | 
			
		||||
  deletedBy   : DS.attr('number'),
 | 
			
		||||
});
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,28 +1,31 @@
 | 
			
		|||
import DS from 'ember-data';
 | 
			
		||||
 | 
			
		||||
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'),
 | 
			
		||||
  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'),
 | 
			
		||||
 | 
			
		||||
  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() {
 | 
			
		||||
    return `<em>${this.get('species.speciesName')}</em> ${this.get('strainNameMU')}`;
 | 
			
		||||
  }.property('species', 'strainNameMU').readOnly(),
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,9 +1,9 @@
 | 
			
		|||
import DS from 'ember-data';
 | 
			
		||||
 | 
			
		||||
export default DS.Model.extend({
 | 
			
		||||
  email: DS.attr('string'),
 | 
			
		||||
  name: DS.attr('string'),
 | 
			
		||||
  role: DS.attr('string'),
 | 
			
		||||
  email    : DS.attr('string'),
 | 
			
		||||
  name     : DS.attr('string'),
 | 
			
		||||
  role     : DS.attr('string'),
 | 
			
		||||
  createdAt: DS.attr('date'),
 | 
			
		||||
  updatedAt: DS.attr('date'),
 | 
			
		||||
  deletedAt: DS.attr('date')
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Reference in a new issue