Add initial query atom

This commit is contained in:
shamoon
2025-10-07 12:16:11 -07:00
parent 88fcc5f339
commit e759ca58c3
2 changed files with 8 additions and 7 deletions

View File

@@ -120,6 +120,12 @@ export class CustomFieldQueriesModel {
}) })
} }
addInitialAtom() {
this.addAtom(
new CustomFieldQueryAtom([null, CustomFieldQueryOperator.Exists, 'true'])
)
}
private findElement( private findElement(
queryElement: CustomFieldQueryElement, queryElement: CustomFieldQueryElement,
elements: any[] elements: any[]
@@ -261,13 +267,7 @@ export class CustomFieldsQueryDropdownComponent extends LoadingComponentWithPerm
public onOpenChange(open: boolean) { public onOpenChange(open: boolean) {
if (open) { if (open) {
if (this.selectionModel.queries.length === 0) { if (this.selectionModel.queries.length === 0) {
this.selectionModel.addAtom( this.selectionModel.addInitialAtom()
new CustomFieldQueryAtom([
null,
CustomFieldQueryOperator.Exists,
'true',
])
)
} }
if ( if (
this.selectionModel.queries.length === 1 && this.selectionModel.queries.length === 1 &&

View File

@@ -963,6 +963,7 @@ export class WorkflowEditDialogComponent
model.queries = [expression] model.queries = [expression]
} catch (error) { } catch (error) {
model.clear(false) model.clear(false)
model.addInitialAtom()
} }
} }