From a96b55f665d99f8e2f92ceb7eccf4c39fc482fef Mon Sep 17 00:00:00 2001 From: Samiul Monir Date: Wed, 27 Nov 2024 15:49:01 -0500 Subject: [PATCH] Temp commit --- .../create_connector_flyout/index.tsx | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/create_connector_flyout/index.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/create_connector_flyout/index.tsx index b93d2815bf197..9f3480de43d93 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/create_connector_flyout/index.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/create_connector_flyout/index.tsx @@ -60,6 +60,7 @@ const CreateConnectorFlyoutComponent: React.FC = ({ const [actionType, setActionType] = useState(null); const [hasActionsUpgradeableByTrial, setHasActionsUpgradeableByTrial] = useState(false); const canSave = hasSaveActionsCapability(capabilities); + const [isRequiredFieldError, setIsRequiredFieldError] = useState(false); const [preSubmitValidationErrorMessage, setPreSubmitValidationErrorMessage] = useState(null); @@ -157,8 +158,15 @@ const CreateConnectorFlyoutComponent: React.FC = ({ secrets: secrets ?? {}, }; + return; + const createdConnector = await createConnector(validConnector); return createdConnector; + } else { + if (Object.keys(data).length === 0) { + setIsRequiredFieldError(true); + } + return; } }, [submit, preSubmitValidator, createConnector]); @@ -228,6 +236,15 @@ const CreateConnectorFlyoutComponent: React.FC = ({ )} + {isRequiredFieldError && ( +

+ + +

+ )}