From a3731c9261f3ab89503fc0e9609cbc941b235703 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 Signed-off-by: Dan Wells --- 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.43.2