diff --git a/.jshintrc b/.jshintrc index 08096ef..32bd9c7 100644 --- a/.jshintrc +++ b/.jshintrc @@ -2,7 +2,8 @@ "predef": [ "document", "window", - "-Promise" + "-Promise", + "FlakesFrame" ], "browser": true, "boss": true, diff --git a/app/pods/protected/about/route.js b/app/pods/protected/about/route.js index 5b14286..096e3c5 100644 --- a/app/pods/protected/about/route.js +++ b/app/pods/protected/about/route.js @@ -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({}); diff --git a/app/pods/protected/characteristics/route.js b/app/pods/protected/characteristics/route.js index 77c7739..cf8c61a 100644 --- a/app/pods/protected/characteristics/route.js +++ b/app/pods/protected/characteristics/route.js @@ -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'); }, diff --git a/app/pods/protected/compare/results/controller.js b/app/pods/protected/compare/results/controller.js index 24fd5e7..c8fafc1 100644 --- a/app/pods/protected/compare/results/controller.js +++ b/app/pods/protected/compare/results/controller.js @@ -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(), }); diff --git a/app/pods/protected/compare/results/route.js b/app/pods/protected/compare/results/route.js index 757d14d..ef097f3 100644 --- a/app/pods/protected/compare/results/route.js +++ b/app/pods/protected/compare/results/route.js @@ -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); diff --git a/app/pods/protected/compare/route.js b/app/pods/protected/compare/route.js index e8a8576..19c8e94 100644 --- a/app/pods/protected/compare/route.js +++ b/app/pods/protected/compare/route.js @@ -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')); }, diff --git a/app/pods/protected/index/route.js b/app/pods/protected/index/route.js index 6fc51ce..bfdf329 100644 --- a/app/pods/protected/index/route.js +++ b/app/pods/protected/index/route.js @@ -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'); diff --git a/app/pods/protected/measurements/route.js b/app/pods/protected/measurements/route.js index b3f843f..096e3c5 100644 --- a/app/pods/protected/measurements/route.js +++ b/app/pods/protected/measurements/route.js @@ -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({}); diff --git a/app/pods/protected/species/edit/route.js b/app/pods/protected/species/edit/route.js index 6c264c2..59dcc15 100644 --- a/app/pods/protected/species/edit/route.js +++ b/app/pods/protected/species/edit/route.js @@ -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')); diff --git a/app/pods/protected/species/new/route.js b/app/pods/protected/species/new/route.js index 8c9caf9..3d15e44 100644 --- a/app/pods/protected/species/new/route.js +++ b/app/pods/protected/species/new/route.js @@ -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') { diff --git a/app/pods/protected/species/show/route.js b/app/pods/protected/species/show/route.js index da42b03..94f8361 100644 --- a/app/pods/protected/species/show/route.js +++ b/app/pods/protected/species/show/route.js @@ -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 }); }, diff --git a/app/pods/protected/strains/index/route.js b/app/pods/protected/strains/index/route.js index 9456dfc..9a19a1c 100644 --- a/app/pods/protected/strains/index/route.js +++ b/app/pods/protected/strains/index/route.js @@ -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'); }, diff --git a/app/pods/protected/strains/new/route.js b/app/pods/protected/strains/new/route.js index cb601a3..8c0ee68 100644 --- a/app/pods/protected/strains/new/route.js +++ b/app/pods/protected/strains/new/route.js @@ -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') {