feat(console): add stylelint scss, app redirecturi validation, user grant api change (#531)

* add custom validator for redirect inputs

* change http pattern, i18n

* throw out deprecated usergrant functions

* remove deprecation service

* show docs in app detail

* reorder data promises

* show redirect desc in app detail

* custom validator

* grant search filters

* rm animations

* add validation to app detail

* user grant udpate

* rm grantid from update req

* fix project member guard

* fix hasrole directive

* show validation errors, i18n

* fix router link from org members

* navitem padding

* mobile layout

* policy grid mobile layout

* rm unused background

* lint

* add stylelinter add to pipeline

* update stylelint rules

* lint unknown rule

* disable enable rules

* lint

* table style lint

* table classes

* fix stylelinter rule, lint

* overflow fix member detail

* common detail page

* user create, password, project grant detail clnup

* move meta styles

* lint

* password policy indicator

* lint

* fix org create

* common component for complexity view

* lint

* user grant filter

* Update console/src/assets/i18n/en.json

Co-authored-by: Florian Forster <[email protected]>

* Update console/src/assets/i18n/en.json

Co-authored-by: Florian Forster <[email protected]>

* Update console/src/assets/i18n/de.json

Co-authored-by: Florian Forster <[email protected]>

* Update console/src/assets/i18n/de.json

Co-authored-by: Florian Forster <[email protected]>

* Update console/src/assets/i18n/en.json

Co-authored-by: Florian Forster <[email protected]>

Co-authored-by: Florian Forster <[email protected]>
This commit is contained in:
Max Peintner
2020-07-30 16:54:15 +02:00
committed by GitHub
co-authored by Florian Forster
parent 8d1725a81d
commit 22ba33c2ef
154 changed files with 6778 additions and 6156 deletions
-3
View File
@@ -61,7 +61,6 @@ export class AuthService {
}
private loadPermissions(): void {
console.log('load permissions');
merge([
// this.authenticationChanged,
this.activeOrgChanged.pipe(map(org => !!org)),
@@ -83,8 +82,6 @@ export class AuthService {
}
public hasRoles(userRoles: string[], requestedRoles: string[], each: boolean = false): boolean {
// console.log('has', userRoles);
// console.log('needs', requestedRoles);
return each ?
requestedRoles.every(role => userRoles.includes(role)) :
requestedRoles.findIndex(role => {
+10 -128
View File
@@ -15,13 +15,7 @@ import {
ProjectGrantMemberSearchQuery,
ProjectGrantMemberSearchRequest,
ProjectGrantMemberSearchResponse,
ProjectGrantUserGrantCreate,
ProjectGrantUserGrantID,
ProjectGrantUserGrantSearchRequest,
ProjectGrantUserGrantUpdate,
ProjectRoleAdd,
ProjectUserGrantSearchRequest,
ProjectUserGrantUpdate,
SetPasswordNotificationRequest,
UpdateUserAddressRequest,
UpdateUserEmailRequest,
@@ -37,6 +31,7 @@ import {
UserGrantSearchQuery,
UserGrantSearchRequest,
UserGrantSearchResponse,
UserGrantUpdate,
UserGrantView,
UserID,
UserPhone,
@@ -217,43 +212,24 @@ export class MgmtUserService {
);
}
public async CreateProjectUserGrant(
projectId: string,
public async CreateUserGrant(
userId: string,
roleNamesList: string[],
projectId?: string,
grantId?: string,
): Promise<UserGrant> {
const req = new UserGrantCreate();
req.setProjectId(projectId);
if (projectId) { req.setProjectId(projectId); }
if (grantId) { req.setGrantId(grantId); }
req.setUserId(userId);
req.setRoleKeysList(roleNamesList);
return await this.request(
c => c.createProjectUserGrant,
c => c.createUserGrant,
req,
f => f,
);
}
public async CreateProjectGrantUserGrant(
orgId: string,
projectId: string,
grantId: string,
userId: string,
roleNamesList: string[],
): Promise<UserGrant> {
const req = new ProjectGrantUserGrantCreate();
req.setProjectId(projectId);
req.setProjectGrantId(grantId);
req.setUserId(userId);
req.setRoleKeysList(roleNamesList);
return await this.request(
c => c.createProjectGrantUserGrant,
req,
f => f,
);
}
public async ReactivateUser(id: string): Promise<UserPhone> {
const req = new UserID();
req.setId(id);
@@ -408,62 +384,6 @@ export class MgmtUserService {
);
}
public async SearchProjectUserGrants(
projectId: string,
limit: number,
offset: number,
queryList?: UserGrantSearchQuery[],
): Promise<UserGrantSearchResponse> {
const req = new ProjectUserGrantSearchRequest();
req.setProjectId(projectId);
req.setLimit(limit);
req.setOffset(offset);
if (queryList) {
req.setQueriesList(queryList);
}
return await this.request(
c => c.searchProjectUserGrants,
req,
f => f,
);
}
public async SearchProjectGrantUserGrants(
projectGrantId: string,
limit: number,
offset: number,
queryList?: UserGrantSearchQuery[],
): Promise<UserGrantSearchResponse> {
const req = new ProjectGrantUserGrantSearchRequest();
req.setProjectGrantId(projectGrantId);
req.setLimit(limit);
req.setOffset(offset);
if (queryList) {
req.setQueriesList(queryList);
}
return await this.request(
c => c.searchProjectGrantUserGrants,
req,
f => f,
);
}
public async projectGrantUserGrantByID(
id: string,
userId: string,
projectGrantId: string,
): Promise<UserGrant> {
const req = new ProjectGrantUserGrantID();
req.setId(id);
req.setUserId(userId);
req.setProjectGrantId(projectGrantId);
return await this.request(
c => c.projectGrantUserGrantByID,
req,
f => f,
);
}
public async UserGrantByID(
id: string,
@@ -480,56 +400,18 @@ export class MgmtUserService {
);
}
// public async UpdateUserGrant(
// id: string,
// userId: string,
// roleKeysList: string[],
// ): Promise<UserGrant> {
// const req = new UserGrantUpdate();
// req.setId(id);
// req.setRoleKeysList(roleKeysList);
// req.setUserId(userId);
// return await this.request(
// c => c.updateUserGrant,
// req,
// f => f,
// );
// }
public async UpdateProjectUserGrant(
public async UpdateUserGrant(
id: string,
projectId: string,
userId: string,
roleKeysList: string[],
): Promise<UserGrant> {
const req = new ProjectUserGrantUpdate();
const req = new UserGrantUpdate();
req.setId(id);
req.setProjectId(projectId);
req.setRoleKeysList(roleKeysList);
req.setUserId(userId);
return await this.request(
c => c.updateProjectUserGrant,
req,
f => f,
);
}
public async updateProjectGrantUserGrant(
id: string,
projectGrantId: string,
userId: string,
roleKeysList: string[],
): Promise<UserGrant> {
const req = new ProjectGrantUserGrantUpdate();
req.setId(id);
req.setProjectGrantId(projectGrantId);
req.setRoleKeysList(roleKeysList);
req.setUserId(userId);
return await this.request(
c => c.updateProjectGrantUserGrant,
c => c.updateUserGrant,
req,
f => f,
);
@@ -56,6 +56,7 @@ import {
UserGrantCreate,
UserGrantSearchQuery,
UserGrantSearchResponse,
ZitadelDocs,
} from '../proto/generated/management_pb';
import { GrpcBackendService } from './grpc-backend.service';
import { GrpcService, RequestFactory, ResponseMapper } from './grpc.service';
@@ -111,6 +112,16 @@ export class ProjectService {
);
}
public async GetZitadelDocs(): Promise<ZitadelDocs> {
const req = new Empty();
return await this.request(
c => c.getZitadelDocs,
req,
f => f,
);
}
public async GetProjectById(projectId: string): Promise<ProjectView> {
const req = new ProjectID();
req.setId(projectId);
@@ -11,8 +11,6 @@ export abstract class StatehandlerService {
public abstract initStateHandler(): void;
}
// TODO: Add Angular decorator.
// TODO: Add Angular decorator.
@Injectable()
export class StatehandlerServiceImpl
implements StatehandlerService, OnDestroy {