Commit de4793c5 authored by Yogi_Wang's avatar Yogi_Wang
Browse files

[fix] [replication] Success rate should be displayed as 0 when status is inprogress


1.[replication] sccess rate should be displayed as 0 when status is inprogress
2.[repository] fix get repo name error when the repo contains the project name field
Signed-off-by: default avatarYogi_Wang <yawang@vmware.com>
parent 47e731d8
......@@ -122,7 +122,7 @@ export class RepositoryGridviewComponent implements OnChanges, OnInit, OnDestroy
}
goIntoRepo(repoEvt: NewRepository): void {
let linkUrl = ['harbor', 'projects', repoEvt.project_id, 'repositories', repoEvt.name.split(`${this.projectName}/`)[1]];
let linkUrl = ['harbor', 'projects', repoEvt.project_id, 'repositories', repoEvt.name.substr(this.projectName.length + 1)];
this.router.navigate(linkUrl);
}
......@@ -223,7 +223,7 @@ export class RepositoryGridviewComponent implements OnChanges, OnInit, OnDestroy
operMessage.name = 'OPERATION.DELETE_REPO';
operMessage.data.id = repo.id;
operMessage.state = OperationState.progressing;
repo.name = repo.name.split(`${this.projectName}/`)[1];
repo.name = repo.name.substr(this.projectName.length + 1);
operMessage.data.name = repo.name;
this.operationService.publishInfo(operMessage);
......
......@@ -69,7 +69,7 @@ export class ListRepositoryROComponent implements OnInit, OnDestroy {
public gotoLink(projectId: number, repoName: string): void {
this.searchTrigger.closeSearch(true);
let projectName = repoName.split('/')[0];
let repositorieName = projectName ? repoName.split(`${projectName}/`)[1] : repoName;
let repositorieName = projectName ? repoName.substr(projectName.length + 1) : repoName;
let linkUrl = ['harbor', 'projects', projectId, 'repositories', repositorieName ];
this.router.navigate(linkUrl);
}
......
......@@ -77,7 +77,7 @@
<clr-dg-cell>{{j.start_time | date: 'short'}}</clr-dg-cell>
<clr-dg-cell>{{getDuration(j)}}</clr-dg-cell>
<clr-dg-cell>
{{(j.total > 0 ? j.succeed / j.total : 1)| percent }}
{{(j.status === 'InProgress'? (j.total > 0 ? j.succeed / j.total : 0): j.total > 0 ? j.succeed / j.total : 1)| percent }}
</clr-dg-cell>
<clr-dg-cell>{{j.total}}</clr-dg-cell>
</clr-dg-row>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment