mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-04 13:22:16 +00:00
feat: rehauled console (#3525)
* new console * move npm ci to angular build * rel path for assets * local grpc copy * login policy, rm clear views, features rel path * lock Co-authored-by: Livio Amstutz <[email protected]>
This commit is contained in:
co-authored by
Livio Amstutz
parent
00f7dbe875
commit
08ae39ae19
@@ -0,0 +1,65 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { ActivatedRoute, Params, Router } from '@angular/router';
|
||||
import { BehaviorSubject, take } from 'rxjs';
|
||||
import { ProjectType } from 'src/app/modules/project-members/project-members-datasource';
|
||||
import { Breadcrumb, BreadcrumbService, BreadcrumbType } from 'src/app/services/breadcrumb.service';
|
||||
import { ManagementService } from 'src/app/services/mgmt.service';
|
||||
|
||||
@Component({
|
||||
selector: 'cnsl-projects',
|
||||
templateUrl: './projects.component.html',
|
||||
styleUrls: ['./projects.component.scss'],
|
||||
})
|
||||
export class ProjectsComponent {
|
||||
public zitadelProjectId: string = '';
|
||||
public projectType$: BehaviorSubject<any> = new BehaviorSubject(ProjectType.PROJECTTYPE_OWNED);
|
||||
public ProjectType: any = ProjectType;
|
||||
public grid: boolean = true;
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private activatedRoute: ActivatedRoute,
|
||||
public mgmtService: ManagementService,
|
||||
breadcrumbService: BreadcrumbService,
|
||||
) {
|
||||
this.activatedRoute.queryParams.pipe(take(1)).subscribe((params: Params) => {
|
||||
const type = params.type;
|
||||
if (type && type === 'owned') {
|
||||
this.setType(ProjectType.PROJECTTYPE_OWNED);
|
||||
} else if (type && type === 'granted') {
|
||||
this.setType(ProjectType.PROJECTTYPE_GRANTED);
|
||||
}
|
||||
});
|
||||
mgmtService.getIAM().then((iam) => {
|
||||
this.zitadelProjectId = iam.iamProjectId;
|
||||
});
|
||||
|
||||
const iambread = new Breadcrumb({
|
||||
type: BreadcrumbType.IAM,
|
||||
name: 'IAM',
|
||||
routerLink: ['/system'],
|
||||
});
|
||||
const bread: Breadcrumb = {
|
||||
type: BreadcrumbType.ORG,
|
||||
routerLink: ['/org'],
|
||||
};
|
||||
breadcrumbService.setBreadcrumb([iambread, bread]);
|
||||
}
|
||||
|
||||
public addProject(): void {
|
||||
this.router.navigate(['/projects', 'create']);
|
||||
}
|
||||
|
||||
public setType(type: ProjectType) {
|
||||
this.projectType$.next(type);
|
||||
this.router.navigate([], {
|
||||
relativeTo: this.route,
|
||||
queryParams: {
|
||||
type:
|
||||
type === ProjectType.PROJECTTYPE_OWNED ? 'owned' : type === ProjectType.PROJECTTYPE_GRANTED ? 'granted' : 'owned',
|
||||
},
|
||||
queryParamsHandling: 'merge',
|
||||
skipLocationChange: false,
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user