cleaning up measurements table

This commit is contained in:
Matthew Dillon 2015-06-12 15:30:05 -08:00
parent 046fea2dbb
commit 33d325a4b0
14 changed files with 102 additions and 260 deletions

View file

@ -1,26 +0,0 @@
import Ember from 'ember';
export default Ember.Component.extend({
actions: {
search: function() {
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);
});
return;
}
let search = {};
if (strain !== 'all') {
search['strain'] = strain;
}
if (characteristic !== 'all') {
search['characteristic'] = characteristic;
}
this.store.find('measurement', search).then((measurements)=>{
this.set('measurements', measurements);
});
}
},
});

View file

@ -1,34 +0,0 @@
<div class="grid-12 gutter-50">
<div class="span-12">
{{search-button isLoading=isLoading action='search'}}
</div>
</div>
<div class="grid-12 gutter-50">
<div class="span-12">
<h3>Total matching measurements: {{measurements.length}}</h3>
</div>
</div>
{{#if isLoading}}
{{!-- This doesn't work yet, something is blocking --}}
{{loading-panel}}
{{else}}
<table class="flakes-table">
<thead>
<tr>
<th>Strain</th>
<th>Characteristic</th>
<th>Value</th>
</tr>
</thead>
<tbody>
{{#each measurements as |measurement|}}
<tr>
<td>{{{measurement.strain.fullNameMU}}}</td>
<td>{{measurement.characteristic.characteristicName}}</td>
<td>{{{measurement.value}}}</td>
</tr>
{{/each}}
</tbody>
</table>
{{/if}}