Browse Source

Minor fix with user creation.

pull/65/head
Sebastian Stehle 9 years ago
parent
commit
11d08acc90
  1. 11
      src/Squidex/app/features/administration/pages/users/user-page.component.ts
  2. 5
      src/Squidex/app/theme/_forms.scss

11
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).');
}
}

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

Loading…
Cancel
Save