mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
[CST-6932] behavior on the registration page should be the same as the behavior on the change password page
This commit is contained in:
@@ -41,6 +41,11 @@ export class CreateProfileComponent implements OnInit {
|
|||||||
userInfoForm: FormGroup;
|
userInfoForm: FormGroup;
|
||||||
activeLangs: LangConfig[];
|
activeLangs: LangConfig[];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Prefix for the notification messages of this security form
|
||||||
|
*/
|
||||||
|
NOTIFICATIONS_PREFIX = 'register-page.create-profile.submit.';
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private translateService: TranslateService,
|
private translateService: TranslateService,
|
||||||
private ePersonDataService: EPersonDataService,
|
private ePersonDataService: EPersonDataService,
|
||||||
@@ -161,13 +166,12 @@ export class CreateProfileComponent implements OnInit {
|
|||||||
getFirstCompletedRemoteData(),
|
getFirstCompletedRemoteData(),
|
||||||
).subscribe((rd: RemoteData<EPerson>) => {
|
).subscribe((rd: RemoteData<EPerson>) => {
|
||||||
if (rd.hasSucceeded) {
|
if (rd.hasSucceeded) {
|
||||||
this.notificationsService.success(this.translateService.get('register-page.create-profile.submit.success.head'),
|
this.notificationsService.success(this.translateService.get(this.NOTIFICATIONS_PREFIX + 'success.head'),
|
||||||
this.translateService.get('register-page.create-profile.submit.success.content'));
|
this.translateService.get(this.NOTIFICATIONS_PREFIX + 'success.content'));
|
||||||
this.store.dispatch(new AuthenticateAction(this.email, this.password));
|
this.store.dispatch(new AuthenticateAction(this.email, this.password));
|
||||||
this.router.navigate(['/home']);
|
this.router.navigate(['/home']);
|
||||||
} else {
|
} else {
|
||||||
this.notificationsService.error(this.translateService.get('register-page.create-profile.submit.error.head'),
|
this.notificationsService.error(this.translateService.get(this.NOTIFICATIONS_PREFIX + 'error.head'), rd.errorMessage);
|
||||||
this.translateService.get('register-page.create-profile.submit.error.content'));
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user