107873: Add redirect on 4xx

This commit is contained in:
Andreas Awouters
2024-01-23 08:17:03 +01:00
parent 24ece9f33a
commit 492f4c22fc

View File

@@ -14,6 +14,9 @@ import { map, switchMap } from 'rxjs/operators';
import { EPerson } from '../../../core/eperson/models/eperson.model'; import { EPerson } from '../../../core/eperson/models/eperson.model';
import { PaginationService } from 'src/app/core/pagination/pagination.service'; import { PaginationService } from 'src/app/core/pagination/pagination.service';
import { FindListOptions } from '../../../core/data/find-list-options.model'; 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({ @Component({
selector: 'ds-process-overview-table', selector: 'ds-process-overview-table',
@@ -61,7 +64,10 @@ export class ProcessOverviewTableComponent implements OnInit {
protected processBulkDeleteService: ProcessBulkDeleteService, protected processBulkDeleteService: ProcessBulkDeleteService,
protected ePersonDataService: EPersonDataService, protected ePersonDataService: EPersonDataService,
protected dsoNameService: DSONameService, protected dsoNameService: DSONameService,
protected paginationService: PaginationService) { protected paginationService: PaginationService,
protected router: Router,
protected auth: AuthService,
) {
} }
ngOnInit() { ngOnInit() {
@@ -77,13 +83,12 @@ export class ProcessOverviewTableComponent implements OnInit {
.pipe( .pipe(
map((paginationOptions: PaginationComponentOptions) => map((paginationOptions: PaginationComponentOptions) =>
this.processOverviewService.getFindListOptions(paginationOptions)), this.processOverviewService.getFindListOptions(paginationOptions)),
switchMap( switchMap((findListOptions: FindListOptions) =>
(findListOptions: FindListOptions) => { this.processOverviewService.getProcessesByProcessStatus(
return this.processOverviewService.getProcessesByProcessStatus( this.processStatus, findListOptions, this.useAutoRefreshingSearchBy ? this.autoRefreshInterval : null)
this.processStatus, findListOptions, this.useAutoRefreshingSearchBy ? this.autoRefreshInterval : null); ),
} redirectOn4xx(this.router, this.auth),
)); );
} }
/** /**