fix(console): show loginname suffix correctly (#4649)

fix: suffix in user-create
This commit is contained in:
Max Peintner 2022-11-07 08:43:41 +01:00 committed by GitHub
parent b3d2892e4c
commit 5c807a0660
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 7 deletions

View File

@ -30,7 +30,7 @@
required required
[ngStyle]="{ 'padding-right': suffixPadding ? suffixPadding : '10px' }" [ngStyle]="{ 'padding-right': suffixPadding ? suffixPadding : '10px' }"
/> />
<span #suffix *ngIf="envSuffixLabel" cnslSuffix>{{ envSuffixLabel }}</span> <span #suffix *ngIf="envSuffix" cnslSuffix>{{ envSuffix }}</span>
<span cnslError *ngIf="userName?.invalid && userName?.errors?.required"> <span cnslError *ngIf="userName?.invalid && userName?.errors?.required">
{{ 'USER.VALIDATION.REQUIRED' | translate }} {{ 'USER.VALIDATION.REQUIRED' | translate }}

View File

@ -46,8 +46,6 @@ export class UserCreateComponent implements OnDestroy {
public languages: string[] = ['de', 'en', 'it', 'fr']; public languages: string[] = ['de', 'en', 'it', 'fr'];
public userForm!: UntypedFormGroup; public userForm!: UntypedFormGroup;
public pwdForm!: UntypedFormGroup; public pwdForm!: UntypedFormGroup;
public envSuffixLabel: string = '';
private destroyed$: Subject<void> = new Subject(); private destroyed$: Subject<void> = new Subject();
public userLoginMustBeDomain: boolean = false; public userLoginMustBeDomain: boolean = false;
@ -84,14 +82,12 @@ export class UserCreateComponent implements OnDestroy {
} }
this.initForm(); this.initForm();
this.loading = false; this.loading = false;
this.envSuffixLabel = this.envSuffix();
this.changeDetRef.detectChanges(); this.changeDetRef.detectChanges();
}) })
.catch((error) => { .catch((error) => {
console.error(error); console.error(error);
this.initForm(); this.initForm();
this.loading = false; this.loading = false;
this.envSuffixLabel = this.envSuffix();
this.changeDetRef.detectChanges(); this.changeDetRef.detectChanges();
}); });
@ -249,7 +245,8 @@ export class UserCreateComponent implements OnDestroy {
public get confirmPassword(): AbstractControl | null { public get confirmPassword(): AbstractControl | null {
return this.pwdForm.get('confirmPassword'); return this.pwdForm.get('confirmPassword');
} }
private envSuffix(): string {
public get envSuffix(): string {
if (this.userLoginMustBeDomain && this.primaryDomain?.domainName) { if (this.userLoginMustBeDomain && this.primaryDomain?.domainName) {
return `@${this.primaryDomain.domainName}`; return `@${this.primaryDomain.domainName}`;
} else { } else {

View File

@ -868,7 +868,7 @@
"GENERAL": "Generale", "GENERAL": "Generale",
"LOGIN": "Comportamento login e sicurezza", "LOGIN": "Comportamento login e sicurezza",
"LOCKOUT": "Meccanismi di bloccaggio", "LOCKOUT": "Meccanismi di bloccaggio",
"COMPLEXITY": "complessità della password", "COMPLEXITY": "Complessità della password",
"NOTIFICATIONS": "Notifiche", "NOTIFICATIONS": "Notifiche",
"NOTIFICATIONS_DESC": "Impostazioni SMTP e SMS", "NOTIFICATIONS_DESC": "Impostazioni SMTP e SMS",
"MESSAGETEXTS": "Testi di notifica", "MESSAGETEXTS": "Testi di notifica",