Linting
This commit is contained in:
parent
aeb3206fd9
commit
21e0e6c624
10 changed files with 112 additions and 87 deletions
|
@ -1,14 +1,16 @@
|
|||
import DS from 'ember-data';
|
||||
|
||||
export default DS.Model.extend({
|
||||
characteristicName : DS.attr('string'),
|
||||
characteristicTypeName: DS.attr('string'),
|
||||
strains : DS.hasMany('strain', { async: false }),
|
||||
measurements : DS.hasMany('measurements', { async: false }),
|
||||
createdAt : DS.attr('date'),
|
||||
updatedAt : DS.attr('date'),
|
||||
createdBy : DS.attr('number'),
|
||||
updatedBy : DS.attr('number'),
|
||||
sortOrder : DS.attr('number'),
|
||||
canEdit : DS.attr('boolean'),
|
||||
const { Model, attr, hasMany } = DS;
|
||||
|
||||
export default Model.extend({
|
||||
characteristicName : attr('string'),
|
||||
characteristicTypeName: attr('string'),
|
||||
strains : hasMany('strain', { async: false }),
|
||||
measurements : hasMany('measurements', { async: false }),
|
||||
createdAt : attr('date'),
|
||||
updatedAt : attr('date'),
|
||||
createdBy : attr('number'),
|
||||
updatedBy : attr('number'),
|
||||
sortOrder : attr('number'),
|
||||
canEdit : attr('boolean'),
|
||||
});
|
||||
|
|
|
@ -1,15 +1,17 @@
|
|||
import DS from 'ember-data';
|
||||
|
||||
export default DS.Model.extend({
|
||||
strain : DS.belongsTo('strain', { async: false }),
|
||||
characteristic : DS.belongsTo('characteristic', { async: false }),
|
||||
value : DS.attr('string'),
|
||||
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'),
|
||||
const { Model, belongsTo, attr } = DS;
|
||||
|
||||
export default Model.extend({
|
||||
strain : belongsTo('strain', { async: false }),
|
||||
characteristic : belongsTo('characteristic', { async: false }),
|
||||
value : attr('string'),
|
||||
confidenceInterval : attr('number'),
|
||||
unitType : attr('string'),
|
||||
notes : attr('string'),
|
||||
testMethod : attr('string'),
|
||||
createdAt : attr('date'),
|
||||
updatedAt : attr('date'),
|
||||
createdBy : attr('number'),
|
||||
updatedBy : attr('number'),
|
||||
});
|
||||
|
|
|
@ -2,20 +2,23 @@ import DS from 'ember-data';
|
|||
import config from '../config/environment';
|
||||
import Ember from 'ember';
|
||||
|
||||
export default DS.Model.extend({
|
||||
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: false }),
|
||||
totalStrains: DS.attr('number'),
|
||||
createdAt : DS.attr('date'),
|
||||
updatedAt : DS.attr('date'),
|
||||
createdBy : DS.attr('number'),
|
||||
updatedBy : DS.attr('number'),
|
||||
sortOrder : DS.attr('number'),
|
||||
canEdit : DS.attr('boolean'),
|
||||
const { Model, attr, hasMany } = DS;
|
||||
|
||||
export default Model.extend({
|
||||
speciesName : attr('string'),
|
||||
typeSpecies : attr('boolean'),
|
||||
etymology : attr('string'),
|
||||
genusName : attr('string', { defaultValue: config.APP.genus }),
|
||||
strains : hasMany('strain', { async: false }),
|
||||
totalStrains: attr('number'),
|
||||
createdAt : attr('date'),
|
||||
updatedAt : attr('date'),
|
||||
createdBy : attr('number'),
|
||||
updatedBy : attr('number'),
|
||||
sortOrder : attr('number'),
|
||||
canEdit : attr('boolean'),
|
||||
|
||||
// TODO: move this to component/helper
|
||||
speciesNameMU: function() {
|
||||
return Ember.String.htmlSafe(`<em>${this.get('speciesName')}</em>`);
|
||||
}.property('speciesName').readOnly(),
|
||||
|
|
|
@ -1,34 +1,39 @@
|
|||
import DS from 'ember-data';
|
||||
import Ember from 'ember';
|
||||
|
||||
export default DS.Model.extend({
|
||||
measurements : DS.hasMany('measurements', { async: false }),
|
||||
characteristics : DS.hasMany('characteristics', { async: false }),
|
||||
species : DS.belongsTo('species', { async: false }),
|
||||
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'),
|
||||
createdBy : DS.attr('number'),
|
||||
updatedBy : DS.attr('number'),
|
||||
totalMeasurements : DS.attr('number'),
|
||||
sortOrder : DS.attr('number'),
|
||||
canEdit : DS.attr('boolean'),
|
||||
const { Model, hasMany, belongsTo, attr } = DS;
|
||||
|
||||
export default Model.extend({
|
||||
measurements : hasMany('measurements', { async: false }),
|
||||
characteristics : hasMany('characteristics', { async: false }),
|
||||
species : belongsTo('species', { async: false }),
|
||||
strainName : attr('string'),
|
||||
typeStrain : attr('boolean'),
|
||||
accessionNumbers : attr('string'),
|
||||
genbank : attr('string'),
|
||||
wholeGenomeSequence: attr('string'),
|
||||
isolatedFrom : attr('string'),
|
||||
notes : attr('string'),
|
||||
createdAt : attr('date'),
|
||||
updatedAt : attr('date'),
|
||||
createdBy : attr('number'),
|
||||
updatedBy : attr('number'),
|
||||
totalMeasurements : attr('number'),
|
||||
sortOrder : attr('number'),
|
||||
canEdit : attr('boolean'),
|
||||
|
||||
// TODO: move this to component/helper
|
||||
strainNameMU: function() {
|
||||
let type = this.get('typeStrain') ? '<sup>T</sup>' : '';
|
||||
return Ember.String.htmlSafe(`${this.get('strainName')}${type}`);
|
||||
}.property('strainName', 'typeStrain').readOnly(),
|
||||
|
||||
// TODO: move this to component/helper
|
||||
fullName: Ember.computed('species', 'strainName', function() {
|
||||
return `${this.get('species.speciesName')} ${this.get('strainNameMU')}`;
|
||||
}),
|
||||
|
||||
// TODO: move this to component/helper
|
||||
fullNameMU: function() {
|
||||
return Ember.String.htmlSafe(`<em>${this.get('species.speciesName')}</em> ${this.get('strainNameMU')}`);
|
||||
}.property('species', 'strainNameMU').readOnly(),
|
||||
|
|
|
@ -1,29 +1,32 @@
|
|||
import Ember from 'ember';
|
||||
import DS from 'ember-data';
|
||||
|
||||
export default DS.Model.extend({
|
||||
email : DS.attr('string'),
|
||||
password : DS.attr('string'),
|
||||
name : DS.attr('string'),
|
||||
role : DS.attr('string'),
|
||||
canEdit : DS.attr('boolean'),
|
||||
createdAt: DS.attr('date'),
|
||||
updatedAt: DS.attr('date'),
|
||||
const { Model, attr } = DS;
|
||||
const { computed } = Ember;
|
||||
|
||||
isAdmin: function() {
|
||||
export default Model.extend({
|
||||
email : attr('string'),
|
||||
password : attr('string'),
|
||||
name : attr('string'),
|
||||
role : attr('string'),
|
||||
canEdit : attr('boolean'),
|
||||
createdAt: attr('date'),
|
||||
updatedAt: attr('date'),
|
||||
|
||||
isAdmin: computed('role', function() {
|
||||
return this.get('role') === 'A';
|
||||
}.property('role'),
|
||||
}),
|
||||
|
||||
isWriter: function() {
|
||||
isWriter: computed('role', function() {
|
||||
return this.get('role') === 'W';
|
||||
}.property('role'),
|
||||
}),
|
||||
|
||||
isReader: function() {
|
||||
isReader: computed('role', function() {
|
||||
return this.get('role') === 'R';
|
||||
}.property('role'),
|
||||
}),
|
||||
|
||||
fullRole: function() {
|
||||
let role = this.get('role');
|
||||
fullRole: computed('role', function() {
|
||||
const role = this.get('role');
|
||||
if (role === 'R') {
|
||||
return 'Read-Only';
|
||||
} else if (role === 'W') {
|
||||
|
@ -33,13 +36,13 @@ export default DS.Model.extend({
|
|||
} else {
|
||||
return 'Error';
|
||||
}
|
||||
}.property('role'),
|
||||
}),
|
||||
|
||||
canWrite: Ember.computed('role', function() {
|
||||
canWrite: computed('role', function() {
|
||||
return this.get('role') !== 'R';
|
||||
}),
|
||||
|
||||
metaData: Ember.computed('canWrite', function() {
|
||||
metaData: computed('canWrite', function() {
|
||||
return { 'canAdd': this.get('canWrite') };
|
||||
}),
|
||||
|
||||
|
|
Reference in a new issue