mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-29 13:45:20 +01:00
Revert changes to tags route. (#2179)
This commit is contained in:
parent
d03657e1d0
commit
62f9f842d4
@ -94,7 +94,6 @@ const harborRoutes: Routes = [
|
|||||||
{
|
{
|
||||||
path: 'tags/:id/:repo',
|
path: 'tags/:id/:repo',
|
||||||
component: TagRepositoryComponent,
|
component: TagRepositoryComponent,
|
||||||
canActivate: [MemberGuard],
|
|
||||||
resolve: {
|
resolve: {
|
||||||
projectResolver: ProjectRoutingResolver
|
projectResolver: ProjectRoutingResolver
|
||||||
}
|
}
|
||||||
|
@ -33,9 +33,9 @@ export class MemberGuard implements CanActivate, CanActivateChild {
|
|||||||
let projectId = route.params['id'];
|
let projectId = route.params['id'];
|
||||||
this.sessionService.setProjectMembers([]);
|
this.sessionService.setProjectMembers([]);
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
if(!this.sessionService.getCurrentUser()) {
|
let projectId = route.params['id'];
|
||||||
return resolve(true);
|
this.sessionService.setProjectMembers([]);
|
||||||
}
|
return new Promise((resolve, reject) => {
|
||||||
this.projectService.checkProjectMember(projectId)
|
this.projectService.checkProjectMember(projectId)
|
||||||
.subscribe(
|
.subscribe(
|
||||||
res=>{
|
res=>{
|
||||||
@ -47,13 +47,8 @@ export class MemberGuard implements CanActivate, CanActivateChild {
|
|||||||
if(state.url.endsWith('repository')) {
|
if(state.url.endsWith('repository')) {
|
||||||
return resolve(true);
|
return resolve(true);
|
||||||
}
|
}
|
||||||
this.projectService.getProject(projectId).subscribe(project=>{
|
|
||||||
if(project.public === 1) {
|
|
||||||
return resolve(true);
|
|
||||||
} else {
|
|
||||||
this.router.navigate([CommonRoutes.HARBOR_DEFAULT]);
|
this.router.navigate([CommonRoutes.HARBOR_DEFAULT]);
|
||||||
return resolve(false);
|
return resolve(false);
|
||||||
}
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user