@@ -39,7 +39,8 @@ import { LicenseInquireLink } from 'app/shared/links/LicenseInquireLink';
39
39
import WindowStore from 'app/store/WindowStore' ;
40
40
import SmallPageContainer from 'app/components/SmallPageContainer' ;
41
41
import MessageToContact from 'app/shared/texts/MessageToContact' ;
42
- import * as XRegExp from "xregexp" ;
42
+ import * as XRegExp from 'xregexp' ;
43
+ import { ErrorAlert , OncoKBError } from 'app/shared/alert/ErrorAlert' ;
43
44
44
45
export type NewUserRequiredFields = {
45
46
username : string ;
@@ -69,7 +70,7 @@ export const LICENSE_HASH_KEY = 'license';
69
70
export class RegisterPage extends React . Component < IRegisterProps > {
70
71
@observable password = '' ;
71
72
@observable registerStatus : RegisterStatus = RegisterStatus . NA ;
72
- @observable registerError : any ;
73
+ @observable registerError : OncoKBError ;
73
74
@observable selectedLicense : LicenseType | undefined ;
74
75
75
76
private newAccount : Partial < ManagedUserVM > ;
@@ -146,7 +147,7 @@ export class RegisterPage extends React.Component<IRegisterProps> {
146
147
}
147
148
148
149
@action . bound
149
- failedToRegistered ( error : any ) {
150
+ failedToRegistered ( error : OncoKBError ) {
150
151
this . registerStatus = RegisterStatus . NOT_SUCCESS ;
151
152
this . registerError = error ;
152
153
window . scrollTo ( 0 , 0 ) ;
@@ -237,11 +238,7 @@ export class RegisterPage extends React.Component<IRegisterProps> {
237
238
238
239
return (
239
240
< div className = { 'registerPage' } >
240
- { this . registerStatus === RegisterStatus . NOT_SUCCESS ? (
241
- < div >
242
- < Alert variant = "danger" > { this . errorRegisterMessage } </ Alert >
243
- </ div >
244
- ) : null }
241
+ { this . registerError ? < ErrorAlert error = { this . registerError } /> : null }
245
242
< AvForm id = "register-form" onValidSubmit = { this . handleValidSubmit } >
246
243
< Row className = { getSectionClassName ( true ) } >
247
244
< Col xs = { 12 } >
@@ -312,7 +309,8 @@ export class RegisterPage extends React.Component<IRegisterProps> {
312
309
} ,
313
310
pattern : {
314
311
value : XRegExp ( '^[\\p{Latin}\\s]+$' ) ,
315
- errorMessage : 'Sorry, we only support Latin letters for now.'
312
+ errorMessage :
313
+ 'Sorry, we only support Latin letters for now.'
316
314
} ,
317
315
minLength : {
318
316
value : 1 ,
@@ -334,7 +332,8 @@ export class RegisterPage extends React.Component<IRegisterProps> {
334
332
} ,
335
333
pattern : {
336
334
value : XRegExp ( '^[\\p{Latin}\\s]+$' ) ,
337
- errorMessage : 'Sorry, we only support Latin letters for now.'
335
+ errorMessage :
336
+ 'Sorry, we only support Latin letters for now.'
338
337
} ,
339
338
minLength : {
340
339
value : 1 ,
@@ -422,7 +421,8 @@ export class RegisterPage extends React.Component<IRegisterProps> {
422
421
} ,
423
422
pattern : {
424
423
value : XRegExp ( '^[\\p{Latin}\\p{Common}\\s]+$' ) ,
425
- errorMessage : 'Sorry, we only support Latin letters for now.'
424
+ errorMessage :
425
+ 'Sorry, we only support Latin letters for now.'
426
426
} ,
427
427
maxLength : {
428
428
value : 50 ,
@@ -445,7 +445,8 @@ export class RegisterPage extends React.Component<IRegisterProps> {
445
445
} ,
446
446
pattern : {
447
447
value : XRegExp ( '^[\\p{Latin}\\p{Common}\\s]+$' ) ,
448
- errorMessage : 'Sorry, we only support Latin letters for now.'
448
+ errorMessage :
449
+ 'Sorry, we only support Latin letters for now.'
449
450
} ,
450
451
maxLength : {
451
452
value : 50 ,
@@ -468,7 +469,8 @@ export class RegisterPage extends React.Component<IRegisterProps> {
468
469
} ,
469
470
pattern : {
470
471
value : XRegExp ( '^[\\p{Latin}\\p{Common}\\s]+$' ) ,
471
- errorMessage : 'Sorry, we only support Latin letters for now.'
472
+ errorMessage :
473
+ 'Sorry, we only support Latin letters for now.'
472
474
} ,
473
475
maxLength : {
474
476
value : 50 ,
@@ -487,7 +489,8 @@ export class RegisterPage extends React.Component<IRegisterProps> {
487
489
required : { value : true , errorMessage : 'Required.' } ,
488
490
pattern : {
489
491
value : XRegExp ( '^[\\p{Latin}\\p{Common}\\s]+$' ) ,
490
- errorMessage : 'Sorry, we only support Latin letters for now.'
492
+ errorMessage :
493
+ 'Sorry, we only support Latin letters for now.'
491
494
} ,
492
495
minLength : {
493
496
value : 1 ,
0 commit comments