mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-17 02:55:11 +00:00
fix(console): project member grants, user grants (#329)
* checkbox color * project grant preview * project grante expandable row * add grant detail component * proto regen * project grant members shared module * fix project grant members dialog * fix create dialog * lint * add avatar colors, meta component styling * light theme * dl report * styles * move grants out of user context, grant detail * i18n grant pipe * lint * user grants * clear expandable view project grants * fix project member routing * fix granted members routing * fix group label * rename project grant * disable zitadel grant members * fix routing user grant creation * rest member writes * ignore case searches * forkjoin observables for project search * fix grant creation with users * fix projectid reference * formfield table style, user grant dynamic load * show key if no displayvalue is set * Delete report.20200630.163913.44081.0.001.json Co-authored-by: Silvan <[email protected]>
This commit is contained in:
@@ -3,7 +3,14 @@ import { Component, OnDestroy } from '@angular/core';
|
||||
import { ActivatedRoute, Params } from '@angular/router';
|
||||
import { Subscription } from 'rxjs';
|
||||
import { Org } from 'src/app/proto/generated/auth_pb';
|
||||
import { ProjectGrantView, ProjectRole, ProjectView, UserGrant } from 'src/app/proto/generated/management_pb';
|
||||
import {
|
||||
ProjectGrantView,
|
||||
ProjectRole,
|
||||
ProjectView,
|
||||
User,
|
||||
UserGrant,
|
||||
UserGrantSearchKey,
|
||||
} from 'src/app/proto/generated/management_pb';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
import { MgmtUserService } from 'src/app/services/mgmt-user.service';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
@@ -20,10 +27,15 @@ export class UserGrantCreateComponent implements OnDestroy {
|
||||
public grantId: string = '';
|
||||
public rolesList: string[] = [];
|
||||
|
||||
public STEPS: number = 3; // org, project, roles
|
||||
public STEPS: number = 2; // project, roles
|
||||
public currentCreateStep: number = 1;
|
||||
|
||||
public filter!: UserGrantSearchKey;
|
||||
public filterValue: string = '';
|
||||
|
||||
private subscription: Subscription = new Subscription();
|
||||
|
||||
public UserGrantSearchKey: any = UserGrantSearchKey;
|
||||
constructor(
|
||||
private authService: AuthService,
|
||||
private userService: MgmtUserService,
|
||||
@@ -31,8 +43,20 @@ export class UserGrantCreateComponent implements OnDestroy {
|
||||
private _location: Location,
|
||||
private route: ActivatedRoute,
|
||||
) {
|
||||
this.subscription = this.route.params.subscribe(({ id }: Params) => {
|
||||
this.userId = id;
|
||||
this.subscription = this.route.params.subscribe((params: Params) => {
|
||||
console.log(params);
|
||||
const { filter, filterValue } = params;
|
||||
this.filter = filter;
|
||||
switch (filter) {
|
||||
case (`${UserGrantSearchKey.USERGRANTSEARCHKEY_PROJECT_ID}`):
|
||||
this.projectId = filterValue;
|
||||
break;
|
||||
case (`${UserGrantSearchKey.USERGRANTSEARCHKEY_USER_ID}`):
|
||||
this.userId = filterValue;
|
||||
break;
|
||||
}
|
||||
|
||||
console.log(this.projectId, this.userId);
|
||||
});
|
||||
|
||||
this.authService.GetActiveOrg().then(org => {
|
||||
@@ -57,7 +81,13 @@ export class UserGrantCreateComponent implements OnDestroy {
|
||||
}
|
||||
|
||||
public selectProject(project: ProjectView.AsObject | ProjectGrantView.AsObject | any): void {
|
||||
this.projectId = project.id ? project.id : project.projectId ? project.projectId : undefined;
|
||||
console.log(project);
|
||||
this.projectId = project.projectId;
|
||||
}
|
||||
|
||||
public selectUser(user: User.AsObject): void {
|
||||
console.log(user);
|
||||
this.userId = user.id;
|
||||
}
|
||||
|
||||
public selectRoles(roles: ProjectRole.AsObject[]): void {
|
||||
|
||||
Reference in New Issue
Block a user