mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-13 10:03:49 -05:00
Fix: clear custom field query dropdown on close if invalid
This commit is contained in:
parent
169aa8c8bd
commit
e7685116ec
@ -93,6 +93,13 @@ describe('CustomFieldsQueryDropdownComponent', () => {
|
|||||||
expect(component.selectionModel.queries.length).toBe(1)
|
expect(component.selectionModel.queries.length).toBe(1)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('should clear on close if model is invalid', () => {
|
||||||
|
component.selectionModel.clear()
|
||||||
|
component.selectionModel.addExpression()
|
||||||
|
component.onOpenChange(false)
|
||||||
|
expect(component.selectionModel.isEmpty()).toBeTruthy()
|
||||||
|
})
|
||||||
|
|
||||||
it('should support reset the selection model', () => {
|
it('should support reset the selection model', () => {
|
||||||
component.selectionModel.addExpression()
|
component.selectionModel.addExpression()
|
||||||
component.reset()
|
component.reset()
|
||||||
|
@ -274,6 +274,8 @@ export class CustomFieldsQueryDropdownComponent extends LoadingComponentWithPerm
|
|||||||
this.fieldSelects.first?.focus()
|
this.fieldSelects.first?.focus()
|
||||||
}, 0)
|
}, 0)
|
||||||
}
|
}
|
||||||
|
} else if (!this.selectionModel.isValid()) {
|
||||||
|
this.selectionModel.clear()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user