From e759ca58c383f7696a9462134e22a071eacdb814 Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Tue, 7 Oct 2025 12:16:11 -0700 Subject: [PATCH] Add initial query atom --- .../custom-fields-query-dropdown.component.ts | 14 +++++++------- .../workflow-edit-dialog.component.ts | 1 + 2 files changed, 8 insertions(+), 7 deletions(-) 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() } }