From f7a12e28b71ef069288f12d47cdd5d0e91d2a5b7 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Mon, 19 Apr 2021 12:44:01 -0400 Subject: [PATCH] LP1904036 Grid flat data service/support Signed-off-by: Bill Erickson --- Open-ILS/src/eg2/src/app/core/format.service.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/eg2/src/app/core/format.service.ts b/Open-ILS/src/eg2/src/app/core/format.service.ts index 9622bd0681..57797579bc 100644 --- a/Open-ILS/src/eg2/src/app/core/format.service.ts +++ b/Open-ILS/src/eg2/src/app/core/format.service.ts @@ -102,7 +102,16 @@ export class FormatService { } } else { - return value + ''; + + // We have an object with no display selector + // Display its pkey instead to avoid showing [object Object] + + const pkey = this.idl.classes[params.idlClass].pkey; + if (pkey && typeof value[pkey] === 'function') { + return value[pkey](); + } + + return ''; } case 'org_unit': -- 2.11.0