@@ -101,6 +101,14 @@ const getStyleForDirection = (direction: Direction): string => {
101
101
return direction === Direction . MO ? styles . msg_received : styles . send_msg ;
102
102
} ;
103
103
104
+ const renderWarning = ( warning : string ) : JSX . Element => {
105
+ return (
106
+ < div className = { styles . warning } >
107
+ < span > Warning: { warning } </ span >
108
+ </ div >
109
+ ) ;
110
+ } ;
111
+
104
112
const renderError = ( error : string ) : JSX . Element => {
105
113
return (
106
114
< div className = { styles . error } >
@@ -109,6 +117,10 @@ const renderError = (error: string): JSX.Element => {
109
117
) ;
110
118
} ;
111
119
120
+ const renderInfoStyles = ( allStyles : any [ ] ) : string => {
121
+ return allStyles . join ( ' ' ) ;
122
+ } ;
123
+
112
124
const renderInfo = ( info : string , extraStyles ?: any [ ] ) : JSX . Element => {
113
125
// localized text can have html entities, so this isn't as dangerous as it looks
114
126
const infoStyle = [ styles . info ] ;
@@ -120,9 +132,6 @@ const renderInfo = (info: string, extraStyles?: any[]): JSX.Element => {
120
132
</ div >
121
133
) ;
122
134
} ;
123
- const renderInfoStyles = ( allStyles : any [ ] ) : string => {
124
- return allStyles . join ( ' ' ) ;
125
- } ;
126
135
127
136
const renderAttachment = ( attachment : string ) : JSX . Element => {
128
137
const idx = attachment . indexOf ( ':' ) ;
@@ -381,6 +390,8 @@ export default class LogEvent extends React.Component<EventProps, LogEventState>
381
390
return renderMessage ( this . props . msg . text , this . props . msg . attachments , Direction . MT ) ;
382
391
case 'ivr_created' :
383
392
return renderMessage ( this . props . msg . text , this . props . msg . attachments , Direction . MT ) ;
393
+ case 'warning' :
394
+ return renderWarning ( this . props . text ) ;
384
395
case 'error' :
385
396
return renderError ( this . props . text ) ;
386
397
case 'failure' :
@@ -391,7 +402,7 @@ export default class LogEvent extends React.Component<EventProps, LogEventState>
391
402
return this . renderGroupsChanged ( ) ;
392
403
case 'contact_urns_changed' :
393
404
return renderInfo ( 'Added a URN for the contact' ) ;
394
- case 'contact_field_changed' :
405
+ case 'contact_field_changed' : {
395
406
const value = this . getValue ( this . props . value ) ;
396
407
if ( value !== '' ) {
397
408
return renderInfo (
@@ -407,6 +418,7 @@ export default class LogEvent extends React.Component<EventProps, LogEventState>
407
418
} )
408
419
) ;
409
420
}
421
+ }
410
422
case 'run_result_changed' :
411
423
return renderInfo (
412
424
i18n . t ( 'simulator.run_result_changed' , 'Set result "[[field]]" to "[[value]]"' , {
@@ -423,9 +435,10 @@ export default class LogEvent extends React.Component<EventProps, LogEventState>
423
435
case 'email_created' :
424
436
case 'email_sent' :
425
437
return this . renderEmailSent ( ) ;
426
- case 'broadcast_created' :
438
+ case 'broadcast_created' : {
427
439
const translation = this . props . translations [ this . props . base_language ] ;
428
440
return renderMessage ( translation . text , translation . attachments , Direction . MT ) ;
441
+ }
429
442
case 'resthook_called' :
430
443
return renderInfo (
431
444
i18n . t ( 'simulator.resthook_called' , 'Triggered flow event "[[resthook]]"' , {
@@ -475,7 +488,7 @@ export default class LogEvent extends React.Component<EventProps, LogEventState>
475
488
topic : this . props . ticket . topic . name
476
489
} )
477
490
) ;
478
- case 'airtime_transferred' :
491
+ case 'airtime_transferred' : {
479
492
const event = this . props as AirtimeTransferEvent ;
480
493
return (
481
494
< >
@@ -494,6 +507,7 @@ export default class LogEvent extends React.Component<EventProps, LogEventState>
494
507
) }
495
508
</ >
496
509
) ;
510
+ }
497
511
}
498
512
499
513
// should only get here if we are get an unexpected event
0 commit comments