88 EVT_PLATFORM_EVENT ,
99 EVT_CDC_STANDARD ,
1010 EVT_CDC_CUSTOM ,
11+ EVT_CUSTOM_CHANNEL ,
1112 EVT_MONITORING ,
1213 getChannelPrefix
1314} from 'c/streamingUtility' ;
@@ -103,10 +104,14 @@ export default class Actions extends LightningElement {
103104 handleSubEventTypeChange ( event ) {
104105 this . subEventType = event . detail . value ;
105106 this . subEventName = undefined ;
106- this . subChannel =
107- this . subEventType === EVT_CDC_CUSTOM
108- ? getChannelPrefix ( EVT_CDC_CUSTOM )
109- : '' ;
107+ if (
108+ this . subEventType === EVT_CDC_CUSTOM ||
109+ this . subEventType === EVT_CUSTOM_CHANNEL
110+ ) {
111+ this . subChannel = getChannelPrefix ( this . subEventType ) ;
112+ } else {
113+ this . subChannel = '' ;
114+ }
110115 }
111116
112117 handleSubEventNameChange ( event ) {
@@ -167,6 +172,8 @@ export default class Actions extends LightningElement {
167172 }
168173 if ( this . subEventType === EVT_CDC_CUSTOM ) {
169174 return 'The /data/ChangeEvents channel and custom channels require manual channel input' ;
175+ } else if ( this . subEventType === EVT_CUSTOM_CHANNEL ) {
176+ return 'Custom channels require manual channel input' ;
170177 }
171178 const eventDefinition = EVENT_TYPES . find (
172179 ( e ) => e . value === this . subEventType
@@ -185,15 +192,26 @@ export default class Actions extends LightningElement {
185192 }
186193
187194 get isSubChannelDisabled ( ) {
188- return this . subEventType !== EVT_CDC_CUSTOM ;
195+ return (
196+ this . subEventType !== EVT_CDC_CUSTOM &&
197+ this . subEventType !== EVT_CUSTOM_CHANNEL
198+ ) ;
189199 }
190200
191201 get isSubscribeDisabled ( ) {
202+ if (
203+ this . subEventType === EVT_CDC_CUSTOM ||
204+ this . subEventType === EVT_CUSTOM_CHANNEL
205+ ) {
206+ const channel = this . subChannel . trim ( ) ;
207+ return (
208+ channel === '' ||
209+ channel === getChannelPrefix ( this . subEventType )
210+ ) ;
211+ }
192212 return (
193- ( this . subEventType === EVT_CDC_CUSTOM &&
194- this . subChannel . trim ( ) === '' ) ||
195- ( this . subEventType !== EVT_CDC_CUSTOM &&
196- this . subEventName === undefined )
213+ this . subEventType !== EVT_CDC_CUSTOM &&
214+ this . subEventName === undefined
197215 ) ;
198216 }
199217
0 commit comments