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(
|
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 &&
|
||||||
|
@@ -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()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user