File tree 2 files changed +25
-9
lines changed
public/pages/CreateTrigger
2 files changed +25
-9
lines changed Original file line number Diff line number Diff line change @@ -156,7 +156,7 @@ const Action = ({
156
156
</ EuiText >
157
157
</ React . Fragment >
158
158
) ,
159
- rowHeight : 45 ,
159
+ rowHeight : 30 ,
160
160
isLoading : ! flyoutMode && loadingDestinations ,
161
161
} }
162
162
/>
Original file line number Diff line number Diff line change @@ -19,14 +19,30 @@ import moment from 'moment-timezone';
19
19
import { formikToTrigger } from '../containers/CreateTrigger/utils/formikToTrigger' ;
20
20
import { getUISettings } from '../../../services' ;
21
21
22
- export const getChannelOptions = ( channels ) =>
23
- channels . map ( ( channel ) => ( {
24
- key : channel . type ,
25
- label : channel . type ,
26
- options : channels
27
- . filter ( ( local_channel ) => local_channel . type === channel . type )
28
- . map ( ( option ) => ( { key : option . value , ...option } ) ) ,
29
- } ) ) ;
22
+ export const getChannelOptions = ( channels ) => {
23
+ const channelMap = { } ;
24
+
25
+ // Iterate over channels to group options by channel type
26
+ channels . forEach ( channel => {
27
+ if ( ! channelMap [ channel . type ] ) {
28
+ channelMap [ channel . type ] = {
29
+ key : channel . type ,
30
+ label : channel . type ,
31
+ options : [ ]
32
+ } ;
33
+ }
34
+ // Add the option to the corresponding channel type
35
+ channelMap [ channel . type ] . options . push ( {
36
+ key : channel . value ,
37
+ ...channel
38
+ } ) ;
39
+ } ) ;
40
+
41
+ // Convert the channelMap object to an array of values
42
+ const channelOptions = Object . values ( channelMap ) ;
43
+
44
+ return channelOptions ;
45
+ } ;
30
46
31
47
// Custom Webhooks for Destinations used `custom_webhook` for the type whereas Notification Channels use 'webhook'
32
48
// This conversion ensures Notifications' nomenclature is used for the labeling for consistency
You can’t perform that action at this time.
0 commit comments