From 492f4c22fc09819fdadb5690d0dc36bf868974e0 Mon Sep 17 00:00:00 2001 From: Andreas Awouters Date: Tue, 23 Jan 2024 08:17:03 +0100 Subject: [PATCH] 107873: Add redirect on 4xx --- .../table/process-overview-table.component.ts | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/app/process-page/overview/table/process-overview-table.component.ts b/src/app/process-page/overview/table/process-overview-table.component.ts index 395e16ef6e..dba4bfa585 100644 --- a/src/app/process-page/overview/table/process-overview-table.component.ts +++ b/src/app/process-page/overview/table/process-overview-table.component.ts @@ -14,6 +14,9 @@ import { map, switchMap } from 'rxjs/operators'; import { EPerson } from '../../../core/eperson/models/eperson.model'; import { PaginationService } from 'src/app/core/pagination/pagination.service'; import { FindListOptions } from '../../../core/data/find-list-options.model'; +import { redirectOn4xx } from '../../../core/shared/authorized.operators'; +import { Router } from '@angular/router'; +import { AuthService } from '../../../core/auth/auth.service'; @Component({ selector: 'ds-process-overview-table', @@ -61,7 +64,10 @@ export class ProcessOverviewTableComponent implements OnInit { protected processBulkDeleteService: ProcessBulkDeleteService, protected ePersonDataService: EPersonDataService, protected dsoNameService: DSONameService, - protected paginationService: PaginationService) { + protected paginationService: PaginationService, + protected router: Router, + protected auth: AuthService, + ) { } ngOnInit() { @@ -77,13 +83,12 @@ export class ProcessOverviewTableComponent implements OnInit { .pipe( map((paginationOptions: PaginationComponentOptions) => this.processOverviewService.getFindListOptions(paginationOptions)), - switchMap( - (findListOptions: FindListOptions) => { - return this.processOverviewService.getProcessesByProcessStatus( - this.processStatus, findListOptions, this.useAutoRefreshingSearchBy ? this.autoRefreshInterval : null); - } - )); - + switchMap((findListOptions: FindListOptions) => + this.processOverviewService.getProcessesByProcessStatus( + this.processStatus, findListOptions, this.useAutoRefreshingSearchBy ? this.autoRefreshInterval : null) + ), + redirectOn4xx(this.router, this.auth), + ); } /**