File tree Expand file tree Collapse file tree
x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ export interface ConnectorAddFlyoutProps {
3737 addFlyoutVisible : boolean ;
3838 setAddFlyoutVisibility : React . Dispatch < React . SetStateAction < boolean > > ;
3939 actionTypes ?: ActionType [ ] ;
40- onTestConnector : ( connector : ActionConnector ) => void ;
40+ onTestConnector ? : ( connector : ActionConnector ) => void ;
4141}
4242
4343export const ConnectorAddFlyout = ( {
@@ -264,26 +264,28 @@ export const ConnectorAddFlyout = ({
264264 < EuiFlexGroup justifyContent = "spaceBetween" >
265265 { canSave && actionTypeModel && actionType ? (
266266 < Fragment >
267- < EuiFlexItem grow = { false } >
268- < EuiButton
269- color = "secondary"
270- data-test-subj = "saveAndTestNewActionButton"
271- type = "submit"
272- isDisabled = { hasErrors }
273- isLoading = { isSaving }
274- onClick = { async ( ) => {
275- const savedConnector = await onSaveClicked ( ) ;
276- if ( savedConnector ) {
277- onTestConnector ( savedConnector ) ;
278- }
279- } }
280- >
281- < FormattedMessage
282- id = "xpack.triggersActionsUI.sections.actionConnectorAdd.saveAndTestButtonLabel"
283- defaultMessage = "Save & Test"
284- />
285- </ EuiButton >
286- </ EuiFlexItem >
267+ { onTestConnector && (
268+ < EuiFlexItem grow = { false } >
269+ < EuiButton
270+ color = "secondary"
271+ data-test-subj = "saveAndTestNewActionButton"
272+ type = "submit"
273+ isDisabled = { hasErrors }
274+ isLoading = { isSaving }
275+ onClick = { async ( ) => {
276+ const savedConnector = await onSaveClicked ( ) ;
277+ if ( savedConnector ) {
278+ onTestConnector ( savedConnector ) ;
279+ }
280+ } }
281+ >
282+ < FormattedMessage
283+ id = "xpack.triggersActionsUI.sections.actionConnectorAdd.saveAndTestButtonLabel"
284+ defaultMessage = "Save & Test"
285+ />
286+ </ EuiButton >
287+ </ EuiFlexItem >
288+ ) }
287289 < EuiFlexItem grow = { false } >
288290 < EuiButton
289291 fill
You can’t perform that action at this time.
0 commit comments