Fix markDeleteTables issue and usage/profiler ingestion description text (#4501)

This commit is contained in:
darth-coder00 2022-04-26 21:28:01 +05:30 committed by GitHub
parent b863d91360
commit f1da85036f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 47 additions and 24 deletions

View File

@ -21,6 +21,7 @@ import {
} from '../../constants/ingestion.constant';
import { FilterPatternEnum } from '../../enums/filterPattern.enum';
import { FormSubmitType } from '../../enums/form.enum';
import { ServiceCategory } from '../../enums/service.enum';
import {
ConfigClass,
CreateIngestionPipeline,
@ -55,6 +56,10 @@ const AddIngestion = ({
handleCancelClick,
handleViewServiceClick,
}: AddIngestionProps) => {
const isDatabaseService = useMemo(() => {
return serviceCategory === ServiceCategory.DATABASE_SERVICES;
}, [serviceCategory]);
const [saveState, setSaveState] = useState<LoadingState>('initial');
const [ingestionName, setIngestionName] = useState(
data?.name ?? getIngestionName(serviceData.name, pipelineType)
@ -110,7 +115,12 @@ const AddIngestion = ({
true
);
const [markDeletedTables, setMarkDeletedTables] = useState(
(data?.source.sourceConfig.config as ConfigClass)?.markDeletedTables ?? true
isDatabaseService
? Boolean(
(data?.source.sourceConfig.config as ConfigClass)
?.markDeletedTables ?? true
)
: undefined
);
const [dashboardFilterPattern, setDashboardFilterPattern] =
useState<FilterPattern>(
@ -302,7 +312,7 @@ const AddIngestion = ({
enableDataProfiler: enableDataProfiler,
generateSampleData: ingestSampleData,
includeViews: includeView,
markDeletedTables: markDeletedTables,
markDeletedTables: isDatabaseService ? markDeletedTables : undefined,
schemaFilterPattern: getFilterPatternData(schemaFilterPattern),
tableFilterPattern: getFilterPatternData(tableFilterPattern),
chartFilterPattern: getFilterPatternData(chartFilterPattern),

View File

@ -11,6 +11,7 @@
* limitations under the License.
*/
import { isNil } from 'lodash';
import { EditorContentRef } from 'Models';
import React, { Fragment, useRef } from 'react';
import { FilterPatternEnum } from '../../../enums/filterPattern.enum';
@ -207,20 +208,26 @@ const ConfigureIngestion = ({
</p>
{getSeparator('')}
</Field>
<Field>
<div className="tw-flex tw-gap-1">
<label>Mark Deleted Tables</label>
<ToggleSwitchV1
checked={markDeletedTables}
handleCheck={handleMarkDeletedTables}
/>
</div>
<p className="tw-text-grey-muted tw-mt-3">
Any deleted tables in the data source will be soft deleted in
OpenMetadata
</p>
{getSeparator('')}
</Field>
{!isNil(markDeletedTables) && (
<Field>
<div className="tw-flex tw-gap-1">
<label>Mark Deleted Tables</label>
<ToggleSwitchV1
checked={markDeletedTables}
handleCheck={() => {
if (handleMarkDeletedTables) {
handleMarkDeletedTables();
}
}}
/>
</div>
<p className="tw-text-grey-muted tw-mt-3">
Any deleted tables in the data source will be soft deleted in
OpenMetadata
</p>
{getSeparator('')}
</Field>
)}
</div>
</>
);

View File

@ -59,7 +59,7 @@ export interface ConfigureIngestionProps {
includeView: boolean;
enableDataProfiler: boolean;
ingestSampleData: boolean;
markDeletedTables: boolean;
markDeletedTables?: boolean;
pipelineType: PipelineType;
showDashboardFilter: boolean;
showSchemaFilter: boolean;
@ -75,7 +75,7 @@ export interface ConfigureIngestionProps {
handleIncludeView: () => void;
handleEnableDataProfiler: () => void;
handleIngestSampleData: () => void;
handleMarkDeletedTables: () => void;
handleMarkDeletedTables?: () => void;
getIncludeValue: (value: string[], type: FilterPatternEnum) => void;
getExcludeValue: (value: string[], type: FilterPatternEnum) => void;
handleShowFilter: (value: boolean, type: FilterPatternEnum) => void;

View File

@ -62,8 +62,14 @@ const AddService = ({
const [saveServiceState, setSaveServiceState] =
useState<LoadingState>('initial');
const resetServiceData = () => {
setServiceName('');
setDescription('');
};
const handleServiceTypeClick = (type: string) => {
setShowErrorMessage({ ...showErrorMessage, serviceType: false });
resetServiceData();
setSelectServiceType(type);
};

View File

@ -57,8 +57,8 @@ export const addUsageIngestionGuide = [
{
step: 1,
title: 'Add Usage Ingestion',
description: `Based on the service type selected, enter the filter pattern details for the schema or table (database), or topic (messaging), or dashboard.
You can include or exclude the filter patterns. Choose to include views, enable or disable the data profiler, and ingest sample data, as required.`,
description: `We can create a workflow that will obtain the query log and table creation information from the underlying database and feed it to OpenMetadata.
The Usage Ingestion will be in charge of obtaining this data.`,
},
{
...schedulingIngestionGuide,
@ -67,7 +67,7 @@ export const addUsageIngestionGuide = [
step: 3,
title: 'Usage Ingestion Added Successfully',
description:
'You are all set! The <Ingestion Pipeline Name> has been successfully deployed. The metadata will be ingested at a regular interval as per the schedule.',
'You are all set! The <Ingestion Pipeline Name> has been successfully deployed. The usage will be ingested at a regular interval as per the schedule.',
},
];
@ -75,14 +75,14 @@ export const addProfilerIngestionGuide = [
{
step: 1,
title: 'Add Profiler Ingestion',
description: `Based on the service type selected, enter the filter pattern details for the schema or table (database), or topic (messaging), or dashboard.
You can include or exclude the filter patterns. Choose to include views, enable or disable the data profiler, and ingest sample data, as required.`,
description: `After the metadata ingestion has been done correctly, we can configure and deploy the Profiler Workflow.
This Pipeline will be in charge of feeding the Profiler tab of the Table Entity, as well as running any tests configured in the Entity.`,
},
{ ...schedulingIngestionGuide },
{
step: 3,
title: 'Profiler Ingestion Added Successfully',
description:
'You are all set! The <Ingestion Pipeline Name> has been successfully deployed. The metadata will be ingested at a regular interval as per the schedule.',
'You are all set! The <Ingestion Pipeline Name> has been successfully deployed. The profiler will run at a regular interval as per the schedule.',
},
];