mirror of
https://github.com/goharbor/harbor.git
synced 2024-10-06 09:17:33 +02:00
Merge pull request #7936 from jwangyangls/redirectToError
Fix issue click members and logs tab in project detail page portal will redirect to projects list page when call API failed
This commit is contained in:
commit
0798e0d795
@ -31,6 +31,9 @@ export const errorHandler = function (error: any): string {
|
|||||||
if (error.error && error.error.message) {
|
if (error.error && error.error.message) {
|
||||||
return error.error.message;
|
return error.error.message;
|
||||||
}
|
}
|
||||||
|
if (error.message) {
|
||||||
|
return error.message;
|
||||||
|
}
|
||||||
|
|
||||||
if (!(error.statusCode || error.status)) {
|
if (!(error.statusCode || error.status)) {
|
||||||
// treat as string message
|
// treat as string message
|
||||||
|
@ -104,7 +104,6 @@ export class AuditLogComponent implements OnInit {
|
|||||||
this.auditLogs = response.body;
|
this.auditLogs = response.body;
|
||||||
},
|
},
|
||||||
error => {
|
error => {
|
||||||
this.router.navigate(['/harbor', 'projects']);
|
|
||||||
this.messageHandlerService.handleError(error);
|
this.messageHandlerService.handleError(error);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
@ -129,15 +129,16 @@ export class MemberComponent implements OnInit, OnDestroy {
|
|||||||
this.selectedRow = [];
|
this.selectedRow = [];
|
||||||
this.memberService
|
this.memberService
|
||||||
.listMembers(projectId, username).pipe(
|
.listMembers(projectId, username).pipe(
|
||||||
finalize(() => this.loading = false))
|
finalize(() => {
|
||||||
|
this.loading = false;
|
||||||
|
let hnd = setInterval(() => this.ref.markForCheck(), 100);
|
||||||
|
setTimeout(() => clearInterval(hnd), 1000);
|
||||||
|
}))
|
||||||
.subscribe(
|
.subscribe(
|
||||||
response => {
|
response => {
|
||||||
this.members = response;
|
this.members = response;
|
||||||
let hnd = setInterval(() => this.ref.markForCheck(), 100);
|
|
||||||
setTimeout(() => clearInterval(hnd), 1000);
|
|
||||||
},
|
},
|
||||||
error => {
|
error => {
|
||||||
this.router.navigate(["/harbor", "projects"]);
|
|
||||||
this.messageHandlerService.handleError(error);
|
this.messageHandlerService.handleError(error);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user