File tree Expand file tree Collapse file tree
src/app/register-page/create-profile Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -41,6 +41,11 @@ export class CreateProfileComponent implements OnInit {
4141 userInfoForm : FormGroup ;
4242 activeLangs : LangConfig [ ] ;
4343
44+ /**
45+ * Prefix for the notification messages of this security form
46+ */
47+ NOTIFICATIONS_PREFIX = 'register-page.create-profile.submit.' ;
48+
4449 constructor (
4550 private translateService : TranslateService ,
4651 private ePersonDataService : EPersonDataService ,
@@ -161,13 +166,12 @@ export class CreateProfileComponent implements OnInit {
161166 getFirstCompletedRemoteData ( ) ,
162167 ) . subscribe ( ( rd : RemoteData < EPerson > ) => {
163168 if ( rd . hasSucceeded ) {
164- this . notificationsService . success ( this . translateService . get ( 'register-page.create-profile.submit. success.head') ,
165- this . translateService . get ( 'register-page.create-profile.submit. success.content') ) ;
169+ this . notificationsService . success ( this . translateService . get ( this . NOTIFICATIONS_PREFIX + ' success.head') ,
170+ this . translateService . get ( this . NOTIFICATIONS_PREFIX + ' success.content') ) ;
166171 this . store . dispatch ( new AuthenticateAction ( this . email , this . password ) ) ;
167172 this . router . navigate ( [ '/home' ] ) ;
168173 } else {
169- this . notificationsService . error ( this . translateService . get ( 'register-page.create-profile.submit.error.head' ) ,
170- this . translateService . get ( 'register-page.create-profile.submit.error.content' ) ) ;
174+ this . notificationsService . error ( this . translateService . get ( this . NOTIFICATIONS_PREFIX + 'error.head' ) , rd . errorMessage ) ;
171175 }
172176 } ) ;
173177 }
You can’t perform that action at this time.
0 commit comments