From ec65d76f0f39b0c859532f5433ada754d77fb8c6 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Mon, 25 Mar 2019 20:29:27 +0000 Subject: [PATCH] LP1811288 Allow Combobox to default to field id If a combobox field is provided without a label, use the id value as the display value. This helps avoid ugly JS errors while trying to format a null string. Signed-off-by: Bill Erickson --- Open-ILS/src/eg2/src/app/share/combobox/combobox.component.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 272a27189d..8b018d5e38 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 @@ -102,7 +102,8 @@ export class ComboboxComponent implements OnInit { this.defaultSelectionApplied = false; this.formatDisplayString = (result: ComboboxEntry) => { - return result.label.trim(); + const display = result.label || result.id; + return (display + '').trim(); }; } -- 2.11.0