Housekeeping
This commit is contained in:
parent
d80ce9286b
commit
0d840b4586
15 changed files with 91 additions and 141 deletions
app
initializers
models
pods
application
components/site-name
measurements
species
strains
config
|
@ -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),
|
||||
|
|
|
@ -8,68 +8,46 @@ module.exports = function(environment) {
|
|||
locationType: 'auto',
|
||||
EmberENV: {
|
||||
FEATURES: {
|
||||
// Here you can enable experimental features on an ember canary build
|
||||
// e.g. 'with-controller': true
|
||||
// enable experimental features on an ember canary build
|
||||
}
|
||||
},
|
||||
APP: {
|
||||
// Here you can pass flags/options to your application instance
|
||||
// when it is created
|
||||
genus: 'hymenobacter',
|
||||
},
|
||||
genus: 'hymenobacter',
|
||||
podModulePrefix: 'hymenobacterdotinfo/pods',
|
||||
};
|
||||
|
||||
if (environment === 'development') {
|
||||
ENV['simple-auth'] = {
|
||||
'simple-auth': {
|
||||
session: 'session:custom',
|
||||
authorizer: 'simple-auth-authorizer:token',
|
||||
crossOriginWhitelist: ['http://127.0.0.1:4200']
|
||||
}
|
||||
ENV['simple-auth-token'] = {
|
||||
serverTokenEndpoint: '/api/authenticate',
|
||||
},
|
||||
'simple-auth-token': {
|
||||
identificationField: 'email',
|
||||
passwordField: 'password',
|
||||
tokenPropertyName: 'token',
|
||||
authorizationPrefix: 'Bearer ',
|
||||
authorizationHeaderName: 'Authorization',
|
||||
}
|
||||
ENV.apiURL = 'http://127.0.0.1:4200';
|
||||
ENV.contentSecurityPolicy = {
|
||||
},
|
||||
contentSecurityPolicy: {
|
||||
'default-src': "'none'",
|
||||
'script-src': "'self'",
|
||||
'font-src': "'self'",
|
||||
'connect-src': "'self' http://127.0.0.1:4200",
|
||||
'img-src': "'self'",
|
||||
'style-src': "'self' 'unsafe-inline'",
|
||||
'media-src': "'self'"
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
if (environment === 'development') {
|
||||
ENV['simple-auth']['crossOriginWhitelist'] = ['http://127.0.0.1:4200'];
|
||||
ENV['simple-auth-token']['serverTokenEndpoint'] = '/api/authenticate';
|
||||
ENV.apiURL = 'http://127.0.0.1:4200';
|
||||
ENV.contentSecurityPolicy['connect-src'] = "'self' http://127.0.0.1:4200";
|
||||
}
|
||||
|
||||
if (environment === 'test') {
|
||||
ENV['simple-auth'] = {
|
||||
session: 'session:custom',
|
||||
authorizer: 'simple-auth-authorizer:token',
|
||||
crossOriginWhitelist: ['https://bactdb-test.herokuapp.com']
|
||||
}
|
||||
ENV['simple-auth-token'] = {
|
||||
serverTokenEndpoint: 'https://bactdb-test.herokuapp.com/api/authenticate',
|
||||
identificationField: 'email',
|
||||
passwordField: 'password',
|
||||
tokenPropertyName: 'token',
|
||||
authorizationPrefix: 'Bearer ',
|
||||
authorizationHeaderName: 'Authorization',
|
||||
}
|
||||
ENV['simple-auth']['crossOriginWhitelist'] = ['https://bactdb-test.herokuapp.com'];
|
||||
ENV['simple-auth-token']['serverTokenEndpoint'] = 'https://bactdb-test.herokuapp.com/api/authenticate';
|
||||
ENV.apiURL = 'https://bactdb-test.herokuapp.com';
|
||||
ENV.contentSecurityPolicy = {
|
||||
'default-src': "'none'",
|
||||
'script-src': "'self'",
|
||||
'font-src': "'self'",
|
||||
'connect-src': "'self' https://bactdb-test.herokuapp.com",
|
||||
'img-src': "'self'",
|
||||
'style-src': "'self'",
|
||||
'media-src': "'self'"
|
||||
}
|
||||
ENV.contentSecurityPolicy['connect-src'] = "'self' https://bactdb-test.herokuapp.com";
|
||||
|
||||
// keep test console output quieter
|
||||
ENV.APP.LOG_ACTIVE_GENERATION = false;
|
||||
|
@ -77,29 +55,10 @@ module.exports = function(environment) {
|
|||
}
|
||||
|
||||
if (environment === 'production') {
|
||||
ENV['simple-auth'] = {
|
||||
session: 'session:custom',
|
||||
authorizer: 'simple-auth-authorizer:token',
|
||||
crossOriginWhitelist: ['https://bactdb.herokuapp.com']
|
||||
}
|
||||
ENV['simple-auth-token'] = {
|
||||
serverTokenEndpoint: 'https://bactdb.herokuapp.com/api/authenticate',
|
||||
identificationField: 'email',
|
||||
passwordField: 'password',
|
||||
tokenPropertyName: 'token',
|
||||
authorizationPrefix: 'Bearer ',
|
||||
authorizationHeaderName: 'Authorization',
|
||||
}
|
||||
ENV['simple-auth']['crossOriginWhitelist'] = ['https://bactdb.herokuapp.com'];
|
||||
ENV['simple-auth-token']['serverTokenEndpoint'] = 'https://bactdb.herokuapp.com/api/authenticate';
|
||||
ENV.apiURL = 'https://bactdb.herokuapp.com';
|
||||
ENV.contentSecurityPolicy = {
|
||||
'default-src': "'none'",
|
||||
'script-src': "'self'",
|
||||
'font-src': "'self'",
|
||||
'connect-src': "'self' https://bactdb.herokuapp.com",
|
||||
'img-src': "'self'",
|
||||
'style-src': "'self'",
|
||||
'media-src': "'self'"
|
||||
}
|
||||
ENV.contentSecurityPolicy['connect-src'] = "'self' https://bactdb.herokuapp.com";
|
||||
}
|
||||
|
||||
return ENV;
|
||||
|
|
Reference in a new issue