From 11d08acc906de349e5b812f7ffdeaa232f226037 Mon Sep 17 00:00:00 2001 From: Sebastian Stehle Date: Sun, 28 May 2017 11:10:22 +0200 Subject: [PATCH] Minor fix with user creation. --- .../administration/pages/users/user-page.component.ts | 11 ++++------- src/Squidex/app/theme/_forms.scss | 5 +++-- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/Squidex/app/features/administration/pages/users/user-page.component.ts b/src/Squidex/app/features/administration/pages/users/user-page.component.ts index 9954c4efe..78c285cea 100644 --- a/src/Squidex/app/features/administration/pages/users/user-page.component.ts +++ b/src/Squidex/app/features/administration/pages/users/user-page.component.ts @@ -47,12 +47,12 @@ export class UserPageComponent extends ComponentBase implements OnInit { } public ngOnInit() { + this.currentUserId = this.authService.user!.id; + this.route.data.map(p => p['user']) .subscribe((user: UserDto) => { this.populateForm(user); }); - - this.currentUserId = this.authService.user!.id; } public save() { @@ -66,7 +66,6 @@ export class UserPageComponent extends ComponentBase implements OnInit { const enable = (message?: string) => { this.userForm.enable(); this.userForm.controls['password'].reset(); - this.userForm.controls['passwordConfirm'].reset(); this.userFormSubmitted = false; this.userFormError = message; }; @@ -88,7 +87,7 @@ export class UserPageComponent extends ComponentBase implements OnInit { this.notifyInfo('User created successfully.'); back(); }, error => { - enable(); + enable(error.displayMessage); }); } else { this.userManagementService.putUser(this.userId, requestDto) @@ -100,13 +99,11 @@ export class UserPageComponent extends ComponentBase implements OnInit { requestDto.displayName)); this.notifyInfo('User saved successfully.'); - enable(null); + enable(); }, error => { enable(error.displayMessage); }); } - } else { - this.notifyError('Content element not valid, please check the field with the red bar on the left in all languages (if localizable).'); } } diff --git a/src/Squidex/app/theme/_forms.scss b/src/Squidex/app/theme/_forms.scss index a640ab056..85e796857 100644 --- a/src/Squidex/app/theme/_forms.scss +++ b/src/Squidex/app/theme/_forms.scss @@ -68,10 +68,11 @@ select { .form-error { @include border-radius(4px); - @include truncate; color: $color-dark-foreground; margin-top: .25rem; - margin-bottom: .5rem; + margin-bottom: .8rem; + font-size: .9rem; + font-weight: normal; padding: .5rem; background: $color-theme-error; }