mirror of
https://github.com/zitadel/zitadel.git
synced 2025-01-07 22:17:42 +00:00
fix(console): org create missing module, layout (#2870)
* fix: org create module * rm comment
This commit is contained in:
parent
278a278a5b
commit
db355facee
@ -63,6 +63,15 @@ const routes: Routes = [
|
|||||||
roles: ['iam.read', 'iam.write'],
|
roles: ['iam.read', 'iam.write'],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: 'org/create',
|
||||||
|
component: OrgCreateComponent,
|
||||||
|
canActivate: [AuthGuard, RoleGuard],
|
||||||
|
data: {
|
||||||
|
roles: ['(org.create)?(iam.write)?'],
|
||||||
|
},
|
||||||
|
loadChildren: () => import('./pages/org-create/org-create.module').then((m) => m.OrgCreateModule),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: 'org',
|
path: 'org',
|
||||||
loadChildren: () => import('./pages/orgs/orgs.module').then((m) => m.OrgsModule),
|
loadChildren: () => import('./pages/orgs/orgs.module').then((m) => m.OrgsModule),
|
||||||
@ -71,15 +80,6 @@ const routes: Routes = [
|
|||||||
roles: ['org.read'],
|
roles: ['org.read'],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
|
||||||
path: 'org/create',
|
|
||||||
component: OrgCreateComponent,
|
|
||||||
canActivate: [RoleGuard],
|
|
||||||
data: {
|
|
||||||
roles: ['(org.create)?(iam.write)?'],
|
|
||||||
},
|
|
||||||
loadChildren: () => import('./pages/org-create/org-create.module').then((m) => m.OrgCreateModule),
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
path: 'actions',
|
path: 'actions',
|
||||||
loadChildren: () => import('./pages/actions/actions.module').then((m) => m.ActionsModule),
|
loadChildren: () => import('./pages/actions/actions.module').then((m) => m.ActionsModule),
|
||||||
|
@ -11,6 +11,7 @@ import { MatDialogModule } from '@angular/material/dialog';
|
|||||||
import { MatIconModule } from '@angular/material/icon';
|
import { MatIconModule } from '@angular/material/icon';
|
||||||
import { MatProgressBarModule } from '@angular/material/progress-bar';
|
import { MatProgressBarModule } from '@angular/material/progress-bar';
|
||||||
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
||||||
|
import { MatSelectModule } from '@angular/material/select';
|
||||||
import { MatSidenavModule } from '@angular/material/sidenav';
|
import { MatSidenavModule } from '@angular/material/sidenav';
|
||||||
import { MatSnackBarModule } from '@angular/material/snack-bar';
|
import { MatSnackBarModule } from '@angular/material/snack-bar';
|
||||||
import { MatToolbarModule } from '@angular/material/toolbar';
|
import { MatToolbarModule } from '@angular/material/toolbar';
|
||||||
@ -130,6 +131,7 @@ const authConfig: AuthConfig = {
|
|||||||
MatSnackBarModule,
|
MatSnackBarModule,
|
||||||
AvatarModule,
|
AvatarModule,
|
||||||
WarnDialogModule,
|
WarnDialogModule,
|
||||||
|
MatSelectModule,
|
||||||
MatDialogModule,
|
MatDialogModule,
|
||||||
RegExpPipeModule,
|
RegExpPipeModule,
|
||||||
OnboardingModule,
|
OnboardingModule,
|
||||||
|
@ -1,183 +1,183 @@
|
|||||||
<div class="max-width-container container">
|
<div class="max-width-container container">
|
||||||
<div class="abort-container">
|
<div class="abort-container">
|
||||||
<button (click)="close()" mat-icon-button>
|
<button (click)="close()" mat-icon-button>
|
||||||
<mat-icon>close</mat-icon>
|
<mat-icon>close</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
<span class="abort">{{ 'ORG.PAGES.CREATE' | translate }}</span>
|
||||||
|
<span class="abort-2">Step {{ currentCreateStep }} of {{ createSteps }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
<ng-template cnslHasRole [hasRole]="['iam.write']">
|
<ng-template cnslHasRole [hasRole]="['iam.write']">
|
||||||
<mat-slide-toggle [disabled]="currentCreateStep !== 1" class="example-margin" color="primary"
|
<mat-slide-toggle [disabled]="currentCreateStep !== 1" class="example-margin" color="primary"
|
||||||
(change)="changeSelf($event)" [(ngModel)]="forSelf">
|
(change)="changeSelf($event)" [(ngModel)]="forSelf">
|
||||||
Use your personal account as organisation owner
|
{{'ORG.PAGES.USERSELFACCOUNT' | translate}}
|
||||||
</mat-slide-toggle>
|
</mat-slide-toggle>
|
||||||
|
|
||||||
<ng-container *ngIf="!forSelf">
|
<ng-container *ngIf="!forSelf">
|
||||||
<ng-container *ngIf="currentCreateStep === 1">
|
<ng-container *ngIf="currentCreateStep === 1">
|
||||||
<h1>{{'ORG.PAGES.ORGDETAIL_TITLE' | translate}} </h1>
|
<h1>{{'ORG.PAGES.ORGDETAIL_TITLE' | translate}} </h1>
|
||||||
|
|
||||||
<form [formGroup]="orgForm" (ngSubmit)="next()">
|
<form [formGroup]="orgForm" (ngSubmit)="next()">
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<cnsl-form-field class="formfield" appearance="outline">
|
<cnsl-form-field class="formfield" appearance="outline">
|
||||||
<cnsl-label>{{ 'ORG_DETAIL.DETAIL.NAME' | translate }}</cnsl-label>
|
<cnsl-label>{{ 'ORG_DETAIL.DETAIL.NAME' | translate }}</cnsl-label>
|
||||||
<input cnslInput formControlName="name" />
|
<input cnslInput formControlName="name" />
|
||||||
</cnsl-form-field>
|
</cnsl-form-field>
|
||||||
<cnsl-form-field class="formfield" appearance="outline">
|
<cnsl-form-field class="formfield" appearance="outline">
|
||||||
<cnsl-label>{{ 'ORG_DETAIL.DETAIL.DOMAIN' | translate }}</cnsl-label>
|
<cnsl-label>{{ 'ORG_DETAIL.DETAIL.DOMAIN' | translate }}</cnsl-label>
|
||||||
<input cnslInput formControlName="domain" />
|
<input cnslInput formControlName="domain" />
|
||||||
</cnsl-form-field>
|
</cnsl-form-field>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="btn-container">
|
<div class="btn-container">
|
||||||
<span class="fill-space"></span>
|
<span class="fill-space"></span>
|
||||||
<button [disabled]="orgForm.invalid" color="primary" mat-raised-button class="big-button"
|
<button [disabled]="orgForm.invalid" color="primary" mat-raised-button class="big-button" cdkFocusInitial
|
||||||
cdkFocusInitial type="submit">
|
type="submit">
|
||||||
{{'CONTINUE' | translate}}
|
{{'ACTIONS.CONTINUE' | translate}}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
</form>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
|
<ng-container *ngIf="currentCreateStep === createSteps">
|
||||||
|
<h1>{{'ORG.PAGES.ORGDETAILUSER_TITLE' | translate}}</h1>
|
||||||
|
|
||||||
|
<div class="user">
|
||||||
|
<form [formGroup]="userForm" class="form">
|
||||||
|
<div class="content">
|
||||||
|
<p class="section">{{ 'USER.CREATE.NAMEANDEMAILSECTION' | translate }}</p>
|
||||||
|
<cnsl-form-field class="formfield" appearance="outline">
|
||||||
|
<cnsl-label>{{ 'USER.PROFILE.USERNAME' | translate }}</cnsl-label>
|
||||||
|
<input cnslInput formControlName="userName" required />
|
||||||
|
<span cnslError *ngIf="userName?.invalid && userName?.errors?.required">
|
||||||
|
{{ 'USER.VALIDATION.REQUIRED' | translate }}
|
||||||
|
</span>
|
||||||
|
</cnsl-form-field>
|
||||||
|
<cnsl-form-field class="formfield" appearance="outline">
|
||||||
|
<cnsl-label>{{ 'USER.PROFILE.EMAIL' | translate }}</cnsl-label>
|
||||||
|
<input cnslInput formControlName="email" required />
|
||||||
|
<span cnslError *ngIf="email?.invalid && email?.errors?.required">
|
||||||
|
{{ 'USER.VALIDATION.REQUIRED' | translate }}
|
||||||
|
</span>
|
||||||
|
</cnsl-form-field>
|
||||||
|
<cnsl-form-field class="formfield" appearance="outline">
|
||||||
|
<cnsl-label>{{ 'USER.PROFILE.FIRSTNAME' | translate }}</cnsl-label>
|
||||||
|
<input cnslInput formControlName="firstName" required />
|
||||||
|
<span cnslError *ngIf="firstName?.invalid && firstName?.errors?.required">
|
||||||
|
{{ 'USER.VALIDATION.REQUIRED' | translate }}
|
||||||
|
</span>
|
||||||
|
</cnsl-form-field>
|
||||||
|
<cnsl-form-field class="formfield" appearance="outline">
|
||||||
|
<cnsl-label>{{ 'USER.PROFILE.LASTNAME' | translate }}</cnsl-label>
|
||||||
|
<input cnslInput formControlName="lastName" required />
|
||||||
|
<span cnslError *ngIf="lastName?.invalid && lastName?.errors?.required">
|
||||||
|
{{ 'USER.VALIDATION.REQUIRED' | translate }}
|
||||||
|
</span>
|
||||||
|
</cnsl-form-field>
|
||||||
|
<cnsl-form-field class="formfield" appearance="outline">
|
||||||
|
<cnsl-label>{{ 'USER.PROFILE.NICKNAME' | translate }}</cnsl-label>
|
||||||
|
<input cnslInput formControlName="nickName" />
|
||||||
|
<span cnslError *ngIf="nickName?.invalid && nickName?.errors?.required">
|
||||||
|
{{ 'USER.VALIDATION.REQUIRED' | translate }}
|
||||||
|
</span>
|
||||||
|
</cnsl-form-field>
|
||||||
|
|
||||||
|
<p class="section">{{ 'USER.CREATE.GENDERLANGSECTION' | translate }}</p>
|
||||||
|
|
||||||
|
<cnsl-form-field class="formfield" appearance="outline">
|
||||||
|
<cnsl-label>{{ 'USER.PROFILE.GENDER' | translate }}</cnsl-label>
|
||||||
|
<mat-select formControlName="gender">
|
||||||
|
<mat-option *ngFor="let gender of genders" [value]="gender">
|
||||||
|
{{ 'GENDERS.'+gender | translate }}
|
||||||
|
</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
<span cnslError *ngIf="gender?.invalid && gender?.errors?.required">
|
||||||
|
{{ 'USER.VALIDATION.REQUIRED' | translate }}
|
||||||
|
</span>
|
||||||
|
</cnsl-form-field>
|
||||||
|
<cnsl-form-field class="formfield" appearance="outline">
|
||||||
|
<cnsl-label>{{ 'USER.PROFILE.PREFERRED_LANGUAGE' | translate }}</cnsl-label>
|
||||||
|
<mat-select formControlName="preferredLanguage">
|
||||||
|
<mat-option *ngFor="let language of languages" [value]="language">
|
||||||
|
{{ 'LANGUAGES.'+language | translate }}
|
||||||
|
</mat-option>
|
||||||
|
<span cnslError *ngIf="preferredLanguage?.invalid && preferredLanguage?.errors?.required">
|
||||||
|
{{ 'USER.VALIDATION.REQUIRED' | translate }}
|
||||||
|
</span>
|
||||||
|
</mat-select>
|
||||||
|
</cnsl-form-field>
|
||||||
|
|
||||||
|
<mat-checkbox class="checkbox" [(ngModel)]="usePassword" [ngModelOptions]="{standalone: true}"
|
||||||
|
(change)="initPwdValidators()">
|
||||||
|
{{'ORG.PAGES.USEPASSWORD' | translate}}</mat-checkbox>
|
||||||
|
|
||||||
|
<ng-container *ngIf="usePassword && pwdForm">
|
||||||
|
<p class="section">{{ 'USER.CREATE.PASSWORDSECTION' | translate }}</p>
|
||||||
|
|
||||||
|
<cnsl-password-complexity-view class="complexity-view" [policy]="this.policy" [password]="password">
|
||||||
|
</cnsl-password-complexity-view>
|
||||||
|
|
||||||
|
<form [formGroup]="pwdForm" class="pwd-form">
|
||||||
|
<cnsl-form-field class="pwd" *ngIf="password" appearance="outline">
|
||||||
|
<cnsl-label>{{ 'USER.PASSWORD.NEW' | translate }}</cnsl-label>
|
||||||
|
<input cnslInput autocomplete="off" name="firstpassword" formControlName="password"
|
||||||
|
type="password" />
|
||||||
|
|
||||||
|
<span cnslError *ngIf="password?.errors?.required">
|
||||||
|
{{ 'USER.VALIDATION.REQUIRED' | translate }}
|
||||||
|
</span>
|
||||||
|
|
||||||
|
</cnsl-form-field>
|
||||||
|
<cnsl-form-field class="pwd" *ngIf="confirmPassword" appearance="outline">
|
||||||
|
<cnsl-label>{{ 'USER.PASSWORD.CONFIRM' | translate }}</cnsl-label>
|
||||||
|
<input cnslInput autocomplete="off" name="confirmPassword" formControlName="confirmPassword"
|
||||||
|
type="password" />
|
||||||
|
|
||||||
|
<span cnslError *ngIf="confirmPassword?.errors?.required">
|
||||||
|
{{ 'USER.VALIDATION.REQUIRED' | translate }}
|
||||||
|
</span>
|
||||||
|
<span cnslError *ngIf="confirmPassword?.errors?.notequal">
|
||||||
|
{{ 'USER.PASSWORD.NOTEQUAL' | translate }}
|
||||||
|
</span>
|
||||||
|
</cnsl-form-field>
|
||||||
</form>
|
</form>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
</div>
|
||||||
<ng-container *ngIf="currentCreateStep === createSteps">
|
<div class="btn-container">
|
||||||
<h1>{{'ORG.PAGES.ORGDETAILUSER_TITLE' | translate}}</h1>
|
<button color="primary" class="small-button" type="button" (click)="previous()" mat-stroked-button>{{
|
||||||
|
'ACTIONS.BACK' | translate }}</button>
|
||||||
<div class="user">
|
<span class="fill-space"></span>
|
||||||
<form [formGroup]="userForm" class="form">
|
<button color="primary" class="big-button" (click)="finish()"
|
||||||
<div class="content">
|
[disabled]="orgForm.invalid || userForm.invalid || ((usePassword && pwdForm) ? pwdForm?.invalid : false)"
|
||||||
<p class="section">{{ 'USER.CREATE.NAMEANDEMAILSECTION' | translate }}</p>
|
mat-raised-button>{{ 'ACTIONS.FINISH' | translate }}</button>
|
||||||
<cnsl-form-field class="formfield" appearance="outline">
|
</div>
|
||||||
<cnsl-label>{{ 'USER.PROFILE.USERNAME' | translate }}</cnsl-label>
|
</form>
|
||||||
<input cnslInput formControlName="userName" required />
|
|
||||||
<span cnslError *ngIf="userName?.invalid && userName?.errors?.required">
|
|
||||||
{{ 'USER.VALIDATION.REQUIRED' | translate }}
|
|
||||||
</span>
|
|
||||||
</cnsl-form-field>
|
|
||||||
<cnsl-form-field class="formfield" appearance="outline">
|
|
||||||
<cnsl-label>{{ 'USER.PROFILE.EMAIL' | translate }}</cnsl-label>
|
|
||||||
<input cnslInput formControlName="email" required />
|
|
||||||
<span cnslError *ngIf="email?.invalid && email?.errors?.required">
|
|
||||||
{{ 'USER.VALIDATION.REQUIRED' | translate }}
|
|
||||||
</span>
|
|
||||||
</cnsl-form-field>
|
|
||||||
<cnsl-form-field class="formfield" appearance="outline">
|
|
||||||
<cnsl-label>{{ 'USER.PROFILE.FIRSTNAME' | translate }}</cnsl-label>
|
|
||||||
<input cnslInput formControlName="firstName" required />
|
|
||||||
<span cnslError *ngIf="firstName?.invalid && firstName?.errors?.required">
|
|
||||||
{{ 'USER.VALIDATION.REQUIRED' | translate }}
|
|
||||||
</span>
|
|
||||||
</cnsl-form-field>
|
|
||||||
<cnsl-form-field class="formfield" appearance="outline">
|
|
||||||
<cnsl-label>{{ 'USER.PROFILE.LASTNAME' | translate }}</cnsl-label>
|
|
||||||
<input cnslInput formControlName="lastName" required />
|
|
||||||
<span cnslError *ngIf="lastName?.invalid && lastName?.errors?.required">
|
|
||||||
{{ 'USER.VALIDATION.REQUIRED' | translate }}
|
|
||||||
</span>
|
|
||||||
</cnsl-form-field>
|
|
||||||
<cnsl-form-field class="formfield" appearance="outline">
|
|
||||||
<cnsl-label>{{ 'USER.PROFILE.NICKNAME' | translate }}</cnsl-label>
|
|
||||||
<input cnslInput formControlName="nickName" />
|
|
||||||
<span cnslError *ngIf="nickName?.invalid && nickName?.errors?.required">
|
|
||||||
{{ 'USER.VALIDATION.REQUIRED' | translate }}
|
|
||||||
</span>
|
|
||||||
</cnsl-form-field>
|
|
||||||
|
|
||||||
<p class="section">{{ 'USER.CREATE.GENDERLANGSECTION' | translate }}</p>
|
|
||||||
|
|
||||||
<cnsl-form-field class="formfield" appearance="outline">
|
|
||||||
<cnsl-label>{{ 'USER.PROFILE.GENDER' | translate }}</cnsl-label>
|
|
||||||
<mat-select formControlName="gender">
|
|
||||||
<mat-option *ngFor="let gender of genders" [value]="gender">
|
|
||||||
{{ 'GENDERS.'+gender | translate }}
|
|
||||||
</mat-option>
|
|
||||||
</mat-select>
|
|
||||||
<span cnslError *ngIf="gender?.invalid && gender?.errors?.required">
|
|
||||||
{{ 'USER.VALIDATION.REQUIRED' | translate }}
|
|
||||||
</span>
|
|
||||||
</cnsl-form-field>
|
|
||||||
<cnsl-form-field class="formfield" appearance="outline">
|
|
||||||
<cnsl-label>{{ 'USER.PROFILE.PREFERRED_LANGUAGE' | translate }}</cnsl-label>
|
|
||||||
<mat-select formControlName="preferredLanguage">
|
|
||||||
<mat-option *ngFor="let language of languages" [value]="language">
|
|
||||||
{{ 'LANGUAGES.'+language | translate }}
|
|
||||||
</mat-option>
|
|
||||||
<span cnslError
|
|
||||||
*ngIf="preferredLanguage?.invalid && preferredLanguage?.errors?.required">
|
|
||||||
{{ 'USER.VALIDATION.REQUIRED' | translate }}
|
|
||||||
</span>
|
|
||||||
</mat-select>
|
|
||||||
</cnsl-form-field>
|
|
||||||
|
|
||||||
<mat-checkbox class="checkbox" [(ngModel)]="usePassword"
|
|
||||||
[ngModelOptions]="{standalone: true}" (change)="initPwdValidators()">
|
|
||||||
{{'ORG.PAGES.USEPASSWORD' | translate}}</mat-checkbox>
|
|
||||||
|
|
||||||
<ng-container *ngIf="usePassword && pwdForm">
|
|
||||||
<p class="section">{{ 'USER.CREATE.PASSWORDSECTION' | translate }}</p>
|
|
||||||
|
|
||||||
<cnsl-password-complexity-view class="complexity-view" [policy]="this.policy"
|
|
||||||
[password]="password">
|
|
||||||
</cnsl-password-complexity-view>
|
|
||||||
|
|
||||||
<form [formGroup]="pwdForm" class="pwd-form">
|
|
||||||
<cnsl-form-field class="pwd" *ngIf="password" appearance="outline">
|
|
||||||
<cnsl-label>{{ 'USER.PASSWORD.NEW' | translate }}</cnsl-label>
|
|
||||||
<input cnslInput autocomplete="off" name="firstpassword"
|
|
||||||
formControlName="password" type="password" />
|
|
||||||
|
|
||||||
<span cnslError *ngIf="password?.errors?.required">
|
|
||||||
{{ 'USER.VALIDATION.REQUIRED' | translate }}
|
|
||||||
</span>
|
|
||||||
|
|
||||||
</cnsl-form-field>
|
|
||||||
<cnsl-form-field class="pwd" *ngIf="confirmPassword" appearance="outline">
|
|
||||||
<cnsl-label>{{ 'USER.PASSWORD.CONFIRM' | translate }}</cnsl-label>
|
|
||||||
<input cnslInput autocomplete="off" name="confirmPassword"
|
|
||||||
formControlName="confirmPassword" type="password" />
|
|
||||||
|
|
||||||
<span cnslError *ngIf="confirmPassword?.errors?.required">
|
|
||||||
{{ 'USER.VALIDATION.REQUIRED' | translate }}
|
|
||||||
</span>
|
|
||||||
<span cnslError *ngIf="confirmPassword?.errors?.notequal">
|
|
||||||
{{ 'USER.PASSWORD.NOTEQUAL' | translate }}
|
|
||||||
</span>
|
|
||||||
</cnsl-form-field>
|
|
||||||
</form>
|
|
||||||
</ng-container>
|
|
||||||
</div>
|
|
||||||
<div class="btn-container">
|
|
||||||
<button color="primary" class="small-button" type="button" (click)="previous()"
|
|
||||||
mat-stroked-button>{{ 'ACTIONS.BACK' | translate }}</button>
|
|
||||||
<span class="fill-space"></span>
|
|
||||||
<button color="primary" class="big-button" (click)="finish()"
|
|
||||||
[disabled]="orgForm.invalid || userForm.invalid || ((usePassword && pwdForm) ? pwdForm?.invalid : false)"
|
|
||||||
mat-raised-button>{{ 'ACTIONS.FINISH' | translate }}</button>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</ng-container>
|
|
||||||
</ng-container>
|
|
||||||
</ng-template>
|
|
||||||
<ng-template cnslHasRole [hasRole]="['org.create']">
|
|
||||||
<div *ngIf="forSelf">
|
|
||||||
<ng-container *ngIf="currentCreateStep === 1">
|
|
||||||
<h1>{{'ORG.PAGES.ORGDETAIL_TITLE_WITHOUT_DOMAIN' | translate}} </h1>
|
|
||||||
|
|
||||||
<form [formGroup]="orgForm" (ngSubmit)="createOrgForSelf()">
|
|
||||||
<div class="content">
|
|
||||||
<cnsl-form-field class="formfield" appearance="outline">
|
|
||||||
<cnsl-label>{{ 'ORG_DETAIL.DETAIL.NAME' | translate }}</cnsl-label>
|
|
||||||
<input cnslInput formControlName="name" />
|
|
||||||
</cnsl-form-field>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="btn-container">
|
|
||||||
<span class="fill-space"></span>
|
|
||||||
<button [disabled]="orgForm.invalid" color="primary" mat-raised-button class="big-button"
|
|
||||||
cdkFocusInitial type="submit">
|
|
||||||
{{'CREATE' | translate}}
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</ng-container>
|
|
||||||
</div>
|
</div>
|
||||||
</ng-template>
|
</ng-container>
|
||||||
|
</ng-container>
|
||||||
|
</ng-template>
|
||||||
|
<ng-template cnslHasRole [hasRole]="['org.create']">
|
||||||
|
<div *ngIf="forSelf">
|
||||||
|
<ng-container *ngIf="currentCreateStep === 1">
|
||||||
|
<h1>{{'ORG.PAGES.ORGDETAIL_TITLE_WITHOUT_DOMAIN' | translate}} </h1>
|
||||||
|
|
||||||
|
<form [formGroup]="orgForm" (ngSubmit)="createOrgForSelf()">
|
||||||
|
<div class="content">
|
||||||
|
<cnsl-form-field class="formfield" appearance="outline">
|
||||||
|
<cnsl-label>{{ 'ORG_DETAIL.DETAIL.NAME' | translate }}</cnsl-label>
|
||||||
|
<input cnslInput formControlName="name" />
|
||||||
|
</cnsl-form-field>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="btn-container">
|
||||||
|
<span class="fill-space"></span>
|
||||||
|
<button [disabled]="orgForm.invalid" color="primary" mat-raised-button class="big-button" cdkFocusInitial
|
||||||
|
type="submit">
|
||||||
|
{{'CREATE' | translate}}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</ng-container>
|
||||||
|
</div>
|
||||||
|
</ng-template>
|
||||||
</div>
|
</div>
|
@ -44,9 +44,7 @@ function passwordConfirmValidator(c: AbstractControl): any {
|
|||||||
style({ height: '0', opacity: 0 }),
|
style({ height: '0', opacity: 0 }),
|
||||||
animate('150ms ease-in-out', style({ height: '*', opacity: 1 })),
|
animate('150ms ease-in-out', style({ height: '*', opacity: 1 })),
|
||||||
]),
|
]),
|
||||||
transition(':leave', [
|
transition(':leave', [animate('150ms ease-in-out', style({ height: '0', opacity: 0 }))]),
|
||||||
animate('150ms ease-in-out', style({ height: '0', opacity: 0 })),
|
|
||||||
]),
|
|
||||||
]),
|
]),
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
@ -72,11 +70,14 @@ export class OrgCreateComponent {
|
|||||||
private mgmtService: ManagementService,
|
private mgmtService: ManagementService,
|
||||||
private authService: GrpcAuthService,
|
private authService: GrpcAuthService,
|
||||||
) {
|
) {
|
||||||
this.authService.isAllowed(['iam.write']).pipe(take(1)).subscribe((allowed) => {
|
this.authService
|
||||||
if (allowed) {
|
.isAllowed(['iam.write'])
|
||||||
this.forSelf = false;
|
.pipe(take(1))
|
||||||
}
|
.subscribe((allowed) => {
|
||||||
});
|
if (allowed) {
|
||||||
|
this.forSelf = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
this.orgForm = this.fb.group({
|
this.orgForm = this.fb.group({
|
||||||
name: ['', [Validators.required]],
|
name: ['', [Validators.required]],
|
||||||
@ -123,7 +124,7 @@ export class OrgCreateComponent {
|
|||||||
// this.router.navigate(['/org', 'overview']);
|
// this.router.navigate(['/org', 'overview']);
|
||||||
// }
|
// }
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch((error) => {
|
||||||
this.toast.showError(error);
|
this.toast.showError(error);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -152,7 +153,7 @@ export class OrgCreateComponent {
|
|||||||
const validators: Validators[] = [Validators.required];
|
const validators: Validators[] = [Validators.required];
|
||||||
|
|
||||||
if (this.usePassword) {
|
if (this.usePassword) {
|
||||||
this.mgmtService.getDefaultPasswordComplexityPolicy().then(data => {
|
this.mgmtService.getDefaultPasswordComplexityPolicy().then((data) => {
|
||||||
if (data.policy) {
|
if (data.policy) {
|
||||||
this.policy = data.policy;
|
this.policy = data.policy;
|
||||||
|
|
||||||
@ -195,7 +196,6 @@ export class OrgCreateComponent {
|
|||||||
this.orgForm = this.fb.group({
|
this.orgForm = this.fb.group({
|
||||||
name: ['', [Validators.required]],
|
name: ['', [Validators.required]],
|
||||||
});
|
});
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
this.createSteps = 2;
|
this.createSteps = 2;
|
||||||
|
|
||||||
@ -208,16 +208,14 @@ export class OrgCreateComponent {
|
|||||||
|
|
||||||
public createOrgForSelf(): void {
|
public createOrgForSelf(): void {
|
||||||
if (this.name && this.name.value) {
|
if (this.name && this.name.value) {
|
||||||
this.mgmtService.addOrg(this.name.value).then(() => {
|
this.mgmtService
|
||||||
this.router.navigate(['/org/overview']);
|
.addOrg(this.name.value)
|
||||||
// const newOrg = org.toObject();
|
.then(() => {
|
||||||
// setTimeout(() => {
|
this.router.navigate(['/org/overview']);
|
||||||
// this.authService.setActiveOrg(newOrg);
|
})
|
||||||
// this.router.navigate(['/org']);
|
.catch((error) => {
|
||||||
// }, 1000);
|
this.toast.showError(error);
|
||||||
}).catch(error => {
|
});
|
||||||
this.toast.showError(error);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,22 +16,22 @@ import { OrgCreateRoutingModule } from './org-create-routing.module';
|
|||||||
import { OrgCreateComponent } from './org-create.component';
|
import { OrgCreateComponent } from './org-create.component';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [OrgCreateComponent],
|
declarations: [OrgCreateComponent],
|
||||||
imports: [
|
imports: [
|
||||||
OrgCreateRoutingModule,
|
OrgCreateRoutingModule,
|
||||||
CommonModule,
|
CommonModule,
|
||||||
FormsModule,
|
FormsModule,
|
||||||
ReactiveFormsModule,
|
ReactiveFormsModule,
|
||||||
InputModule,
|
InputModule,
|
||||||
MatButtonModule,
|
MatButtonModule,
|
||||||
MatIconModule,
|
MatIconModule,
|
||||||
MatSelectModule,
|
MatSelectModule,
|
||||||
HasRolePipeModule,
|
HasRolePipeModule,
|
||||||
TranslateModule,
|
TranslateModule,
|
||||||
HasRoleModule,
|
HasRoleModule,
|
||||||
MatCheckboxModule,
|
MatCheckboxModule,
|
||||||
PasswordComplexityViewModule,
|
PasswordComplexityViewModule,
|
||||||
MatSlideToggleModule,
|
MatSlideToggleModule,
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
export class OrgCreateModule { }
|
export class OrgCreateModule {}
|
||||||
|
@ -641,6 +641,7 @@
|
|||||||
"LISTDESCRIPTION": "Wähle eine Organisation aus.",
|
"LISTDESCRIPTION": "Wähle eine Organisation aus.",
|
||||||
"ACTIVE": "Aktiv",
|
"ACTIVE": "Aktiv",
|
||||||
"CREATE": "Organisation erstellen",
|
"CREATE": "Organisation erstellen",
|
||||||
|
"USERSELFACCOUNT": "Verwenden Sie Ihr persönliches Konto als Organisationsinhaber",
|
||||||
"ORGDETAIL_TITLE": "Gebe den Namen und die Domain für die neue Organisation ein.",
|
"ORGDETAIL_TITLE": "Gebe den Namen und die Domain für die neue Organisation ein.",
|
||||||
"ORGDETAIL_TITLE_WITHOUT_DOMAIN": "Geben Sie den Namen der neuen Organisation ein.",
|
"ORGDETAIL_TITLE_WITHOUT_DOMAIN": "Geben Sie den Namen der neuen Organisation ein.",
|
||||||
"ORGDETAILUSER_TITLE": "Organisationsbesitzer hinzufügen",
|
"ORGDETAILUSER_TITLE": "Organisationsbesitzer hinzufügen",
|
||||||
|
@ -641,6 +641,7 @@
|
|||||||
"LISTDESCRIPTION": "Choose an organisation.",
|
"LISTDESCRIPTION": "Choose an organisation.",
|
||||||
"ACTIVE": "Active",
|
"ACTIVE": "Active",
|
||||||
"CREATE": "Create Organisation",
|
"CREATE": "Create Organisation",
|
||||||
|
"USERSELFACCOUNT": "Use your personal account as organisation owner",
|
||||||
"ORGDETAIL_TITLE": "Enter the name and domain of your new organisation.",
|
"ORGDETAIL_TITLE": "Enter the name and domain of your new organisation.",
|
||||||
"ORGDETAIL_TITLE_WITHOUT_DOMAIN": "Enter the name of your new organisation.",
|
"ORGDETAIL_TITLE_WITHOUT_DOMAIN": "Enter the name of your new organisation.",
|
||||||
"ORGDETAILUSER_TITLE": "Configure Organisation Owner",
|
"ORGDETAILUSER_TITLE": "Configure Organisation Owner",
|
||||||
|
@ -641,6 +641,7 @@
|
|||||||
"LISTDESCRIPTION": "Scegli un'organizzazione.",
|
"LISTDESCRIPTION": "Scegli un'organizzazione.",
|
||||||
"ACTIVE": "Attivo",
|
"ACTIVE": "Attivo",
|
||||||
"CREATE": "Creare un'organizzazione",
|
"CREATE": "Creare un'organizzazione",
|
||||||
|
"USERSELFACCOUNT": "Usa il tuo account personale come proprietario dell'organizzazione",
|
||||||
"ORGDETAIL_TITLE": "Inserisci il nome e il dominio della tua nuova organizzazione.",
|
"ORGDETAIL_TITLE": "Inserisci il nome e il dominio della tua nuova organizzazione.",
|
||||||
"ORGDETAIL_TITLE_WITHOUT_DOMAIN": "Inserisci il nome della tua nuova organizzazione.",
|
"ORGDETAIL_TITLE_WITHOUT_DOMAIN": "Inserisci il nome della tua nuova organizzazione.",
|
||||||
"ORGDETAILUSER_TITLE": "Configurare il proprietario dell'organizzazione",
|
"ORGDETAILUSER_TITLE": "Configurare il proprietario dell'organizzazione",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user