feat(console): org managers, refactor, bugfixes (#226)

* resourceowner header, i18n

* password policy validators, roles required field

* use angular pattern instead of custom validator

* user detail fixes, mfa qr code, add org

* use mgmt for mfa list

* fetch owned projects

* search project

* seperate owned from granted projects

* lint

* fix granted project grid

* refactor project detail

* disable zitadel apps

* refactor project contributors

* changed i18n

* hide meta nav

* mobile meta layout

* refactor contributor name

* refactor org contributors

* org i18n, org member detail view
This commit is contained in:
Max Peintner
2020-06-16 14:52:07 +02:00
committed by GitHub
parent 7a6ca24625
commit f2cdae9ea3
95 changed files with 5019 additions and 3413 deletions
@@ -96,6 +96,7 @@ export class AuthUserService {
req.setDisplayName(profile.displayName);
req.setPreferredLanguage(profile.preferredLanguage);
req.setGender(profile.gender);
console.log(req.toObject());
return await this.request(
c => c.updateMyUserProfile,
req,
@@ -264,7 +265,12 @@ export class AuthUserService {
return this.GetMyzitadelPermissions().pipe(
switchMap(response => {
const userRoles = response.toObject().permissionsList;
let userRoles = [];
if (response.toObject().permissionsList) {
userRoles = response.toObject().permissionsList;
} else {
userRoles = ['user.resourceowner'];
}
this._roleCache = userRoles;
return of(this.hasRoles(userRoles, roles, each));
}),
@@ -7,6 +7,7 @@ import {
ChangeRequest,
Changes,
CreateUserRequest,
MultiFactors,
NotificationType,
PasswordRequest,
ProjectGrantMemberSearchQuery,
@@ -92,6 +93,16 @@ export class MgmtUserService {
);
}
public async getUserMfas(id: string): Promise<MultiFactors> {
const req = new UserID();
req.setId(id);
return await this.request(
c => c.getUserMfas,
req,
f => f,
);
}
public async SaveUserProfile(profile: UserProfile.AsObject): Promise<UserProfile> {
const req = new UpdateUserProfileRequest();
req.setId(profile.id);
+22 -21
View File
@@ -10,10 +10,7 @@ import {
ApplicationSearchRequest,
ApplicationSearchResponse,
ApplicationUpdate,
GrantedProject,
GrantedProjectSearchQuery,
GrantedProjectSearchRequest,
GrantedProjectSearchResponse,
OIDCApplicationCreate,
OIDCConfig,
OIDCConfigUpdate,
@@ -30,6 +27,7 @@ import {
ProjectGrantSearchRequest,
ProjectGrantSearchResponse,
ProjectGrantUpdate,
ProjectGrantView,
ProjectID,
ProjectMemberAdd,
ProjectMemberChange,
@@ -42,6 +40,9 @@ import {
ProjectRoleSearchQuery,
ProjectRoleSearchRequest,
ProjectRoleSearchResponse,
ProjectSearchQuery,
ProjectSearchRequest,
ProjectSearchResponse,
ProjectUpdateRequest,
ProjectUserGrantSearchRequest,
UserGrant,
@@ -73,8 +74,23 @@ export class ProjectService {
return responseMapper(response);
}
public async SearchProjects(
limit: number, offset: number, queryList?: ProjectSearchQuery[]): Promise<ProjectSearchResponse> {
const req = new ProjectSearchRequest();
req.setLimit(limit);
req.setOffset(offset);
if (queryList) {
req.setQueriesList(queryList);
}
return await this.request(
c => c.searchProjects,
req,
f => f,
);
}
public async SearchGrantedProjects(
limit: number, offset: number, queryList?: GrantedProjectSearchQuery[]): Promise<GrantedProjectSearchResponse> {
limit: number, offset: number, queryList?: ProjectSearchQuery[]): Promise<ProjectGrantSearchResponse> {
const req = new GrantedProjectSearchRequest();
req.setLimit(limit);
req.setOffset(offset);
@@ -88,21 +104,6 @@ export class ProjectService {
);
}
// public async SearchGrantedProjects(
// limit: number, offset: number, queryList?: GrantedProjectSearchQuery[]): Promise<GrantedProjectSearchResponse> {
// const req = new GrantedProjectSearchRequest();
// req.setLimit(limit);
// req.setOffset(offset);
// if (queryList) {
// req.setQueriesList(queryList);
// }
// return await this.request(
// c => c.search,
// req,
// f => f,
// );
// }
public async GetProjectById(projectId: string): Promise<Project> {
const req = new ProjectID();
req.setId(projectId);
@@ -113,12 +114,12 @@ export class ProjectService {
);
}
public async GetGrantedProjectGrantByID(projectId: string, id: string): Promise<GrantedProject> {
public async GetGrantedProjectByID(projectId: string, id: string): Promise<ProjectGrantView> {
const req = new ProjectGrantID();
req.setId(id);
req.setProjectId(projectId);
return await this.request(
c => c.getGrantedProjectGrantByID,
c => c.getGrantedProjectByID,
req,
f => f,
);