Fix unescaped URL for repo links (#16092)

Signed-off-by: AllForNothing <sshijun@vmware.com>
This commit is contained in:
孙世军 2021-12-09 10:15:21 +08:00 committed by GitHub
parent 5b7e684bc4
commit eb8db3215c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -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 {

View File

@ -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()) {