mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-12-24 14:08:45 +00:00
Fix: Remove Test Connection for Pipeline Services (#4808)
This commit is contained in:
parent
4f57e20a15
commit
92913c6eaf
@ -14,7 +14,7 @@
|
||||
import { ISubmitEvent } from '@rjsf/core';
|
||||
import { cloneDeep, isNil } from 'lodash';
|
||||
import { LoadingState } from 'Models';
|
||||
import React, { Fragment, FunctionComponent } from 'react';
|
||||
import React, { Fragment, FunctionComponent, useMemo } from 'react';
|
||||
import { TestConnection } from '../../axiosAPIs/serviceAPI';
|
||||
import { ServiceCategory } from '../../enums/service.enum';
|
||||
import {
|
||||
@ -24,7 +24,6 @@ import {
|
||||
import {
|
||||
DatabaseConnection,
|
||||
DatabaseService,
|
||||
DatabaseServiceType,
|
||||
} from '../../generated/entity/services/databaseService';
|
||||
import {
|
||||
MessagingConnection,
|
||||
@ -38,6 +37,7 @@ import { getDatabaseConfig } from '../../utils/DatabaseServiceUtils';
|
||||
import { formatFormDataForSubmit } from '../../utils/JSONSchemaFormUtils';
|
||||
import { getMessagingConfig } from '../../utils/MessagingServiceUtils';
|
||||
import { getPipelineConfig } from '../../utils/PipelineServiceUtils';
|
||||
import { shouldTestConnection } from '../../utils/ServiceUtils';
|
||||
import { showErrorToast } from '../../utils/ToastUtils';
|
||||
import FormBuilder from '../common/FormBuilder/FormBuilder';
|
||||
|
||||
@ -62,6 +62,10 @@ const ConnectionConfigForm: FunctionComponent<Props> = ({
|
||||
onCancel,
|
||||
onSave,
|
||||
}: Props) => {
|
||||
const allowTestConn = useMemo(() => {
|
||||
return shouldTestConnection(serviceType, serviceCategory);
|
||||
}, [serviceType, serviceCategory]);
|
||||
|
||||
const config = !isNil(data)
|
||||
? /* eslint-disable-next-line no-prototype-builtins */
|
||||
data.hasOwnProperty('connection')
|
||||
@ -152,11 +156,7 @@ const ConnectionConfigForm: FunctionComponent<Props> = ({
|
||||
uiSchema={connSch.uiSchema}
|
||||
onCancel={onCancel}
|
||||
onSubmit={handleSave}
|
||||
onTestConnection={
|
||||
serviceType !== DatabaseServiceType.SampleData
|
||||
? handleTestConnection
|
||||
: undefined
|
||||
}
|
||||
onTestConnection={allowTestConn ? handleTestConnection : undefined}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
@ -584,3 +584,13 @@ export const getIngestionName = (
|
||||
return `${serviceName}_${type}`;
|
||||
}
|
||||
};
|
||||
|
||||
export const shouldTestConnection = (
|
||||
serviceType: string,
|
||||
serviceCategory: ServiceCategory
|
||||
) => {
|
||||
return (
|
||||
serviceType !== DatabaseServiceType.SampleData &&
|
||||
serviceCategory !== ServiceCategory.PIPELINE_SERVICES
|
||||
);
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user