From ae71a11a8c42ac3180733b86487a3aa8436724f9 Mon Sep 17 00:00:00 2001 From: Shailesh Parmar Date: Mon, 21 Aug 2023 15:36:57 +0530 Subject: [PATCH] fix(ui): Revert to initial behavior and always display the system profile graph #12869 (#12919) --- .../AddDataQualityTestV1.tsx | 5 - .../Component/TableProfilerChart.test.tsx | 21 +--- .../Component/TableProfilerChart.tsx | 101 ++++++++---------- .../TableProfiler/TableProfiler.interface.ts | 1 - .../TableProfiler/TableProfilerV1.tsx | 14 +-- .../ui/src/constants/profiler.constant.ts | 7 -- 6 files changed, 51 insertions(+), 98 deletions(-) diff --git a/openmetadata-ui/src/main/resources/ui/src/components/AddDataQualityTest/AddDataQualityTestV1.tsx b/openmetadata-ui/src/main/resources/ui/src/components/AddDataQualityTest/AddDataQualityTestV1.tsx index 752eb7d81d9..6cc96045bc7 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/AddDataQualityTest/AddDataQualityTestV1.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/AddDataQualityTest/AddDataQualityTestV1.tsx @@ -36,7 +36,6 @@ import { getEntityBreadcrumbs, getEntityName } from 'utils/EntityUtils'; import { getEncodedFqn } from 'utils/StringsUtils'; import { getTableTabPath } from '../../constants/constants'; import { - allowedServiceForOperationGraph, DEFAULT_RANGE_DATA, STEPS_FOR_ADD_TEST_CASE, } from '../../constants/profiler.constant'; @@ -232,10 +231,6 @@ const AddDataQualityTestV1: React.FC = ({ )} {isColumnFqn && ( diff --git a/openmetadata-ui/src/main/resources/ui/src/components/TableProfiler/Component/TableProfilerChart.test.tsx b/openmetadata-ui/src/main/resources/ui/src/components/TableProfiler/Component/TableProfilerChart.test.tsx index a9cc119eb31..3f2ea806c6c 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/TableProfiler/Component/TableProfilerChart.test.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/TableProfiler/Component/TableProfilerChart.test.tsx @@ -47,12 +47,7 @@ describe('TableProfilerChart component test', () => { const mockGetSystemProfileList = getSystemProfileList as jest.Mock; const mockGetTableProfilesList = getTableProfilesList as jest.Mock; act(() => { - render( - - ); + render(); }); expect( @@ -77,12 +72,7 @@ describe('TableProfilerChart component test', () => { const mockGetSystemProfileList = getSystemProfileList as jest.Mock; const mockGetTableProfilesList = getTableProfilesList as jest.Mock; await act(async () => { - render( - - ); + render(); }); // API should be call once @@ -111,12 +101,7 @@ describe('TableProfilerChart component test', () => { const mockGetTableProfilesList = getTableProfilesList as jest.Mock; await act(async () => { - render( - - ); + render(); }); // API should be call with proper Param value diff --git a/openmetadata-ui/src/main/resources/ui/src/components/TableProfiler/Component/TableProfilerChart.tsx b/openmetadata-ui/src/main/resources/ui/src/components/TableProfiler/Component/TableProfilerChart.tsx index ecd3d308943..7bcfa97365b 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/TableProfiler/Component/TableProfilerChart.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/TableProfiler/Component/TableProfilerChart.tsx @@ -38,7 +38,6 @@ import { TableProfilerChartProps } from '../TableProfiler.interface'; const TableProfilerChart = ({ dateRangeObject, entityFqn = '', - showOperationGraph = false, }: TableProfilerChartProps) => { const { datasetFQN } = useParams<{ datasetFQN: string }>(); const { t } = useTranslation(); @@ -116,59 +115,53 @@ const TableProfilerChart = ({ title={t('label.data-volume')} /> - {showOperationGraph && ( - <> - - - - - - {t('label.table-update-plural')} - - - - - - - - - - - - - - - - - {t('label.volume-change')} - - - - - - - - - - - - - )} + + + + + + {t('label.table-update-plural')} + + + + + + + + + + + + + + + + + {t('label.volume-change')} + + + + + + + + + + + ); }; diff --git a/openmetadata-ui/src/main/resources/ui/src/components/TableProfiler/TableProfiler.interface.ts b/openmetadata-ui/src/main/resources/ui/src/components/TableProfiler/TableProfiler.interface.ts index 3b624cffbe0..c3419a3c31f 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/TableProfiler/TableProfiler.interface.ts +++ b/openmetadata-ui/src/main/resources/ui/src/components/TableProfiler/TableProfiler.interface.ts @@ -86,7 +86,6 @@ export type TableProfilerData = { export type TableProfilerChartProps = { dateRangeObject: DateRangeObject; entityFqn?: string; - showOperationGraph?: boolean; }; export interface ProfilerSettingModalState { diff --git a/openmetadata-ui/src/main/resources/ui/src/components/TableProfiler/TableProfilerV1.tsx b/openmetadata-ui/src/main/resources/ui/src/components/TableProfiler/TableProfilerV1.tsx index 17b46b7a4e7..6305f36529a 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/TableProfiler/TableProfilerV1.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/TableProfiler/TableProfilerV1.tsx @@ -70,7 +70,6 @@ import { ReactComponent as TableProfileIcon } from '../../assets/svg/table-profi import { API_RES_MAX_SIZE } from '../../constants/constants'; import { PAGE_HEADERS } from '../../constants/PageHeaders.constant'; import { - allowedServiceForOperationGraph, DEFAULT_RANGE_DATA, INITIAL_TEST_RESULT_SUMMARY, } from '../../constants/profiler.constant'; @@ -141,14 +140,6 @@ const TableProfilerV1: FC = ({ const [dateRangeObject, setDateRangeObject] = useState(DEFAULT_RANGE_DATA); - const showOperationGraph = useMemo(() => { - if (table?.serviceType) { - return allowedServiceForOperationGraph.includes(table.serviceType); - } - - return false; - }, [table]); - const isColumnProfile = activeTab === TableProfilerTab.COLUMN_PROFILE; const isDataQuality = activeTab === TableProfilerTab.DATA_QUALITY; const isTableProfile = activeTab === TableProfilerTab.TABLE_PROFILE; @@ -694,10 +685,7 @@ const TableProfilerV1: FC = ({ )} {isTableProfile && ( - + )} {settingModalVisible && ( diff --git a/openmetadata-ui/src/main/resources/ui/src/constants/profiler.constant.ts b/openmetadata-ui/src/main/resources/ui/src/constants/profiler.constant.ts index 0360d589952..0b2974fd6e9 100644 --- a/openmetadata-ui/src/main/resources/ui/src/constants/profiler.constant.ts +++ b/openmetadata-ui/src/main/resources/ui/src/constants/profiler.constant.ts @@ -22,7 +22,6 @@ import { CSMode } from '../enums/codemirror.enum'; import { DMLOperationType } from '../generated/api/data/createTableProfile'; import { ColumnProfilerConfig, - DatabaseServiceType, DataType, PartitionIntervalType, PartitionIntervalUnit, @@ -395,9 +394,3 @@ export const TIME_BASED_PARTITION = [ PartitionIntervalType.IngestionTime, PartitionIntervalType.TimeUnit, ]; - -export const allowedServiceForOperationGraph = [ - DatabaseServiceType.BigQuery, - DatabaseServiceType.Redshift, - DatabaseServiceType.Snowflake, -];