Browse Source

Small layout fixes

pull/65/head
Sebastian Stehle 9 years ago
parent
commit
5a21add93b
  1. 6
      src/Squidex/app/features/administration/pages/users/user-page.component.html
  2. 6
      src/Squidex/app/features/administration/pages/users/user-page.component.ts
  3. 10
      src/Squidex/app/shared/components/app-form.component.ts
  4. 1
      src/Squidex/app/shared/components/asset.component.ts

6
src/Squidex/app/features/administration/pages/users/user-page.component.html

@ -29,6 +29,12 @@
<div class="panel-main"> <div class="panel-main">
<div class="panel-content panel-content-blank"> <div class="panel-content panel-content-blank">
<div *ngIf="userFormError">
<div class="form-error">
{{userFormError}}
</div>
</div>
<div class="form-group"> <div class="form-group">
<label for="email">Email</label> <label for="email">Email</label>

6
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 requestDto = this.userForm.value;
const enable = (message: string) => { const enable = (message?: string) => {
this.userForm.enable(); this.userForm.enable();
this.userForm.controls['password'].reset(); this.userForm.controls['password'].reset();
this.userForm.controls['passwordConfirm'].reset(); this.userForm.controls['passwordConfirm'].reset();
@ -88,8 +88,7 @@ export class UserPageComponent extends ComponentBase implements OnInit {
this.notifyInfo('User created successfully.'); this.notifyInfo('User created successfully.');
back(); back();
}, error => { }, error => {
this.notifyError(error); enable();
enable(error.displayMessage);
}); });
} else { } else {
this.userManagementService.putUser(this.userId, requestDto) this.userManagementService.putUser(this.userId, requestDto)
@ -103,7 +102,6 @@ export class UserPageComponent extends ComponentBase implements OnInit {
this.notifyInfo('User saved successfully.'); this.notifyInfo('User saved successfully.');
enable(null); enable(null);
}, error => { }, error => {
this.notifyError(error);
enable(error.displayMessage); enable(error.displayMessage);
}); });
} }

10
src/Squidex/app/shared/components/app-form.component.ts

@ -30,7 +30,7 @@ export class AppFormComponent {
@Output() @Output()
public cancelled = new EventEmitter(); public cancelled = new EventEmitter();
public creationError = ''; public createFormError = '';
public createFormSubmitted = false; public createFormSubmitted = false;
public createForm: FormGroup = public createForm: FormGroup =
this.formBuilder.group({ this.formBuilder.group({
@ -66,9 +66,10 @@ export class AppFormComponent {
const request = new CreateAppDto(this.createForm.get('name')!.value); const request = new CreateAppDto(this.createForm.get('name')!.value);
const enable = () => { const enable = (message?: string) => {
this.createForm.enable(); this.createForm.enable();
this.createFormSubmitted = false; this.createFormSubmitted = false;
this.createFormError = message;
}; };
this.appsStore.createApp(request) this.appsStore.createApp(request)
@ -76,14 +77,13 @@ export class AppFormComponent {
this.reset(); this.reset();
this.created.emit(dto); this.created.emit(dto);
}, error => { }, error => {
enable(); enable(error.displayMessage);
this.creationError = error.displayMessage;
}); });
} }
} }
private reset() { private reset() {
this.creationError = ''; this.createFormError = '';
this.createForm.enable(); this.createForm.enable();
this.createFormSubmitted = false; this.createFormSubmitted = false;
} }

1
src/Squidex/app/shared/components/asset.component.ts

@ -189,7 +189,6 @@ export class AssetComponent extends AppComponentBase implements OnInit {
this.notifyError(error); this.notifyError(error);
this.resetRename(); this.resetRename();
}); });
this.resetRename();
} }
} }

Loading…
Cancel
Save