Advanced Search: Don't clear value on field changed if the field type is keyword

This commit is contained in:
Konstantinos Triantafyllou 2023-07-21 16:33:29 +03:00
parent 73d6a9f32f
commit 8c2cb847e9
1 changed files with 3 additions and 1 deletions

View File

@ -188,8 +188,10 @@ export class AdvancedSearchFormComponent implements OnInit, OnDestroy, OnChanges
fieldIdsChanged(index: number, fieldId: string) { fieldIdsChanged(index: number, fieldId: string) {
this.selectedFields[index].name = this.fieldIdsMap[fieldId].name; this.selectedFields[index].name = this.fieldIdsMap[fieldId].name;
this.selectedFields[index].type = this.fieldIdsMap[fieldId].type; if(this.selectedFields[index].type !== 'keyword' || this.fieldIdsMap[fieldId].type !== 'keyword') {
this.selectedFields[index].value = ""; this.selectedFields[index].value = "";
}
this.selectedFields[index].type = this.fieldIdsMap[fieldId].type;
this.selectedFields[index].param = this.fieldIdsMap[fieldId].param; this.selectedFields[index].param = this.fieldIdsMap[fieldId].param;
if (this.fieldIdsMap[fieldId].type == "boolean") { if (this.fieldIdsMap[fieldId].type == "boolean") {
this.selectedFields[index].value = "true"; this.selectedFields[index].value = "true";