diff --git a/src/Squidex/app/features/administration/pages/users/user-page.component.html b/src/Squidex/app/features/administration/pages/users/user-page.component.html index 60d9794e2..ead6b4e2a 100644 --- a/src/Squidex/app/features/administration/pages/users/user-page.component.html +++ b/src/Squidex/app/features/administration/pages/users/user-page.component.html @@ -29,6 +29,12 @@
+
+
+ {{userFormError}} +
+
+
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 8169ed182..9954c4efe 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 @@ -63,7 +63,7 @@ export class UserPageComponent extends ComponentBase implements OnInit { const requestDto = this.userForm.value; - const enable = (message: string) => { + const enable = (message?: string) => { this.userForm.enable(); this.userForm.controls['password'].reset(); this.userForm.controls['passwordConfirm'].reset(); @@ -88,8 +88,7 @@ export class UserPageComponent extends ComponentBase implements OnInit { this.notifyInfo('User created successfully.'); back(); }, error => { - this.notifyError(error); - enable(error.displayMessage); + enable(); }); } else { this.userManagementService.putUser(this.userId, requestDto) @@ -103,7 +102,6 @@ export class UserPageComponent extends ComponentBase implements OnInit { this.notifyInfo('User saved successfully.'); enable(null); }, error => { - this.notifyError(error); enable(error.displayMessage); }); } diff --git a/src/Squidex/app/shared/components/app-form.component.ts b/src/Squidex/app/shared/components/app-form.component.ts index 120de6da5..6258702f9 100644 --- a/src/Squidex/app/shared/components/app-form.component.ts +++ b/src/Squidex/app/shared/components/app-form.component.ts @@ -30,7 +30,7 @@ export class AppFormComponent { @Output() public cancelled = new EventEmitter(); - public creationError = ''; + public createFormError = ''; public createFormSubmitted = false; public createForm: FormGroup = this.formBuilder.group({ @@ -66,9 +66,10 @@ export class AppFormComponent { const request = new CreateAppDto(this.createForm.get('name')!.value); - const enable = () => { + const enable = (message?: string) => { this.createForm.enable(); this.createFormSubmitted = false; + this.createFormError = message; }; this.appsStore.createApp(request) @@ -76,14 +77,13 @@ export class AppFormComponent { this.reset(); this.created.emit(dto); }, error => { - enable(); - this.creationError = error.displayMessage; + enable(error.displayMessage); }); } } private reset() { - this.creationError = ''; + this.createFormError = ''; this.createForm.enable(); this.createFormSubmitted = false; } diff --git a/src/Squidex/app/shared/components/asset.component.ts b/src/Squidex/app/shared/components/asset.component.ts index f6a5ba2fe..bd32284de 100644 --- a/src/Squidex/app/shared/components/asset.component.ts +++ b/src/Squidex/app/shared/components/asset.component.ts @@ -189,7 +189,6 @@ export class AssetComponent extends AppComponentBase implements OnInit { this.notifyError(error); this.resetRename(); }); - this.resetRename(); } }