From a354ecd639996d16e51b043ee5f88f30a34ba8ee Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Fri, 12 Jun 2015 12:40:28 -0800 Subject: [PATCH] Clean up meas search a bit --- app/pods/components/measurement-search-table/component.js | 7 +------ app/pods/components/measurement-search-table/template.hbs | 2 +- app/pods/measurements/route.js | 7 ------- app/pods/measurements/template.hbs | 6 +++++- 4 files changed, 7 insertions(+), 15 deletions(-) diff --git a/app/pods/components/measurement-search-table/component.js b/app/pods/components/measurement-search-table/component.js index 0a941ee..2d618ef 100644 --- a/app/pods/components/measurement-search-table/component.js +++ b/app/pods/components/measurement-search-table/component.js @@ -1,18 +1,15 @@ import Ember from 'ember'; export default Ember.Component.extend({ - isLoading: false, actions: { search: function() { - this.set('isLoading', true); let strain = this.get('selectedStrain'); let characteristic = this.get('selectedCharacteristic'); if ((strain === 'all') && (characteristic === 'all')) { this.store.findAll('measurement').then((measurements)=>{ this.set('measurements', measurements); }); - this.set('isLoading', false); - return false; + return; } let search = {}; if (strain !== 'all') { @@ -24,8 +21,6 @@ export default Ember.Component.extend({ this.store.find('measurement', search).then((measurements)=>{ this.set('measurements', measurements); }); - this.set('isLoading', false); - return false; } }, }); diff --git a/app/pods/components/measurement-search-table/template.hbs b/app/pods/components/measurement-search-table/template.hbs index 93d8ab8..601ad48 100644 --- a/app/pods/components/measurement-search-table/template.hbs +++ b/app/pods/components/measurement-search-table/template.hbs @@ -10,7 +10,7 @@ {{#if isLoading}} - {{!-- This doesn't work yet --}} + {{!-- This doesn't work yet, something is blocking --}} {{loading-panel}} {{else}} diff --git a/app/pods/measurements/route.js b/app/pods/measurements/route.js index 9dbfd63..1b8e793 100644 --- a/app/pods/measurements/route.js +++ b/app/pods/measurements/route.js @@ -10,13 +10,6 @@ export default Ember.Route.extend(AuthenticatedRouteMixin, { }); }, setupController: function(controller, models) { - var tableAttrs = [ - { name: 'Strain', attr: 'strain.strainName' }, - { name: 'Characteristic', attr: 'characteristic.characteristicName' }, - { name: 'Value', attr: 'computedValue'} - ]; - controller.set('tableAttrs', tableAttrs); - controller.set('row', 'measurement-index-row'); controller.set('measurements', []); // Set up search parameters diff --git a/app/pods/measurements/template.hbs b/app/pods/measurements/template.hbs index 87b6327..e99f3e2 100644 --- a/app/pods/measurements/template.hbs +++ b/app/pods/measurements/template.hbs @@ -28,4 +28,8 @@ -{{measurement-search-table}} +{{ + measurement-search-table + selectedStrain=selectedStrain + selectedCharacteristic=selectedCharacteristic +}}