mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-11-02 11:39:12 +00:00
chore(ui): improve ux around test-connection button disabled state (#11139)
* fix: We should provide helpful text here on why we are disabling the "Test Connection" button. * address comment * address feedback * address feedback * fix: unit test --------- Co-authored-by: Chirag Madlani <12962843+chirag-madlani@users.noreply.github.com>
This commit is contained in:
parent
80aa7b27b0
commit
3f0a9090e2
@ -91,7 +91,7 @@ const ServiceDocPanel: FC<ServiceDocPanelProp> = ({
|
||||
response = translation.value;
|
||||
}
|
||||
|
||||
if (isEnglishLanguage && fallbackTranslation.status === 'fulfilled') {
|
||||
if (!isEnglishLanguage && fallbackTranslation.status === 'fulfilled') {
|
||||
response = fallbackTranslation.value;
|
||||
}
|
||||
|
||||
|
||||
@ -350,6 +350,18 @@ describe('Test Connection Component', () => {
|
||||
expect(testConnectionButton).toBeDisabled();
|
||||
});
|
||||
|
||||
it('Should render the configure airflow message if airflow is not available', async () => {
|
||||
(useAirflowStatus as jest.Mock).mockImplementationOnce(() => ({
|
||||
isAirflowAvailable: false,
|
||||
}));
|
||||
|
||||
await act(async () => {
|
||||
render(<TestConnection {...mockProps} />);
|
||||
});
|
||||
|
||||
expect(screen.getByTestId('airflow-doc-link')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('Test connection button with showDetails false should be disabled is airflow is not available', async () => {
|
||||
(useAirflowStatus as jest.Mock).mockImplementationOnce(() => ({
|
||||
isAirflowAvailable: false,
|
||||
|
||||
@ -47,6 +47,7 @@ import { Transi18next } from 'utils/CommonUtils';
|
||||
import { TestConnectionProps, TestStatus } from './TestConnection.interface';
|
||||
import TestConnectionModal from './TestConnectionModal/TestConnectionModal';
|
||||
|
||||
import { CUSTOM_AIRFLOW_DOCS } from 'constants/constants';
|
||||
import {
|
||||
FETCHING_EXPIRY_TIME,
|
||||
FETCH_INTERVAL,
|
||||
@ -327,7 +328,24 @@ const TestConnection: FC<TestConnectionProps> = ({
|
||||
/>
|
||||
)}
|
||||
<div data-testid="messag-text">
|
||||
{message}{' '}
|
||||
{isAirflowAvailable ? (
|
||||
message
|
||||
) : (
|
||||
<Transi18next
|
||||
i18nKey="message.configure-airflow"
|
||||
renderElement={
|
||||
<a
|
||||
data-testid="airflow-doc-link"
|
||||
href={CUSTOM_AIRFLOW_DOCS}
|
||||
rel="noopener noreferrer"
|
||||
target="_blank"
|
||||
/>
|
||||
}
|
||||
values={{
|
||||
text: t('label.documentation-lowercase'),
|
||||
}}
|
||||
/>
|
||||
)}{' '}
|
||||
{(testStatus || isTestingConnection) && (
|
||||
<Transi18next
|
||||
i18nKey="message.click-text-to-view-details"
|
||||
|
||||
@ -166,8 +166,8 @@
|
||||
.admonition {
|
||||
border-radius: 8px;
|
||||
border-left: 8px solid @admonition-border-color;
|
||||
padding: 1px 16px 1px 48px;
|
||||
margin: 15px 0 0px;
|
||||
padding: 1px 16px 1px 48px !important;
|
||||
margin: 16px;
|
||||
background-color: @markdown-bg-color;
|
||||
position: relative;
|
||||
|
||||
|
||||
@ -16,6 +16,7 @@ import classNames from 'classnames';
|
||||
import { isUndefined } from 'lodash';
|
||||
import React from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Transi18next } from 'utils/CommonUtils';
|
||||
import { CUSTOM_AIRFLOW_DOCS } from '../../../constants/constants';
|
||||
import { FormSubmitType } from '../../../enums/form.enum';
|
||||
import { useAirflowStatus } from '../../../hooks/useAirflowStatus';
|
||||
@ -140,16 +141,20 @@ const SuccessScreen = ({
|
||||
)}
|
||||
</div>
|
||||
{!isAirflowAvailable && (
|
||||
<p className="tw-mt-3">
|
||||
{t('message.configure-airflow')}
|
||||
<a
|
||||
data-testid="airflow-doc-link"
|
||||
href={CUSTOM_AIRFLOW_DOCS}
|
||||
rel="noopener noreferrer"
|
||||
target="_blank">
|
||||
{t('label.documentation-lowercase')}
|
||||
</a>
|
||||
</p>
|
||||
<Transi18next
|
||||
i18nKey="message.configure-airflow"
|
||||
renderElement={
|
||||
<a
|
||||
data-testid="airflow-doc-link"
|
||||
href={CUSTOM_AIRFLOW_DOCS}
|
||||
rel="noopener noreferrer"
|
||||
target="_blank"
|
||||
/>
|
||||
}
|
||||
values={{
|
||||
text: t('label.documentation-lowercase'),
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
|
||||
@ -71,7 +71,7 @@
|
||||
"auto-tag-pii-uppercase": "Auto Tag PII",
|
||||
"automatically-generate": "Automatically Generate",
|
||||
"average-session": "Avg. Session Time",
|
||||
"awaiting-status": "Awaiting-status",
|
||||
"awaiting-status": "Awaiting status",
|
||||
"aws-access-key-id": "AWS Access Key ID",
|
||||
"aws-region": "AWS Region",
|
||||
"aws-secret-access-key": "AWS Secret Access Key",
|
||||
@ -986,7 +986,7 @@
|
||||
"collaborate-with-other-user": "to collaborate with other users.",
|
||||
"confidence-percentage-message": "Set the confidence level for the NLP model to use when infering whether a column contains PII data or not.",
|
||||
"configure-a-service-description": "Enter a unique service name. The name must be unique across the category of services. For e.g., among database services, both MySQL and Snowflake cannot have the same service name (E.g. customer_data). However, different service categories (dashboard, pipeline) can have the same service name. Spaces are not supported in the service name. Characters like - _ are supported. Also, add a description.",
|
||||
"configure-airflow": "To set up metadata extraction through UI, you first need to configure and connect to Airflow. For more details visit our",
|
||||
"configure-airflow": "To set up metadata extraction through UI, you first need to configure and connect to Airflow. For more details visit our <0>{{text}}</0>.",
|
||||
"configure-dbt-model-description": "A dbt model provides transformation logic that creates a table from raw data. Lineage traces the path of data across tables, but a dbt model provides specifics. Select the required dbt source provider and fill in the mandatory fields. Integrate with dbt from OpenMetadata to view the models used to generate tables.",
|
||||
"configure-glossary-term-description": "Every term in the glossary has a unique definition. Along with defining the standard term for a concept, the synonyms as well as related terms (for e.g., parent and child terms) can be specified. References can be added to the assets related to the terms. New terms can be added or updated to the Glossary. The glossary terms can be reviewed by certain users, who can accept or reject the terms.",
|
||||
"configure-webhook-message": "OpenMetadata can be configured to automatically send out event notifications to registered webhooks. Enter the Webhook Name, and an Endpoint URL to receive the HTTP callback on. Use Event Filters to only receive notifications based on events of interest, like when an entity is created, updated, or deleted; and for the entities your application is interested in. Add a description to help people understand the purpose of the webhook and to keep track of the use case. Use advanced configuration to set up a shared secret key to verify the webhook events using HMAC signature.",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user