From f1da85036fc1a6671336d2a9ed081eeadc2e6306 Mon Sep 17 00:00:00 2001 From: darth-coder00 <86726556+darth-coder00@users.noreply.github.com> Date: Tue, 26 Apr 2022 21:28:01 +0530 Subject: [PATCH] Fix markDeleteTables issue and usage/profiler ingestion description text (#4501) --- .../AddIngestion/AddIngestion.component.tsx | 14 ++++++-- .../AddIngestion/Steps/ConfigureIngestion.tsx | 35 +++++++++++-------- .../AddIngestion/addIngestion.interface.ts | 4 +-- .../AddService/AddService.component.tsx | 6 ++++ .../src/constants/service-guide.constant.ts | 12 +++---- 5 files changed, 47 insertions(+), 24 deletions(-) diff --git a/openmetadata-ui/src/main/resources/ui/src/components/AddIngestion/AddIngestion.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/AddIngestion/AddIngestion.component.tsx index 75e445b6659..485cdb0538f 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/AddIngestion/AddIngestion.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/AddIngestion/AddIngestion.component.tsx @@ -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('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( @@ -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), diff --git a/openmetadata-ui/src/main/resources/ui/src/components/AddIngestion/Steps/ConfigureIngestion.tsx b/openmetadata-ui/src/main/resources/ui/src/components/AddIngestion/Steps/ConfigureIngestion.tsx index fe24f42a0bb..160d49a1c52 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/AddIngestion/Steps/ConfigureIngestion.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/AddIngestion/Steps/ConfigureIngestion.tsx @@ -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 = ({

{getSeparator('')} - -
- - -
-

- Any deleted tables in the data source will be soft deleted in - OpenMetadata -

- {getSeparator('')} -
+ {!isNil(markDeletedTables) && ( + +
+ + { + if (handleMarkDeletedTables) { + handleMarkDeletedTables(); + } + }} + /> +
+

+ Any deleted tables in the data source will be soft deleted in + OpenMetadata +

+ {getSeparator('')} +
+ )} ); diff --git a/openmetadata-ui/src/main/resources/ui/src/components/AddIngestion/addIngestion.interface.ts b/openmetadata-ui/src/main/resources/ui/src/components/AddIngestion/addIngestion.interface.ts index ad29bb021da..558908ebe86 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/AddIngestion/addIngestion.interface.ts +++ b/openmetadata-ui/src/main/resources/ui/src/components/AddIngestion/addIngestion.interface.ts @@ -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; diff --git a/openmetadata-ui/src/main/resources/ui/src/components/AddService/AddService.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/AddService/AddService.component.tsx index 2de747c9f0e..33d2d5bfe0f 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/AddService/AddService.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/AddService/AddService.component.tsx @@ -62,8 +62,14 @@ const AddService = ({ const [saveServiceState, setSaveServiceState] = useState('initial'); + const resetServiceData = () => { + setServiceName(''); + setDescription(''); + }; + const handleServiceTypeClick = (type: string) => { setShowErrorMessage({ ...showErrorMessage, serviceType: false }); + resetServiceData(); setSelectServiceType(type); }; diff --git a/openmetadata-ui/src/main/resources/ui/src/constants/service-guide.constant.ts b/openmetadata-ui/src/main/resources/ui/src/constants/service-guide.constant.ts index a1c104080b0..2db82a98418 100644 --- a/openmetadata-ui/src/main/resources/ui/src/constants/service-guide.constant.ts +++ b/openmetadata-ui/src/main/resources/ui/src/constants/service-guide.constant.ts @@ -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 has been successfully deployed. The metadata will be ingested at a regular interval as per the schedule.', + 'You are all set! The 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 has been successfully deployed. The metadata will be ingested at a regular interval as per the schedule.', + 'You are all set! The has been successfully deployed. The profiler will run at a regular interval as per the schedule.', }, ];