Skip to content

Commit

Permalink
fix: added hint when user account is disabled (#1737)
Browse files Browse the repository at this point in the history
closes #1734 

Co-authored-by: Sebastian <sebastian.leidig@gmail.com>
  • Loading branch information
TheSlimvReal and sleidig authored Mar 1, 2023
1 parent 033cdd1 commit 341b8f2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/app/core/user/user-security/user-security.component.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<em *ngIf="!userIsPermitted" i18n="Placeholder text when permissions are missing">
You account does not have the required permissions to see this page.
</em>

<div *ngIf="userIsPermitted" class="flex-column">
<div *ngIf="!user" class="buttons-wrapper align-self-start">
<p i18n="notice about user without account" class="field-hint field-warning">
Expand Down Expand Up @@ -68,6 +69,13 @@
</button>
</div>

<p
*ngIf="user && !user.enabled"
i18n="Hint in user account page"
class="field-hint field-warning"
>
User is currently disabled and will not be able to login to the app
</p>
<form [formGroup]="form">
<div>
<mat-form-field>
Expand Down
2 changes: 1 addition & 1 deletion src/app/core/user/user-security/user-security.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export class UserSecurityComponent implements OnInitDynamicComponent {
}
// automatically skip trailing and leading whitespaces when the form changes
this.form.valueChanges.pipe(untilDestroyed(this)).subscribe((next) => {
if (next.email.startsWith(" ") || next.email.endsWith(" ")) {
if (next.email?.startsWith(" ") || next.email?.endsWith(" ")) {
this.form.get("email").setValue(next.email.trim());
}
});
Expand Down

0 comments on commit 341b8f2

Please sign in to comment.