From 9e69671b29ba913ec9d1c414c06034dc8f8de9d4 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Fri, 22 Mar 2019 14:43:34 -0700 Subject: [PATCH] LP1811288 Admin grids preload combobox values Adds a global option to the fieldmapper editor component to preload linked selector values by default. Update the basic admin pages to use the new flag to preload comboboxes. Signed-off-by: Bill Erickson Signed-off-by: Jane Sandberg Signed-off-by: Dan Wells --- .../src/eg2/src/app/share/fm-editor/fm-editor.component.ts | 11 +++++++++++ .../src/app/staff/share/admin-page/admin-page.component.html | 3 ++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor.component.ts b/Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor.component.ts index ec8d0b1968..3e41fa221d 100644 --- a/Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor.component.ts +++ b/Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor.component.ts @@ -117,6 +117,10 @@ export class FmRecordEditorComponent // IDL record display label. Defaults to the IDL label. @Input() recordLabel: string; + // When true at the component level, pre-fetch the combobox data + // for all combobox fields. See also FmFieldOptions. + @Input() preloadLinkedValues: boolean; + // Emit the modified object when the save action completes. @Output() onSave$ = new EventEmitter(); @@ -368,6 +372,13 @@ export class FmRecordEditorComponent const fieldOptions = this.fieldOptions[field.name] || {}; + // globally preloading unless a field-specific value is set. + if (this.preloadLinkedValues) { + if (!('preloadLinkedValues' in fieldOptions)) { + fieldOptions.preloadLinkedValues = true; + } + } + const selector = fieldOptions.linkedSearchField || this.getClassSelector(field.class); diff --git a/Open-ILS/src/eg2/src/app/staff/share/admin-page/admin-page.component.html b/Open-ILS/src/eg2/src/app/staff/share/admin-page/admin-page.component.html index 95819f0a0a..7a47a3d424 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/admin-page/admin-page.component.html +++ b/Open-ILS/src/eg2/src/app/staff/share/admin-page/admin-page.component.html @@ -62,7 +62,8 @@ - + -- 2.11.0