From f116b2668f92868736abd6db38eeef05371a0e75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Luis=20Gonz=C3=A1lez?= Date: Mon, 9 Dec 2024 12:15:54 +0100 Subject: [PATCH] [Search][Connectors] Disable setup options after creating configuration (#203374) ## Summary This PR disables the _Elastic managed_ and _Self-managed_ setup options after clicking the _Generate configuration_ button in order to avoid the error described in this ticket https://github.com/elastic/search-team/issues/8665 when changing deployment method after generating the config. ![CleanShot 2024-12-09 at 10 32 08@2x](https://github.com/user-attachments/assets/dafea7ac-5d50-44a0-a59d-03ee29043dec) (cherry picked from commit 9b6af1c1887f83d821d6fc639715ad4be593fea7) --- .../components/connectors/create_connector/start_step.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/connectors/create_connector/start_step.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/connectors/create_connector/start_step.tsx index 34b51e5471792..762e63a1941ab 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/connectors/create_connector/start_step.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/connectors/create_connector/start_step.tsx @@ -65,6 +65,7 @@ export const StartStep: React.FC = ({ generatedConfigData, isGenerateLoading, isCreateLoading, + isFormDirty, } = useValues(NewConnectorLogic); const { setRawName, createConnector, generateConnectorName, setFormDirty } = useActions(NewConnectorLogic); @@ -208,7 +209,9 @@ export const StartStep: React.FC = ({ { defaultMessage: 'Elastic managed' } )} checked={selfManagePreference === 'native'} - disabled={selectedConnector?.isNative === false || isRunningLocally} + disabled={ + selectedConnector?.isNative === false || isRunningLocally || isFormDirty + } onChange={() => onSelfManagePreferenceChange('native')} name="setUp" /> @@ -229,6 +232,7 @@ export const StartStep: React.FC = ({ { defaultMessage: 'Self-managed' } )} checked={selfManagePreference === 'selfManaged'} + disabled={isFormDirty} onChange={() => onSelfManagePreferenceChange('selfManaged')} name="setUp" />