From f9db6254d650e082841da8e82b5dd0c40a00be0b Mon Sep 17 00:00:00 2001 From: Nevio Di Gennaro Date: Tue, 15 Oct 2024 16:06:39 +0200 Subject: [PATCH] add a Observable that triggers a refresh when called --- .../check-in-history-dialog.component.ts | 1 + .../keyresult-detail/keyresult-detail.component.ts | 5 ++++- frontend/src/app/services/refresh-data.service.ts | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/frontend/src/app/components/check-in-history-dialog/check-in-history-dialog.component.ts b/frontend/src/app/components/check-in-history-dialog/check-in-history-dialog.component.ts index 4241ad6426..7b8a93d8fe 100644 --- a/frontend/src/app/components/check-in-history-dialog/check-in-history-dialog.component.ts +++ b/frontend/src/app/components/check-in-history-dialog/check-in-history-dialog.component.ts @@ -48,6 +48,7 @@ export class CheckInHistoryDialogComponent implements OnInit { }); dialogRef.afterClosed().subscribe(() => { this.loadCheckInHistory(); + this.refreshDataService.reloadKeyResultSubject.next(); this.refreshDataService.markDataRefresh(); }); } diff --git a/frontend/src/app/components/keyresult-detail/keyresult-detail.component.ts b/frontend/src/app/components/keyresult-detail/keyresult-detail.component.ts index d31fae0dfb..8b9ede3dd7 100644 --- a/frontend/src/app/components/keyresult-detail/keyresult-detail.component.ts +++ b/frontend/src/app/components/keyresult-detail/keyresult-detail.component.ts @@ -41,6 +41,9 @@ export class KeyresultDetailComponent implements OnInit { ngOnInit(): void { this.keyResultId = this.getIdFromParams(); this.loadKeyResult(this.keyResultId); + this.refreshDataService.reloadKeyResultSubject.subscribe(() => { + this.loadKeyResult(this.keyResultId); + }); } private getIdFromParams(): number { @@ -181,7 +184,7 @@ export class KeyresultDetailComponent implements OnInit { }, }); dialogRef.afterClosed().subscribe(() => { - this.loadKeyResult(this.keyResult$.getValue().id); + this.refreshDataService.reloadKeyResultSubject.next(); this.refreshDataService.markDataRefresh(); }); } diff --git a/frontend/src/app/services/refresh-data.service.ts b/frontend/src/app/services/refresh-data.service.ts index fe5a7f5f7a..3c1a1fb321 100644 --- a/frontend/src/app/services/refresh-data.service.ts +++ b/frontend/src/app/services/refresh-data.service.ts @@ -7,6 +7,7 @@ import { DEFAULT_HEADER_HEIGHT_PX } from '../shared/constantLibary'; }) export class RefreshDataService { public reloadOverviewSubject: Subject = new Subject(); + public reloadKeyResultSubject: Subject = new Subject(); public quarterFilterReady: Subject = new Subject(); public teamFilterReady: Subject = new Subject();