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 <livio.a@gmail.com>

* 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] <support@github.com>

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] <support@github.com>

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] <support@github.com>

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] <support@github.com>

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] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Max Peintner <max@caos.ch>

* 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] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Max Peintner <max@caos.ch>

* 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] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Max Peintner <max@caos.ch>

* 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 <38692350+fgerschwiler@users.noreply.github.com>
Co-authored-by: Livio Amstutz <livio.a@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This commit is contained in:
Max Peintner 2020-06-23 18:56:29 +02:00 committed by GitHub
parent 3cd3a238c2
commit e54778828e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
59 changed files with 4637 additions and 3316 deletions

2546
console/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -37,8 +37,8 @@
"grpc": "^1.24.3", "grpc": "^1.24.3",
"grpc-web": "^1.1.0", "grpc-web": "^1.1.0",
"hammerjs": "^2.0.8", "hammerjs": "^2.0.8",
"moment": "^2.26.0", "ngx-moment": "^4.0.1",
"ngx-moment": "^3.5.0", "moment": "^2.27.0",
"prettier-stylelint": "^0.4.2", "prettier-stylelint": "^0.4.2",
"rxjs": "~6.5.5", "rxjs": "~6.5.5",
"ts-protoc-gen": "^0.12.0", "ts-protoc-gen": "^0.12.0",
@ -47,17 +47,17 @@
"zone.js": "~0.10.3" "zone.js": "~0.10.3"
}, },
"devDependencies": { "devDependencies": {
"@angular-devkit/build-angular": "~0.901.7", "@angular/cli": "~9.1.9",
"@angular/cli": "~9.1.7", "@angular-devkit/build-angular": "~0.901.9",
"@angular/compiler-cli": "~9.1.10", "@angular/compiler-cli": "~9.1.10",
"@angular/language-service": "~9.1.10", "@angular/language-service": "~9.1.11",
"@types/jasmine": "~3.5.10", "@types/jasmine": "~3.5.11",
"@types/jasminewd2": "~2.0.3", "@types/jasminewd2": "~2.0.3",
"@types/node": "^14.0.13", "@types/node": "^14.0.13",
"codelyzer": "^5.2.2", "codelyzer": "^5.2.2",
"jasmine-core": "~3.5.0", "jasmine-core": "~3.5.0",
"jasmine-spec-reporter": "~5.0.2", "jasmine-spec-reporter": "~5.0.2",
"karma": "^5.0.9", "karma": "^5.1.0",
"karma-chrome-launcher": "~3.1.0", "karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~3.0.3", "karma-coverage-istanbul-reporter": "~3.0.3",
"karma-jasmine": "^3.3.1", "karma-jasmine": "^3.3.1",

View File

@ -32,7 +32,7 @@ const routes: Routes = [
}, },
}, },
{ {
path: 'orgs', path: 'org',
loadChildren: () => import('./pages/orgs/orgs.module').then(m => m.OrgsModule), loadChildren: () => import('./pages/orgs/orgs.module').then(m => m.OrgsModule),
canActivate: [AuthGuard, RoleGuard], canActivate: [AuthGuard, RoleGuard],
data: { data: {

View File

@ -18,7 +18,7 @@
<mat-menu #menu="matMenu"> <mat-menu #menu="matMenu">
<mat-progress-bar *ngIf="orgLoading" color="accent" mode="indeterminate"></mat-progress-bar> <mat-progress-bar *ngIf="orgLoading" color="accent" mode="indeterminate"></mat-progress-bar>
<button class="show-all" mat-menu-item [routerLink]="[ '/orgs' ]">Show all organizations</button> <button class="show-all" mat-menu-item [routerLink]="[ '/org/overview' ]">Show all organizations</button>
<button [ngClass]="{'active': temporg.id === org?.id}" [disabled]="!temporg.id" *ngFor="let temporg of orgs" <button [ngClass]="{'active': temporg.id === org?.id}" [disabled]="!temporg.id" *ngFor="let temporg of orgs"
mat-menu-item (click)="setActiveOrg(temporg)"> mat-menu-item (click)="setActiveOrg(temporg)">
@ -27,7 +27,7 @@
</button> </button>
<ng-template appHasRole [appHasRole]="['iam.write']"> <ng-template appHasRole [appHasRole]="['iam.write']">
<button mat-menu-item [routerLink]="[ '/orgs/create' ]"> <button mat-menu-item [routerLink]="[ '/org/create' ]">
<mat-icon class="avatar">add</mat-icon> <mat-icon class="avatar">add</mat-icon>
{{'MENU.NEWORG' | translate}} {{'MENU.NEWORG' | translate}}
</button> </button>
@ -63,8 +63,7 @@
<span class="label">{{ 'MENU.PERSONAL_INFO' | translate }}</span> <span class="label">{{ 'MENU.PERSONAL_INFO' | translate }}</span>
</a> </a>
<a *ngIf="showOrgSection && org?.id" class="nav-item" [routerLinkActive]="['active']" <a *ngIf="showOrgSection" class="nav-item" [routerLinkActive]="['active']" [routerLink]="[ '/org']">
[routerLink]="[ '/orgs', org.id]">
<i class="icon las la-archway"></i> <i class="icon las la-archway"></i>
<span class="label">{{org?.name ? org.name : 'MENU.ORGANIZATION' | translate}}</span> <span class="label">{{org?.name ? org.name : 'MENU.ORGANIZATION' | translate}}</span>
</a> </a>
@ -89,9 +88,10 @@
</div> </div>
<span class="fill-space"></span> <span class="fill-space"></span>
<div class="footer"> <!-- <div class="footer">
<a href="https://caos.ch/impressum/" target="_blank" rel="noreferrer">AGB</a> <a href="https://caos.ch/impressum/" target="_blank" rel="noreferrer">AGB</a>
<a href="https://caos.ch/impressum/" target="_blank" rel="noreferrer">Impressum</a></div> <a href="https://caos.ch/impressum/" target="_blank" rel="noreferrer">Impressum</a>
</div> -->
</div> </div>
</mat-drawer> </mat-drawer>
<mat-drawer-content class="content"> <mat-drawer-content class="content">

View File

@ -5,6 +5,7 @@
<span class="seq"> <span class="seq">
{{dateFromTimestamp(event.changeDate) | localizedDate: 'EEE dd. MMM, HH:mm'}} {{dateFromTimestamp(event.changeDate) | localizedDate: 'EEE dd. MMM, HH:mm'}}
</span> </span>
<span class="editor">{{event.editor}}</span>
<span class="desc">{{'CHANGES.EVENTS.'+event.eventType | translate}}</span> <span class="desc">{{'CHANGES.EVENTS.'+event.eventType | translate}}</span>
</li> </li>
<div class="sp-wrapper"> <div class="sp-wrapper">

View File

@ -17,7 +17,11 @@
border-radius: .5rem; border-radius: .5rem;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
.editor {
color: #81868a;
font-size: 12px;
align-self: flex-end;
}
.seq { .seq {
color: #81868a; color: #81868a;
font-size: 12px; font-size: 12px;

View File

@ -100,13 +100,15 @@ export class ChangesComponent implements OnInit {
// Map snapshot with doc ref (needed for cursor) // Map snapshot with doc ref (needed for cursor)
return from(col).pipe( return from(col).pipe(
tap((res: Changes) => { tap((res: Changes) => {
console.log('more cahnge'); console.log('more changes');
let values = res.toObject().changesList; let values = res.toObject().changesList;
// If prepending, reverse the batch order // If prepending, reverse the batch order
values = false ? values.reverse() : values; values = false ? values.reverse() : values;
// update source with new values, done loading // update source with new values, done loading
this._data.next(values); this._data.next(values);
console.log(values);
// console.log(values); // console.log(values);
this._loading.next(false); this._loading.next(false);

View File

@ -15,6 +15,7 @@
} }
.meta { .meta {
overflow-y: hidden;
position: relative; position: relative;
flex: 1 0 300px; flex: 1 0 300px;
background: linear-gradient(to bottom right, #4072b410 20%,transparent 50%); background: linear-gradient(to bottom right, #4072b410 20%,transparent 50%);

View File

@ -6,8 +6,7 @@
<h1>{{ 'APP.PAGES.TITLE' | translate }} {{app?.name}}</h1> <h1>{{ 'APP.PAGES.TITLE' | translate }} {{app?.name}}</h1>
<p class="desc">{{ 'APP.PAGES.DESCRIPTION' | translate }}</p> <p class="desc">{{ 'APP.PAGES.DESCRIPTION' | translate }}</p>
<p *ngIf="isZitadel" class="zitadel-warning">This belongs to Zitadel project. If you change something, Zitadel <p *ngIf="isZitadel" class="zitadel-warning">{{'PROJECT.PAGES.ZITADELPROJECT' | translate}}</p>
may not behave as intended!</p>
</div> </div>
<span *ngIf="errorMessage" class="err-container">{{errorMessage}}</span> <span *ngIf="errorMessage" class="err-container">{{errorMessage}}</span>

View File

@ -235,7 +235,8 @@ export class AppDetailComponent implements OnInit, OnDestroy {
} }
public regenerateOIDCClientSecret(): void { public regenerateOIDCClientSecret(): void {
this.projectService.RegenerateOIDCClientSecret(this.app.id).then((data: OIDCConfig) => { console.log(this.app.id, this.projectId);
this.projectService.RegenerateOIDCClientSecret(this.app.id, this.projectId).then((data: OIDCConfig) => {
console.log(data.toObject()); console.log(data.toObject());
this.toast.showInfo('OIDC Secret Regenerated'); this.toast.showInfo('OIDC Secret Regenerated');
this.dialog.open(AppSecretDialogComponent, { this.dialog.open(AppSecretDialogComponent, {

View File

@ -6,10 +6,10 @@
<p *ngIf="data.clientId">ClientId: {{data.clientId}}</p> <p *ngIf="data.clientId">ClientId: {{data.clientId}}</p>
<div *ngIf="data.clientSecret" class="flex"> <div *ngIf="data.clientSecret" class="flex">
<button matTooltip="copy to clipboard" (click)="copytoclipboard(data.clientSecret)" mat-icon-button> <button color="primary" [disabled]="copied == data.clientSecret" matTooltip="copy to clipboard"
<mat-icon *ngIf="!copied" svgIcon="mdi_content_copy"></mat-icon> (click)="copytoclipboard(data.clientSecret)" mat-icon-button>
<mat-icon *ngIf="copied">check</mat-icon> <i *ngIf="copied != data.clientSecret" class="las la-clipboard"></i>
<i *ngIf="copied == data.clientSecret" class="las la-clipboard-check"></i>
</button> </button>
<span class="secret">{{data.clientSecret}}</span> <span class="secret">{{data.clientSecret}}</span>
</div> </div>

View File

@ -7,7 +7,7 @@ import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
styleUrls: ['./app-secret-dialog.component.scss'], styleUrls: ['./app-secret-dialog.component.scss'],
}) })
export class AppSecretDialogComponent { export class AppSecretDialogComponent {
public copied: boolean = false; public copied: string = '';
constructor(public dialogRef: MatDialogRef<AppSecretDialogComponent>, constructor(public dialogRef: MatDialogRef<AppSecretDialogComponent>,
@Inject(MAT_DIALOG_DATA) public data: any) { } @Inject(MAT_DIALOG_DATA) public data: any) { }
@ -27,9 +27,9 @@ export class AppSecretDialogComponent {
selBox.select(); selBox.select();
document.execCommand('copy'); document.execCommand('copy');
document.body.removeChild(selBox); document.body.removeChild(selBox);
this.copied = true; this.copied = value;
setTimeout(() => { setTimeout(() => {
this.copied = false; this.copied = '';
}, 3000); }, 3000);
} }
} }

View File

@ -87,7 +87,7 @@ export class OrgContributorsComponent implements OnInit {
public showDetail(): void { public showDetail(): void {
if (this.org?.state === OrgState.ORGSTATE_ACTIVE) { if (this.org?.state === OrgState.ORGSTATE_ACTIVE) {
this.router.navigate(['orgs', this.org.id, 'members']); this.router.navigate(['org/members']);
} }
} }
} }

View File

@ -46,6 +46,13 @@
<form [formGroup]="userForm" (ngSubmit)="finish()" class="form"> <form [formGroup]="userForm" (ngSubmit)="finish()" class="form">
<div class="content"> <div class="content">
<p class="section">{{ 'USER.CREATE.NAMEANDEMAILSECTION' | translate }}</p> <p class="section">{{ 'USER.CREATE.NAMEANDEMAILSECTION' | translate }}</p>
<mat-form-field class="formfield">
<mat-label>{{ 'USER.PROFILE.USERNAME' | translate }}</mat-label>
<input matInput formControlName="userName" required />
<mat-error *ngIf="userName?.invalid && userName?.errors?.required">
{{ 'USER.VALIDATION.REQUIRED' | translate }}
</mat-error>
</mat-form-field>
<mat-form-field class="formfield"> <mat-form-field class="formfield">
<mat-label>{{ 'USER.PROFILE.EMAIL' | translate }}</mat-label> <mat-label>{{ 'USER.PROFILE.EMAIL' | translate }}</mat-label>
<input matInput formControlName="email" required /> <input matInput formControlName="email" required />

View File

@ -78,11 +78,11 @@ export class OrgCreateComponent {
validators.push(Validators.pattern(/[0-9]/g)); validators.push(Validators.pattern(/[0-9]/g));
} }
if (this.policy.hasSymbol) { if (this.policy.hasSymbol) {
// All characters that are not a digit or an English letter \W or a whitespace \S validators.push(Validators.pattern(/[^a-z0-9]/gi));
validators.push(Validators.pattern(/[\W\S]/));
} }
this.userForm = this.fb.group({ this.userForm = this.fb.group({
userName: ['', [Validators.required]],
firstName: ['', [Validators.required]], firstName: ['', [Validators.required]],
lastName: ['', [Validators.required]], lastName: ['', [Validators.required]],
email: ['', [Validators.required]], email: ['', [Validators.required]],
@ -96,6 +96,7 @@ export class OrgCreateComponent {
console.log('no password complexity policy defined!'); console.log('no password complexity policy defined!');
console.error(error); console.error(error);
this.userForm = this.fb.group({ this.userForm = this.fb.group({
userName: ['', [Validators.required]],
firstName: ['', [Validators.required]], firstName: ['', [Validators.required]],
lastName: ['', [Validators.required]], lastName: ['', [Validators.required]],
email: ['', [Validators.required]], email: ['', [Validators.required]],
@ -117,6 +118,7 @@ export class OrgCreateComponent {
createOrgRequest.setDomain(this.domain?.value); createOrgRequest.setDomain(this.domain?.value);
const registerUserRequest: CreateUserRequest = new CreateUserRequest(); const registerUserRequest: CreateUserRequest = new CreateUserRequest();
registerUserRequest.setUserName(this.userName?.value);
registerUserRequest.setEmail(this.email?.value); registerUserRequest.setEmail(this.email?.value);
registerUserRequest.setFirstName(this.firstName?.value); registerUserRequest.setFirstName(this.firstName?.value);
registerUserRequest.setLastName(this.lastName?.value); registerUserRequest.setLastName(this.lastName?.value);
@ -151,6 +153,9 @@ export class OrgCreateComponent {
return this.orgForm.get('domain'); return this.orgForm.get('domain');
} }
public get userName(): AbstractControl | null {
return this.userForm.get('userName');
}
public get firstName(): AbstractControl | null { public get firstName(): AbstractControl | null {
return this.userForm.get('firstName'); return this.userForm.get('firstName');

View File

@ -2,7 +2,6 @@ import { SelectionModel } from '@angular/cdk/collections';
import { Component, OnDestroy, OnInit } from '@angular/core'; import { Component, OnDestroy, OnInit } from '@angular/core';
import { MatButtonToggleChange } from '@angular/material/button-toggle'; import { MatButtonToggleChange } from '@angular/material/button-toggle';
import { MatTableDataSource } from '@angular/material/table'; import { MatTableDataSource } from '@angular/material/table';
import { ActivatedRoute, Params } from '@angular/router';
import { TranslateService } from '@ngx-translate/core'; import { TranslateService } from '@ngx-translate/core';
import { Subscription } from 'rxjs'; import { Subscription } from 'rxjs';
import { ChangeType } from 'src/app/modules/changes/changes.component'; import { ChangeType } from 'src/app/modules/changes/changes.component';
@ -17,7 +16,6 @@ import { ToastService } from 'src/app/services/toast.service';
styleUrls: ['./org-detail.component.scss'], styleUrls: ['./org-detail.component.scss'],
}) })
export class OrgDetailComponent implements OnInit, OnDestroy { export class OrgDetailComponent implements OnInit, OnDestroy {
public orgId: string = '';
public org!: Org.AsObject; public org!: Org.AsObject;
public dataSource: MatTableDataSource<OrgMember.AsObject> = new MatTableDataSource<OrgMember.AsObject>(); public dataSource: MatTableDataSource<OrgMember.AsObject> = new MatTableDataSource<OrgMember.AsObject>();
@ -34,23 +32,20 @@ export class OrgDetailComponent implements OnInit, OnDestroy {
constructor( constructor(
public translate: TranslateService, public translate: TranslateService,
private route: ActivatedRoute,
private orgService: OrgService, private orgService: OrgService,
private toast: ToastService, private toast: ToastService,
) { } ) { }
public ngOnInit(): void { public ngOnInit(): void {
this.subscription = this.route.params.subscribe(params => this.getData(params)); this.getData();
} }
public ngOnDestroy(): void { public ngOnDestroy(): void {
this.subscription.unsubscribe(); this.subscription.unsubscribe();
} }
private async getData({ id }: Params): Promise<void> { private async getData(): Promise<void> {
this.orgId = id; this.orgService.GetMyOrg().then((org: Org) => {
this.orgService.GetOrgById(this.orgId).then((org: Org) => {
this.org = org.toObject(); this.org = org.toObject();
}).catch(error => { }).catch(error => {
this.toast.showError(error.message); this.toast.showError(error.message);
@ -64,15 +59,15 @@ export class OrgDetailComponent implements OnInit, OnDestroy {
public changeState(event: MatButtonToggleChange | any): void { public changeState(event: MatButtonToggleChange | any): void {
if (event.value === OrgState.ORGSTATE_ACTIVE) { if (event.value === OrgState.ORGSTATE_ACTIVE) {
this.orgService.ReactivateOrg(this.orgId).then(() => { this.orgService.ReactivateMyOrg().then(() => {
this.toast.showInfo('Reactivated Org'); this.toast.showInfo('Reactivated Org');
}).catch(error => { }).catch((error) => {
this.toast.showError(error.message); this.toast.showError(error.message);
}); });
} else if (event.value === OrgState.ORGSTATE_INACTIVE) { } else if (event.value === OrgState.ORGSTATE_INACTIVE) {
this.orgService.DeactivateOrg(this.orgId).then(() => { this.orgService.DeactivateMyOrg().then(() => {
this.toast.showInfo('Deactivated Org'); this.toast.showInfo('Deactivated Org');
}).catch(error => { }).catch((error) => {
this.toast.showError(error.message); this.toast.showError(error.message);
}); });
} }
@ -88,6 +83,10 @@ export class OrgDetailComponent implements OnInit, OnDestroy {
console.log(domain); console.log(domain);
this.orgService.RemoveMyOrgDomain(domain).then(() => { this.orgService.RemoveMyOrgDomain(domain).then(() => {
this.toast.showInfo('Removed'); this.toast.showInfo('Removed');
const index = this.domains.findIndex(d => d.domain === domain);
if (index > -1) {
this.domains.splice(index, 1);
}
}).catch(error => { }).catch(error => {
this.toast.showError(error.message); this.toast.showError(error.message);
}); });

View File

@ -16,6 +16,7 @@
[ngClass]="{ selected: selection.isSelected(org),active: activeOrg?.id === org?.id }"> [ngClass]="{ selected: selection.isSelected(org),active: activeOrg?.id === org?.id }">
<!-- <mat-icon matTooltip="select org" (click)="selection.toggle(org)" class="selection-icon"> <!-- <mat-icon matTooltip="select org" (click)="selection.toggle(org)" class="selection-icon">
check_circle</mat-icon> --> check_circle</mat-icon> -->
<div class="text-part"> <div class="text-part">
<!-- <span *ngIf="org?.changeDate" class="top">last modified on <!-- <span *ngIf="org?.changeDate" class="top">last modified on
{{ {{

View File

@ -70,6 +70,7 @@ h1 {
} }
.text-part { .text-part {
position: relative;
flex: 1; flex: 1;
display: flex; display: flex;
flex-direction: column; flex-direction: column;

View File

@ -1,7 +1,7 @@
<div class="max-width-container"> <div class="max-width-container">
<div class="container"> <div class="container">
<div class="left"> <div class="left">
<a *ngIf="org" [routerLink]="[ '/orgs', org.id]" mat-icon-button> <a *ngIf="org" [routerLink]="[ '/org']" mat-icon-button>
<mat-icon class="icon">arrow_back</mat-icon> <mat-icon class="icon">arrow_back</mat-icon>
</a> </a>
</div> </div>

View File

@ -3,7 +3,6 @@ import { AfterViewInit, Component, ViewChild } from '@angular/core';
import { MatDialog } from '@angular/material/dialog'; import { MatDialog } from '@angular/material/dialog';
import { MatPaginator } from '@angular/material/paginator'; import { MatPaginator } from '@angular/material/paginator';
import { MatTable } from '@angular/material/table'; import { MatTable } from '@angular/material/table';
import { ActivatedRoute } from '@angular/router';
import { tap } from 'rxjs/operators'; import { tap } from 'rxjs/operators';
import { CreationType, MemberCreateDialogComponent } from 'src/app/modules/add-member-dialog/member-create-dialog.component'; import { CreationType, MemberCreateDialogComponent } from 'src/app/modules/add-member-dialog/member-create-dialog.component';
import { Org, ProjectMember, ProjectType, User } from 'src/app/proto/generated/management_pb'; import { Org, ProjectMember, ProjectType, User } from 'src/app/proto/generated/management_pb';
@ -31,15 +30,12 @@ export class OrgMembersComponent implements AfterViewInit {
constructor(private orgService: OrgService, constructor(private orgService: OrgService,
private dialog: MatDialog, private dialog: MatDialog,
private toast: ToastService, private toast: ToastService) {
private route: ActivatedRoute) { this.orgService.GetMyOrg().then(org => {
this.route.params.subscribe(params => { this.org = org.toObject();
this.orgService.GetOrgById(params.orgid).then(org => { console.log(this.org);
this.org = org.toObject(); this.dataSource = new ProjectMembersDataSource(this.orgService);
console.log(this.org); this.dataSource.loadMembers(0, 25, 'asc');
this.dataSource = new ProjectMembersDataSource(this.orgService);
this.dataSource.loadMembers(0, 25, 'asc');
});
}); });
} }

View File

@ -18,14 +18,14 @@ const routes: Routes = [
loadChildren: () => import('./org-create/org-create.module').then(m => m.OrgCreateModule), loadChildren: () => import('./org-create/org-create.module').then(m => m.OrgCreateModule),
}, },
{ {
path: ':id/policy/:policytype/create', path: 'policy/:policytype/create',
component: PasswordPolicyComponent, component: PasswordPolicyComponent,
data: { data: {
action: PolicyComponentAction.CREATE, action: PolicyComponentAction.CREATE,
}, },
}, },
{ {
path: ':id/policy/:policytype', path: 'policy/:policytype',
component: PasswordPolicyComponent, component: PasswordPolicyComponent,
data: { data: {
action: PolicyComponentAction.MODIFY, action: PolicyComponentAction.MODIFY,
@ -33,15 +33,15 @@ const routes: Routes = [
loadChildren: () => import('./password-policy/password-policy.module').then(m => m.PasswordPolicyModule), loadChildren: () => import('./password-policy/password-policy.module').then(m => m.PasswordPolicyModule),
}, },
{ {
path: ':orgid/members', path: 'members',
loadChildren: () => import('./org-members/org-members.module').then(m => m.OrgMembersModule), loadChildren: () => import('./org-members/org-members.module').then(m => m.OrgMembersModule),
}, },
{ {
path: ':id', path: '',
component: OrgDetailComponent, component: OrgDetailComponent,
}, },
{ {
path: '', path: 'overview',
component: OrgGridComponent, component: OrgGridComponent,
}, },
]; ];

View File

@ -1,7 +1,7 @@
<div class="max-width-container"> <div class="max-width-container">
<div class="container"> <div class="container">
<div class="left"> <div class="left">
<a [routerLink]="[ '/orgs/', orgId]" mat-icon-button> <a [routerLink]="[ '/org']" mat-icon-button>
<mat-icon class="icon">arrow_back</mat-icon> <mat-icon class="icon">arrow_back</mat-icon>
</a> </a>
</div> </div>
@ -51,13 +51,13 @@
<span class="left-desc">{{'ORG.POLICY.DATA.MINLENGTH' | translate}}</span> <span class="left-desc">{{'ORG.POLICY.DATA.MINLENGTH' | translate}}</span>
<span class="fill-space"></span> <span class="fill-space"></span>
<div class="length-wrapper"> <div class="length-wrapper">
<button mat-icon-button (click)="incrementLength()">
<mat-icon>add</mat-icon>
</button>
<span>{{complexityData?.minLength}}</span>
<button mat-icon-button (click)="decrementLength()"> <button mat-icon-button (click)="decrementLength()">
<mat-icon>remove</mat-icon> <mat-icon>remove</mat-icon>
</button> </button>
<span>{{complexityData?.minLength}}</span>
<button mat-icon-button (click)="incrementLength()">
<mat-icon>add</mat-icon>
</button>
</div> </div>
</div> </div>
<div class="row"> <div class="row">

View File

@ -51,7 +51,7 @@ export class ProjectRoleCreateComponent implements OnInit, OnDestroy {
this.formGroup = new FormGroup({ this.formGroup = new FormGroup({
key: new FormControl('', [Validators.required]), key: new FormControl('', [Validators.required]),
displayName: new FormControl(''), displayName: new FormControl(''),
group: new FormControl('', [Validators.required]), group: new FormControl(''),
}); });
this.formArray = new FormArray([this.formGroup]); this.formArray = new FormArray([this.formGroup]);

View File

@ -8,9 +8,7 @@
<div class="full-width"> <div class="full-width">
<p class="desc">{{ 'PROJECT.PAGES.DESCRIPTION' | translate }}</p> <p class="desc">{{ 'PROJECT.PAGES.DESCRIPTION' | translate }}</p>
<p *ngIf="isZitadel" class="zitadel-warning">This belongs to Zitadel project. If you change something, <p *ngIf="isZitadel" class="zitadel-warning">{{'PROJECT.PAGES.ZITADELPROJECT' | translate}}</p>
Zitadel
may not behave as intended!</p>
</div> </div>
</div> </div>

View File

@ -28,8 +28,6 @@
}}</span> }}</span>
<span class="name" *ngIf="item.projectName">{{ item.projectName }}</span> <span class="name" *ngIf="item.projectName">{{ item.projectName }}</span>
<span class="description" *ngIf="item.state">{{'PROJECT.STATE.'+item.state | translate}}</span> <span class="description" *ngIf="item.state">{{'PROJECT.STATE.'+item.state | translate}}</span>
<span class="description">{{'PROJECT.TYPE.TITLE' | translate}}:
{{'PROJECT.TYPE.'+ProjectType.PROJECTTYPE_GRANTED | translate}}</span>
<span *ngIf="item.changeDate" class="created">created on <span *ngIf="item.changeDate" class="created">created on
{{ {{
dateFromTimestamp(item.creationDate) | date: 'EEE dd. MMM, HH:mm' dateFromTimestamp(item.creationDate) | date: 'EEE dd. MMM, HH:mm'

View File

@ -1,5 +1,5 @@
<app-granted-project-grid *ngIf="grid" [loading]="loading$ | async" (changedView)="grid = false" <app-granted-project-grid *ngIf="grid" [loading]="loading$ | async" (changedView)="grid = false"
[items]="grantedProjectList" (newClicked)="addProject()"> [items]="grantedProjectList">
</app-granted-project-grid> </app-granted-project-grid>
<div *ngIf="!grid" class="view-toggle"> <div *ngIf="!grid" class="view-toggle">
@ -31,9 +31,6 @@
<mat-icon svgIcon="mdi_light_on"></mat-icon> <mat-icon svgIcon="mdi_light_on"></mat-icon>
</button> </button>
</div> </div>
<a class="add-button" [routerLink]="[ '/projects', 'create']" color="primary" mat-raised-button>
<mat-icon class="icon">add</mat-icon>{{ 'ACTIONS.NEW' | translate }}
</a>
</div> </div>
<div class="table-wrapper"> <div class="table-wrapper">
<div class="spinner-container" *ngIf="(loading$ | async) || (loading$ | async)"> <div class="spinner-container" *ngIf="(loading$ | async) || (loading$ | async)">
@ -77,13 +74,6 @@
*ngIf="project.state">{{'PROJECT.STATE.'+project.state | translate}}</span></td> *ngIf="project.state">{{'PROJECT.STATE.'+project.state | translate}}</span></td>
</ng-container> </ng-container>
<ng-container matColumnDef="type">
<th mat-header-cell *matHeaderCellDef> {{ 'PROJECT.TABLE.TYPE' | translate }} </th>
<td mat-cell *matCellDef="let project">
<span *ngIf="project.type !== undefined">{{'PROJECT.TYPE.'+project.type | translate}}</span>
</td>
</ng-container>
<ng-container matColumnDef="creationDate"> <ng-container matColumnDef="creationDate">
<th mat-header-cell *matHeaderCellDef> {{ 'PROJECT.TABLE.CREATIONDATE' | translate }} </th> <th mat-header-cell *matHeaderCellDef> {{ 'PROJECT.TABLE.CREATIONDATE' | translate }} </th>
<td mat-cell *matCellDef="let project"> <td mat-cell *matCellDef="let project">

View File

@ -50,10 +50,6 @@
.icon-button { .icon-button {
margin-right: .5rem; margin-right: .5rem;
} }
.add-button {
border-radius: .5rem;
}
} }
.table-wrapper { .table-wrapper {

View File

@ -41,7 +41,7 @@ export class GrantedProjectListComponent implements OnInit, OnDestroy {
new MatTableDataSource<ProjectGrantView.AsObject>(); new MatTableDataSource<ProjectGrantView.AsObject>();
public grantedProjectList: ProjectGrantView.AsObject[] = []; public grantedProjectList: ProjectGrantView.AsObject[] = [];
public displayedColumns: string[] = ['select', 'name', 'orgName', 'orgDomain', 'type', 'state', 'creationDate', 'changeDate']; public displayedColumns: string[] = ['select', 'name', 'orgName', 'orgDomain', 'state', 'creationDate', 'changeDate'];
public selection: SelectionModel<ProjectGrantView.AsObject> = new SelectionModel<ProjectGrantView.AsObject>(true, []); public selection: SelectionModel<ProjectGrantView.AsObject> = new SelectionModel<ProjectGrantView.AsObject>(true, []);
private loadingSubject: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false); private loadingSubject: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false);

View File

@ -1,6 +1,6 @@
<app-meta-layout> <app-meta-layout>
<div class="max-width-container"> <div class="max-width-container">
<div class="head" *ngIf="project?.id"> <div class="head" *ngIf="project?.projectId">
<a [routerLink]="[ '/projects' ]" mat-icon-button> <a [routerLink]="[ '/projects' ]" mat-icon-button>
<mat-icon class="icon">arrow_back</mat-icon> <mat-icon class="icon">arrow_back</mat-icon>
</a> </a>
@ -39,7 +39,7 @@
<!-- show only on owned projects--> <!-- show only on owned projects-->
<ng-container *ngIf="project"> <ng-container *ngIf="project">
<ng-template appHasRole [appHasRole]="['project.app.read:' + project.id, 'project.app.read']"> <ng-template appHasRole [appHasRole]="['project.app.read:' + project.projectId, 'project.app.read']">
<app-project-application-grid *ngIf="grid" <app-project-application-grid *ngIf="grid"
[disabled]="project?.state !== ProjectState.PROJECTSTATE_ACTIVE || isZitadel" [disabled]="project?.state !== ProjectState.PROJECTSTATE_ACTIVE || isZitadel"
(changeView)="grid = false" [projectId]="projectId"></app-project-application-grid> (changeView)="grid = false" [projectId]="projectId"></app-project-application-grid>
@ -56,7 +56,8 @@
</ng-template> </ng-template>
<ng-container *ngIf="isZitadel == false"> <ng-container *ngIf="isZitadel == false">
<ng-template appHasRole [appHasRole]="['project.grant.read:' + project.id, 'project.grant.read']"> <ng-template appHasRole
[appHasRole]="['project.grant.read:' + project.projectId, 'project.grant.read']">
<app-card title="{{ 'PROJECT.GRANT.TITLE' | translate }}" <app-card title="{{ 'PROJECT.GRANT.TITLE' | translate }}"
description="{{ 'PROJECT.GRANT.DESCRIPTION' | translate }}"> description="{{ 'PROJECT.GRANT.DESCRIPTION' | translate }}">
<app-project-grants [disabled]="project?.state !== ProjectState.PROJECTSTATE_ACTIVE" <app-project-grants [disabled]="project?.state !== ProjectState.PROJECTSTATE_ACTIVE"
@ -65,7 +66,7 @@
</app-card> </app-card>
</ng-template> </ng-template>
<ng-template appHasRole [appHasRole]="['project.role.read:' + project.id, 'project.role.read']"> <ng-template appHasRole [appHasRole]="['project.role.read:' + project.projectId, 'project.role.read']">
<app-card title="{{ 'PROJECT.ROLE.TITLE' | translate }}" <app-card title="{{ 'PROJECT.ROLE.TITLE' | translate }}"
description="{{ 'PROJECT.ROLE.DESCRIPTION' | translate }}"> description="{{ 'PROJECT.ROLE.DESCRIPTION' | translate }}">
<app-project-roles [disabled]="project?.state !== ProjectState.PROJECTSTATE_ACTIVE" <app-project-roles [disabled]="project?.state !== ProjectState.PROJECTSTATE_ACTIVE"
@ -97,7 +98,7 @@
</app-project-contributors> </app-project-contributors>
</mat-tab> </mat-tab>
<mat-tab label="{{ 'CHANGES.PROJECT.TITLE' | translate }}" class="flex-col"> <mat-tab label="{{ 'CHANGES.PROJECT.TITLE' | translate }}" class="flex-col">
<app-changes *ngIf="project" [changeType]="ChangeType.PROJECT" [id]="project.id"></app-changes> <app-changes *ngIf="project" [changeType]="ChangeType.PROJECT" [id]="project.projectId"></app-changes>
</mat-tab> </mat-tab>
</mat-tab-group> </mat-tab-group>
</metainfo> </metainfo>

View File

@ -9,13 +9,13 @@ import { ChangeType } from 'src/app/modules/changes/changes.component';
import { import {
Application, Application,
ApplicationSearchResponse, ApplicationSearchResponse,
Project,
ProjectMember, ProjectMember,
ProjectMemberSearchResponse, ProjectMemberSearchResponse,
ProjectRole, ProjectRole,
ProjectRoleSearchResponse, ProjectRoleSearchResponse,
ProjectState, ProjectState,
ProjectType, ProjectType,
ProjectView,
} from 'src/app/proto/generated/management_pb'; } from 'src/app/proto/generated/management_pb';
import { OrgService } from 'src/app/services/org.service'; import { OrgService } from 'src/app/services/org.service';
import { ProjectService } from 'src/app/services/project.service'; import { ProjectService } from 'src/app/services/project.service';
@ -29,7 +29,7 @@ import { ToastService } from 'src/app/services/toast.service';
}) })
export class OwnedProjectDetailComponent implements OnInit, OnDestroy { export class OwnedProjectDetailComponent implements OnInit, OnDestroy {
public projectId: string = ''; public projectId: string = '';
public project!: Project.AsObject; public project!: ProjectView.AsObject;
public pageSizeRoles: number = 10; public pageSizeRoles: number = 10;
public roleDataSource: MatTableDataSource<ProjectRole.AsObject> = new MatTableDataSource<ProjectRole.AsObject>(); public roleDataSource: MatTableDataSource<ProjectRole.AsObject> = new MatTableDataSource<ProjectRole.AsObject>();
@ -105,7 +105,7 @@ export class OwnedProjectDetailComponent implements OnInit, OnDestroy {
} }
public saveProject(): void { public saveProject(): void {
this.projectService.UpdateProject(this.project as Project.AsObject).then(() => { this.projectService.UpdateProject(this.project.projectId, this.project.name).then(() => {
this.toast.showInfo('Project updated'); this.toast.showInfo('Project updated');
}).catch(error => { }).catch(error => {
this.toast.showInfo(error.message); this.toast.showInfo(error.message);

View File

@ -29,8 +29,6 @@
}}</span> }}</span>
<span class="name" *ngIf="item.name">{{ item.name }}</span> <span class="name" *ngIf="item.name">{{ item.name }}</span>
<span class="description" *ngIf="item.state">{{'PROJECT.STATE.'+item.state | translate}}</span> <span class="description" *ngIf="item.state">{{'PROJECT.STATE.'+item.state | translate}}</span>
<span class="description">{{'PROJECT.TYPE.TITLE' | translate}}:
{{'PROJECT.TYPE.'+ProjectType.PROJECTTYPE_OWNED | translate}}</span>
<span *ngIf="item.changeDate" class="created">created on <span *ngIf="item.changeDate" class="created">created on
{{ {{
dateFromTimestamp(item.creationDate) | date: 'EEE dd. MMM, HH:mm' dateFromTimestamp(item.creationDate) | date: 'EEE dd. MMM, HH:mm'

View File

@ -58,30 +58,12 @@
<td mat-cell *matCellDef="let project"> {{project.name}} </td> <td mat-cell *matCellDef="let project"> {{project.name}} </td>
</ng-container> </ng-container>
<ng-container matColumnDef="orgName">
<th mat-header-cell *matHeaderCellDef> {{ 'PROJECT.TABLE.ORGNAME' | translate }} </th>
<td class="pointer" mat-cell *matCellDef="let project">
{{project.orgName}} </td>
</ng-container>
<ng-container matColumnDef="orgDomain">
<th mat-header-cell *matHeaderCellDef> {{ 'PROJECT.TABLE.ORGDOMAIN' | translate }} </th>
<td class="pointer" mat-cell *matCellDef="let project">
{{project?.orgDomain}} </td>
</ng-container>
<ng-container matColumnDef="state"> <ng-container matColumnDef="state">
<th mat-header-cell *matHeaderCellDef> {{ 'PROJECT.TABLE.STATE' | translate }} </th> <th mat-header-cell *matHeaderCellDef> {{ 'PROJECT.TABLE.STATE' | translate }} </th>
<td mat-cell *matCellDef="let project"><span <td mat-cell *matCellDef="let project"><span
*ngIf="project.state">{{'PROJECT.STATE.'+project.state | translate}}</span></td> *ngIf="project.state">{{'PROJECT.STATE.'+project.state | translate}}</span></td>
</ng-container> </ng-container>
<ng-container matColumnDef="type">
<th mat-header-cell *matHeaderCellDef> {{ 'PROJECT.TABLE.TYPE' | translate }} </th>
<td mat-cell *matCellDef="let project">
<span *ngIf="project.type !== undefined">{{'PROJECT.TYPE.'+project.type | translate}}</span>
</td>
</ng-container>
<ng-container matColumnDef="creationDate"> <ng-container matColumnDef="creationDate">
<th mat-header-cell *matHeaderCellDef> {{ 'PROJECT.TABLE.CREATIONDATE' | translate }} </th> <th mat-header-cell *matHeaderCellDef> {{ 'PROJECT.TABLE.CREATIONDATE' | translate }} </th>

View File

@ -41,7 +41,7 @@ export class OwnedProjectListComponent implements OnInit, OnDestroy {
new MatTableDataSource<ProjectView.AsObject>(); new MatTableDataSource<ProjectView.AsObject>();
public ownedProjectList: ProjectView.AsObject[] = []; public ownedProjectList: ProjectView.AsObject[] = [];
public displayedColumns: string[] = ['select', 'name', 'orgName', 'orgDomain', 'type', 'state', 'creationDate', 'changeDate']; public displayedColumns: string[] = ['select', 'name', 'state', 'creationDate', 'changeDate'];
public selection: SelectionModel<ProjectView.AsObject> = new SelectionModel<ProjectView.AsObject>(true, []); public selection: SelectionModel<ProjectView.AsObject> = new SelectionModel<ProjectView.AsObject>(true, []);
private loadingSubject: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false); private loadingSubject: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false);

View File

@ -1,7 +1,7 @@
import { DataSource } from '@angular/cdk/collections'; import { DataSource } from '@angular/cdk/collections';
import { BehaviorSubject, from, Observable, of } from 'rxjs'; import { BehaviorSubject, from, Observable, of } from 'rxjs';
import { catchError, finalize, map } from 'rxjs/operators'; import { catchError, finalize, map } from 'rxjs/operators';
import { Project, ProjectMember, ProjectMemberSearchResponse, ProjectType } from 'src/app/proto/generated/management_pb'; import { ProjectMember, ProjectMemberSearchResponse, ProjectType, ProjectView } from 'src/app/proto/generated/management_pb';
import { ProjectService } from 'src/app/services/project.service'; import { ProjectService } from 'src/app/services/project.service';
/** /**
@ -19,7 +19,7 @@ export class ProjectMembersDataSource extends DataSource<ProjectMember.AsObject>
super(); super();
} }
public loadMembers(project: Project.AsObject, public loadMembers(project: ProjectView.AsObject,
projectType: ProjectType, projectType: ProjectType,
pageIndex: number, pageSize: number, grantId?: string, sortDirection?: string): void { pageIndex: number, pageSize: number, grantId?: string, sortDirection?: string): void {
const offset = pageIndex * pageSize; const offset = pageIndex * pageSize;
@ -28,9 +28,9 @@ export class ProjectMembersDataSource extends DataSource<ProjectMember.AsObject>
// TODO // TODO
const promise: Promise<ProjectMemberSearchResponse> | undefined = const promise: Promise<ProjectMemberSearchResponse> | undefined =
projectType === ProjectType.PROJECTTYPE_OWNED ? projectType === ProjectType.PROJECTTYPE_OWNED ?
this.projectService.SearchProjectMembers(project.id, pageSize, offset) : this.projectService.SearchProjectMembers(project.projectId, pageSize, offset) :
projectType === ProjectType.PROJECTTYPE_GRANTED && grantId ? projectType === ProjectType.PROJECTTYPE_GRANTED && grantId ?
this.projectService.SearchProjectGrantMembers(project.id, this.projectService.SearchProjectGrantMembers(project.projectId,
grantId, pageSize, offset) : undefined; grantId, pageSize, offset) : undefined;
if (promise) { if (promise) {
from(promise).pipe( from(promise).pipe(

View File

@ -1,7 +1,7 @@
<div class="max-width-container"> <div class="max-width-container">
<div class="container"> <div class="container">
<div class="left"> <div class="left">
<a *ngIf="project" [routerLink]="[ '/projects', project.id]" mat-icon-button> <a *ngIf="project" [routerLink]="[ '/projects', project.projectId]" mat-icon-button>
<mat-icon class="icon">arrow_back</mat-icon> <mat-icon class="icon">arrow_back</mat-icon>
</a> </a>
</div> </div>
@ -23,14 +23,16 @@
</ng-container> </ng-container>
</div> </div>
<span class="fill-space"></span> <span class="fill-space"></span>
<ng-template appHasRole [appHasRole]="['project.member.delete:'+project.id,'project.member.delete']"> <ng-template appHasRole
[appHasRole]="['project.member.delete:' + project.projectId, 'project.member.delete']">
<button (click)="removeProjectMemberSelection()" <button (click)="removeProjectMemberSelection()"
matTooltip="{{'ORG_DETAIL.TABLE.DELETE' | translate}}" class="icon-button" mat-icon-button matTooltip="{{'ORG_DETAIL.TABLE.DELETE' | translate}}" class="icon-button" mat-icon-button
*ngIf="selection.hasValue()"> *ngIf="selection.hasValue()">
<mat-icon>remove_circle</mat-icon> <mat-icon>remove_circle</mat-icon>
</button> </button>
</ng-template> </ng-template>
<ng-template appHasRole [appHasRole]="['project.member.write:'+project.id,'project.member.write']"> <ng-template appHasRole
[appHasRole]="['project.member.write:'+project.projectId,'project.member.write']">
<a color="primary" [disabled]="disabled" class="add-button" (click)="openAddMember()" <a color="primary" [disabled]="disabled" class="add-button" (click)="openAddMember()"
color="primary" mat-raised-button> color="primary" mat-raised-button>
<mat-icon class="icon">add</mat-icon>{{ 'ACTIONS.NEW' | translate }} <mat-icon class="icon">add</mat-icon>{{ 'ACTIONS.NEW' | translate }}

View File

@ -4,7 +4,7 @@ import { MatPaginator } from '@angular/material/paginator';
import { MatTable } from '@angular/material/table'; import { MatTable } from '@angular/material/table';
import { ActivatedRoute } from '@angular/router'; import { ActivatedRoute } from '@angular/router';
import { tap } from 'rxjs/operators'; import { tap } from 'rxjs/operators';
import { Project, ProjectMember, ProjectType } from 'src/app/proto/generated/management_pb'; import { ProjectMember, ProjectType, ProjectView } from 'src/app/proto/generated/management_pb';
import { ProjectService } from 'src/app/services/project.service'; import { ProjectService } from 'src/app/services/project.service';
import { ToastService } from 'src/app/services/toast.service'; import { ToastService } from 'src/app/services/toast.service';
@ -16,7 +16,7 @@ import { ProjectMembersDataSource } from './project-members-datasource';
styleUrls: ['./project-members.component.scss'], styleUrls: ['./project-members.component.scss'],
}) })
export class ProjectMembersComponent implements AfterViewInit { export class ProjectMembersComponent implements AfterViewInit {
public project!: Project.AsObject; public project!: ProjectView.AsObject;
public projectType: ProjectType = ProjectType.PROJECTTYPE_OWNED; public projectType: ProjectType = ProjectType.PROJECTTYPE_OWNED;
public disabled: boolean = false; public disabled: boolean = false;
@ViewChild(MatPaginator) public paginator!: MatPaginator; @ViewChild(MatPaginator) public paginator!: MatPaginator;
@ -60,7 +60,7 @@ export class ProjectMembersComponent implements AfterViewInit {
public removeProjectMemberSelection(): void { public removeProjectMemberSelection(): void {
Promise.all(this.selection.selected.map(member => { Promise.all(this.selection.selected.map(member => {
return this.projectService.RemoveProjectMember(this.project.id, member.userId).then(() => { return this.projectService.RemoveProjectMember(this.project.projectId, member.userId).then(() => {
this.toast.showInfo('Removed successfully'); this.toast.showInfo('Removed successfully');
}).catch(error => { }).catch(error => {
this.toast.showError(error.message); this.toast.showError(error.message);
@ -69,7 +69,7 @@ export class ProjectMembersComponent implements AfterViewInit {
} }
public removeMember(member: ProjectMember.AsObject): void { public removeMember(member: ProjectMember.AsObject): void {
this.projectService.RemoveProjectMember(this.project.id, member.userId).then(() => { this.projectService.RemoveProjectMember(this.project.projectId, member.userId).then(() => {
this.toast.showInfo('Member removed successfully'); this.toast.showInfo('Member removed successfully');
}).catch(error => { }).catch(error => {
this.toast.showError(error.message); this.toast.showError(error.message);

View File

@ -12,6 +12,7 @@ import { MatSortModule } from '@angular/material/sort';
import { MatTableModule } from '@angular/material/table'; import { MatTableModule } from '@angular/material/table';
import { MatTooltipModule } from '@angular/material/tooltip'; import { MatTooltipModule } from '@angular/material/tooltip';
import { TranslateModule } from '@ngx-translate/core'; import { TranslateModule } from '@ngx-translate/core';
import { HasRoleModule } from 'src/app/directives/has-role/has-role.module';
import { ProjectMembersRoutingModule } from './project-members-routing.module'; import { ProjectMembersRoutingModule } from './project-members-routing.module';
import { ProjectMembersComponent } from './project-members.component'; import { ProjectMembersComponent } from './project-members.component';
@ -23,6 +24,7 @@ import { ProjectMembersComponent } from './project-members.component';
ProjectMembersRoutingModule, ProjectMembersRoutingModule,
CommonModule, CommonModule,
MatAutocompleteModule, MatAutocompleteModule,
HasRoleModule,
MatChipsModule, MatChipsModule,
MatButtonModule, MatButtonModule,
MatCheckboxModule, MatCheckboxModule,

View File

@ -4,12 +4,25 @@
<mat-progress-bar *ngIf="loading" color="accent" mode="indeterminate"></mat-progress-bar> <mat-progress-bar *ngIf="loading" color="accent" mode="indeterminate"></mat-progress-bar>
<span *ngIf="!loading && !profile">No user</span> <span *ngIf="!loading && !user">{{ 'USER.PAGES.NOUSER' | translate }}</span>
<div class="col" *ngIf="profile"> <app-card title="{{ 'USER.PAGES.LOGINNAMES' | translate }}"
description="{{ 'USER.PAGES.LOGINNAMESDESC' | translate }}" *ngIf="user">
<div class="login-name-row" *ngFor="let login of user?.loginNamesList">
<span>{{login}}</span>
<button color="primary" [disabled]="copied == login"
[matTooltip]="(copied != login ? 'USER.PAGES.COPY' : 'USER.PAGES.COPIED' ) | translate"
(click)="copytoclipboard(login)" mat-icon-button>
<i *ngIf="copied != login" class="las la-clipboard"></i>
<i *ngIf="copied == login" class="las la-clipboard-check"></i>
</button>
</div>
</app-card>
<div class="col" *ngIf="user">
<app-card title="{{ 'USER.PROFILE.TITLE' | translate }}" <app-card title="{{ 'USER.PROFILE.TITLE' | translate }}"
description="{{'USER.PROFILE.DESCRIPTION' | translate}}"> description="{{'USER.PROFILE.DESCRIPTION' | translate}}">
<app-detail-form [genders]="genders" [languages]="languages" [profile]="profile" <app-detail-form [genders]="genders" [languages]="languages" [profile]="user"
(changedLanguage)="changedLanguage($event)" (submitData)="saveProfile($event)"> (changedLanguage)="changedLanguage($event)" (submitData)="saveProfile($event)">
</app-detail-form> </app-detail-form>
</app-card> </app-card>
@ -19,7 +32,7 @@
</app-card> </app-card>
</div> </div>
<app-card *ngIf="profile" title="{{'USER.PASSWORD.TITLE' | translate}}" <app-card *ngIf="user" title="{{'USER.PASSWORD.TITLE' | translate}}"
description="{{'USER.PASSWORD.DESCRIPTION' | translate}}"> description="{{'USER.PASSWORD.DESCRIPTION' | translate}}">
<form *ngIf="passwordForm" [formGroup]="passwordForm" (ngSubmit)="setPassword()"> <form *ngIf="passwordForm" [formGroup]="passwordForm" (ngSubmit)="setPassword()">
<div class="content"> <div class="content">
@ -65,7 +78,7 @@
</form> </form>
</app-card> </app-card>
<app-card *ngIf="profile" title="{{ 'USER.LOGINMETHODS.TITLE' | translate }}" <app-card *ngIf="user" title="{{ 'USER.LOGINMETHODS.TITLE' | translate }}"
description="{{ 'USER.LOGINMETHODS.DESCRIPTION' | translate }}"> description="{{ 'USER.LOGINMETHODS.DESCRIPTION' | translate }}">
<div class="method-col"> <div class="method-col">
<div class="method-row"> <div class="method-row">
@ -148,9 +161,9 @@
</div> </div>
</app-card> </app-card>
<app-auth-user-mfa *ngIf="profile" [profile]="profile"></app-auth-user-mfa> <app-auth-user-mfa *ngIf="user"></app-auth-user-mfa>
<app-card title="{{ 'USER.ADDRESS.TITLE' | translate }}" *ngIf="profile"> <app-card title="{{ 'USER.ADDRESS.TITLE' | translate }}" *ngIf="user">
<form [formGroup]="addressForm" (ngSubmit)="saveAddress()"> <form [formGroup]="addressForm" (ngSubmit)="saveAddress()">
<div class="content"> <div class="content">
<mat-form-field class="formfield"> <mat-form-field class="formfield">

View File

@ -30,6 +30,30 @@ h1 {
margin-bottom: 2rem; margin-bottom: 2rem;
} }
.login-name-row {
display: flex;
align-items: center;
button {
transition: opacity .15s ease-in-out;
visibility: hidden;
opacity: 0;
&[disabled] {
visibility: visible;
color: white;
opacity: 1;
}
}
&:hover {
button {
visibility: visible;
opacity: 1;
}
}
}
.content { .content {
display: flex; display: flex;
flex-direction: row; flex-direction: row;

View File

@ -3,10 +3,9 @@ import { AbstractControl, FormBuilder, FormGroup, Validators } from '@angular/fo
import { MatDialog } from '@angular/material/dialog'; import { MatDialog } from '@angular/material/dialog';
import { TranslateService } from '@ngx-translate/core'; import { TranslateService } from '@ngx-translate/core';
import { Subscription } from 'rxjs'; import { Subscription } from 'rxjs';
import { Gender, UserAddress, UserEmail, UserPhone, UserProfile } from 'src/app/proto/generated/auth_pb'; import { Gender, UserAddress, UserEmail, UserPhone, UserProfile, UserView } from 'src/app/proto/generated/auth_pb';
import { PasswordComplexityPolicy } from 'src/app/proto/generated/management_pb'; import { PasswordComplexityPolicy } from 'src/app/proto/generated/management_pb';
import { AuthUserService } from 'src/app/services/auth-user.service'; import { AuthUserService } from 'src/app/services/auth-user.service';
import { MgmtUserService } from 'src/app/services/mgmt-user.service';
import { OrgService } from 'src/app/services/org.service'; import { OrgService } from 'src/app/services/org.service';
import { ToastService } from 'src/app/services/toast.service'; import { ToastService } from 'src/app/services/toast.service';
@ -33,7 +32,7 @@ function passwordConfirmValidator(c: AbstractControl): any {
styleUrls: ['./auth-user-detail.component.scss'], styleUrls: ['./auth-user-detail.component.scss'],
}) })
export class AuthUserDetailComponent implements OnDestroy { export class AuthUserDetailComponent implements OnDestroy {
public profile!: UserProfile.AsObject; public user!: UserView.AsObject;
public email: UserEmail.AsObject = { email: '' } as any; public email: UserEmail.AsObject = { email: '' } as any;
public phone: UserPhone.AsObject = { phone: '' } as any; public phone: UserPhone.AsObject = { phone: '' } as any;
public address: UserAddress.AsObject = { id: '' } as any; public address: UserAddress.AsObject = { id: '' } as any;
@ -50,11 +49,11 @@ export class AuthUserDetailComponent implements OnDestroy {
public loading: boolean = false; public loading: boolean = false;
public policy!: PasswordComplexityPolicy.AsObject; public policy!: PasswordComplexityPolicy.AsObject;
public copied: string = '';
constructor( constructor(
public translate: TranslateService, public translate: TranslateService,
private toast: ToastService, private toast: ToastService,
private mgmtUserService: MgmtUserService,
private userService: AuthUserService, private userService: AuthUserService,
private fb: FormBuilder, private fb: FormBuilder,
private dialog: MatDialog, private dialog: MatDialog,
@ -63,6 +62,7 @@ export class AuthUserDetailComponent implements OnDestroy {
const validators: Validators[] = [Validators.required]; const validators: Validators[] = [Validators.required];
this.orgService.GetPasswordComplexityPolicy().then(data => { this.orgService.GetPasswordComplexityPolicy().then(data => {
this.policy = data.toObject(); this.policy = data.toObject();
console.log(this.policy);
if (this.policy.minLength) { if (this.policy.minLength) {
validators.push(Validators.minLength(this.policy.minLength)); validators.push(Validators.minLength(this.policy.minLength));
} }
@ -76,8 +76,7 @@ export class AuthUserDetailComponent implements OnDestroy {
validators.push(Validators.pattern(/[0-9]/g)); validators.push(Validators.pattern(/[0-9]/g));
} }
if (this.policy.hasSymbol) { if (this.policy.hasSymbol) {
// All characters that are not a digit or an English letter \W or a whitespace \S validators.push(Validators.pattern(/[^a-z0-9]/gi));
validators.push(Validators.pattern(/[\W\S]/));
} }
this.passwordForm = this.fb.group({ this.passwordForm = this.fb.group({
@ -86,11 +85,12 @@ export class AuthUserDetailComponent implements OnDestroy {
confirmPassword: ['', [...validators, passwordConfirmValidator]], confirmPassword: ['', [...validators, passwordConfirmValidator]],
}); });
}).catch(error => { }).catch(error => {
console.log('no password complexity policy defined!'); this.toast.showError(error.message);
console.error(error.message);
this.passwordForm = this.fb.group({ this.passwordForm = this.fb.group({
currentPassword: ['', []], currentPassword: ['', []],
newPassword: ['', []], newPassword: ['', validators],
confirmPassword: ['', [passwordConfirmValidator]], confirmPassword: ['', [...validators, passwordConfirmValidator]],
}); });
}); });
@ -116,18 +116,24 @@ export class AuthUserDetailComponent implements OnDestroy {
public saveProfile(profileData: UserProfile.AsObject): void { public saveProfile(profileData: UserProfile.AsObject): void {
console.log(profileData); console.log(profileData);
this.profile.firstName = profileData.firstName; this.user.firstName = profileData.firstName;
this.profile.lastName = profileData.lastName; this.user.lastName = profileData.lastName;
this.profile.nickName = profileData.nickName; this.user.nickName = profileData.nickName;
this.profile.displayName = profileData.displayName; this.user.displayName = profileData.displayName;
this.profile.gender = profileData.gender; this.user.gender = profileData.gender;
this.profile.preferredLanguage = profileData.preferredLanguage; this.user.preferredLanguage = profileData.preferredLanguage;
console.log(this.profile); console.log(this.user);
this.userService this.userService
.SaveMyUserProfile(this.profile as UserProfile.AsObject) .SaveMyUserProfile(
this.user.firstName,
this.user.lastName,
this.user.nickName,
this.user.preferredLanguage,
this.user.gender,
)
.then((data: UserProfile) => { .then((data: UserProfile) => {
this.toast.showInfo('Saved Profile'); this.toast.showInfo('Saved Profile');
this.profile = data.toObject(); this.user = Object.assign(this.user, data.toObject());
}) })
.catch(data => { .catch(data => {
this.toast.showError(data.message); this.toast.showError(data.message);
@ -214,7 +220,7 @@ export class AuthUserDetailComponent implements OnDestroy {
public savePhone(): void { public savePhone(): void {
this.phoneEditState = false; this.phoneEditState = false;
if (!this.phone.id) { if (!this.phone.id) {
this.phone.id = this.profile.id; this.phone.id = this.user.id;
} }
this.userService this.userService
.SaveMyUserPhone(this.phone).then((data: UserPhone) => { .SaveMyUserPhone(this.phone).then((data: UserPhone) => {
@ -265,12 +271,35 @@ export class AuthUserDetailComponent implements OnDestroy {
} }
private async getData(): Promise<void> { private async getData(): Promise<void> {
this.profile = (await this.userService.GetMyUserProfile()).toObject(); this.userService.GetMyUser().then(user => {
console.log(user.toObject());
this.user = user.toObject();
}).catch(err => {
console.error(err);
});
this.email = (await this.userService.GetMyUserEmail()).toObject(); this.email = (await this.userService.GetMyUserEmail()).toObject();
this.phone = (await this.userService.GetMyUserPhone()).toObject(); this.phone = (await this.userService.GetMyUserPhone()).toObject();
this.address = (await this.userService.GetMyUserAddress()).toObject(); this.address = (await this.userService.GetMyUserAddress()).toObject();
console.log(this.profile);
this.addressForm.patchValue(this.address); this.addressForm.patchValue(this.address);
} }
public copytoclipboard(value: string): void {
const selBox = document.createElement('textarea');
selBox.style.position = 'fixed';
selBox.style.left = '0';
selBox.style.top = '0';
selBox.style.opacity = '0';
selBox.value = value;
document.body.appendChild(selBox);
selBox.focus();
selBox.select();
document.execCommand('copy');
document.body.removeChild(selBox);
this.copied = value;
setTimeout(() => {
this.copied = '';
}, 3000);
}
} }

View File

@ -1,10 +1,8 @@
import { Component, Input, OnDestroy, OnInit } from '@angular/core'; import { Component, OnDestroy, OnInit } from '@angular/core';
import { MatDialog } from '@angular/material/dialog'; import { MatDialog } from '@angular/material/dialog';
import { BehaviorSubject, Observable } from 'rxjs'; import { BehaviorSubject, Observable } from 'rxjs';
import { MfaOtpResponse, MFAState, MfaType, MultiFactor } from 'src/app/proto/generated/auth_pb'; import { MfaOtpResponse, MFAState, MfaType, MultiFactor } from 'src/app/proto/generated/auth_pb';
import { UserProfile } from 'src/app/proto/generated/management_pb';
import { AuthUserService } from 'src/app/services/auth-user.service'; import { AuthUserService } from 'src/app/services/auth-user.service';
import { MgmtUserService } from 'src/app/services/mgmt-user.service';
import { ToastService } from 'src/app/services/toast.service'; import { ToastService } from 'src/app/services/toast.service';
import { DialogOtpComponent } from '../dialog-otp/dialog-otp.component'; import { DialogOtpComponent } from '../dialog-otp/dialog-otp.component';
@ -15,18 +13,15 @@ import { DialogOtpComponent } from '../dialog-otp/dialog-otp.component';
styleUrls: ['./auth-user-mfa.component.scss'], styleUrls: ['./auth-user-mfa.component.scss'],
}) })
export class AuthUserMfaComponent implements OnInit, OnDestroy { export class AuthUserMfaComponent implements OnInit, OnDestroy {
@Input() private profile!: UserProfile.AsObject;
public mfaSubject: BehaviorSubject<MultiFactor.AsObject[]> = new BehaviorSubject<MultiFactor.AsObject[]>([]); public mfaSubject: BehaviorSubject<MultiFactor.AsObject[]> = new BehaviorSubject<MultiFactor.AsObject[]>([]);
private loadingSubject: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false); private loadingSubject: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false);
public loading$: Observable<boolean> = this.loadingSubject.asObservable(); public loading$: Observable<boolean> = this.loadingSubject.asObservable();
public MfaType: any = MfaType; public MfaType: any = MfaType;
public MFAState: any = MFAState; public MFAState: any = MFAState;
constructor(private userService: AuthUserService, private mgmtUserService: MgmtUserService, constructor(private userService: AuthUserService, private toast: ToastService, private dialog: MatDialog) { }
private toast: ToastService, private dialog: MatDialog) { }
public ngOnInit(): void { public ngOnInit(): void {
console.log(this.profile);
this.getOTP(); this.getOTP();
} }
@ -58,8 +53,7 @@ export class AuthUserMfaComponent implements OnInit, OnDestroy {
} }
public getOTP(): void { public getOTP(): void {
console.log('otp'); this.userService.GetMyMfas().then(mfas => {
this.mgmtUserService.getUserMfas(this.profile.id).then(mfas => {
this.mfaSubject.next(mfas.toObject().mfasList); this.mfaSubject.next(mfas.toObject().mfasList);
console.log(mfas.toObject()); console.log(mfas.toObject());
}).catch(error => { }).catch(error => {

View File

@ -12,6 +12,8 @@
<mat-progress-bar *ngIf="loading" color="accent" mode="indeterminate"></mat-progress-bar> <mat-progress-bar *ngIf="loading" color="accent" mode="indeterminate"></mat-progress-bar>
<span *ngIf="!loading && !user">{{ 'USER.PAGES.NOUSER' | translate }}</span>
<ng-template appHasRole [appHasRole]="['user.read', 'user.read:'+user?.id]"> <ng-template appHasRole [appHasRole]="['user.read', 'user.read:'+user?.id]">
<app-card title="{{ 'USER.PROFILE.TITLE' | translate }}" <app-card title="{{ 'USER.PROFILE.TITLE' | translate }}"
description="{{'USER.PROFILE.DESCRIPTION' | translate}}"> description="{{'USER.PROFILE.DESCRIPTION' | translate}}">
@ -149,7 +151,7 @@
</div> </div>
</app-card> </app-card>
<app-auth-user-mfa *ngIf="user" [profile]="user"></app-auth-user-mfa> <app-auth-user-mfa *ngIf="user" [user]="user"></app-auth-user-mfa>
<app-card title="{{ 'USER.ADDRESS.TITLE' | translate }}"> <app-card title="{{ 'USER.ADDRESS.TITLE' | translate }}">
<form [formGroup]="addressForm" (ngSubmit)="saveAddress()"> <form [formGroup]="addressForm" (ngSubmit)="saveAddress()">

View File

@ -93,8 +93,7 @@ export class UserDetailComponent implements OnInit, OnDestroy {
validators.push(Validators.pattern(/[0-9]/g)); validators.push(Validators.pattern(/[0-9]/g));
} }
if (this.policy.hasSymbol) { if (this.policy.hasSymbol) {
// All characters that are not a digit or an English letter \W or a whitespace \S validators.push(Validators.pattern(/[^a-z0-9]/gi));
validators.push(Validators.pattern(/[\W\S]/));
} }
this.passwordForm = this.fb.group({ this.passwordForm = this.fb.group({
@ -161,7 +160,13 @@ export class UserDetailComponent implements OnInit, OnDestroy {
this.user.preferredLanguage = profileData.preferredLanguage; this.user.preferredLanguage = profileData.preferredLanguage;
console.log(this.user); console.log(this.user);
this.mgmtUserService this.mgmtUserService
.SaveUserProfile(this.user) .SaveUserProfile(
this.user.id,
this.user.firstName,
this.user.lastName,
this.user.nickName,
this.user.preferredLanguage,
this.user.gender)
.then((data: UserProfile) => { .then((data: UserProfile) => {
this.toast.showInfo('Saved Profile'); this.toast.showInfo('Saved Profile');
this.user = Object.assign(this.user, data.toObject()); this.user = Object.assign(this.user, data.toObject());

View File

@ -1,11 +1,13 @@
<app-card title="{{'USER.MFA.TITLE' | translate}}" description="{{'USER.MFA.MANAGE_DESCRIPTION' | translate}}"> <app-card title="{{'USER.MFA.TITLE' | translate}}" description="{{'USER.MFA.DESCRIPTION' | translate}}">
<div class="col">
<div class="row" *ngFor="let mfa of mfaSubject | async">
<span>{{'USER.MFA.TYPE.'+ mfa.type | translate}}</span>
<span>{{'USER.MFA.STATE.'+ mfa.state | translate}}</span>
</div>
</div>
<div class="table-wrapper"> <div class="table-wrapper">
<div class="spinner-container" *ngIf="loading$ | async"> <div class="spinner-container" *ngIf="loading$ | async">
<mat-spinner diameter="50"></mat-spinner> <mat-spinner diameter="50"></mat-spinner>
</div> </div>
<div class="col">
<div class="row"></div>
</div>
</div> </div>
</app-card> </app-card>

View File

@ -1,80 +1,18 @@
.table-header-row { .col {
display: flex; display: flex;
align-items: center; flex-direction: column;
border-bottom: 1px solid #ffffff20;
margin-bottom: 1rem;
.col { .row {
display: flex;
flex-direction: column;
.desc {
font-size: .8rem;
color: #81868a;
}
.count {
font-size: 2rem;
}
}
.fill-space {
flex: 1;
}
.icon-button {
margin-right: .5rem;
}
.add-button {
border-radius: .5rem;
}
}
.table-wrapper {
overflow: auto;
.spinner-container {
display: flex; display: flex;
justify-content: space-between;
padding: .5rem 0;
align-items: center; align-items: center;
justify-content: center;
}
table, mat-paginator { span {
width: 100%; flex: 1;
td, th {
&:first-child {
padding-left: 0;
padding-right: 1rem;
}
&:last-child {
padding-right: 0;
}
}
.data-row {
cursor: pointer;
&:hover {
background-color: #ffffff05;
}
}
.selection {
width: 50px;
max-width: 50px;
}
}
}
.add-row {
display: flex;
margin: -.5rem;
button {
border-radius: .5rem;
margin: .5rem;
mat-icon {
margin-right: .5rem;
} }
} }
} }

View File

@ -1,6 +1,8 @@
import { Component, Input, OnInit } from '@angular/core'; import { Component, Input, OnDestroy, OnInit } from '@angular/core';
import { BehaviorSubject, Observable } from 'rxjs'; import { BehaviorSubject, Observable } from 'rxjs';
import { UserProfile } from 'src/app/proto/generated/management_pb'; import { MFAState, MfaType, MultiFactor, UserView } from 'src/app/proto/generated/management_pb';
import { MgmtUserService } from 'src/app/services/mgmt-user.service';
import { ToastService } from 'src/app/services/toast.service';
export interface MFAItem { export interface MFAItem {
@ -13,16 +15,53 @@ export interface MFAItem {
templateUrl: './user-mfa.component.html', templateUrl: './user-mfa.component.html',
styleUrls: ['./user-mfa.component.scss'], styleUrls: ['./user-mfa.component.scss'],
}) })
export class UserMfaComponent implements OnInit { export class UserMfaComponent implements OnInit, OnDestroy {
@Input() public profile!: UserProfile; @Input() private user!: UserView.AsObject;
public mfaSubject: BehaviorSubject<MultiFactor.AsObject[]> = new BehaviorSubject<MultiFactor.AsObject[]>([]);
public mfaSubject: BehaviorSubject<MFAItem[]> = new BehaviorSubject<MFAItem[]>([]);
private loadingSubject: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false); private loadingSubject: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false);
public loading$: Observable<boolean> = this.loadingSubject.asObservable(); public loading$: Observable<boolean> = this.loadingSubject.asObservable();
constructor() { }
ngOnInit(): void {
public MfaType: any = MfaType;
public MFAState: any = MFAState;
constructor(private mgmtUserService: MgmtUserService,
private toast: ToastService) { }
public ngOnInit(): void {
console.log(this.user);
this.getOTP();
} }
public ngOnDestroy(): void {
this.mfaSubject.complete();
this.loadingSubject.complete();
}
public getOTP(): void {
console.log('otp', this.user);
this.mgmtUserService.getUserMfas(this.user.id).then(mfas => {
this.mfaSubject.next(mfas.toObject().mfasList);
console.log(mfas.toObject());
}).catch(error => {
console.error(error);
this.toast.showError(error.message);
});
}
// public deleteMFA(type: MfaType): void {
// if (type === MfaType.MFATYPE_OTP) {
// this.userService.RemoveMfaOTP().then(() => {
// this.toast.showInfo('OTP Deleted');
// const index = this.mfaSubject.value.findIndex(mfa => mfa.type === type);
// if (index > -1) {
// const newValues = this.mfaSubject.value;
// newValues.splice(index, 1);
// this.mfaSubject.next(newValues);
// }
// }).catch(error => {
// this.toast.showError(error.message);
// });
// }
// }
} }

View File

@ -215,6 +215,13 @@ export class AuthServiceClient {
response: MyPermissions) => void response: MyPermissions) => void
): grpcWeb.ClientReadableStream<MyPermissions>; ): grpcWeb.ClientReadableStream<MyPermissions>;
getMyProjectPermissions(
request: google_protobuf_empty_pb.Empty,
metadata: grpcWeb.Metadata | undefined,
callback: (err: grpcWeb.Error,
response: MyPermissions) => void
): grpcWeb.ClientReadableStream<MyPermissions>;
} }
export class AuthServicePromiseClient { export class AuthServicePromiseClient {
@ -347,5 +354,10 @@ export class AuthServicePromiseClient {
metadata?: grpcWeb.Metadata metadata?: grpcWeb.Metadata
): Promise<MyPermissions>; ): Promise<MyPermissions>;
getMyProjectPermissions(
request: google_protobuf_empty_pb.Empty,
metadata?: grpcWeb.Metadata
): Promise<MyPermissions>;
} }

View File

@ -2084,5 +2084,85 @@ proto.caos.zitadel.auth.api.v1.AuthServicePromiseClient.prototype.getMyZitadelPe
}; };
/**
* @const
* @type {!grpc.web.MethodDescriptor<
* !proto.google.protobuf.Empty,
* !proto.caos.zitadel.auth.api.v1.MyPermissions>}
*/
const methodDescriptor_AuthService_GetMyProjectPermissions = new grpc.web.MethodDescriptor(
'/caos.zitadel.auth.api.v1.AuthService/GetMyProjectPermissions',
grpc.web.MethodType.UNARY,
google_protobuf_empty_pb.Empty,
proto.caos.zitadel.auth.api.v1.MyPermissions,
/**
* @param {!proto.google.protobuf.Empty} request
* @return {!Uint8Array}
*/
function(request) {
return request.serializeBinary();
},
proto.caos.zitadel.auth.api.v1.MyPermissions.deserializeBinary
);
/**
* @const
* @type {!grpc.web.AbstractClientBase.MethodInfo<
* !proto.google.protobuf.Empty,
* !proto.caos.zitadel.auth.api.v1.MyPermissions>}
*/
const methodInfo_AuthService_GetMyProjectPermissions = new grpc.web.AbstractClientBase.MethodInfo(
proto.caos.zitadel.auth.api.v1.MyPermissions,
/**
* @param {!proto.google.protobuf.Empty} request
* @return {!Uint8Array}
*/
function(request) {
return request.serializeBinary();
},
proto.caos.zitadel.auth.api.v1.MyPermissions.deserializeBinary
);
/**
* @param {!proto.google.protobuf.Empty} request The
* request proto
* @param {?Object<string, string>} metadata User defined
* call metadata
* @param {function(?grpc.web.Error, ?proto.caos.zitadel.auth.api.v1.MyPermissions)}
* callback The callback function(error, response)
* @return {!grpc.web.ClientReadableStream<!proto.caos.zitadel.auth.api.v1.MyPermissions>|undefined}
* The XHR Node Readable Stream
*/
proto.caos.zitadel.auth.api.v1.AuthServiceClient.prototype.getMyProjectPermissions =
function(request, metadata, callback) {
return this.client_.rpcCall(this.hostname_ +
'/caos.zitadel.auth.api.v1.AuthService/GetMyProjectPermissions',
request,
metadata || {},
methodDescriptor_AuthService_GetMyProjectPermissions,
callback);
};
/**
* @param {!proto.google.protobuf.Empty} request The
* request proto
* @param {?Object<string, string>} metadata User defined
* call metadata
* @return {!Promise<!proto.caos.zitadel.auth.api.v1.MyPermissions>}
* A native promise that resolves to the response
*/
proto.caos.zitadel.auth.api.v1.AuthServicePromiseClient.prototype.getMyProjectPermissions =
function(request, metadata) {
return this.client_.unaryCall(this.hostname_ +
'/caos.zitadel.auth.api.v1.AuthService/GetMyProjectPermissions',
request,
metadata || {},
methodDescriptor_AuthService_GetMyProjectPermissions);
};
module.exports = proto.caos.zitadel.auth.api.v1; module.exports = proto.caos.zitadel.auth.api.v1;

View File

@ -17,13 +17,14 @@ import {
ApplicationSearchRequest, ApplicationSearchRequest,
ApplicationSearchResponse, ApplicationSearchResponse,
ApplicationUpdate, ApplicationUpdate,
AuthGrantSearchRequest, ApplicationView,
AuthGrantSearchResponse,
ChangeOrgMemberRequest, ChangeOrgMemberRequest,
ChangeRequest, ChangeRequest,
Changes, Changes,
ClientSecret, ClientSecret,
CreateUserRequest, CreateUserRequest,
Domain,
Email,
GrantedProjectSearchRequest, GrantedProjectSearchRequest,
Iam, Iam,
MultiFactors, MultiFactors,
@ -34,11 +35,12 @@ import {
OrgDomain, OrgDomain,
OrgDomainSearchRequest, OrgDomainSearchRequest,
OrgDomainSearchResponse, OrgDomainSearchResponse,
OrgID, OrgIamPolicy,
OrgMember, OrgMember,
OrgMemberRoles, OrgMemberRoles,
OrgMemberSearchRequest, OrgMemberSearchRequest,
OrgMemberSearchResponse, OrgMemberSearchResponse,
OrgView,
PasswordAgePolicy, PasswordAgePolicy,
PasswordAgePolicyCreate, PasswordAgePolicyCreate,
PasswordAgePolicyID, PasswordAgePolicyID,
@ -82,6 +84,7 @@ import {
ProjectMemberSearchResponse, ProjectMemberSearchResponse,
ProjectRole, ProjectRole,
ProjectRoleAdd, ProjectRoleAdd,
ProjectRoleAddBulk,
ProjectRoleChange, ProjectRoleChange,
ProjectRoleRemove, ProjectRoleRemove,
ProjectRoleSearchRequest, ProjectRoleSearchRequest,
@ -92,6 +95,7 @@ import {
ProjectUserGrantID, ProjectUserGrantID,
ProjectUserGrantSearchRequest, ProjectUserGrantSearchRequest,
ProjectUserGrantUpdate, ProjectUserGrantUpdate,
ProjectView,
RemoveOrgDomainRequest, RemoveOrgDomainRequest,
RemoveOrgMemberRequest, RemoveOrgMemberRequest,
SetPasswordNotificationRequest, SetPasswordNotificationRequest,
@ -105,14 +109,17 @@ import {
UserAddress, UserAddress,
UserAddressView, UserAddressView,
UserEmail, UserEmail,
UserEmailID,
UserEmailView, UserEmailView,
UserGrant, UserGrant,
UserGrantCreate, UserGrantCreate,
UserGrantCreateBulk,
UserGrantID, UserGrantID,
UserGrantRemoveBulk,
UserGrantSearchRequest, UserGrantSearchRequest,
UserGrantSearchResponse, UserGrantSearchResponse,
UserGrantUpdate, UserGrantUpdate,
UserGrantUpdateBulk,
UserGrantView,
UserID, UserID,
UserPhone, UserPhone,
UserPhoneView, UserPhoneView,
@ -163,7 +170,7 @@ export class ManagementServiceClient {
): grpcWeb.ClientReadableStream<UserView>; ): grpcWeb.ClientReadableStream<UserView>;
getUserByEmailGlobal( getUserByEmailGlobal(
request: UserEmailID, request: Email,
metadata: grpcWeb.Metadata | undefined, metadata: grpcWeb.Metadata | undefined,
callback: (err: grpcWeb.Error, callback: (err: grpcWeb.Error,
response: UserView) => void response: UserView) => void
@ -428,29 +435,29 @@ export class ManagementServiceClient {
response: google_protobuf_empty_pb.Empty) => void response: google_protobuf_empty_pb.Empty) => void
): grpcWeb.ClientReadableStream<google_protobuf_empty_pb.Empty>; ): grpcWeb.ClientReadableStream<google_protobuf_empty_pb.Empty>;
getOrgByID( getMyOrg(
request: OrgID, request: google_protobuf_empty_pb.Empty,
metadata: grpcWeb.Metadata | undefined, metadata: grpcWeb.Metadata | undefined,
callback: (err: grpcWeb.Error, callback: (err: grpcWeb.Error,
response: Org) => void response: OrgView) => void
): grpcWeb.ClientReadableStream<Org>; ): grpcWeb.ClientReadableStream<OrgView>;
getOrgByDomainGlobal( getOrgByDomainGlobal(
request: OrgDomain, request: Domain,
metadata: grpcWeb.Metadata | undefined,
callback: (err: grpcWeb.Error,
response: OrgView) => void
): grpcWeb.ClientReadableStream<OrgView>;
deactivateMyOrg(
request: google_protobuf_empty_pb.Empty,
metadata: grpcWeb.Metadata | undefined, metadata: grpcWeb.Metadata | undefined,
callback: (err: grpcWeb.Error, callback: (err: grpcWeb.Error,
response: Org) => void response: Org) => void
): grpcWeb.ClientReadableStream<Org>; ): grpcWeb.ClientReadableStream<Org>;
deactivateOrg( reactivateMyOrg(
request: OrgID, request: google_protobuf_empty_pb.Empty,
metadata: grpcWeb.Metadata | undefined,
callback: (err: grpcWeb.Error,
response: Org) => void
): grpcWeb.ClientReadableStream<Org>;
reactivateOrg(
request: OrgID,
metadata: grpcWeb.Metadata | undefined, metadata: grpcWeb.Metadata | undefined,
callback: (err: grpcWeb.Error, callback: (err: grpcWeb.Error,
response: Org) => void response: Org) => void
@ -477,6 +484,13 @@ export class ManagementServiceClient {
response: google_protobuf_empty_pb.Empty) => void response: google_protobuf_empty_pb.Empty) => void
): grpcWeb.ClientReadableStream<google_protobuf_empty_pb.Empty>; ): grpcWeb.ClientReadableStream<google_protobuf_empty_pb.Empty>;
getMyOrgIamPolicy(
request: google_protobuf_empty_pb.Empty,
metadata: grpcWeb.Metadata | undefined,
callback: (err: grpcWeb.Error,
response: OrgIamPolicy) => void
): grpcWeb.ClientReadableStream<OrgIamPolicy>;
getOrgMemberRoles( getOrgMemberRoles(
request: google_protobuf_empty_pb.Empty, request: google_protobuf_empty_pb.Empty,
metadata: grpcWeb.Metadata | undefined, metadata: grpcWeb.Metadata | undefined,
@ -523,8 +537,8 @@ export class ManagementServiceClient {
request: ProjectID, request: ProjectID,
metadata: grpcWeb.Metadata | undefined, metadata: grpcWeb.Metadata | undefined,
callback: (err: grpcWeb.Error, callback: (err: grpcWeb.Error,
response: Project) => void response: ProjectView) => void
): grpcWeb.ClientReadableStream<Project>; ): grpcWeb.ClientReadableStream<ProjectView>;
createProject( createProject(
request: ProjectCreateRequest, request: ProjectCreateRequest,
@ -617,6 +631,13 @@ export class ManagementServiceClient {
response: ProjectRole) => void response: ProjectRole) => void
): grpcWeb.ClientReadableStream<ProjectRole>; ): grpcWeb.ClientReadableStream<ProjectRole>;
bulkAddProjectRole(
request: ProjectRoleAddBulk,
metadata: grpcWeb.Metadata | undefined,
callback: (err: grpcWeb.Error,
response: google_protobuf_empty_pb.Empty) => void
): grpcWeb.ClientReadableStream<google_protobuf_empty_pb.Empty>;
changeProjectRole( changeProjectRole(
request: ProjectRoleChange, request: ProjectRoleChange,
metadata: grpcWeb.Metadata | undefined, metadata: grpcWeb.Metadata | undefined,
@ -642,8 +663,8 @@ export class ManagementServiceClient {
request: ApplicationID, request: ApplicationID,
metadata: grpcWeb.Metadata | undefined, metadata: grpcWeb.Metadata | undefined,
callback: (err: grpcWeb.Error, callback: (err: grpcWeb.Error,
response: Application) => void response: ApplicationView) => void
): grpcWeb.ClientReadableStream<Application>; ): grpcWeb.ClientReadableStream<ApplicationView>;
createOIDCApplication( createOIDCApplication(
request: OIDCApplicationCreate, request: OIDCApplicationCreate,
@ -705,8 +726,8 @@ export class ManagementServiceClient {
request: ProjectGrantID, request: ProjectGrantID,
metadata: grpcWeb.Metadata | undefined, metadata: grpcWeb.Metadata | undefined,
callback: (err: grpcWeb.Error, callback: (err: grpcWeb.Error,
response: ProjectGrant) => void response: ProjectGrantView) => void
): grpcWeb.ClientReadableStream<ProjectGrant>; ): grpcWeb.ClientReadableStream<ProjectGrantView>;
createProjectGrant( createProjectGrant(
request: ProjectGrantCreate, request: ProjectGrantCreate,
@ -789,8 +810,8 @@ export class ManagementServiceClient {
request: UserGrantID, request: UserGrantID,
metadata: grpcWeb.Metadata | undefined, metadata: grpcWeb.Metadata | undefined,
callback: (err: grpcWeb.Error, callback: (err: grpcWeb.Error,
response: UserGrant) => void response: UserGrantView) => void
): grpcWeb.ClientReadableStream<UserGrant>; ): grpcWeb.ClientReadableStream<UserGrantView>;
createUserGrant( createUserGrant(
request: UserGrantCreate, request: UserGrantCreate,
@ -827,6 +848,27 @@ export class ManagementServiceClient {
response: google_protobuf_empty_pb.Empty) => void response: google_protobuf_empty_pb.Empty) => void
): grpcWeb.ClientReadableStream<google_protobuf_empty_pb.Empty>; ): grpcWeb.ClientReadableStream<google_protobuf_empty_pb.Empty>;
bulkCreateUserGrant(
request: UserGrantCreateBulk,
metadata: grpcWeb.Metadata | undefined,
callback: (err: grpcWeb.Error,
response: google_protobuf_empty_pb.Empty) => void
): grpcWeb.ClientReadableStream<google_protobuf_empty_pb.Empty>;
bulkUpdateUserGrant(
request: UserGrantUpdateBulk,
metadata: grpcWeb.Metadata | undefined,
callback: (err: grpcWeb.Error,
response: google_protobuf_empty_pb.Empty) => void
): grpcWeb.ClientReadableStream<google_protobuf_empty_pb.Empty>;
bulkRemoveUserGrant(
request: UserGrantRemoveBulk,
metadata: grpcWeb.Metadata | undefined,
callback: (err: grpcWeb.Error,
response: google_protobuf_empty_pb.Empty) => void
): grpcWeb.ClientReadableStream<google_protobuf_empty_pb.Empty>;
searchProjectUserGrants( searchProjectUserGrants(
request: ProjectUserGrantSearchRequest, request: ProjectUserGrantSearchRequest,
metadata: grpcWeb.Metadata | undefined, metadata: grpcWeb.Metadata | undefined,
@ -838,8 +880,8 @@ export class ManagementServiceClient {
request: ProjectUserGrantID, request: ProjectUserGrantID,
metadata: grpcWeb.Metadata | undefined, metadata: grpcWeb.Metadata | undefined,
callback: (err: grpcWeb.Error, callback: (err: grpcWeb.Error,
response: UserGrant) => void response: UserGrantView) => void
): grpcWeb.ClientReadableStream<UserGrant>; ): grpcWeb.ClientReadableStream<UserGrantView>;
createProjectUserGrant( createProjectUserGrant(
request: UserGrantCreate, request: UserGrantCreate,
@ -880,8 +922,8 @@ export class ManagementServiceClient {
request: ProjectGrantUserGrantID, request: ProjectGrantUserGrantID,
metadata: grpcWeb.Metadata | undefined, metadata: grpcWeb.Metadata | undefined,
callback: (err: grpcWeb.Error, callback: (err: grpcWeb.Error,
response: UserGrant) => void response: UserGrantView) => void
): grpcWeb.ClientReadableStream<UserGrant>; ): grpcWeb.ClientReadableStream<UserGrantView>;
createProjectGrantUserGrant( createProjectGrantUserGrant(
request: ProjectGrantUserGrantCreate, request: ProjectGrantUserGrantCreate,
@ -911,13 +953,6 @@ export class ManagementServiceClient {
response: UserGrant) => void response: UserGrant) => void
): grpcWeb.ClientReadableStream<UserGrant>; ): grpcWeb.ClientReadableStream<UserGrant>;
searchAuthGrant(
request: AuthGrantSearchRequest,
metadata: grpcWeb.Metadata | undefined,
callback: (err: grpcWeb.Error,
response: AuthGrantSearchResponse) => void
): grpcWeb.ClientReadableStream<AuthGrantSearchResponse>;
} }
export class ManagementServicePromiseClient { export class ManagementServicePromiseClient {
@ -951,7 +986,7 @@ export class ManagementServicePromiseClient {
): Promise<UserView>; ): Promise<UserView>;
getUserByEmailGlobal( getUserByEmailGlobal(
request: UserEmailID, request: Email,
metadata?: grpcWeb.Metadata metadata?: grpcWeb.Metadata
): Promise<UserView>; ): Promise<UserView>;
@ -1140,23 +1175,23 @@ export class ManagementServicePromiseClient {
metadata?: grpcWeb.Metadata metadata?: grpcWeb.Metadata
): Promise<google_protobuf_empty_pb.Empty>; ): Promise<google_protobuf_empty_pb.Empty>;
getOrgByID( getMyOrg(
request: OrgID, request: google_protobuf_empty_pb.Empty,
metadata?: grpcWeb.Metadata metadata?: grpcWeb.Metadata
): Promise<Org>; ): Promise<OrgView>;
getOrgByDomainGlobal( getOrgByDomainGlobal(
request: OrgDomain, request: Domain,
metadata?: grpcWeb.Metadata
): Promise<OrgView>;
deactivateMyOrg(
request: google_protobuf_empty_pb.Empty,
metadata?: grpcWeb.Metadata metadata?: grpcWeb.Metadata
): Promise<Org>; ): Promise<Org>;
deactivateOrg( reactivateMyOrg(
request: OrgID, request: google_protobuf_empty_pb.Empty,
metadata?: grpcWeb.Metadata
): Promise<Org>;
reactivateOrg(
request: OrgID,
metadata?: grpcWeb.Metadata metadata?: grpcWeb.Metadata
): Promise<Org>; ): Promise<Org>;
@ -1175,6 +1210,11 @@ export class ManagementServicePromiseClient {
metadata?: grpcWeb.Metadata metadata?: grpcWeb.Metadata
): Promise<google_protobuf_empty_pb.Empty>; ): Promise<google_protobuf_empty_pb.Empty>;
getMyOrgIamPolicy(
request: google_protobuf_empty_pb.Empty,
metadata?: grpcWeb.Metadata
): Promise<OrgIamPolicy>;
getOrgMemberRoles( getOrgMemberRoles(
request: google_protobuf_empty_pb.Empty, request: google_protobuf_empty_pb.Empty,
metadata?: grpcWeb.Metadata metadata?: grpcWeb.Metadata
@ -1208,7 +1248,7 @@ export class ManagementServicePromiseClient {
projectByID( projectByID(
request: ProjectID, request: ProjectID,
metadata?: grpcWeb.Metadata metadata?: grpcWeb.Metadata
): Promise<Project>; ): Promise<ProjectView>;
createProject( createProject(
request: ProjectCreateRequest, request: ProjectCreateRequest,
@ -1275,6 +1315,11 @@ export class ManagementServicePromiseClient {
metadata?: grpcWeb.Metadata metadata?: grpcWeb.Metadata
): Promise<ProjectRole>; ): Promise<ProjectRole>;
bulkAddProjectRole(
request: ProjectRoleAddBulk,
metadata?: grpcWeb.Metadata
): Promise<google_protobuf_empty_pb.Empty>;
changeProjectRole( changeProjectRole(
request: ProjectRoleChange, request: ProjectRoleChange,
metadata?: grpcWeb.Metadata metadata?: grpcWeb.Metadata
@ -1293,7 +1338,7 @@ export class ManagementServicePromiseClient {
applicationByID( applicationByID(
request: ApplicationID, request: ApplicationID,
metadata?: grpcWeb.Metadata metadata?: grpcWeb.Metadata
): Promise<Application>; ): Promise<ApplicationView>;
createOIDCApplication( createOIDCApplication(
request: OIDCApplicationCreate, request: OIDCApplicationCreate,
@ -1338,7 +1383,7 @@ export class ManagementServicePromiseClient {
projectGrantByID( projectGrantByID(
request: ProjectGrantID, request: ProjectGrantID,
metadata?: grpcWeb.Metadata metadata?: grpcWeb.Metadata
): Promise<ProjectGrant>; ): Promise<ProjectGrantView>;
createProjectGrant( createProjectGrant(
request: ProjectGrantCreate, request: ProjectGrantCreate,
@ -1398,7 +1443,7 @@ export class ManagementServicePromiseClient {
userGrantByID( userGrantByID(
request: UserGrantID, request: UserGrantID,
metadata?: grpcWeb.Metadata metadata?: grpcWeb.Metadata
): Promise<UserGrant>; ): Promise<UserGrantView>;
createUserGrant( createUserGrant(
request: UserGrantCreate, request: UserGrantCreate,
@ -1425,6 +1470,21 @@ export class ManagementServicePromiseClient {
metadata?: grpcWeb.Metadata metadata?: grpcWeb.Metadata
): Promise<google_protobuf_empty_pb.Empty>; ): Promise<google_protobuf_empty_pb.Empty>;
bulkCreateUserGrant(
request: UserGrantCreateBulk,
metadata?: grpcWeb.Metadata
): Promise<google_protobuf_empty_pb.Empty>;
bulkUpdateUserGrant(
request: UserGrantUpdateBulk,
metadata?: grpcWeb.Metadata
): Promise<google_protobuf_empty_pb.Empty>;
bulkRemoveUserGrant(
request: UserGrantRemoveBulk,
metadata?: grpcWeb.Metadata
): Promise<google_protobuf_empty_pb.Empty>;
searchProjectUserGrants( searchProjectUserGrants(
request: ProjectUserGrantSearchRequest, request: ProjectUserGrantSearchRequest,
metadata?: grpcWeb.Metadata metadata?: grpcWeb.Metadata
@ -1433,7 +1493,7 @@ export class ManagementServicePromiseClient {
projectUserGrantByID( projectUserGrantByID(
request: ProjectUserGrantID, request: ProjectUserGrantID,
metadata?: grpcWeb.Metadata metadata?: grpcWeb.Metadata
): Promise<UserGrant>; ): Promise<UserGrantView>;
createProjectUserGrant( createProjectUserGrant(
request: UserGrantCreate, request: UserGrantCreate,
@ -1463,7 +1523,7 @@ export class ManagementServicePromiseClient {
projectGrantUserGrantByID( projectGrantUserGrantByID(
request: ProjectGrantUserGrantID, request: ProjectGrantUserGrantID,
metadata?: grpcWeb.Metadata metadata?: grpcWeb.Metadata
): Promise<UserGrant>; ): Promise<UserGrantView>;
createProjectGrantUserGrant( createProjectGrantUserGrant(
request: ProjectGrantUserGrantCreate, request: ProjectGrantUserGrantCreate,
@ -1485,10 +1545,5 @@ export class ManagementServicePromiseClient {
metadata?: grpcWeb.Metadata metadata?: grpcWeb.Metadata
): Promise<UserGrant>; ): Promise<UserGrant>;
searchAuthGrant(
request: AuthGrantSearchRequest,
metadata?: grpcWeb.Metadata
): Promise<AuthGrantSearchResponse>;
} }

File diff suppressed because it is too large Load Diff

View File

@ -193,19 +193,19 @@ export namespace UserID {
} }
} }
export class UserEmailID extends jspb.Message { export class Email extends jspb.Message {
getEmail(): string; getEmail(): string;
setEmail(value: string): void; setEmail(value: string): void;
serializeBinary(): Uint8Array; serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): UserEmailID.AsObject; toObject(includeInstance?: boolean): Email.AsObject;
static toObject(includeInstance: boolean, msg: UserEmailID): UserEmailID.AsObject; static toObject(includeInstance: boolean, msg: Email): Email.AsObject;
static serializeBinaryToWriter(message: UserEmailID, writer: jspb.BinaryWriter): void; static serializeBinaryToWriter(message: Email, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): UserEmailID; static deserializeBinary(bytes: Uint8Array): Email;
static deserializeBinaryFromReader(message: UserEmailID, reader: jspb.BinaryReader): UserEmailID; static deserializeBinaryFromReader(message: Email, reader: jspb.BinaryReader): Email;
} }
export namespace UserEmailID { export namespace Email {
export type AsObject = { export type AsObject = {
email: string, email: string,
} }
@ -1733,6 +1733,36 @@ export namespace PasswordLockoutPolicyUpdate {
} }
} }
export class OrgIamPolicy extends jspb.Message {
getOrgId(): string;
setOrgId(value: string): void;
getDescription(): string;
setDescription(value: string): void;
getUserLoginMustBeDomain(): boolean;
setUserLoginMustBeDomain(value: boolean): void;
getDefault(): boolean;
setDefault(value: boolean): void;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): OrgIamPolicy.AsObject;
static toObject(includeInstance: boolean, msg: OrgIamPolicy): OrgIamPolicy.AsObject;
static serializeBinaryToWriter(message: OrgIamPolicy, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): OrgIamPolicy;
static deserializeBinaryFromReader(message: OrgIamPolicy, reader: jspb.BinaryReader): OrgIamPolicy;
}
export namespace OrgIamPolicy {
export type AsObject = {
orgId: string,
description: string,
userLoginMustBeDomain: boolean,
pb_default: boolean,
}
}
export class OrgID extends jspb.Message { export class OrgID extends jspb.Message {
getId(): string; getId(): string;
setId(value: string): void; setId(value: string): void;
@ -1793,6 +1823,66 @@ export namespace Org {
} }
} }
export class OrgView extends jspb.Message {
getId(): string;
setId(value: string): void;
getState(): OrgState;
setState(value: OrgState): void;
getCreationDate(): google_protobuf_timestamp_pb.Timestamp | undefined;
setCreationDate(value?: google_protobuf_timestamp_pb.Timestamp): void;
hasCreationDate(): boolean;
clearCreationDate(): void;
getChangeDate(): google_protobuf_timestamp_pb.Timestamp | undefined;
setChangeDate(value?: google_protobuf_timestamp_pb.Timestamp): void;
hasChangeDate(): boolean;
clearChangeDate(): void;
getName(): string;
setName(value: string): void;
getSequence(): number;
setSequence(value: number): void;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): OrgView.AsObject;
static toObject(includeInstance: boolean, msg: OrgView): OrgView.AsObject;
static serializeBinaryToWriter(message: OrgView, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): OrgView;
static deserializeBinaryFromReader(message: OrgView, reader: jspb.BinaryReader): OrgView;
}
export namespace OrgView {
export type AsObject = {
id: string,
state: OrgState,
creationDate?: google_protobuf_timestamp_pb.Timestamp.AsObject,
changeDate?: google_protobuf_timestamp_pb.Timestamp.AsObject,
name: string,
sequence: number,
}
}
export class Domain extends jspb.Message {
getDomain(): string;
setDomain(value: string): void;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): Domain.AsObject;
static toObject(includeInstance: boolean, msg: Domain): Domain.AsObject;
static serializeBinaryToWriter(message: Domain, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): Domain;
static deserializeBinaryFromReader(message: Domain, reader: jspb.BinaryReader): Domain;
}
export namespace Domain {
export type AsObject = {
domain: string,
}
}
export class OrgDomains extends jspb.Message { export class OrgDomains extends jspb.Message {
getDomainsList(): Array<OrgDomain>; getDomainsList(): Array<OrgDomain>;
setDomainsList(value: Array<OrgDomain>): void; setDomainsList(value: Array<OrgDomain>): void;
@ -2697,6 +2787,30 @@ export namespace ProjectRoleAdd {
} }
} }
export class ProjectRoleAddBulk extends jspb.Message {
getId(): string;
setId(value: string): void;
getProjectRolesList(): Array<ProjectRoleAdd>;
setProjectRolesList(value: Array<ProjectRoleAdd>): void;
clearProjectRolesList(): void;
addProjectRoles(value?: ProjectRoleAdd, index?: number): ProjectRoleAdd;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): ProjectRoleAddBulk.AsObject;
static toObject(includeInstance: boolean, msg: ProjectRoleAddBulk): ProjectRoleAddBulk.AsObject;
static serializeBinaryToWriter(message: ProjectRoleAddBulk, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): ProjectRoleAddBulk;
static deserializeBinaryFromReader(message: ProjectRoleAddBulk, reader: jspb.BinaryReader): ProjectRoleAddBulk;
}
export namespace ProjectRoleAddBulk {
export type AsObject = {
id: string,
projectRolesList: Array<ProjectRoleAdd.AsObject>,
}
}
export class ProjectRoleChange extends jspb.Message { export class ProjectRoleChange extends jspb.Message {
getId(): string; getId(): string;
setId(value: string): void; setId(value: string): void;
@ -3620,9 +3734,6 @@ export class ProjectGrantView extends jspb.Message {
getGrantedOrgName(): string; getGrantedOrgName(): string;
setGrantedOrgName(value: string): void; setGrantedOrgName(value: string): void;
getGrantedOrgDomain(): string;
setGrantedOrgDomain(value: string): void;
getRoleKeysList(): Array<string>; getRoleKeysList(): Array<string>;
setRoleKeysList(value: Array<string>): void; setRoleKeysList(value: Array<string>): void;
clearRoleKeysList(): void; clearRoleKeysList(): void;
@ -3647,6 +3758,12 @@ export class ProjectGrantView extends jspb.Message {
getSequence(): number; getSequence(): number;
setSequence(value: number): void; setSequence(value: number): void;
getResourceOwner(): string;
setResourceOwner(value: string): void;
getResourceOwnerName(): string;
setResourceOwnerName(value: string): void;
serializeBinary(): Uint8Array; serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): ProjectGrantView.AsObject; toObject(includeInstance?: boolean): ProjectGrantView.AsObject;
static toObject(includeInstance: boolean, msg: ProjectGrantView): ProjectGrantView.AsObject; static toObject(includeInstance: boolean, msg: ProjectGrantView): ProjectGrantView.AsObject;
@ -3661,13 +3778,14 @@ export namespace ProjectGrantView {
projectId: string, projectId: string,
grantedOrgId: string, grantedOrgId: string,
grantedOrgName: string, grantedOrgName: string,
grantedOrgDomain: string,
roleKeysList: Array<string>, roleKeysList: Array<string>,
state: ProjectGrantState, state: ProjectGrantState,
creationDate?: google_protobuf_timestamp_pb.Timestamp.AsObject, creationDate?: google_protobuf_timestamp_pb.Timestamp.AsObject,
changeDate?: google_protobuf_timestamp_pb.Timestamp.AsObject, changeDate?: google_protobuf_timestamp_pb.Timestamp.AsObject,
projectName: string, projectName: string,
sequence: number, sequence: number,
resourceOwner: string,
resourceOwnerName: string,
} }
} }
@ -3703,32 +3821,6 @@ export namespace ProjectGrantSearchResponse {
} }
} }
export class ProjectGrantSearchRequest extends jspb.Message {
getProjectId(): string;
setProjectId(value: string): void;
getOffset(): number;
setOffset(value: number): void;
getLimit(): number;
setLimit(value: number): void;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): ProjectGrantSearchRequest.AsObject;
static toObject(includeInstance: boolean, msg: ProjectGrantSearchRequest): ProjectGrantSearchRequest.AsObject;
static serializeBinaryToWriter(message: ProjectGrantSearchRequest, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): ProjectGrantSearchRequest;
static deserializeBinaryFromReader(message: ProjectGrantSearchRequest, reader: jspb.BinaryReader): ProjectGrantSearchRequest;
}
export namespace ProjectGrantSearchRequest {
export type AsObject = {
projectId: string,
offset: number,
limit: number,
}
}
export class GrantedProjectSearchRequest extends jspb.Message { export class GrantedProjectSearchRequest extends jspb.Message {
getOffset(): number; getOffset(): number;
setOffset(value: number): void; setOffset(value: number): void;
@ -3757,6 +3849,64 @@ export namespace GrantedProjectSearchRequest {
} }
} }
export class ProjectGrantSearchRequest extends jspb.Message {
getProjectId(): string;
setProjectId(value: string): void;
getOffset(): number;
setOffset(value: number): void;
getLimit(): number;
setLimit(value: number): void;
getQueriesList(): Array<ProjectGrantSearchQuery>;
setQueriesList(value: Array<ProjectGrantSearchQuery>): void;
clearQueriesList(): void;
addQueries(value?: ProjectGrantSearchQuery, index?: number): ProjectGrantSearchQuery;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): ProjectGrantSearchRequest.AsObject;
static toObject(includeInstance: boolean, msg: ProjectGrantSearchRequest): ProjectGrantSearchRequest.AsObject;
static serializeBinaryToWriter(message: ProjectGrantSearchRequest, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): ProjectGrantSearchRequest;
static deserializeBinaryFromReader(message: ProjectGrantSearchRequest, reader: jspb.BinaryReader): ProjectGrantSearchRequest;
}
export namespace ProjectGrantSearchRequest {
export type AsObject = {
projectId: string,
offset: number,
limit: number,
queriesList: Array<ProjectGrantSearchQuery.AsObject>,
}
}
export class ProjectGrantSearchQuery extends jspb.Message {
getKey(): ProjectGrantSearchKey;
setKey(value: ProjectGrantSearchKey): void;
getMethod(): SearchMethod;
setMethod(value: SearchMethod): void;
getValue(): string;
setValue(value: string): void;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): ProjectGrantSearchQuery.AsObject;
static toObject(includeInstance: boolean, msg: ProjectGrantSearchQuery): ProjectGrantSearchQuery.AsObject;
static serializeBinaryToWriter(message: ProjectGrantSearchQuery, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): ProjectGrantSearchQuery;
static deserializeBinaryFromReader(message: ProjectGrantSearchQuery, reader: jspb.BinaryReader): ProjectGrantSearchQuery;
}
export namespace ProjectGrantSearchQuery {
export type AsObject = {
key: ProjectGrantSearchKey,
method: SearchMethod,
value: string,
}
}
export class ProjectGrantMemberRoles extends jspb.Message { export class ProjectGrantMemberRoles extends jspb.Message {
getRolesList(): Array<string>; getRolesList(): Array<string>;
setRolesList(value: Array<string>): void; setRolesList(value: Array<string>): void;
@ -4113,6 +4263,26 @@ export namespace UserGrant {
} }
} }
export class UserGrantCreateBulk extends jspb.Message {
getUserGrantsList(): Array<UserGrantCreate>;
setUserGrantsList(value: Array<UserGrantCreate>): void;
clearUserGrantsList(): void;
addUserGrants(value?: UserGrantCreate, index?: number): UserGrantCreate;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): UserGrantCreateBulk.AsObject;
static toObject(includeInstance: boolean, msg: UserGrantCreateBulk): UserGrantCreateBulk.AsObject;
static serializeBinaryToWriter(message: UserGrantCreateBulk, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): UserGrantCreateBulk;
static deserializeBinaryFromReader(message: UserGrantCreateBulk, reader: jspb.BinaryReader): UserGrantCreateBulk;
}
export namespace UserGrantCreateBulk {
export type AsObject = {
userGrantsList: Array<UserGrantCreate.AsObject>,
}
}
export class UserGrantCreate extends jspb.Message { export class UserGrantCreate extends jspb.Message {
getUserId(): string; getUserId(): string;
setUserId(value: string): void; setUserId(value: string): void;
@ -4141,6 +4311,26 @@ export namespace UserGrantCreate {
} }
} }
export class UserGrantUpdateBulk extends jspb.Message {
getUserGrantsList(): Array<UserGrantUpdate>;
setUserGrantsList(value: Array<UserGrantUpdate>): void;
clearUserGrantsList(): void;
addUserGrants(value?: UserGrantUpdate, index?: number): UserGrantUpdate;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): UserGrantUpdateBulk.AsObject;
static toObject(includeInstance: boolean, msg: UserGrantUpdateBulk): UserGrantUpdateBulk.AsObject;
static serializeBinaryToWriter(message: UserGrantUpdateBulk, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): UserGrantUpdateBulk;
static deserializeBinaryFromReader(message: UserGrantUpdateBulk, reader: jspb.BinaryReader): UserGrantUpdateBulk;
}
export namespace UserGrantUpdateBulk {
export type AsObject = {
userGrantsList: Array<UserGrantUpdate.AsObject>,
}
}
export class UserGrantUpdate extends jspb.Message { export class UserGrantUpdate extends jspb.Message {
getUserId(): string; getUserId(): string;
setUserId(value: string): void; setUserId(value: string): void;
@ -4169,6 +4359,26 @@ export namespace UserGrantUpdate {
} }
} }
export class UserGrantRemoveBulk extends jspb.Message {
getIdsList(): Array<string>;
setIdsList(value: Array<string>): void;
clearIdsList(): void;
addIds(value: string, index?: number): void;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): UserGrantRemoveBulk.AsObject;
static toObject(includeInstance: boolean, msg: UserGrantRemoveBulk): UserGrantRemoveBulk.AsObject;
static serializeBinaryToWriter(message: UserGrantRemoveBulk, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): UserGrantRemoveBulk;
static deserializeBinaryFromReader(message: UserGrantRemoveBulk, reader: jspb.BinaryReader): UserGrantRemoveBulk;
}
export namespace UserGrantRemoveBulk {
export type AsObject = {
idsList: Array<string>,
}
}
export class UserGrantID extends jspb.Message { export class UserGrantID extends jspb.Message {
getUserId(): string; getUserId(): string;
setUserId(value: string): void; setUserId(value: string): void;
@ -4581,132 +4791,6 @@ export namespace ProjectGrantUserGrantSearchRequest {
} }
} }
export class AuthGrantSearchRequest extends jspb.Message {
getOffset(): number;
setOffset(value: number): void;
getLimit(): number;
setLimit(value: number): void;
getSortingColumn(): AuthGrantSearchKey;
setSortingColumn(value: AuthGrantSearchKey): void;
getAsc(): boolean;
setAsc(value: boolean): void;
getQueriesList(): Array<AuthGrantSearchQuery>;
setQueriesList(value: Array<AuthGrantSearchQuery>): void;
clearQueriesList(): void;
addQueries(value?: AuthGrantSearchQuery, index?: number): AuthGrantSearchQuery;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): AuthGrantSearchRequest.AsObject;
static toObject(includeInstance: boolean, msg: AuthGrantSearchRequest): AuthGrantSearchRequest.AsObject;
static serializeBinaryToWriter(message: AuthGrantSearchRequest, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): AuthGrantSearchRequest;
static deserializeBinaryFromReader(message: AuthGrantSearchRequest, reader: jspb.BinaryReader): AuthGrantSearchRequest;
}
export namespace AuthGrantSearchRequest {
export type AsObject = {
offset: number,
limit: number,
sortingColumn: AuthGrantSearchKey,
asc: boolean,
queriesList: Array<AuthGrantSearchQuery.AsObject>,
}
}
export class AuthGrantSearchQuery extends jspb.Message {
getKey(): AuthGrantSearchKey;
setKey(value: AuthGrantSearchKey): void;
getMethod(): SearchMethod;
setMethod(value: SearchMethod): void;
getValue(): string;
setValue(value: string): void;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): AuthGrantSearchQuery.AsObject;
static toObject(includeInstance: boolean, msg: AuthGrantSearchQuery): AuthGrantSearchQuery.AsObject;
static serializeBinaryToWriter(message: AuthGrantSearchQuery, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): AuthGrantSearchQuery;
static deserializeBinaryFromReader(message: AuthGrantSearchQuery, reader: jspb.BinaryReader): AuthGrantSearchQuery;
}
export namespace AuthGrantSearchQuery {
export type AsObject = {
key: AuthGrantSearchKey,
method: SearchMethod,
value: string,
}
}
export class AuthGrantSearchResponse extends jspb.Message {
getOffset(): number;
setOffset(value: number): void;
getLimit(): number;
setLimit(value: number): void;
getTotalResult(): number;
setTotalResult(value: number): void;
getResultList(): Array<AuthGrant>;
setResultList(value: Array<AuthGrant>): void;
clearResultList(): void;
addResult(value?: AuthGrant, index?: number): AuthGrant;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): AuthGrantSearchResponse.AsObject;
static toObject(includeInstance: boolean, msg: AuthGrantSearchResponse): AuthGrantSearchResponse.AsObject;
static serializeBinaryToWriter(message: AuthGrantSearchResponse, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): AuthGrantSearchResponse;
static deserializeBinaryFromReader(message: AuthGrantSearchResponse, reader: jspb.BinaryReader): AuthGrantSearchResponse;
}
export namespace AuthGrantSearchResponse {
export type AsObject = {
offset: number,
limit: number,
totalResult: number,
resultList: Array<AuthGrant.AsObject>,
}
}
export class AuthGrant extends jspb.Message {
getOrgid(): string;
setOrgid(value: string): void;
getProjectid(): string;
setProjectid(value: string): void;
getUserid(): string;
setUserid(value: string): void;
getRolesList(): Array<string>;
setRolesList(value: Array<string>): void;
clearRolesList(): void;
addRoles(value: string, index?: number): void;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): AuthGrant.AsObject;
static toObject(includeInstance: boolean, msg: AuthGrant): AuthGrant.AsObject;
static serializeBinaryToWriter(message: AuthGrant, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): AuthGrant;
static deserializeBinaryFromReader(message: AuthGrant, reader: jspb.BinaryReader): AuthGrant;
}
export namespace AuthGrant {
export type AsObject = {
orgid: string,
projectid: string,
userid: string,
rolesList: Array<string>,
}
}
export enum UserState { export enum UserState {
USERSTATE_UNSPECIFIED = 0, USERSTATE_UNSPECIFIED = 0,
USERSTATE_ACTIVE = 1, USERSTATE_ACTIVE = 1,
@ -4739,6 +4823,11 @@ export enum SearchMethod {
SEARCHMETHOD_EQUALS_IGNORE_CASE = 3, SEARCHMETHOD_EQUALS_IGNORE_CASE = 3,
SEARCHMETHOD_STARTS_WITH_IGNORE_CASE = 4, SEARCHMETHOD_STARTS_WITH_IGNORE_CASE = 4,
SEARCHMETHOD_CONTAINS_IGNORE_CASE = 5, SEARCHMETHOD_CONTAINS_IGNORE_CASE = 5,
SEARCHMETHOD_NOT_EQUALS = 6,
SEARCHMETHOD_GREATER_THAN = 7,
SEARCHMETHOD_LESS_THAN = 8,
SEARCHMETHOD_IS_ONE_OF = 9,
SEARCHMETHOD_LIST_CONTAINS = 10,
} }
export enum MfaType { export enum MfaType {
MFATYPE_UNSPECIFIED = 0, MFATYPE_UNSPECIFIED = 0,
@ -4838,6 +4927,11 @@ export enum ProjectGrantState {
PROJECTGRANTSTATE_ACTIVE = 1, PROJECTGRANTSTATE_ACTIVE = 1,
PROJECTGRANTSTATE_INACTIVE = 2, PROJECTGRANTSTATE_INACTIVE = 2,
} }
export enum ProjectGrantSearchKey {
PROJECTGRANTSEARCHKEY_UNSPECIFIED = 0,
PROJECTGRANTSEARCHKEY_PROJECT_NAME = 1,
PROJECTGRANTSEARCHKEY_ROLE_KEY = 2,
}
export enum ProjectGrantMemberSearchKey { export enum ProjectGrantMemberSearchKey {
PROJECTGRANTMEMBERSEARCHKEY_UNSPECIFIED = 0, PROJECTGRANTMEMBERSEARCHKEY_UNSPECIFIED = 0,
PROJECTGRANTMEMBERSEARCHKEY_FIRST_NAME = 1, PROJECTGRANTMEMBERSEARCHKEY_FIRST_NAME = 1,
@ -4856,10 +4950,5 @@ export enum UserGrantSearchKey {
USERGRANTSEARCHKEY_PROJECT_ID = 1, USERGRANTSEARCHKEY_PROJECT_ID = 1,
USERGRANTSEARCHKEY_USER_ID = 2, USERGRANTSEARCHKEY_USER_ID = 2,
USERGRANTSEARCHKEY_ORG_ID = 3, USERGRANTSEARCHKEY_ORG_ID = 3,
} USERGRANTSEARCHKEY_ROLE_KEY = 4,
export enum AuthGrantSearchKey {
AUTHGRANTSEARCHKEY_UNSPECIFIED = 0,
AUTHGRANTSEARCHKEY_ORG_ID = 1,
AUTHGRANTSEARCHKEY_PROJECT_ID = 2,
AUTHGRANTSEARCHKEY_USER_ID = 3,
} }

File diff suppressed because it is too large Load Diff

View File

@ -6,6 +6,7 @@ import { switchMap } from 'rxjs/operators';
import { AuthServicePromiseClient } from '../proto/generated/auth_grpc_web_pb'; import { AuthServicePromiseClient } from '../proto/generated/auth_grpc_web_pb';
import { import {
Gender,
MfaOtpResponse, MfaOtpResponse,
MultiFactors, MultiFactors,
MyProjectOrgSearchQuery, MyProjectOrgSearchQuery,
@ -21,6 +22,7 @@ import {
UserPhone, UserPhone,
UserProfile, UserProfile,
UserSessionViews, UserSessionViews,
UserView,
VerifyMfaOtp, VerifyMfaOtp,
VerifyUserPhoneRequest, VerifyUserPhoneRequest,
} from '../proto/generated/auth_pb'; } 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> { public async GetMyMfas(): Promise<MultiFactors> {
return await this.request( return await this.request(
c => c.getMyMfas, 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(); const req = new UpdateUserProfileRequest();
req.setFirstName(profile.firstName); if (firstName) {
req.setLastName(profile.lastName); req.setFirstName(firstName);
req.setNickName(profile.nickName); }
req.setPreferredLanguage(profile.preferredLanguage); if (lastName) {
req.setGender(profile.gender); req.setLastName(lastName);
}
if (nickName) {
req.setNickName(nickName);
}
if (gender) {
req.setGender(gender);
}
if (preferredLanguage) {
req.setPreferredLanguage(preferredLanguage);
}
console.log(req.toObject()); console.log(req.toObject());
return await this.request( return await this.request(
c => c.updateMyUserProfile, c => c.updateMyUserProfile,

View File

@ -7,6 +7,8 @@ import {
ChangeRequest, ChangeRequest,
Changes, Changes,
CreateUserRequest, CreateUserRequest,
Email,
Gender,
MultiFactors, MultiFactors,
NotificationType, NotificationType,
PasswordRequest, PasswordRequest,
@ -22,7 +24,6 @@ import {
User, User,
UserAddress, UserAddress,
UserEmail, UserEmail,
UserEmailID,
UserGrant, UserGrant,
UserGrantCreate, UserGrantCreate,
UserGrantSearchQuery, 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(); const req = new UpdateUserProfileRequest();
req.setId(profile.id); req.setId(id);
req.setFirstName(profile.firstName); if (firstName) {
req.setLastName(profile.lastName); req.setFirstName(firstName);
req.setNickName(profile.nickName); }
req.setPreferredLanguage(profile.preferredLanguage); if (lastName) {
req.setGender(profile.gender); req.setLastName(lastName);
}
if (nickName) {
req.setNickName(nickName);
}
if (gender) {
req.setGender(gender);
}
if (preferredLanguage) {
req.setPreferredLanguage(preferredLanguage);
}
return await this.request( return await this.request(
c => c.updateUserProfile, c => c.updateUserProfile,
req, req,
@ -322,7 +340,7 @@ export class MgmtUserService {
} }
public async GetUserByEmailGlobal(email: string): Promise<User> { public async GetUserByEmailGlobal(email: string): Promise<User> {
const req = new UserEmailID(); const req = new Email();
req.setEmail(email); req.setEmail(email);
return await this.request( return await this.request(
c => c.getUserByEmailGlobal, c => c.getUserByEmailGlobal,

View File

@ -66,12 +66,10 @@ export class OrgService {
); );
} }
public async GetOrgById(orgId: string): Promise<Org> { public async GetMyOrg(): Promise<Org> {
const req: OrgID = new OrgID();
req.setId(orgId);
return await this.request( return await this.request(
c => c.getOrgByID, c => c.getMyOrg,
req, new Empty(),
f => f, f => f,
); );
} }
@ -156,22 +154,19 @@ export class OrgService {
); );
} }
public async DeactivateOrg(id: string): Promise<Org> { public async DeactivateMyOrg(): Promise<Org> {
const req = new OrgID();
req.setId(id);
return await this.request( return await this.request(
c => c.deactivateOrg, c => c.deactivateMyOrg,
req, new Empty(),
f => f, f => f,
); );
} }
public async ReactivateOrg(id: string): Promise<Org> { public async ReactivateMyOrg(): Promise<Org> {
const req = new OrgID(); const req = new OrgID();
req.setId(id);
return await this.request( return await this.request(
c => c.reactivateOrg, c => c.reactivateMyOrg,
req, new Empty(),
f => f, f => f,
); );
} }
@ -257,11 +252,9 @@ export class OrgService {
} }
public async GetPasswordComplexityPolicy(): Promise<PasswordComplexityPolicy> { public async GetPasswordComplexityPolicy(): Promise<PasswordComplexityPolicy> {
const req = new Empty();
return await this.request( return await this.request(
c => c.getPasswordComplexityPolicy, c => c.getPasswordComplexityPolicy,
req, new Empty(),
f => f, f => f,
); );
} }

View File

@ -45,6 +45,7 @@ import {
ProjectSearchResponse, ProjectSearchResponse,
ProjectUpdateRequest, ProjectUpdateRequest,
ProjectUserGrantSearchRequest, ProjectUserGrantSearchRequest,
ProjectView,
UserGrant, UserGrant,
UserGrantCreate, UserGrantCreate,
UserGrantSearchQuery, 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(); const req = new ProjectID();
req.setId(projectId); req.setId(projectId);
return await this.request( 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(); const req = new ProjectUpdateRequest();
req.setName(project.name); req.setName(name);
req.setId(project.id); req.setId(id);
return await this.request( return await this.request(
c => c.updateProject, c => c.updateProject,
req, 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(); const req = new ApplicationID();
req.setId(id); req.setId(id);
req.setProjectId(projectId);
return await this.request( return await this.request(
c => c.regenerateOIDCClientSecret, c => c.regenerateOIDCClientSecret,
req, req,

View File

@ -51,7 +51,12 @@
"DESCRIPTION": "Hier können Sie neue User anlegen sowie bereits erfasste Userdaten bearbeiten, activieren oder deaktivieren", "DESCRIPTION": "Hier können Sie neue User anlegen sowie bereits erfasste Userdaten bearbeiten, activieren oder deaktivieren",
"DETAIL": "Detail", "DETAIL": "Detail",
"CREATE": "Erstellen", "CREATE": "Erstellen",
"MY": "Meine Informationen" "MY": "Meine Informationen",
"LOGINNAMES":"Loginnamen",
"LOGINNAMESDESC":"Mit diesen Namen können Sie sich anmelden",
"COPY":"In die Zwischenablage kopieren",
"COPIED":"In die Zwischenablage kopiert!",
"NOUSER":"Kein User"
}, },
"MFA": { "MFA": {
"TITLE": "Multifaktor-Authentifizierung", "TITLE": "Multifaktor-Authentifizierung",
@ -215,7 +220,7 @@
"TITLECREATE":"Kennwortkomplexitätsrichtlinie erstellen", "TITLECREATE":"Kennwortkomplexitätsrichtlinie erstellen",
"DESCRIPTIONCREATE":"Stellt sicher, dass alle festgelegten Kennwörter einem bestimmten Muster entsprechen", "DESCRIPTIONCREATE":"Stellt sicher, dass alle festgelegten Kennwörter einem bestimmten Muster entsprechen",
"SYMBOLANDNUMBERERROR":"Das Password muss ein Symbol und eine Nummer beinhalten!", "SYMBOLANDNUMBERERROR":"Das Password muss ein Symbol und eine Nummer beinhalten!",
"SYMBOLERROR":"Das Password msus ein Symbol beinhalten!", "SYMBOLERROR":"Das Password muss ein Symbol beinhalten!",
"NUMBERERROR":"Das Password muss eine Nummer beinhalten!", "NUMBERERROR":"Das Password muss eine Nummer beinhalten!",
"PATTERNERROR":"Das vorgeschriebene Muster ist falsch!" "PATTERNERROR":"Das vorgeschriebene Muster ist falsch!"
}, },
@ -289,7 +294,8 @@
"CREATE": "Projekt erstellen", "CREATE": "Projekt erstellen",
"CREATE_DESC": "Geben Sie den Namen ein", "CREATE_DESC": "Geben Sie den Namen ein",
"ROLE": "Rolle", "ROLE": "Rolle",
"NOITEMS": "Keine Projekte" "NOITEMS": "Keine Projekte",
"ZITADELPROJECT":"Diese Einstellungen gehören zum Zitadel-Projekt. Wenn Sie etwas ändern, verhält sich Zitadel möglicherweise nicht wie beabsichtigt!"
}, },
"STATE": { "STATE": {
"TITLE":"Status", "TITLE":"Status",

View File

@ -51,7 +51,12 @@
"DESCRIPTION": "Here you can create new users or edit data that has already been entered.", "DESCRIPTION": "Here you can create new users or edit data that has already been entered.",
"DETAIL": "Detail", "DETAIL": "Detail",
"CREATE": "Create", "CREATE": "Create",
"MY": "My Informations" "MY": "My Informations",
"LOGINNAMES":"Login names",
"LOGINNAMESDESC":"You can log into zitadel with these names",
"COPY":"Copy to clipboard",
"COPIED":"Copied to clipboard!",
"NOUSER":"No User"
}, },
"MFA": { "MFA": {
"TITLE": "Multifactor Authentication", "TITLE": "Multifactor Authentication",
@ -177,7 +182,7 @@
"SIGNEDOUT":"You are signed out. Click the button below to sign in again!", "SIGNEDOUT":"You are signed out. Click the button below to sign in again!",
"SIGNEDOUT_BTN":"Sign In", "SIGNEDOUT_BTN":"Sign In",
"EDITACCOUNT":"Edit Account", "EDITACCOUNT":"Edit Account",
"ADDACCOUNT":"Login with another account" "ADDACCOUNT":"log in with another account"
}, },
"ORG": { "ORG": {
"PAGES": { "PAGES": {
@ -290,7 +295,8 @@
"CREATE": "Create project", "CREATE": "Create project",
"CREATE_DESC": "Insert your projects name", "CREATE_DESC": "Insert your projects name",
"ROLE": "Role", "ROLE": "Role",
"NOITEMS": "No projects" "NOITEMS": "No projects",
"ZITADELPROJECT":"This belongs to Zitadel project. If you change something, Zitadel may not behave as intended!"
}, },
"STATE": { "STATE": {
"TITLE":"State", "TITLE":"State",

View File

@ -129,6 +129,12 @@ $light-theme: mat-light-theme($light-primary, $light-accent, $light-warn);
$dark-theme: mat-dark-theme($dark-primary, $dark-accent, $dark-warn); $dark-theme: mat-dark-theme($dark-primary, $dark-accent, $dark-warn);
$custom-typography: mat-typography-config(
$font-family: 'Rubik'
);
@include mat-core($custom-typography);
// default theme // default theme
@include component-themes($dark-theme); @include component-themes($dark-theme);
@include angular-material-theme($dark-theme); @include angular-material-theme($dark-theme);