From 0f86a4defe6f4b1ace87b499a993bca4fc5002f8 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 Signed-off-by: Jane Sandberg Signed-off-by: Galen Charlton --- 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 b73209b2d7..b58f5516e6 100644 --- a/Open-ILS/src/eg2/src/app/core/format.service.ts +++ b/Open-ILS/src/eg2/src/app/core/format.service.ts @@ -107,7 +107,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