diff --git a/src/portal/src/app/base/project/repository/repository-gridview.component.ts b/src/portal/src/app/base/project/repository/repository-gridview.component.ts index 7ffd3f362..7bcaa4c10 100644 --- a/src/portal/src/app/base/project/repository/repository-gridview.component.ts +++ b/src/portal/src/app/base/project/repository/repository-gridview.component.ts @@ -125,8 +125,8 @@ export class RepositoryGridviewComponent implements OnChanges, OnInit, OnDestroy return this.systemInfo && this.systemInfo.has_ca_root; } - getLink(repoEvt: NewRepository): string { - return `/harbor/projects/${repoEvt.project_id}/repositories/${repoEvt.name.substr(this.projectName.length + 1)}`; + getLink(repoEvt: NewRepository) { + return ['/harbor/projects', repoEvt.project_id, 'repositories', repoEvt.name.substr(this.projectName.length + 1)]; } ngOnChanges(changes: SimpleChanges): void { diff --git a/src/portal/src/app/shared/components/list-repository-ro/list-repository-ro.component.ts b/src/portal/src/app/shared/components/list-repository-ro/list-repository-ro.component.ts index 07c114b21..742beafef 100644 --- a/src/portal/src/app/shared/components/list-repository-ro/list-repository-ro.component.ts +++ b/src/portal/src/app/shared/components/list-repository-ro/list-repository-ro.component.ts @@ -36,7 +36,7 @@ export class ListRepositoryROComponent { getLink(projectId: number, repoName: string) { let projectName = repoName.split('/')[0]; let repositorieName = projectName ? repoName.substr(projectName.length + 1) : repoName; - return `/harbor/projects/${projectId}/repositories/${repositorieName}`; + return ['/harbor/projects', projectId, 'repositories', repositorieName]; } getQueryParams() { if (this.sessionService.getCurrentUser()) {