diff --git a/src/app/samples/samples.component.html b/src/app/samples/samples.component.html index 4c93668..6ef8aa6 100644 --- a/src/app/samples/samples.component.html +++ b/src/app/samples/samples.component.html @@ -104,6 +104,12 @@ + + has no condition + + + has no measurements + diff --git a/src/app/samples/samples.component.scss b/src/app/samples/samples.component.scss index 8f7e06d..faf9435 100644 --- a/src/app/samples/samples.component.scss +++ b/src/app/samples/samples.component.scss @@ -178,6 +178,10 @@ rb-table { float: left; margin-right: 30px; } + + & > rb-form-checkbox { + float: left; + } } .filtermode { diff --git a/src/app/samples/samples.component.ts b/src/app/samples/samples.component.ts index 331d0b8..88061e7 100644 --- a/src/app/samples/samples.component.ts +++ b/src/app/samples/samples.component.ts @@ -52,6 +52,7 @@ export class SamplesComponent implements OnInit { pageSize: 25, toPage: 0, sort: 'added-asc', + no: {condition: false, measurements: false}, filters: [ {field: 'number', label: 'Number', active: false, autocomplete: [], mode: 'eq', values: ['']}, {field: 'material.name', label: 'Product name', active: false, autocomplete: [], mode: 'eq', values: ['']}, @@ -265,6 +266,12 @@ export class SamplesComponent implements OnInit { .filter(e => e.active && e.values.length > 0) .map(e => 'filters[]=' + encodeURIComponent(JSON.stringify(pick(e, ['mode', 'field', 'values'])))) ); + if (this.filters.no.condition) { + query.push('filters[]=' + encodeURIComponent( JSON.stringify({mode: 'eq', field: 'condition', values: [{}]}))); + } + if (this.filters.no.measurements) { + query.push('filters[]=' + encodeURIComponent( JSON.stringify( {mode: 'eq', field: 'measurements', values: [null]}))); + } if (!options.export) { additionalTableKeys.forEach(key => { if (query.indexOf('fields[]=' + key) < 0) { // add key if not already added diff --git a/src/app/users/users.component.html b/src/app/users/users.component.html index 9c095e2..b745808 100644 --- a/src/app/users/users.component.html +++ b/src/app/users/users.component.html @@ -15,7 +15,8 @@ Cannot be empty - {{locationInput.errors.failure}} Cannot be empty @@ -100,13 +101,13 @@ + appValidate="string" [name]="'device-' + item.i" [ngModel]="item.value"> -