diff --git a/nise-frontend/src/app/search/search.component.html b/nise-frontend/src/app/search/search.component.html index 04a1a36..210069c 100644 --- a/nise-frontend/src/app/search/search.component.html +++ b/nise-frontend/src/app/search/search.component.html @@ -32,16 +32,15 @@
sorting - diff --git a/nise-frontend/src/app/search/search.component.ts b/nise-frontend/src/app/search/search.component.ts index 4b21bf8..b1ff065 100644 --- a/nise-frontend/src/app/search/search.component.ts +++ b/nise-frontend/src/app/search/search.component.ts @@ -185,6 +185,22 @@ export class SearchComponent implements OnInit { }, {}); } + onSortingFieldChange(event: Event): void { + const selectElement = event.target as HTMLSelectElement; + if(!selectElement) { + return; + } + + if(this.sortingOrder === null) { + this.sortingOrder = { + field: 'user_id', + order: 'ASC' + }; + } + + this.sortingOrder.field = selectElement.value; + } + saveSettingsToLocalStorage(): void { const settings = this.serializeSettings(); localStorage.setItem('search_settings', JSON.stringify(settings)); diff --git a/nise-frontend/src/corelib/components/query/query.component.html b/nise-frontend/src/corelib/components/query/query.component.html index 33cfbb8..896000a 100644 --- a/nise-frontend/src/corelib/components/query/query.component.html +++ b/nise-frontend/src/corelib/components/query/query.component.html @@ -35,14 +35,14 @@ - + + diff --git a/nise-frontend/src/corelib/components/query/query.component.ts b/nise-frontend/src/corelib/components/query/query.component.ts index 293b373..d13d8e7 100644 --- a/nise-frontend/src/corelib/components/query/query.component.ts +++ b/nise-frontend/src/corelib/components/query/query.component.ts @@ -43,6 +43,16 @@ export class QueryComponent { predicate.operator = selectedField.validOperators[0]; } + onOperatorChange(predicate: Predicate, event: Event): void { + const selectElement = event.target as HTMLSelectElement; + const selectedOperatorType = selectElement.value; + const selectedOperator = predicate.field?.validOperators.find(operator => operator.operatorType === selectedOperatorType); + if (selectedOperator) { + predicate.operator = selectedOperator; + this.queryChanged.emit(); // Assuming `queryChanged` is an EventEmitter you've defined somewhere in your component + } + } + addPredicate(): void { this.query.predicates.push({ field: null, operator: null, value: null }); this.queryChanged.emit();