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-content panel-content-blank">
<div *ngIf="userFormError">
<div class="form-error">
{{userFormError}}
</div>
</div>
<div class="form-group">
<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 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);
});
}

10
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;
}

1
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();
}
}

Loading…
Cancel
Save