cleaning up measurements table
This commit is contained in:
parent
046fea2dbb
commit
33d325a4b0
14 changed files with 102 additions and 260 deletions
|
@ -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);
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
|
@ -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}}
|
Reference in a new issue