Fix(ui):Test connection timeout message improvement (#21949)

* test connection timeout message improvement

* updated message

* updated message

* fixed sonar
This commit is contained in:
Dhruv Parmar 2025-06-30 17:09:10 +05:30 committed by GitHub
parent d50e155b1b
commit ffd10f5f2a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
24 changed files with 129 additions and 27 deletions

View File

@ -196,6 +196,7 @@ const ConnectionConfigForm = ({
<TestConnection
connectionType={serviceType}
getData={() => formRef.current?.state?.formData}
hostIp={hostIp}
isTestingDisabled={disableTestConnection}
serviceCategory={serviceCategory}
serviceName={data?.name}

View File

@ -23,6 +23,7 @@ export interface TestConnectionProps {
serviceName?: string;
shouldValidateForm?: boolean;
onValidateFormRequiredFields?: () => boolean;
hostIp?: string;
}
export type TestStatus = Exclude<StatusType, 'Running'> | 'Warning' | undefined;

View File

@ -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

View File

@ -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<TestConnectionProps> = ({
onValidateFormRequiredFields,
shouldValidateForm = true,
showDetails = true,
hostIp,
}) => {
const { t } = useTranslation();
const { isAirflowAvailable } = useAirflowStatus();
@ -328,7 +328,15 @@ const TestConnection: FC<TestConnectionProps> = ({
);
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<TestConnectionProps> = ({
<TestConnectionModal
errorMessage={errorMessage}
handleCloseErrorMessage={handleCloseErrorMessage}
hostIp={hostIp}
isConnectionTimeout={isConnectionTimeout}
isOpen={dialogOpen}
isTestingConnection={isTestingConnection}
progress={progress}
serviceType={serviceType}
testConnectionStep={testConnectionStep}
testConnectionStepResult={testConnectionStepResult}
onCancel={handleCancelTestConnectionModal}

View File

@ -18,7 +18,7 @@ import {
Space,
Typography,
} from 'antd';
import { FC } from 'react';
import { FC, useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { ReactComponent as IconTimeOut } from '../../../../assets/svg/ic-time-out.svg';
import { ReactComponent as IconTimeOutButton } from '../../../../assets/svg/ic-timeout-button.svg';
@ -43,6 +43,8 @@ interface TestConnectionModalProps {
subDescription?: string;
};
handleCloseErrorMessage: () => void;
serviceType?: string;
hostIp?: string;
}
const TestConnectionModal: FC<TestConnectionModalProps> = ({
@ -57,9 +59,12 @@ const TestConnectionModal: FC<TestConnectionModalProps> = ({
onTestConnection,
errorMessage,
handleCloseErrorMessage,
serviceType,
hostIp,
}) => {
const { t } = useTranslation();
const [message, setMessage] = useState<string>();
const getConnectionStepResult = (step: TestConnectionStep) => {
return testConnectionStepResult.find(
(resultStep) => resultStep.name === step.name
@ -70,6 +75,20 @@ const TestConnectionModal: FC<TestConnectionModalProps> = ({
return <span data-testid="progress-bar-value">{`${progress}%`}</span>;
};
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 (
<Modal
centered
@ -113,7 +132,7 @@ const TestConnectionModal: FC<TestConnectionModalProps> = ({
{t('label.connection-timeout')}
</Typography.Title>
<Typography.Text className="text-grey-muted">
{t('message.test-connection-taking-too-long')}
{message}
</Typography.Text>
<Button
ghost

View File

@ -447,10 +447,6 @@ export const TEST_CONNECTION_TESTING_MESSAGE = i18n.t(
'message.testing-your-connection-may-take-two-minutes'
);
export const TEST_CONNECTION_INFO_MESSAGE = i18n.t(
'message.test-connection-taking-too-long'
);
export const TEST_CONNECTION_WARNING_MESSAGE = i18n.t(
'message.connection-test-warning'
);

View File

@ -2131,7 +2131,10 @@
"team-no-asset": "Ihr Team hat keine Vermögenswerte.",
"test-case-schedule-description": "Die Datenqualitätstests können mit der gewünschten Häufigkeit geplant werden. Die Zeitzone ist UTC.",
"test-connection-cannot-be-triggered": "Die Testverbindung kann nicht ausgelöst werden.",
"test-connection-taking-too-long": "Die Testverbindung dauert zu lange. Bitte versuchen Sie es erneut.",
"test-connection-taking-too-long": {
"default": "Bitte stellen Sie sicher, dass {{service_type}} so konfiguriert ist, dass Verbindungen erlaubt sind",
"withIp": " von {{ip}}"
},
"test-your-connection-before-creating-service": "Testen Sie Ihre Verbindungen, bevor Sie den Dienst erstellen",
"testing-your-connection-may-take-two-minutes": "Das Testen Ihrer Verbindungen kann bis zu 2 Minuten dauern",
"this-action-is-not-allowed-for-deleted-entities": "Diese Aktion ist für gelöschte Entitäten nicht erlaubt.",

View File

@ -2131,7 +2131,10 @@
"team-no-asset": "Your team does not have any assets.",
"test-case-schedule-description": "The data quality tests can be scheduled to run at the desired frequency. The timezone is in UTC.",
"test-connection-cannot-be-triggered": "Test connection cannot be triggered.",
"test-connection-taking-too-long": "The test connection is taking too long. Please try again.",
"test-connection-taking-too-long": {
"default": "Please ensure that {{service_type}} is configured to allow connections",
"withIp": " from {{ip}}"
},
"test-your-connection-before-creating-service": "Test your connections before creating the service",
"testing-your-connection-may-take-two-minutes": "Testing your connections may take up-to 2 minutes",
"this-action-is-not-allowed-for-deleted-entities": "This action is not allowed for deleted entities.",

View File

@ -2131,7 +2131,10 @@
"team-no-asset": "Tu equipo no tiene ningún activo.",
"test-case-schedule-description": "The data quality tests can be scheduled to run at the desired frequency. The timezone is in UTC.",
"test-connection-cannot-be-triggered": "No se puede iniciar la prueba de conexión.",
"test-connection-taking-too-long": "La prueba de conexión está tardando demasiado. Por favor, inténtalo de nuevo.",
"test-connection-taking-too-long": {
"default": "Por favor, asegúrese de que {{service_type}} esté configurado para permitir conexiones",
"withIp": " desde {{ip}}"
},
"test-your-connection-before-creating-service": "Prueba la conexión antes de crear el servicio",
"testing-your-connection-may-take-two-minutes": "Probar la conexión puede tardar hasta 2 minutos",
"this-action-is-not-allowed-for-deleted-entities": "Esta acción no está permitida para entidades eliminadas.",

View File

@ -2131,7 +2131,10 @@
"team-no-asset": "Votre équipe n'a pas d'actifs de données",
"test-case-schedule-description": "Les tests de quelité de données peuvent être planifiés pour tourner à la fréquence désirée. La timezone est en UTC.",
"test-connection-cannot-be-triggered": "Le test de connexion ne peut pas être déclenché.",
"test-connection-taking-too-long": "Le test de connexion prend trop de temps. Veuillez réessayer.",
"test-connection-taking-too-long": {
"default": "Veuillez vérifier que {{service_type}} est configuré pour autoriser les connexions",
"withIp": " depuis {{ip}}"
},
"test-your-connection-before-creating-service": "Testez la connexion avant de créer le service",
"testing-your-connection-may-take-two-minutes": "Le test de votre connexion peut prendre jusqu'à 2 minutes",
"this-action-is-not-allowed-for-deleted-entities": "Cette action n'est pas permise pour les entités supprimées.",

View File

@ -2131,7 +2131,10 @@
"team-no-asset": "O teu equipo non ten ningún activo.",
"test-case-schedule-description": "As probas de calidade de datos poden programarse para executarse coa frecuencia desexada. A zona horaria está en UTC.",
"test-connection-cannot-be-triggered": "Non se pode iniciar a conexión de proba.",
"test-connection-taking-too-long": "A conexión de proba está tardando demasiado. Inténtao de novo.",
"test-connection-taking-too-long": {
"default": "Asegúrese de que {{service_type}} estea configurado para permitir conexións",
"withIp": " dende {{ip}}"
},
"test-your-connection-before-creating-service": "Proba as túas conexións antes de crear o servizo",
"testing-your-connection-may-take-two-minutes": "A proba das túas conexións pode levar ata 2 minutos",
"this-action-is-not-allowed-for-deleted-entities": "Esta acción non está permitida para entidades eliminadas.",

View File

@ -2131,7 +2131,10 @@
"team-no-asset": "לקבוצתך אין נכסים.",
"test-case-schedule-description": "The data quality tests can be scheduled to run at the desired frequency. The timezone is in UTC.",
"test-connection-cannot-be-triggered": "אין אפשרות להפעיל בדיקת חיבור.",
"test-connection-taking-too-long": "בדיקת החיבור לוקחת זמן רב מדי. יש לנסות שוב.",
"test-connection-taking-too-long": {
"default": "אנא וודא ש‑{{service_type}} מוגדר לאפשר חיבורים",
"withIp": " מ‑{{ip}}"
},
"test-your-connection-before-creating-service": "בדוק את החיבור שלך לפני שתיצור את השירות",
"testing-your-connection-may-take-two-minutes": "בדיקת החיבור שלך עשויה לקחת עד 2 דקות",
"this-action-is-not-allowed-for-deleted-entities": "פעולה זו אינה מותרת עבור ישויות שנמחקו.",

View File

@ -2131,7 +2131,10 @@
"team-no-asset": "あなたのチームはアセットを持っていません。",
"test-case-schedule-description": "The data quality tests can be scheduled to run at the desired frequency. The timezone is in UTC.",
"test-connection-cannot-be-triggered": "Test connection cannot be triggered.",
"test-connection-taking-too-long": "The test connection is taking too long. Please try again.",
"test-connection-taking-too-long": {
"default": "{{service_type}} が接続を許可するように構成されていることを確認してください",
"withIp": " {{ip}} から"
},
"test-your-connection-before-creating-service": "サービスを作成する前に接続テストをしてください。",
"testing-your-connection-may-take-two-minutes": "Testing your connections may take up-to 2 minutes",
"this-action-is-not-allowed-for-deleted-entities": "This action is not allowed for deleted entities.",

View File

@ -2131,7 +2131,10 @@
"team-no-asset": "귀하의 팀은 자산이 없습니다.",
"test-case-schedule-description": "데이터 품질 테스트는 원하는 빈도로 실행되도록 예약할 수 있습니다. 시간대는 UTC입니다.",
"test-connection-cannot-be-triggered": "연결 테스트를 트리거할 수 없습니다.",
"test-connection-taking-too-long": "연결 테스트가 너무 오래 걸립니다. 다시 시도해 주세요.",
"test-connection-taking-too-long": {
"default": "{{service_type}} 가 연결을 허용하도록 구성되어 있는지 확인하세요",
"withIp": " {{ip}} 에서"
},
"test-your-connection-before-creating-service": "서비스를 생성하기 전에 연결을 테스트하세요",
"testing-your-connection-may-take-two-minutes": "연결 테스트는 최대 2분이 소요될 수 있습니다",
"this-action-is-not-allowed-for-deleted-entities": "이 작업은 삭제된 엔티티에 대해 허용되지 않습니다.",

View File

@ -2131,7 +2131,10 @@
"team-no-asset": "तुमच्या टीमकडे कोणतीही ॲसेट नाहीत.",
"test-case-schedule-description": "डेटा गुणवत्ता चाचण्या इच्छित वारंवारतेवर चालवण्यासाठी वेळापत्रक करता येतात. टाइमझोन UTC मध्ये आहे.",
"test-connection-cannot-be-triggered": "कनेक्शन चाचणी ट्रिगर केली जाऊ शकत नाही.",
"test-connection-taking-too-long": "कनेक्शन चाचणी खूप वेळ घेत आहे. कृपया पुन्हा प्रयत्न करा.",
"test-connection-taking-too-long": {
"default": "कृपया खात्री करा की {{service_type}} कनेक्शनसाठी कॉन्फिगर केले गेले आहे",
"withIp": " {{ip}} वरून"
},
"test-your-connection-before-creating-service": "सेवा तयार करण्यापूर्वी तुमचे कनेक्शन चाचणी करा",
"testing-your-connection-may-take-two-minutes": "तुमचे कनेक्शन चाचणी करण्यास 2 मिनिटे लागू शकतात",
"this-action-is-not-allowed-for-deleted-entities": "मिटवलेल्या घटकांसाठी ही क्रिया अनुमत नाही.",

View File

@ -2131,7 +2131,10 @@
"team-no-asset": "Je team heeft geen assets.",
"test-case-schedule-description": "The data quality tests can be scheduled to run at the desired frequency. The timezone is in UTC.",
"test-connection-cannot-be-triggered": "Testconnectie kan niet worden geactiveerd.",
"test-connection-taking-too-long": "De testconnectie duurt te lang. Probeer het opnieuw.",
"test-connection-taking-too-long": {
"default": "Zorg ervoor dat {{service_type}} is geconfigureerd om verbindingen toe te staan",
"withIp": " vanaf {{ip}}"
},
"test-your-connection-before-creating-service": "Test je connecties voordat je de service maakt",
"testing-your-connection-may-take-two-minutes": "Het testen van je connecties kan tot 2 minuten duren",
"this-action-is-not-allowed-for-deleted-entities": "Deze actie is niet toegestaan voor verwijderde entiteiten.",

View File

@ -2131,7 +2131,10 @@
"team-no-asset": "تیم شما هیچ دارایی ندارد.",
"test-case-schedule-description": "آزمون‌های کیفیت داده می‌توانند به صورت دوره‌ای برنامه‌ریزی شوند. منطقه زمانی به صورت UTC است.",
"test-connection-cannot-be-triggered": "اتصال تست نمی‌تواند اجرا شود.",
"test-connection-taking-too-long": "تست اتصال زمان زیادی طول می‌کشد. لطفاً دوباره تلاش کنید.",
"test-connection-taking-too-long": {
"default": "لطفاً اطمینان حاصل کنید که {{service_type}} به درستی برای اجازه اتصال پیکربندی شده است",
"withIp": " از {{ip}}"
},
"test-your-connection-before-creating-service": "اتصالات خود را قبل از ایجاد سرویس تست کنید.",
"testing-your-connection-may-take-two-minutes": "تست اتصالات شما ممکن است تا ۲ دقیقه طول بکشد.",
"this-action-is-not-allowed-for-deleted-entities": "این اقدام برای موجودیت‌های حذف شده مجاز نیست.",

View File

@ -2131,7 +2131,10 @@
"team-no-asset": "Sua equipe não possui ativos.",
"test-case-schedule-description": "Os testes de qualidade de dados podem ser programados para serem executados na frequência desejada. O fuso horário está em UTC.",
"test-connection-cannot-be-triggered": "Não é possível acionar o teste de conexão.",
"test-connection-taking-too-long": "O teste de conexão está demorando muito. Por favor, tente novamente.",
"test-connection-taking-too-long": {
"default": "Por favor, certifiquese de que o {{service_type}} está configurado para permitir conexões",
"withIp": " de {{ip}}"
},
"test-your-connection-before-creating-service": "Teste suas conexões antes de criar o serviço",
"testing-your-connection-may-take-two-minutes": "Testar suas conexões pode levar até 2 minutos",
"this-action-is-not-allowed-for-deleted-entities": "Esta ação não é permitida para entidades excluídas.",

View File

@ -2131,7 +2131,10 @@
"team-no-asset": "Sua equipa não possui ativos.",
"test-case-schedule-description": "The data quality tests can be scheduled to run at the desired frequency. The timezone is in UTC.",
"test-connection-cannot-be-triggered": "Não é possível acionar o teste de conexão.",
"test-connection-taking-too-long": "O teste de conexão está demorando muito. Por favor, tente novamente.",
"test-connection-taking-too-long": {
"default": "Por favor, assegure-se de que o {{service_type}} está configurado para permitir ligações",
"withIp": " a partir de {{ip}}"
},
"test-your-connection-before-creating-service": "Teste suas conexões antes de criar o serviço",
"testing-your-connection-may-take-two-minutes": "Testar suas conexões pode levar até 2 minutos",
"this-action-is-not-allowed-for-deleted-entities": "Esta ação não é permitida para entidades excluídas.",

View File

@ -2131,7 +2131,10 @@
"team-no-asset": "У вашей команды нет объектов.",
"test-case-schedule-description": "The data quality tests can be scheduled to run at the desired frequency. The timezone is in UTC.",
"test-connection-cannot-be-triggered": "Тестовое соединение не может быть запущено.",
"test-connection-taking-too-long": "Тестовое соединение занимает слишком много времени. Пожалуйста, попробуйте еще раз.",
"test-connection-taking-too-long": {
"default": "Пожалуйста, убедитесь, что {{service_type}} настроен на разрешение подключений",
"withIp": " с {{ip}}"
},
"test-your-connection-before-creating-service": "Проверьте свои подключения перед созданием сервиса",
"testing-your-connection-may-take-two-minutes": "Проверка подключений может занять до 2 минут.",
"this-action-is-not-allowed-for-deleted-entities": "This action is not allowed for deleted entities.",

View File

@ -2131,7 +2131,10 @@
"team-no-asset": "ทีมของคุณไม่มีสินทรัพย์ใด ๆ",
"test-case-schedule-description": "การทดสอบคุณภาพข้อมูลสามารถกำหนดเวลาให้ดำเนินการในความถี่ที่ต้องการ เขตเวลาคือ UTC",
"test-connection-cannot-be-triggered": "ไม่สามารถกระตุ้นการทดสอบการเชื่อมต่อได้",
"test-connection-taking-too-long": "การทดสอบการเชื่อมต่อใช้เวลานานเกินไป โปรดลองอีกครั้ง",
"test-connection-taking-too-long": {
"default": "โปรดตรวจสอบว่าได้กำหนดค่าของ {{service_type}} ให้อนุญาตการเชื่อมต่อแล้ว",
"withIp": " จาก {{ip}}"
},
"test-your-connection-before-creating-service": "ทดสอบการเชื่อมต่อของคุณก่อนที่จะสร้างบริการ",
"testing-your-connection-may-take-two-minutes": "การทดสอบการเชื่อมต่ออาจใช้เวลาถึง 2 นาที",
"this-action-is-not-allowed-for-deleted-entities": "การกระทำนี้ไม่อนุญาตสำหรับเอนทิตีที่ถูกลบ",

View File

@ -2131,7 +2131,10 @@
"team-no-asset": "Takımınızın herhangi bir varlığı yok.",
"test-case-schedule-description": "Veri kalitesi testleri istenen sıklıkta çalışacak şekilde zamanlanabilir. Saat dilimi UTC'dir.",
"test-connection-cannot-be-triggered": "Bağlantı testi tetiklenemez.",
"test-connection-taking-too-long": "Bağlantı testi çok uzun sürüyor. Lütfen tekrar deneyin.",
"test-connection-taking-too-long": {
"default": "Lütfen {{service_type}}in bağlantılara izin verecek şekilde yapılandırıldığından emin olun",
"withIp": " {{ip}} adresinden"
},
"test-your-connection-before-creating-service": "Servisi oluşturmadan önce bağlantılarınızı test edin",
"testing-your-connection-may-take-two-minutes": "Bağlantılarınızı test etmek 2 dakika kadar sürebilir",
"this-action-is-not-allowed-for-deleted-entities": "Bu eylem silinmiş varlıklar için izin verilmez.",

View File

@ -2131,7 +2131,10 @@
"team-no-asset": "您的团队没有任何资产",
"test-case-schedule-description": "数据质控测试可按所需频率安排运行, 时区为 UTC",
"test-connection-cannot-be-triggered": "连接测试无法被触发",
"test-connection-taking-too-long": "连接测试超时, 请重新测试",
"test-connection-taking-too-long": {
"default": "请确保 {{service_type}} 已配置为允许连接",
"withIp": " 来自 {{ip}}"
},
"test-your-connection-before-creating-service": "在创建服务之前测试您的连接",
"testing-your-connection-may-take-two-minutes": "连接测试可能最多需要 2 分钟",
"this-action-is-not-allowed-for-deleted-entities": "已删除的实体不允许执行此操作",

View File

@ -89,7 +89,10 @@ import {
ListDataModelParams,
} from '../../rest/dashboardAPI';
import { getDatabases } from '../../rest/databaseAPI';
import { getIngestionPipelines } from '../../rest/ingestionPipelineAPI';
import {
getIngestionPipelines,
getPipelineServiceHostIp,
} from '../../rest/ingestionPipelineAPI';
import { getMlModels } from '../../rest/mlModelAPI';
import { getPipelines } from '../../rest/pipelineAPI';
import { searchQuery } from '../../rest/searchAPI';
@ -177,6 +180,25 @@ const ServiceDetailsPage: FunctionComponent = () => {
const [workflowStatesData, setWorkflowStatesData] =
useState<WorkflowStatesData>();
const [isWorkflowStatusLoading, setIsWorkflowStatusLoading] = useState(true);
const [hostIp, setHostIp] = useState<string>();
const fetchHostIp = async () => {
try {
const { status, data } = await getPipelineServiceHostIp();
if (status === 200) {
setHostIp(data?.ip);
}
} catch {
setHostIp(undefined);
}
};
useEffect(() => {
if (isAirflowAvailable) {
fetchHostIp();
}
}, [isAirflowAvailable]);
const USERId = currentUser?.id ?? '';
const {
paging: collateAgentPaging,
@ -1300,6 +1322,7 @@ const ServiceDetailsPage: FunctionComponent = () => {
<TestConnection
connectionType={serviceDetails?.serviceType ?? ''}
getData={() => connectionDetails}
hostIp={hostIp}
isTestingDisabled={isTestingDisabled}
serviceCategory={serviceCategory as ServiceCategory}
serviceName={serviceDetails?.name}
@ -1332,6 +1355,7 @@ const ServiceDetailsPage: FunctionComponent = () => {
statusFilter,
typeFilter,
extraInfoData,
hostIp,
]);
const tabs: TabsProps['items'] = useMemo(() => {