Skip to content

Commit

Permalink
Fix issue click members and logs tab in project detail page portal wi…
Browse files Browse the repository at this point in the history
…ll redirect to projects list page when call API failed

Signed-off-by: Yogi_Wang <yawang@vmware.com>
  • Loading branch information
Yogi_Wang authored and sshijun committed Jun 26, 2019
1 parent d38ca3b commit c5bdcec
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions src/portal/lib/src/shared/shared.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ export const errorHandler = function (error: any): string {
if (error.error && error.error.message) {
return error.error.message;
}
if (error.message) {
return error.message;
}

if (!(error.statusCode || error.status)) {
// treat as string message
Expand Down
1 change: 0 additions & 1 deletion src/portal/src/app/log/audit-log.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ export class AuditLogComponent implements OnInit {
this.auditLogs = response.body;
},
error => {
this.router.navigate(['/harbor', 'projects']);
this.messageHandlerService.handleError(error);
}
);
Expand Down
9 changes: 5 additions & 4 deletions src/portal/src/app/project/member/member.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,16 @@ export class MemberComponent implements OnInit, OnDestroy {
this.selectedRow = [];
this.memberService
.listMembers(projectId, username).pipe(
finalize(() => this.loading = false))
finalize(() => {
this.loading = false;
let hnd = setInterval(() => this.ref.markForCheck(), 100);
setTimeout(() => clearInterval(hnd), 1000);
}))
.subscribe(
response => {
this.members = response;
let hnd = setInterval(() => this.ref.markForCheck(), 100);
setTimeout(() => clearInterval(hnd), 1000);
},
error => {
this.router.navigate(["/harbor", "projects"]);
this.messageHandlerService.handleError(error);
});
}
Expand Down

0 comments on commit c5bdcec

Please sign in to comment.