mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-10-10 02:16:12 -05:00
Add initial query atom
This commit is contained in:
@@ -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 &&
|
||||
|
@@ -963,6 +963,7 @@ export class WorkflowEditDialogComponent
|
||||
model.queries = [expression]
|
||||
} catch (error) {
|
||||
model.clear(false)
|
||||
model.addInitialAtom()
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user