From: Bill Erickson Date: Wed, 5 Aug 2020 14:43:05 +0000 (-0400) Subject: LP1869898 Ang cat copy table responds to broadcasts X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=47ff5359de4d44e0117ec3bce342b8815c0b4159;p=working%2FEvergreen.git 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 --- 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 {