From def86272dc828fe449475d2c149cd69405c06224 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Fri, 4 Dec 2020 15:39:33 -0500 Subject: [PATCH] LP1929741 Combobox idl auto query filter addition Signed-off-by: Bill Erickson Signed-off-by: Galen Charlton Signed-off-by: Jane Sandberg --- Open-ILS/src/eg2/src/app/share/combobox/combobox.component.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Open-ILS/src/eg2/src/app/share/combobox/combobox.component.ts b/Open-ILS/src/eg2/src/app/share/combobox/combobox.component.ts index a365c7eb72..dd4639556a 100644 --- a/Open-ILS/src/eg2/src/app/share/combobox/combobox.component.ts +++ b/Open-ILS/src/eg2/src/app/share/combobox/combobox.component.ts @@ -107,6 +107,10 @@ export class ComboboxComponent implements ControlValueAccessor, OnInit, AfterVie @Input() idlBaseQuery: any = null; @Input() startIdFiresOnChange: boolean; + // This will be appended to the async data retrieval query + // when fetching objects by idlClass. + @Input() idlQueryAnd: {[field: string]: any}; + // Allow the selected entry ID to be passed via the template // This does NOT not emit onChange events. @Input() set selectedId(id: any) { @@ -263,6 +267,9 @@ export class ComboboxComponent implements ControlValueAccessor, OnInit, AfterVie } const extra_args = { order_by : {} }; args[field] = {'ilike': `%${term}%`}; // could -or search on label + if (this.idlQueryAnd) { + Object.assign(args, this.idlQueryAnd); + } extra_args['order_by'][this.idlClass] = field; extra_args['limit'] = 100; if (this.idlIncludeLibraryInLabel) { -- 2.11.0