added notes.comments field
This commit is contained in:
@ -199,6 +199,7 @@
|
||||
<td *ngFor="let key of activeTemplateKeys.condition">
|
||||
{{sample.condition ? sample.condition[key[1]] : '' | exists}}
|
||||
</td>
|
||||
<td *ngIf="isActiveKey['notes.comment']">{{sample.notes | exists: 'comment'}}</td>
|
||||
<td *ngIf="isActiveKey['notes']">{{sample.notes | object: ['_id', 'sample_references']}}</td>
|
||||
<td *ngFor="let key of activeTemplateKeys.measurements">{{sample[key[1]] | exists: key[2]}}</td>
|
||||
<td *ngIf="isActiveKey['status']">{{sample.status}}</td>
|
||||
|
@ -64,7 +64,7 @@ export class SamplesComponent implements OnInit {
|
||||
{field: 'type', label: 'Type', active: false, autocomplete: [], mode: 'eq', values: ['']},
|
||||
{field: 'color', label: 'Color', active: false, autocomplete: [], mode: 'eq', values: ['']},
|
||||
{field: 'batch', label: 'Batch', active: false, autocomplete: [], mode: 'eq', values: ['']},
|
||||
// {field: 'notes.comment', label: 'Comment', active: false, autocomplete: [], mode: 'eq', values: ['']},
|
||||
{field: 'notes.comment', label: 'Comment', active: false, autocomplete: [], mode: 'eq', values: ['']},
|
||||
{field: 'added', label: 'Added', active: false, autocomplete: [], mode: 'eq', values: ['']}
|
||||
]
|
||||
};
|
||||
@ -80,7 +80,7 @@ export class SamplesComponent implements OnInit {
|
||||
{id: 'type', label: 'Type', active: true, sortable: true},
|
||||
{id: 'color', label: 'Color', active: false, sortable: true},
|
||||
{id: 'batch', label: 'Batch', active: true, sortable: true},
|
||||
// {id: 'notes.comment', label: 'Comment', active: false, sortable: false},
|
||||
{id: 'notes.comment', label: 'Comment', active: false, sortable: false},
|
||||
{id: 'notes', label: 'Notes', active: false, sortable: false},
|
||||
{id: 'status', label: 'Status', active: false, sortable: true},
|
||||
{id: 'added', label: 'Added', active: true, sortable: true}
|
||||
@ -129,7 +129,7 @@ export class SamplesComponent implements OnInit {
|
||||
this.d.load('userKey', onLoad);
|
||||
this.d.load('conditionTemplates', onLoad);
|
||||
this.loadTemplateKeys('material', 'type', onLoad);
|
||||
this.loadTemplateKeys('condition', 'notes', onLoad);
|
||||
this.loadTemplateKeys('condition', 'notes.comment', onLoad);
|
||||
this.loadTemplateKeys('measurement', 'status', onLoad);
|
||||
}
|
||||
|
||||
@ -177,6 +177,10 @@ export class SamplesComponent implements OnInit {
|
||||
key.active = event[key.id];
|
||||
}
|
||||
});
|
||||
const sortId = this.filters.sort.replace(/(-asc|-desc)/, '');
|
||||
if (event.hasOwnProperty(sortId) && !event[sortId]) { // reset sort if sort field was unselected
|
||||
this.setSort('_id-asc');
|
||||
}
|
||||
this.updateActiveKeys();
|
||||
}
|
||||
this.loadSamplesQueue.push(options);
|
||||
@ -254,8 +258,8 @@ export class SamplesComponent implements OnInit {
|
||||
e.values = e.values.map(el => new Date(new Date(el).getTime() - new Date(el).getTimezoneOffset() * 60000).toISOString());
|
||||
}
|
||||
if (e.mode === 'null') {
|
||||
e.mode = 'eq';
|
||||
e.values[0] = null;
|
||||
e.mode = 'in';
|
||||
e.values = [null, ''];
|
||||
}
|
||||
return e;
|
||||
})
|
||||
@ -346,7 +350,7 @@ export class SamplesComponent implements OnInit {
|
||||
|
||||
updateActiveKeys() { // array with all activeKeys
|
||||
this.activeKeys = this.keys.filter(e => e.active);
|
||||
this.filters.filters.forEach(filter => {
|
||||
this.filters.filters.forEach(filter => { // disable filters of fields not displayed
|
||||
if (!this.isActiveKey[filter.field]) {
|
||||
filter.active = false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user