mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-09 15:45:12 +00:00
feat(console): project view model, remove orgid from routes (#263)
* proto gen * fix: remove type from project lists (#256) * fix: remove type from project lists * Update user-detail.component.ts * fix: remove add project Co-authored-by: Livio Amstutz <[email protected]> * fix project view model * regen mgmt proto * rm orgid from route, switch to project view * chore(deps-dev): bump @types/jasmine from 3.5.10 to 3.5.11 in /console (#252) Bumps [@types/jasmine](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jasmine) from 3.5.10 to 3.5.11. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jasmine) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps-dev): bump @angular-devkit/build-angular in /console (#251) Bumps [@angular-devkit/build-angular](https://github.com/angular/angular-cli) from 0.901.7 to 0.901.9. - [Release notes](https://github.com/angular/angular-cli/releases) - [Commits](https://github.com/angular/angular-cli/commits) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): bump moment from 2.26.0 to 2.27.0 in /console (#250) Bumps [moment](https://github.com/moment/moment) from 2.26.0 to 2.27.0. - [Release notes](https://github.com/moment/moment/releases) - [Changelog](https://github.com/moment/moment/blob/develop/CHANGELOG.md) - [Commits](https://github.com/moment/moment/compare/2.26.0...2.27.0) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps-dev): bump karma from 5.0.9 to 5.1.0 in /console (#218) Bumps [karma](https://github.com/karma-runner/karma) from 5.0.9 to 5.1.0. - [Release notes](https://github.com/karma-runner/karma/releases) - [Changelog](https://github.com/karma-runner/karma/blob/master/CHANGELOG.md) - [Commits](https://github.com/karma-runner/karma/compare/v5.0.9...v5.1.0) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): bump ngx-moment from 3.5.0 to 4.0.1 in /console (#219) Bumps [ngx-moment](https://github.com/urish/ngx-moment) from 3.5.0 to 4.0.1. - [Release notes](https://github.com/urish/ngx-moment/releases) - [Changelog](https://github.com/urish/ngx-moment/blob/master/CHANGELOG.md) - [Commits](https://github.com/urish/ngx-moment/compare/3.5.0...4.0.1) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Max Peintner <[email protected]> * chore(deps-dev): bump @angular/language-service in /console (#217) Bumps [@angular/language-service](https://github.com/angular/angular/tree/HEAD/packages/language-service) from 9.1.10 to 9.1.11. - [Release notes](https://github.com/angular/angular/releases) - [Changelog](https://github.com/angular/angular/blob/master/CHANGELOG.md) - [Commits](https://github.com/angular/angular/commits/9.1.11/packages/language-service) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Max Peintner <[email protected]> * chore(deps-dev): bump @angular/cli from 9.1.7 to 9.1.9 in /console (#249) Bumps [@angular/cli](https://github.com/angular/angular-cli) from 9.1.7 to 9.1.9. - [Release notes](https://github.com/angular/angular-cli/releases) - [Commits](https://github.com/angular/angular-cli/compare/v9.1.7...v9.1.9) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Max Peintner <[email protected]> * set partial user profile * fix org routing * auth user loginnames, i18n * fix clipboard, secret regeneration * project role required field * show change editor * show granted project grid, remove add button * hide meta overflow Co-authored-by: Fabi <[email protected]> Co-authored-by: Livio Amstutz <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Fabi
Livio Amstutz
dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
parent
3cd3a238c2
commit
e54778828e
@@ -6,6 +6,7 @@ import { switchMap } from 'rxjs/operators';
|
||||
|
||||
import { AuthServicePromiseClient } from '../proto/generated/auth_grpc_web_pb';
|
||||
import {
|
||||
Gender,
|
||||
MfaOtpResponse,
|
||||
MultiFactors,
|
||||
MyProjectOrgSearchQuery,
|
||||
@@ -21,6 +22,7 @@ import {
|
||||
UserPhone,
|
||||
UserProfile,
|
||||
UserSessionViews,
|
||||
UserView,
|
||||
VerifyMfaOtp,
|
||||
VerifyUserPhoneRequest,
|
||||
} from '../proto/generated/auth_pb';
|
||||
@@ -61,6 +63,14 @@ export class AuthUserService {
|
||||
);
|
||||
}
|
||||
|
||||
public async GetMyUser(): Promise<UserView> {
|
||||
return await this.request(
|
||||
c => c.getMyUser,
|
||||
new Empty(),
|
||||
f => f,
|
||||
);
|
||||
}
|
||||
|
||||
public async GetMyMfas(): Promise<MultiFactors> {
|
||||
return await this.request(
|
||||
c => c.getMyMfas,
|
||||
@@ -88,13 +98,29 @@ export class AuthUserService {
|
||||
);
|
||||
}
|
||||
|
||||
public async SaveMyUserProfile(profile: UserProfile.AsObject): Promise<UserProfile> {
|
||||
public async SaveMyUserProfile(
|
||||
firstName?: string,
|
||||
lastName?: string,
|
||||
nickName?: string,
|
||||
preferredLanguage?: string,
|
||||
gender?: Gender,
|
||||
): Promise<UserProfile> {
|
||||
const req = new UpdateUserProfileRequest();
|
||||
req.setFirstName(profile.firstName);
|
||||
req.setLastName(profile.lastName);
|
||||
req.setNickName(profile.nickName);
|
||||
req.setPreferredLanguage(profile.preferredLanguage);
|
||||
req.setGender(profile.gender);
|
||||
if (firstName) {
|
||||
req.setFirstName(firstName);
|
||||
}
|
||||
if (lastName) {
|
||||
req.setLastName(lastName);
|
||||
}
|
||||
if (nickName) {
|
||||
req.setNickName(nickName);
|
||||
}
|
||||
if (gender) {
|
||||
req.setGender(gender);
|
||||
}
|
||||
if (preferredLanguage) {
|
||||
req.setPreferredLanguage(preferredLanguage);
|
||||
}
|
||||
console.log(req.toObject());
|
||||
return await this.request(
|
||||
c => c.updateMyUserProfile,
|
||||
|
||||
@@ -7,6 +7,8 @@ import {
|
||||
ChangeRequest,
|
||||
Changes,
|
||||
CreateUserRequest,
|
||||
Email,
|
||||
Gender,
|
||||
MultiFactors,
|
||||
NotificationType,
|
||||
PasswordRequest,
|
||||
@@ -22,7 +24,6 @@ import {
|
||||
User,
|
||||
UserAddress,
|
||||
UserEmail,
|
||||
UserEmailID,
|
||||
UserGrant,
|
||||
UserGrantCreate,
|
||||
UserGrantSearchQuery,
|
||||
@@ -113,14 +114,31 @@ export class MgmtUserService {
|
||||
);
|
||||
}
|
||||
|
||||
public async SaveUserProfile(profile: UserProfile.AsObject): Promise<UserProfile> {
|
||||
public async SaveUserProfile(
|
||||
id: string,
|
||||
firstName?: string,
|
||||
lastName?: string,
|
||||
nickName?: string,
|
||||
preferredLanguage?: string,
|
||||
gender?: Gender,
|
||||
): Promise<UserProfile> {
|
||||
const req = new UpdateUserProfileRequest();
|
||||
req.setId(profile.id);
|
||||
req.setFirstName(profile.firstName);
|
||||
req.setLastName(profile.lastName);
|
||||
req.setNickName(profile.nickName);
|
||||
req.setPreferredLanguage(profile.preferredLanguage);
|
||||
req.setGender(profile.gender);
|
||||
req.setId(id);
|
||||
if (firstName) {
|
||||
req.setFirstName(firstName);
|
||||
}
|
||||
if (lastName) {
|
||||
req.setLastName(lastName);
|
||||
}
|
||||
if (nickName) {
|
||||
req.setNickName(nickName);
|
||||
}
|
||||
if (gender) {
|
||||
req.setGender(gender);
|
||||
}
|
||||
if (preferredLanguage) {
|
||||
req.setPreferredLanguage(preferredLanguage);
|
||||
}
|
||||
return await this.request(
|
||||
c => c.updateUserProfile,
|
||||
req,
|
||||
@@ -322,7 +340,7 @@ export class MgmtUserService {
|
||||
}
|
||||
|
||||
public async GetUserByEmailGlobal(email: string): Promise<User> {
|
||||
const req = new UserEmailID();
|
||||
const req = new Email();
|
||||
req.setEmail(email);
|
||||
return await this.request(
|
||||
c => c.getUserByEmailGlobal,
|
||||
|
||||
@@ -66,12 +66,10 @@ export class OrgService {
|
||||
);
|
||||
}
|
||||
|
||||
public async GetOrgById(orgId: string): Promise<Org> {
|
||||
const req: OrgID = new OrgID();
|
||||
req.setId(orgId);
|
||||
public async GetMyOrg(): Promise<Org> {
|
||||
return await this.request(
|
||||
c => c.getOrgByID,
|
||||
req,
|
||||
c => c.getMyOrg,
|
||||
new Empty(),
|
||||
f => f,
|
||||
);
|
||||
}
|
||||
@@ -156,22 +154,19 @@ export class OrgService {
|
||||
);
|
||||
}
|
||||
|
||||
public async DeactivateOrg(id: string): Promise<Org> {
|
||||
const req = new OrgID();
|
||||
req.setId(id);
|
||||
public async DeactivateMyOrg(): Promise<Org> {
|
||||
return await this.request(
|
||||
c => c.deactivateOrg,
|
||||
req,
|
||||
c => c.deactivateMyOrg,
|
||||
new Empty(),
|
||||
f => f,
|
||||
);
|
||||
}
|
||||
|
||||
public async ReactivateOrg(id: string): Promise<Org> {
|
||||
public async ReactivateMyOrg(): Promise<Org> {
|
||||
const req = new OrgID();
|
||||
req.setId(id);
|
||||
return await this.request(
|
||||
c => c.reactivateOrg,
|
||||
req,
|
||||
c => c.reactivateMyOrg,
|
||||
new Empty(),
|
||||
f => f,
|
||||
);
|
||||
}
|
||||
@@ -257,11 +252,9 @@ export class OrgService {
|
||||
}
|
||||
|
||||
public async GetPasswordComplexityPolicy(): Promise<PasswordComplexityPolicy> {
|
||||
const req = new Empty();
|
||||
|
||||
return await this.request(
|
||||
c => c.getPasswordComplexityPolicy,
|
||||
req,
|
||||
new Empty(),
|
||||
f => f,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -45,6 +45,7 @@ import {
|
||||
ProjectSearchResponse,
|
||||
ProjectUpdateRequest,
|
||||
ProjectUserGrantSearchRequest,
|
||||
ProjectView,
|
||||
UserGrant,
|
||||
UserGrantCreate,
|
||||
UserGrantSearchQuery,
|
||||
@@ -104,7 +105,7 @@ export class ProjectService {
|
||||
);
|
||||
}
|
||||
|
||||
public async GetProjectById(projectId: string): Promise<Project> {
|
||||
public async GetProjectById(projectId: string): Promise<ProjectView> {
|
||||
const req = new ProjectID();
|
||||
req.setId(projectId);
|
||||
return await this.request(
|
||||
@@ -135,10 +136,10 @@ export class ProjectService {
|
||||
);
|
||||
}
|
||||
|
||||
public async UpdateProject(project: Project.AsObject): Promise<Project> {
|
||||
public async UpdateProject(id: string, name: string): Promise<Project> {
|
||||
const req = new ProjectUpdateRequest();
|
||||
req.setName(project.name);
|
||||
req.setId(project.id);
|
||||
req.setName(name);
|
||||
req.setId(id);
|
||||
return await this.request(
|
||||
c => c.updateProject,
|
||||
req,
|
||||
@@ -312,9 +313,10 @@ export class ProjectService {
|
||||
);
|
||||
}
|
||||
|
||||
public async RegenerateOIDCClientSecret(id: string): Promise<any> {
|
||||
public async RegenerateOIDCClientSecret(id: string, projectId: string): Promise<any> {
|
||||
const req = new ApplicationID();
|
||||
req.setId(id);
|
||||
req.setProjectId(projectId);
|
||||
return await this.request(
|
||||
c => c.regenerateOIDCClientSecret,
|
||||
req,
|
||||
|
||||
Reference in New Issue
Block a user