File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -99,10 +99,13 @@ const alerts = (state = defaultState, action) => {
9999
100100 const alert = {
101101 id : rtdAlert . Id ,
102- title : rtdAlert . HeaderText ,
102+ // Alert title and description are fields we expect to have values, i.e. they are required fields.
103+ // If for some reason they are null, change them to empty strings so as not to upset the application
104+ // downstream.
105+ title : rtdAlert . HeaderText || '' ,
103106 // RTD server sends back two-char new lines, which can mess up character limit counts
104107 // Here, we replace any of those occurrences with a single new line char.
105- description : rtdAlert . DescriptionText && rtdAlert . DescriptionText . replace ( / ( \r \n ) / g, '\n' ) ,
108+ description : rtdAlert . DescriptionText && rtdAlert . DescriptionText . replace ( / ( \r \n ) / g, '\n' ) || '' ,
106109 cause : rtdAlert . Cause ,
107110 effect : rtdAlert . Effect ,
108111 editedBy : rtdAlert . EditedBy ,
Original file line number Diff line number Diff line change @@ -7,6 +7,8 @@ export const getVisibleAlerts = createSelector(
77 [ state => state . alerts . all , state => state . alerts . filter ] ,
88 ( alerts , visibilityFilter ) => {
99 if ( ! alerts ) return [ ]
10+
11+ // filter alerts by the search text string
1012 let visibleAlerts = alerts . filter ( alert =>
1113 alert . title . toLowerCase ( ) . indexOf ( ( visibilityFilter . searchText || '' ) . toLowerCase ( ) ) !== - 1 )
1214
You can’t perform that action at this time.
0 commit comments