diff --git a/src-ui/src/app/components/common/custom-fields-query-dropdown/custom-fields-query-dropdown.component.ts b/src-ui/src/app/components/common/custom-fields-query-dropdown/custom-fields-query-dropdown.component.ts index 9b58114f7..fc4e8ef19 100644 --- a/src-ui/src/app/components/common/custom-fields-query-dropdown/custom-fields-query-dropdown.component.ts +++ b/src-ui/src/app/components/common/custom-fields-query-dropdown/custom-fields-query-dropdown.component.ts @@ -120,6 +120,12 @@ export class CustomFieldQueriesModel { }) } + addInitialAtom() { + this.addAtom( + new CustomFieldQueryAtom([null, CustomFieldQueryOperator.Exists, 'true']) + ) + } + private findElement( queryElement: CustomFieldQueryElement, elements: any[] @@ -261,13 +267,7 @@ export class CustomFieldsQueryDropdownComponent extends LoadingComponentWithPerm public onOpenChange(open: boolean) { if (open) { if (this.selectionModel.queries.length === 0) { - this.selectionModel.addAtom( - new CustomFieldQueryAtom([ - null, - CustomFieldQueryOperator.Exists, - 'true', - ]) - ) + this.selectionModel.addInitialAtom() } if ( this.selectionModel.queries.length === 1 && diff --git a/src-ui/src/app/components/common/edit-dialog/workflow-edit-dialog/workflow-edit-dialog.component.ts b/src-ui/src/app/components/common/edit-dialog/workflow-edit-dialog/workflow-edit-dialog.component.ts index 33b8fb10b..ee5d57cb7 100644 --- a/src-ui/src/app/components/common/edit-dialog/workflow-edit-dialog/workflow-edit-dialog.component.ts +++ b/src-ui/src/app/components/common/edit-dialog/workflow-edit-dialog/workflow-edit-dialog.component.ts @@ -963,6 +963,7 @@ export class WorkflowEditDialogComponent model.queries = [expression] } catch (error) { model.clear(false) + model.addInitialAtom() } }