From 20d4f9d5d1332601981322b47f583f51ea03aaeb Mon Sep 17 00:00:00 2001 From: Mike Rylander Date: Wed, 2 Feb 2022 15:13:24 -0500 Subject: [PATCH] LP#1839341: Fix row duplication and linked field lookup The grid needed to be refreshed after a filter change to address duplicated rows noticed in testing. In addition, for settings with typed linked objects, we need to look up the labeling column via the selector attribute, or use the pkey, rather than assuming a "name" column will exist. There is an additional issue with setting typed linked objects in the Edit dialog, but this is addressed in an enhancement to the core widgets provided as part of the Simple Reporter work in LP#1945836. Signed-off-by: Mike Rylander Signed-off-by: Bill Erickson Signed-off-by: Terran McCanna Signed-off-by: Jane Sandberg --- .../admin/local/org-unit-settings/org-unit-settings.component.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/eg2/src/app/staff/admin/local/org-unit-settings/org-unit-settings.component.ts b/Open-ILS/src/eg2/src/app/staff/admin/local/org-unit-settings/org-unit-settings.component.ts index 353d88c682..788755dbaa 100644 --- a/Open-ILS/src/eg2/src/app/staff/admin/local/org-unit-settings/org-unit-settings.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/admin/local/org-unit-settings/org-unit-settings.component.ts @@ -72,6 +72,7 @@ export class OrgUnitSettingsComponent implements OnInit { private toast: ToastService, private locale: LocaleService, private net: NetService, + private idl: IdlService ) { this.gridDataSource = new GridDataSource(); this.refreshSettings = true; @@ -155,7 +156,8 @@ export class OrgUnitSettingsComponent implements OnInit { fetchLinkedField(fmClass, id, val) { return new Promise((resolve, reject) => { return this.pcrud.retrieve(fmClass, id).subscribe(linkedField => { - val = linkedField.name(); + const fname = this.idl.getClassSelector(fmClass) || this.idl.classes[fmClass].pkey || 'id'; + val = this.idl.toHash(linkedField)[val]; resolve(val); }); }); @@ -365,6 +367,7 @@ export class OrgUnitSettingsComponent implements OnInit { this.mergeSettingValues().then( res => this.filterCoust() ); + this.refreshSettings = true; } if (this.refreshSettings) { -- 2.11.0