mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-12-05 20:15:15 +00:00
Revert "Fix(ui): Force Test Connection (#21734)"\n\nThis reverts commit b1a1cd89a743b321b2726e5c85f66408c8687dc8. (#23567)
This commit is contained in:
parent
dc474e44f6
commit
1506c29387
@ -19,7 +19,6 @@ import {
|
||||
toastNotification,
|
||||
uuid,
|
||||
} from '../../utils/common';
|
||||
import { testConnection } from '../../utils/serviceIngestion';
|
||||
import { settingClick } from '../../utils/sidebar';
|
||||
|
||||
const apiServiceConfig = {
|
||||
@ -56,7 +55,6 @@ test.describe('API service', () => {
|
||||
.fill(apiServiceConfig.openAPISchemaURL);
|
||||
|
||||
await page.locator('#root\\/token').fill(apiServiceConfig.token);
|
||||
await testConnection(page);
|
||||
await page.getByTestId('submit-btn').click();
|
||||
|
||||
const autoPilotApplicationRequest = page.waitForRequest(
|
||||
|
||||
@ -26,7 +26,7 @@ class MlFlowIngestionClass extends ServiceBaseClass {
|
||||
shouldAddDefaultFilters?: boolean;
|
||||
}) {
|
||||
const {
|
||||
shouldTestConnection = true,
|
||||
shouldTestConnection = false,
|
||||
shouldAddIngestion = false,
|
||||
shouldAddDefaultFilters = false,
|
||||
} = extraParams ?? {};
|
||||
|
||||
@ -104,8 +104,6 @@ class ServiceBaseClass {
|
||||
await this.fillConnectionDetails(page);
|
||||
|
||||
if (this.shouldTestConnection) {
|
||||
expect(page.getByTestId('next-button')).not.toBeVisible();
|
||||
|
||||
await testConnection(page);
|
||||
}
|
||||
|
||||
|
||||
@ -159,19 +159,12 @@ export const testConnection = async (page: Page) => {
|
||||
|
||||
const warningBadge = page.locator('[data-testid="warning-badge"]');
|
||||
|
||||
const failBadge = page.locator('[data-testid="fail-badge"]');
|
||||
|
||||
await expect(successBadge.or(warningBadge).or(failBadge)).toBeVisible({
|
||||
await expect(successBadge.or(warningBadge)).toBeVisible({
|
||||
timeout: 2.5 * 60 * 1000,
|
||||
});
|
||||
|
||||
await expect(page.getByTestId('messag-text')).toContainText(
|
||||
new RegExp(
|
||||
'Connection test was successful.|' +
|
||||
'Test connection partially successful: Some steps had failures, we will only ingest partial metadata. Click here to view details.|' +
|
||||
'Test connection failed, please validate your connection and permissions for the failed steps.',
|
||||
'g'
|
||||
)
|
||||
/Connection test was successful.|Test connection partially successful: Some steps had failures, we will only ingest partial metadata. Click here to view details./g
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@ -37,7 +37,6 @@ import {
|
||||
getFilteredSchema,
|
||||
getUISchemaWithNestedDefaultFilterFieldsHidden,
|
||||
} from '../../../../utils/ServiceConnectionUtils';
|
||||
import { shouldTestConnection } from '../../../../utils/ServiceUtils';
|
||||
import AirflowMessageBanner from '../../../common/AirflowMessageBanner/AirflowMessageBanner';
|
||||
import BooleanFieldTemplate from '../../../common/Form/JSONSchema/JSONSchemaTemplate/BooleanFieldTemplate';
|
||||
import WorkflowArrayFieldTemplate from '../../../common/Form/JSONSchema/JSONSchemaTemplate/WorkflowArrayFieldTemplate';
|
||||
@ -61,17 +60,10 @@ const ConnectionConfigForm = ({
|
||||
const { inlineAlertDetails } = useApplicationStore();
|
||||
const { t } = useTranslation();
|
||||
const [ingestionRunner, setIngestionRunner] = useState<string | undefined>();
|
||||
const { isAirflowAvailable, platform } = useAirflowStatus();
|
||||
const allowTestConn = useMemo(() => {
|
||||
return shouldTestConnection(serviceType);
|
||||
}, [serviceType]);
|
||||
|
||||
const [hasTestedConnection, setHasTestedConnection] = useState(
|
||||
!isAirflowAvailable || !allowTestConn || disableTestConnection
|
||||
);
|
||||
|
||||
const formRef = useRef<Form<ConfigData>>(null);
|
||||
|
||||
const { isAirflowAvailable, platform } = useAirflowStatus();
|
||||
const [hostIp, setHostIp] = useState<string>();
|
||||
|
||||
const fetchHostIp = async () => {
|
||||
@ -161,10 +153,6 @@ const ConnectionConfigForm = ({
|
||||
}
|
||||
}, [formRef.current?.state?.formData]);
|
||||
|
||||
const handleTestConnection = () => {
|
||||
setHasTestedConnection(true);
|
||||
};
|
||||
|
||||
return (
|
||||
<Fragment>
|
||||
<AirflowMessageBanner />
|
||||
@ -172,7 +160,6 @@ const ConnectionConfigForm = ({
|
||||
cancelText={cancelText ?? ''}
|
||||
fields={customFields}
|
||||
formData={validConfig}
|
||||
hasTestedConnection={hasTestedConnection}
|
||||
okText={okText ?? ''}
|
||||
ref={formRef}
|
||||
schema={schemaWithoutDefaultFilterPatternFields}
|
||||
@ -203,18 +190,19 @@ const ConnectionConfigForm = ({
|
||||
type="info"
|
||||
/>
|
||||
)}
|
||||
{!isEmpty(connSch.schema) && (
|
||||
<TestConnection
|
||||
connectionType={serviceType}
|
||||
getData={() => formRef.current?.state?.formData}
|
||||
hostIp={hostIp}
|
||||
isTestingDisabled={disableTestConnection}
|
||||
serviceCategory={serviceCategory}
|
||||
serviceName={data?.name}
|
||||
onTestConnection={handleTestConnection}
|
||||
onValidateFormRequiredFields={handleRequiredFieldsValidation}
|
||||
/>
|
||||
)}
|
||||
{!isEmpty(connSch.schema) &&
|
||||
isAirflowAvailable &&
|
||||
formRef.current?.state?.formData && (
|
||||
<TestConnection
|
||||
connectionType={serviceType}
|
||||
getData={() => formRef.current?.state?.formData}
|
||||
hostIp={hostIp}
|
||||
isTestingDisabled={disableTestConnection}
|
||||
serviceCategory={serviceCategory}
|
||||
serviceName={data?.name}
|
||||
onValidateFormRequiredFields={handleRequiredFieldsValidation}
|
||||
/>
|
||||
)}
|
||||
{!isUndefined(inlineAlertDetails) && (
|
||||
<InlineAlert alertClassName="m-t-xs" {...inlineAlertDetails} />
|
||||
)}
|
||||
|
||||
@ -42,7 +42,6 @@ export interface Props extends FormProps {
|
||||
status?: LoadingState;
|
||||
onCancel?: () => void;
|
||||
useSelectWidget?: boolean;
|
||||
hasTestedConnection?: boolean;
|
||||
}
|
||||
|
||||
const FormBuilder = forwardRef<Form, Props>(
|
||||
@ -62,7 +61,6 @@ const FormBuilder = forwardRef<Form, Props>(
|
||||
onFocus,
|
||||
useSelectWidget = false,
|
||||
children,
|
||||
hasTestedConnection,
|
||||
...props
|
||||
},
|
||||
ref
|
||||
@ -96,9 +94,6 @@ const FormBuilder = forwardRef<Form, Props>(
|
||||
};
|
||||
|
||||
const submitButton = useMemo(() => {
|
||||
if (hasTestedConnection === false) {
|
||||
return null;
|
||||
}
|
||||
if (status === 'waiting') {
|
||||
return (
|
||||
<Button
|
||||
@ -129,7 +124,7 @@ const FormBuilder = forwardRef<Form, Props>(
|
||||
</Button>
|
||||
);
|
||||
}
|
||||
}, [status, isLoading, okText, hasTestedConnection]);
|
||||
}, [status, isLoading, okText]);
|
||||
|
||||
return (
|
||||
<Form
|
||||
|
||||
@ -23,7 +23,6 @@ export interface TestConnectionProps {
|
||||
serviceName?: string;
|
||||
shouldValidateForm?: boolean;
|
||||
onValidateFormRequiredFields?: () => boolean;
|
||||
onTestConnection?: () => void;
|
||||
hostIp?: string;
|
||||
}
|
||||
|
||||
|
||||
@ -70,7 +70,6 @@ const TestConnection: FC<TestConnectionProps> = ({
|
||||
onValidateFormRequiredFields,
|
||||
shouldValidateForm = true,
|
||||
showDetails = true,
|
||||
onTestConnection,
|
||||
hostIp,
|
||||
}) => {
|
||||
const { t } = useTranslation();
|
||||
@ -373,8 +372,6 @@ const TestConnection: FC<TestConnectionProps> = ({
|
||||
if (workflowId) {
|
||||
await handleDeleteWorkflow(workflowId);
|
||||
}
|
||||
} finally {
|
||||
onTestConnection?.();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -80,6 +80,7 @@ const AddServicePage = () => {
|
||||
const [saveServiceState, setSaveServiceState] =
|
||||
useState<LoadingState>('initial');
|
||||
const [activeField, setActiveField] = useState<string>('');
|
||||
|
||||
const slashedBreadcrumb = getAddServiceEntityBreadcrumb(serviceCategory);
|
||||
|
||||
const handleServiceTypeClick = (type: string) => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user