mirror of
https://github.com/andwati/zitadel.git
synced 2026-10-29 18:42:15 +00:00
feat(console): loginname hint, update dependencies (#709)
* chore(deps): bump rxjs from 6.6.2 to 6.6.3 in /console (#707) Bumps [rxjs](https://github.com/reactivex/rxjs) from 6.6.2 to 6.6.3. - [Release notes](https://github.com/reactivex/rxjs/releases) - [Changelog](https://github.com/ReactiveX/rxjs/blob/6.6.3/CHANGELOG.md) - [Commits](https://github.com/reactivex/rxjs/compare/6.6.2...6.6.3) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps-dev): bump @angular/cli from 10.0.8 to 10.1.0 in /console (#706) Bumps [@angular/cli](https://github.com/angular/angular-cli) from 10.0.8 to 10.1.0. - [Release notes](https://github.com/angular/angular-cli/releases) - [Commits](https://github.com/angular/angular-cli/compare/v10.0.8...v10.1.0) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps-dev): bump karma from 5.1.1 to 5.2.1 in /console (#705) Bumps [karma](https://github.com/karma-runner/karma) from 5.1.1 to 5.2.1. - [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.1.1...v5.2.1) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps-dev): bump stylelint from 13.6.1 to 13.7.0 in /console (#704) Bumps [stylelint](https://github.com/stylelint/stylelint) from 13.6.1 to 13.7.0. - [Release notes](https://github.com/stylelint/stylelint/releases) - [Changelog](https://github.com/stylelint/stylelint/blob/master/CHANGELOG.md) - [Commits](https://github.com/stylelint/stylelint/compare/13.6.1...13.7.0) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Max Peintner <[email protected]> * chore(deps): bump angularx-qrcode from 10.0.6 to 10.0.10 in /console (#703) Bumps [angularx-qrcode](https://github.com/cordobo/angularx-qrcode) from 10.0.6 to 10.0.10. - [Release notes](https://github.com/cordobo/angularx-qrcode/releases) - [Commits](https://github.com/cordobo/angularx-qrcode/compare/10.0.6...10.0.10) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Max Peintner <[email protected]> * chore(deps-dev): bump @types/node from 14.6.1 to 14.6.4 in /console (#701) Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.6.1 to 14.6.4. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps-dev): bump prettier from 2.0.5 to 2.1.1 in /console (#665) Bumps [prettier](https://github.com/prettier/prettier) from 2.0.5 to 2.1.1. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/master/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/2.0.5...2.1.1) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps-dev): bump @angular/language-service in /console (#708) Bumps [@angular/language-service](https://github.com/angular/angular/tree/HEAD/packages/language-service) from 10.0.14 to 10.1.0. - [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/10.1.0/packages/language-service) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps-dev): bump @angular-devkit/build-angular in /console (#666) Bumps [@angular-devkit/build-angular](https://github.com/angular/angular-cli) from 0.1000.6 to 0.1000.8. - [Release notes](https://github.com/angular/angular-cli/releases) - [Commits](https://github.com/angular/angular-cli/commits) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Max Peintner <[email protected]> * show loginname suffix * update packlock * rm console logs * private * suffix for org create * rm suffix for org create * rm org create suffix * lint Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
parent
8fcb03854b
commit
5c6989e831
@@ -2,7 +2,13 @@ import { Component, OnDestroy } from '@angular/core';
|
||||
import { AbstractControl, FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||
import { Router } from '@angular/router';
|
||||
import { Subscription } from 'rxjs';
|
||||
import { CreateHumanRequest, CreateUserRequest, Gender, UserResponse } from 'src/app/proto/generated/management_pb';
|
||||
import {
|
||||
CreateHumanRequest,
|
||||
CreateUserRequest,
|
||||
Gender,
|
||||
OrgDomain,
|
||||
UserResponse,
|
||||
} from 'src/app/proto/generated/management_pb';
|
||||
import { ManagementService } from 'src/app/services/mgmt.service';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
|
||||
@@ -40,14 +46,16 @@ export class UserCreateComponent implements OnDestroy {
|
||||
public userLoginMustBeDomain: boolean = false;
|
||||
public loading: boolean = false;
|
||||
|
||||
private primaryDomain!: OrgDomain.AsObject;
|
||||
|
||||
constructor(
|
||||
private router: Router,
|
||||
private toast: ToastService,
|
||||
public userService: ManagementService,
|
||||
private fb: FormBuilder,
|
||||
private mgmtService: ManagementService,
|
||||
) {
|
||||
this.loading = true;
|
||||
this.loadOrg();
|
||||
this.mgmtService.GetMyOrgIamPolicy().then((iampolicy) => {
|
||||
this.userLoginMustBeDomain = iampolicy.toObject().userLoginMustBeDomain;
|
||||
this.initForm();
|
||||
@@ -59,6 +67,14 @@ export class UserCreateComponent implements OnDestroy {
|
||||
});
|
||||
}
|
||||
|
||||
private async loadOrg(): Promise<void> {
|
||||
const domains = (await this.mgmtService.SearchMyOrgDomains(0, 100).then(doms => doms.toObject()));
|
||||
const found = domains.resultList.find(domain => domain.primary);
|
||||
if (found) {
|
||||
this.primaryDomain = found;
|
||||
}
|
||||
}
|
||||
|
||||
private initForm(): void {
|
||||
this.userForm = this.fb.group({
|
||||
email: ['', [Validators.required, Validators.email]],
|
||||
@@ -93,7 +109,7 @@ export class UserCreateComponent implements OnDestroy {
|
||||
humanReq.setGender(this.gender?.value);
|
||||
humanReq.setCountry(this.country?.value);
|
||||
|
||||
this.userService
|
||||
this.mgmtService
|
||||
.CreateUserHuman(this.userName?.value, humanReq)
|
||||
.then((data: UserResponse) => {
|
||||
this.loading = false;
|
||||
@@ -150,4 +166,12 @@ export class UserCreateComponent implements OnDestroy {
|
||||
public get country(): AbstractControl | null {
|
||||
return this.userForm.get('country');
|
||||
}
|
||||
|
||||
public get envSuffix(): string {
|
||||
if (this.userLoginMustBeDomain && this.primaryDomain?.domain) {
|
||||
return `@${this.primaryDomain.domain}`;
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user