Housekeeping
This commit is contained in:
		
							parent
							
								
									d80ce9286b
								
							
						
					
					
						commit
						0d840b4586
					
				
					 15 changed files with 91 additions and 141 deletions
				
			
		| 
						 | 
				
			
			@ -2,7 +2,7 @@ import Ember from 'ember';
 | 
			
		|||
import config from '../config/environment';
 | 
			
		||||
 | 
			
		||||
var globals = Ember.Object.extend({
 | 
			
		||||
  genus: config.genus,
 | 
			
		||||
  genus: config.APP.genus,
 | 
			
		||||
  apiURL: config.apiURL,
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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')
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -6,8 +6,5 @@ export default Ember.Route.extend(ApplicationRouteMixin, {
 | 
			
		|||
    invalidateSession: function() {
 | 
			
		||||
      this.get('session').invalidate();
 | 
			
		||||
    },
 | 
			
		||||
    loading: function() {
 | 
			
		||||
      return true;
 | 
			
		||||
    },
 | 
			
		||||
  }
 | 
			
		||||
});
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,28 +1,28 @@
 | 
			
		|||
  <div class="flakes-navigation">
 | 
			
		||||
    {{#link-to 'index' class='logo'}}
 | 
			
		||||
      {{site-name}}
 | 
			
		||||
      {{globals.genus}}.info
 | 
			
		||||
    {{/link-to}}
 | 
			
		||||
    {{#if session.isAuthenticated}}
 | 
			
		||||
      <ul>
 | 
			
		||||
        {{#link-to 'species' tagName='li' href=false}}
 | 
			
		||||
          {{#link-to 'species'}}Species{{/link-to}}
 | 
			
		||||
          {{link-to 'Species' 'species'}}
 | 
			
		||||
        {{/link-to}}
 | 
			
		||||
        {{#link-to 'strains' tagName='li' href=false}}
 | 
			
		||||
          {{#link-to 'strains'}}Strains{{/link-to}}
 | 
			
		||||
          {{link-to 'Strains' 'strains'}}
 | 
			
		||||
        {{/link-to}}
 | 
			
		||||
        {{#link-to 'characteristics' tagName='li' href=false}}
 | 
			
		||||
          {{#link-to 'characteristics'}}Characteristics{{/link-to}}
 | 
			
		||||
          {{link-to 'Characteristics' 'characteristics'}}
 | 
			
		||||
        {{/link-to}}
 | 
			
		||||
        {{#link-to 'measurements' tagName='li' href=false}}
 | 
			
		||||
          {{#link-to 'measurements'}}Measurements{{/link-to}}
 | 
			
		||||
          {{link-to 'Measurements' 'measurements'}}
 | 
			
		||||
        {{/link-to}}
 | 
			
		||||
        {{#link-to 'about' tagName='li' href=false}}
 | 
			
		||||
          {{#link-to 'about'}}About{{/link-to}}
 | 
			
		||||
          {{link-to 'About' 'about'}}
 | 
			
		||||
        {{/link-to}}
 | 
			
		||||
      </ul>
 | 
			
		||||
      <p class="foot">
 | 
			
		||||
        {{session.currentUser.name}}<br>
 | 
			
		||||
        <a {{ action 'invalidateSession' }}>Logout</a>
 | 
			
		||||
        <a {{action 'invalidateSession'}}>Logout</a>
 | 
			
		||||
      </p>
 | 
			
		||||
    {{else}}
 | 
			
		||||
      <p class="foot">
 | 
			
		||||
| 
						 | 
				
			
			@ -36,7 +36,7 @@
 | 
			
		|||
  <div class="flakes-content">
 | 
			
		||||
    <div class="flakes-mobile-top-bar">
 | 
			
		||||
      <a href="" class="logo-wrap">
 | 
			
		||||
        {{site-name}}
 | 
			
		||||
        {{globals.genus}}.info
 | 
			
		||||
      </a>
 | 
			
		||||
      <a href="" class="navigation-expand-target">
 | 
			
		||||
        <img src="img/navigation-expand-target.png" height="26px">
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1 +0,0 @@
 | 
			
		|||
{{globals.genus}}.info
 | 
			
		||||
| 
						 | 
				
			
			@ -23,7 +23,7 @@
 | 
			
		|||
              content=characteristics
 | 
			
		||||
              value=selectedCharacteristics
 | 
			
		||||
              optionValuePath="id"
 | 
			
		||||
              placeholder="Choose a characteristic"
 | 
			
		||||
              placeholder="All characteristics"
 | 
			
		||||
            }}
 | 
			
		||||
          </li>
 | 
			
		||||
          <li>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,6 +1,7 @@
 | 
			
		|||
import Ember from 'ember';
 | 
			
		||||
import AuthenticatedRouteMixin from 'simple-auth/mixins/authenticated-route-mixin';
 | 
			
		||||
 | 
			
		||||
export default Ember.Route.extend({
 | 
			
		||||
export default Ember.Route.extend(AuthenticatedRouteMixin, {
 | 
			
		||||
  model: function() {
 | 
			
		||||
    return this.store.createRecord('species');
 | 
			
		||||
  },
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,4 +1,4 @@
 | 
			
		|||
import Ember from 'ember';
 | 
			
		||||
import AuthenticatedRouteMixin from 'simple-auth/mixins/authenticated-route-mixin';
 | 
			
		||||
 | 
			
		||||
export default Ember.Route.extend({
 | 
			
		||||
});
 | 
			
		||||
export default Ember.Route.extend(AuthenticatedRouteMixin, {});
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,6 +1,7 @@
 | 
			
		|||
import Ember from 'ember';
 | 
			
		||||
import AuthenticatedRouteMixin from 'simple-auth/mixins/authenticated-route-mixin';
 | 
			
		||||
 | 
			
		||||
export default Ember.Route.extend({
 | 
			
		||||
export default Ember.Route.extend(AuthenticatedRouteMixin, {
 | 
			
		||||
  model: function() {
 | 
			
		||||
    return Ember.RSVP.hash({
 | 
			
		||||
      strain: this.store.createRecord('strain'),
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,6 +1,7 @@
 | 
			
		|||
import Ember from 'ember';
 | 
			
		||||
import AuthenticatedRouteMixin from 'simple-auth/mixins/authenticated-route-mixin';
 | 
			
		||||
 | 
			
		||||
export default Ember.Route.extend({
 | 
			
		||||
export default Ember.Route.extend(AuthenticatedRouteMixin, {
 | 
			
		||||
  model: function(params) {
 | 
			
		||||
    return Ember.RSVP.hash({
 | 
			
		||||
      strain: this.store.find('strain', params.strain_id),
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Reference in a new issue