diff --git a/src/frontend/app/contact/autocomplete/contact-autocomplete.component.ts b/src/frontend/app/contact/autocomplete/contact-autocomplete.component.ts index 5c8bcda5215ea841bf3dc5eaa9cf092f6a301ec2..6eedda338c907a0d8c3f25b1248759a35346b937 100755 --- a/src/frontend/app/contact/autocomplete/contact-autocomplete.component.ts +++ b/src/frontend/app/contact/autocomplete/contact-autocomplete.component.ts @@ -170,7 +170,9 @@ export class ContactAutocompleteComponent implements OnInit { } selectOpt(ev: any) { - this.criteriaSearchService.updateListsPropertiesCriteria({}); + if (!this.functions.empty(this.controlAutocomplete.value.find((item: any) => this.functions.empty(item.id)))) { + this.controlAutocomplete.setValue(this.controlAutocomplete.value.filter((item: any) => !this.functions.empty(item.id))); + } this.setFormValue(ev.option.value); this.afterSelected.emit(ev.option.value); this.myControl.setValue(''); diff --git a/src/frontend/app/header/header-right.component.ts b/src/frontend/app/header/header-right.component.ts index 6c1311489948a0ba72c54e5805803d3f705457a5..50238d6f84d2219bc4997aac2031a0184c3954e0 100644 --- a/src/frontend/app/header/header-right.component.ts +++ b/src/frontend/app/header/header-right.component.ts @@ -38,13 +38,13 @@ export class HeaderRightComponent implements OnInit { icon: 'fas fa-inbox fa-2x', }, { - id: 'recipient', + id: 'recipients', label: this.translate.instant('lang.recipient'), desc: this.translate.instant('lang.searchByRecipient'), icon: 'fas fa-user fa-2x', }, { - id: 'sender', + id: 'senders', label: this.translate.instant('lang.sender'), desc: this.translate.instant('lang.searchBySender'), icon: 'fas fa-address-book fa-2x', diff --git a/src/frontend/app/search/criteria-tool/criteria-tool.component.ts b/src/frontend/app/search/criteria-tool/criteria-tool.component.ts index db778dd61ab9ef4fbc25a0000edd61ecda418d91..bb29873d5108fd62757431f903c24d16aee51fe7 100644 --- a/src/frontend/app/search/criteria-tool/criteria-tool.component.ts +++ b/src/frontend/app/search/criteria-tool/criteria-tool.component.ts @@ -136,8 +136,8 @@ export class CriteriaToolComponent implements OnInit { this.addCriteria(element, false); } }); - if (['sender', 'recipient'].indexOf(this.currentParam?.target) > -1) { - if (this.currentParam.target === 'sender') { + if (['senders', 'recipients'].indexOf(this.currentParam?.target) > -1) { + if (this.currentParam.target === 'senders') { this.criteriaSearchService.updateListsPropertiesCriteria({senders: {type: 'autocomplete', values: [this.currentParam.value]}}); } else { this.criteriaSearchService.updateListsPropertiesCriteria({recipients: {type: 'autocomplete', values: [this.currentParam.value]}}); @@ -267,6 +267,17 @@ export class CriteriaToolComponent implements OnInit { } } }); + if (!this.functions.empty(this.currentParam?.target)) { + const contactArray: any = this.appContactAutocomplete.toArray().find((item: any) => item.id === this.currentParam.target); + if (!this.functions.empty(contactArray?.myControl) && !this.functions.empty(objCriteria[this.currentParam.target])) { + objCriteria[this.currentParam.target]['values'] = contactArray.myControl.value; + if (this.currentParam.target === 'senders') { + this.criteriaSearchService.updateListsPropertiesCriteria({senders: {type: 'autocomplete', values: [contactArray.myControl.value]}}); + } else { + this.criteriaSearchService.updateListsPropertiesCriteria({recipients: {type: 'autocomplete', values: [contactArray.myControl.value]}}); + } + } + } this.searchUrlGenerated.emit(objCriteria); } diff --git a/src/frontend/app/search/result-list/search-result-list.component.ts b/src/frontend/app/search/result-list/search-result-list.component.ts index 2b9650fa568b5ff8a8c3979b26a4c054b96cd1df..7070fe48a33342406bb3a8f343c1e8c384411ab9 100644 --- a/src/frontend/app/search/result-list/search-result-list.component.ts +++ b/src/frontend/app/search/result-list/search-result-list.component.ts @@ -223,8 +223,6 @@ export class SearchResultListComponent implements OnInit, OnDestroy { this.isLoadingResults = false; this.hideFilter = true; } - - this.loading = false; this.dataResult.emit([]); } diff --git a/src/lang/lang-en.json b/src/lang/lang-en.json index 8ba8800e67ff9fb1c4d36e1e11c0f8908978e7b6..8d7d92a2f9825784de0a1f9aec8b82eb62e8e3fb 100644 --- a/src/lang/lang-en.json +++ b/src/lang/lang-en.json @@ -2598,5 +2598,9 @@ "canGoToNextResDesc": "Activating this option saves this choice in your session", "sortBy": "Sort by", "showInformationsBlock": "Show information block", - "hideInformationsBlock": "Hide information block" + "hideInformationsBlock": "Hide information block", + "quickSearchTargets": "Quick search target", + "defaultQuickSearch": "Subject, Barcode, GED Number", + "searchBySender": "Search by sender", + "searchByRecipient": "Search by recipient" }