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) => {
99
99
100
100
const alert = {
101
101
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 || '' ,
103
106
// RTD server sends back two-char new lines, which can mess up character limit counts
104
107
// 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' ) || '' ,
106
109
cause : rtdAlert . Cause ,
107
110
effect : rtdAlert . Effect ,
108
111
editedBy : rtdAlert . EditedBy ,
Original file line number Diff line number Diff line change @@ -7,6 +7,8 @@ export const getVisibleAlerts = createSelector(
7
7
[ state => state . alerts . all , state => state . alerts . filter ] ,
8
8
( alerts , visibilityFilter ) => {
9
9
if ( ! alerts ) return [ ]
10
+
11
+ // filter alerts by the search text string
10
12
let visibleAlerts = alerts . filter ( alert =>
11
13
alert . title . toLowerCase ( ) . indexOf ( ( visibilityFilter . searchText || '' ) . toLowerCase ( ) ) !== - 1 )
12
14
You can’t perform that action at this time.
0 commit comments