diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Settings/Services/ServiceConfig/ConnectionConfigForm.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Settings/Services/ServiceConfig/ConnectionConfigForm.tsx index 0be688dcb81..6fe02c009f4 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Settings/Services/ServiceConfig/ConnectionConfigForm.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Settings/Services/ServiceConfig/ConnectionConfigForm.tsx @@ -196,6 +196,7 @@ const ConnectionConfigForm = ({ formRef.current?.state?.formData} + hostIp={hostIp} isTestingDisabled={disableTestConnection} serviceCategory={serviceCategory} serviceName={data?.name} diff --git a/openmetadata-ui/src/main/resources/ui/src/components/common/TestConnection/TestConnection.interface.ts b/openmetadata-ui/src/main/resources/ui/src/components/common/TestConnection/TestConnection.interface.ts index 707c5183e6d..eda75584c30 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/common/TestConnection/TestConnection.interface.ts +++ b/openmetadata-ui/src/main/resources/ui/src/components/common/TestConnection/TestConnection.interface.ts @@ -23,6 +23,7 @@ export interface TestConnectionProps { serviceName?: string; shouldValidateForm?: boolean; onValidateFormRequiredFields?: () => boolean; + hostIp?: string; } export type TestStatus = Exclude | 'Warning' | undefined; diff --git a/openmetadata-ui/src/main/resources/ui/src/components/common/TestConnection/TestConnection.test.tsx b/openmetadata-ui/src/main/resources/ui/src/components/common/TestConnection/TestConnection.test.tsx index 153f8dc2d0b..4859815e32e 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/common/TestConnection/TestConnection.test.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/common/TestConnection/TestConnection.test.tsx @@ -325,7 +325,7 @@ describe('Test Connection Component', () => { }); expect( - await screen.findByText('message.test-connection-taking-too-long') + screen.getByText('message.test-connection-taking-too-long.default') ).toBeInTheDocument(); // 59 since it will make this amount of call, and after timeout it should not make more api calls diff --git a/openmetadata-ui/src/main/resources/ui/src/components/common/TestConnection/TestConnection.tsx b/openmetadata-ui/src/main/resources/ui/src/components/common/TestConnection/TestConnection.tsx index a9b3fda2249..346bfbab3ca 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/common/TestConnection/TestConnection.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/common/TestConnection/TestConnection.tsx @@ -24,7 +24,6 @@ import { FETCHING_EXPIRY_TIME, FETCH_INTERVAL, TEST_CONNECTION_FAILURE_MESSAGE, - TEST_CONNECTION_INFO_MESSAGE, TEST_CONNECTION_INITIAL_MESSAGE, TEST_CONNECTION_PROGRESS_PERCENTAGE, TEST_CONNECTION_SUCCESS_MESSAGE, @@ -71,6 +70,7 @@ const TestConnection: FC = ({ onValidateFormRequiredFields, shouldValidateForm = true, showDetails = true, + hostIp, }) => { const { t } = useTranslation(); const { isAirflowAvailable } = useAirflowStatus(); @@ -328,7 +328,15 @@ const TestConnection: FC = ({ ); if (!isWorkflowCompleted) { - setMessage(TEST_CONNECTION_INFO_MESSAGE); + let message = t('message.test-connection-taking-too-long.default', { + service_type: serviceType, + }); + if (hostIp) { + message += t('message.test-connection-taking-too-long.withIp', { + ip: hostIp, + }); + } + setMessage(message); setIsConnectionTimeout(true); } @@ -496,10 +504,12 @@ const TestConnection: FC = ({ void; + serviceType?: string; + hostIp?: string; } const TestConnectionModal: FC = ({ @@ -57,9 +59,12 @@ const TestConnectionModal: FC = ({ onTestConnection, errorMessage, handleCloseErrorMessage, + serviceType, + hostIp, }) => { const { t } = useTranslation(); + const [message, setMessage] = useState(); const getConnectionStepResult = (step: TestConnectionStep) => { return testConnectionStepResult.find( (resultStep) => resultStep.name === step.name @@ -70,6 +75,20 @@ const TestConnectionModal: FC = ({ return {`${progress}%`}; }; + useEffect(() => { + const msg = t('message.test-connection-taking-too-long.default', { + service_type: serviceType, + }); + if (hostIp) { + const hostIpMessage = + msg + + t('message.test-connection-taking-too-long.withIp', { ip: hostIp }); + setMessage(hostIpMessage); + } else { + setMessage(msg); + } + }, [hostIp]); + return ( = ({ {t('label.connection-timeout')} - {t('message.test-connection-taking-too-long')} + {message}