From: Bill Erickson Date: Mon, 25 Mar 2019 20:29:27 +0000 (+0000) Subject: LP1811288 Allow Combobox to default to field id X-Git-Url: http://git.equinoxoli.org/?p=evergreen-equinox.git;a=commitdiff_plain;h=a3731c9261f3ab89503fc0e9609cbc941b235703 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 --- 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 272a271..8b018d5 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(); }; }