From 47ff5359de4d44e0117ec3bce342b8815c0b4159 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Wed, 5 Aug 2020 10:43:05 -0400 Subject: [PATCH] LP1869898 Ang cat copy table responds to broadcasts Angular staff catalog copy table responds to broadcasts of modified holdings. When holdings for the current record have changed, the table data is refreshed. Signed-off-by: Bill Erickson Signed-off-by: Galen Charlton --- .../src/eg2/src/app/staff/catalog/record/copies.component.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Open-ILS/src/eg2/src/app/staff/catalog/record/copies.component.ts b/Open-ILS/src/eg2/src/app/staff/catalog/record/copies.component.ts index bfc2b03107..9e288ee61d 100644 --- a/Open-ILS/src/eg2/src/app/staff/catalog/record/copies.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/catalog/record/copies.component.ts @@ -7,6 +7,7 @@ import {Pager} from '@eg/share/util/pager'; import {OrgService} from '@eg/core/org.service'; import {GridDataSource, GridColumn, GridCellTextGenerator} from '@eg/share/grid/grid'; import {GridComponent} from '@eg/share/grid/grid.component'; +import {BroadcastService} from '@eg/share/util/broadcast.service'; @Component({ selector: 'eg-catalog-copies', @@ -35,6 +36,7 @@ export class CopiesComponent implements OnInit { private net: NetService, private org: OrgService, private staffCat: StaffCatalogService, + private broadcaster: BroadcastService ) { this.gridDataSource = new GridDataSource(); } @@ -61,10 +63,12 @@ export class CopiesComponent implements OnInit { holdable: row => this.copyContext.holdable(row), barcode: row => row.barcode }; - } - collectData() { - if (!this.recId) { return; } + this.broadcaster.listen('eg.holdings.update').subscribe(data => { + if (data && data.records && data.records.includes(this.recId)) { + this.copyGrid.reload(); + } + }); } orgName(orgId: number): string { -- 2.11.0