File tree 4 files changed +20
-8
lines changed
pages/CreateTrigger/containers
DefineCompositeLevelTrigger
4 files changed +20
-8
lines changed Original file line number Diff line number Diff line change @@ -121,11 +121,12 @@ class ConfigureActions extends React.Component {
121
121
let channels = [ ] ;
122
122
let index = 0 ;
123
123
const getChannels = async ( ) => {
124
- const config_types = await this . props . notificationService . getServerFeatures ( ) ;
124
+ const serverFeatures = await this . props . notificationService . getServerFeatures ( ) ;
125
+ const configTypes = Object . keys ( serverFeatures . availableChannels ) ;
125
126
const getChannelsQuery = {
126
127
from_index : index ,
127
128
max_items : MAX_CHANNELS_RESULT_SIZE ,
128
- config_type : config_types ,
129
+ config_type : configTypes ,
129
130
sort_field : 'name' ,
130
131
sort_order : 'asc' ,
131
132
} ;
Original file line number Diff line number Diff line change @@ -51,11 +51,12 @@ const TriggerNotifications = ({
51
51
let channels = [ ] ;
52
52
let index = 0 ;
53
53
const getChannels = async ( ) => {
54
- const config_types = await notificationService . getServerFeatures ( ) ;
54
+ const serverFeatures = await notificationService . getServerFeatures ( ) ;
55
+ const configTypes = Object . keys ( serverFeatures . availableChannels ) ;
55
56
const getChannelsQuery = {
56
57
from_index : index ,
57
58
max_items : MAX_CHANNELS_RESULT_SIZE ,
58
- config_type : config_types ,
59
+ config_type : configTypes ,
59
60
sort_field : 'name' ,
60
61
sort_order : 'asc' ,
61
62
} ;
Original file line number Diff line number Diff line change 4
4
*/
5
5
6
6
import { HttpFetchQuery , HttpSetup } from '../../../../src/core/public' ;
7
- import { ChannelItemType } from './models/interfaces' ;
7
+ import { ChannelItemType , NotificationServerFeatures } from './models/interfaces' ;
8
8
import { configListToChannels , configToChannel } from './utils/helper' ;
9
9
10
10
interface ConfigsResponse {
@@ -26,15 +26,19 @@ export default class NotificationService {
26
26
this . httpClient = httpClient ;
27
27
}
28
28
29
- getServerFeatures = async ( ) : Promise < Array < String > > => {
29
+ getServerFeatures = async ( ) : Promise < NotificationServerFeatures > => {
30
30
try {
31
31
const response = await this . httpClient . get (
32
32
NODE_API . GET_AVAILABLE_FEATURES
33
33
) ;
34
- return response . allowed_config_type_list as Array < String > ;
34
+ return response as NotificationServerFeatures ;
35
35
} catch ( error ) {
36
36
console . error ( 'error fetching available features' , error ) ;
37
- return [ ] ;
37
+ return {
38
+ availableChannels : { } ,
39
+ availableConfigTypes : [ ] ,
40
+ tooltipSupport : false
41
+ } ;
38
42
}
39
43
} ;
40
44
Original file line number Diff line number Diff line change @@ -37,3 +37,9 @@ export interface ChannelItemType extends ConfigType {
37
37
} ;
38
38
} ;
39
39
}
40
+
41
+ export interface NotificationServerFeatures {
42
+ availableChannels : Partial < typeof CHANNEL_TYPE > ;
43
+ availableConfigTypes : string [ ] ; // available backend config types
44
+ tooltipSupport : boolean ; // if true, IAM role for SNS is optional and helper text should be available
45
+ }
You can’t perform that action at this time.
0 commit comments