Merge branch 'master' into clostridium

* master:
  Remove duplicate mixins
  auto-reload compare/results model, cleanup
This commit is contained in:
Matthew Dillon 2015-07-14 08:03:21 -08:00
commit 0ab0cf5a6a
13 changed files with 31 additions and 23 deletions

View file

@ -2,7 +2,8 @@
"predef": [
"document",
"window",
"-Promise"
"-Promise",
"FlakesFrame"
],
"browser": true,
"boss": true,

View file

@ -1,4 +1,3 @@
import Ember from 'ember';
import AuthenticatedRouteMixin from 'simple-auth/mixins/authenticated-route-mixin';
export default Ember.Route.extend(AuthenticatedRouteMixin);
export default Ember.Route.extend({});

View file

@ -1,7 +1,6 @@
import Ember from 'ember';
import AuthenticatedRouteMixin from 'simple-auth/mixins/authenticated-route-mixin';
export default Ember.Route.extend(AuthenticatedRouteMixin, {
export default Ember.Route.extend({
model: function() {
return this.store.findAll('characteristic');
},

View file

@ -8,7 +8,7 @@ export default Ember.Controller.extend({
let strain_ids = this.get('strain_ids').split(',');
strain_ids.forEach((id) => {
strains.push(this.store.peekRecord('strain', id));
})
});
return strains;
}.property('strain_ids'),
@ -17,7 +17,7 @@ export default Ember.Controller.extend({
let characteristic_ids = this.get('characteristic_ids').split(',');
characteristic_ids.forEach((id) => {
characteristics.push(this.store.peekRecord('characteristic', id));
})
});
return characteristics;
}.property('characteristic_ids'),
@ -45,6 +45,6 @@ export default Ember.Controller.extend({
data.pushObject(row);
});
return data;
}.property('characteristics', 'strains'),
}.property('characteristics', 'strains').readOnly(),
});

View file

@ -1,6 +1,22 @@
import Ember from 'ember';
export default Ember.Route.extend({
queryParams: {
strain_ids: {
refreshModel: true,
},
characteristic_ids: {
refreshModel: true,
},
},
beforeModel: function(transition) {
this._super(transition);
if (Ember.$.isEmptyObject(transition.queryParams)) {
this.transitionTo('protected.compare');
}
},
model: function(params) {
let compare = this.controllerFor('protected.compare');
compare.set('selectedStrains', params.strain_ids);

View file

@ -5,7 +5,7 @@ export default Ember.Route.extend({
return this.store.findAll('characteristic');
},
setupController: function(controller, model) {
setupController: function(controller/*, model*/) {
controller.set('characteristics', this.store.peekAll('characteristic'));
controller.set('strains', this.store.peekAll('strain'));
},

View file

@ -1,7 +1,6 @@
import Ember from 'ember';
import AuthenticatedRouteMixin from 'simple-auth/mixins/authenticated-route-mixin';
export default Ember.Route.extend(AuthenticatedRouteMixin, {
export default Ember.Route.extend({
beforeModel: function(transition) {
this._super(transition);
this.transitionTo('protected.compare');

View file

@ -1,4 +1,3 @@
import Ember from 'ember';
import AuthenticatedRouteMixin from 'simple-auth/mixins/authenticated-route-mixin';
export default Ember.Route.extend(AuthenticatedRouteMixin, {});
export default Ember.Route.extend({});

View file

@ -1,7 +1,6 @@
import Ember from 'ember';
import AuthenticatedRouteMixin from 'simple-auth/mixins/authenticated-route-mixin';
export default Ember.Route.extend(AuthenticatedRouteMixin, {
export default Ember.Route.extend({
afterModel: function(species) {
if (!species.get('canEdit')) {
this.transitionTo('species.show', species.get('id'));

View file

@ -1,7 +1,6 @@
import Ember from 'ember';
import AuthenticatedRouteMixin from 'simple-auth/mixins/authenticated-route-mixin';
export default Ember.Route.extend(AuthenticatedRouteMixin, {
export default Ember.Route.extend({
beforeModel: function(transition) {
this._super(transition);
if (this.get('session.currentUser.role') === 'R') {

View file

@ -1,7 +1,6 @@
import Ember from 'ember';
import AuthenticatedRouteMixin from 'simple-auth/mixins/authenticated-route-mixin';
export default Ember.Route.extend(AuthenticatedRouteMixin, {
export default Ember.Route.extend({
model: function(params) {
return this.store.findRecord('species', params.species_id, { reload: true });
},

View file

@ -1,7 +1,6 @@
import Ember from 'ember';
import AuthenticatedRouteMixin from 'simple-auth/mixins/authenticated-route-mixin';
export default Ember.Route.extend(AuthenticatedRouteMixin, {
export default Ember.Route.extend({
model: function() {
return this.store.findAll('strain');
},

View file

@ -1,7 +1,6 @@
import Ember from 'ember';
import AuthenticatedRouteMixin from 'simple-auth/mixins/authenticated-route-mixin';
export default Ember.Route.extend(AuthenticatedRouteMixin, {
export default Ember.Route.extend({
beforeModel: function(transition) {
this._super(transition);
if (this.get('session.currentUser.role') === 'R') {