diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Database/Profiler/ProfilerDashboard/profiler-dashboard.less b/openmetadata-ui/src/main/resources/ui/src/components/Database/Profiler/ProfilerDashboard/profiler-dashboard.less index 89872f2f9ff..d910e5265a3 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Database/Profiler/ProfilerDashboard/profiler-dashboard.less +++ b/openmetadata-ui/src/main/resources/ui/src/components/Database/Profiler/ProfilerDashboard/profiler-dashboard.less @@ -43,9 +43,3 @@ border-bottom: none; } } - -.profiler-latest-value { - .ant-statistic-title { - margin-bottom: 0px; - } -} diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Database/Profiler/ProfilerDashboard/profilerDashboard.interface.ts b/openmetadata-ui/src/main/resources/ui/src/components/Database/Profiler/ProfilerDashboard/profilerDashboard.interface.ts index df46736838c..2ddd6b66c21 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Database/Profiler/ProfilerDashboard/profilerDashboard.interface.ts +++ b/openmetadata-ui/src/main/resources/ui/src/components/Database/Profiler/ProfilerDashboard/profilerDashboard.interface.ts @@ -42,6 +42,7 @@ export interface ProfilerDetailsCardProps { isLoading?: boolean; noDataPlaceholderText?: ReactNode; children?: ReactNode; + chartType?: 'line' | 'area'; } export enum TableProfilerTab { @@ -78,6 +79,7 @@ export interface ProfilerLatestValueProps { information: MetricChartType['information']; tickFormatter?: string; stringValue?: boolean; + onClick?: (dataKey: string) => void; } export type TestCaseAction = { diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Database/Profiler/ProfilerDetailsCard/ProfilerDetailsCard.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Database/Profiler/ProfilerDetailsCard/ProfilerDetailsCard.tsx index cf47cc5ee48..8aaa65098b4 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Database/Profiler/ProfilerDetailsCard/ProfilerDetailsCard.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Database/Profiler/ProfilerDetailsCard/ProfilerDetailsCard.tsx @@ -11,15 +11,21 @@ * limitations under the License. */ -import { Card, Col, Row, Typography } from 'antd'; -import React, { useMemo, useState } from 'react'; import { + Box, + Card, + Skeleton, + Stack, + Typography, + useTheme, +} from '@mui/material'; +import React, { Fragment, useMemo, useState } from 'react'; +import { + Area, Brush, CartesianGrid, - Legend, - LegendProps, + ComposedChart, Line, - LineChart, ResponsiveContainer, Tooltip, XAxis, @@ -47,7 +53,9 @@ const ProfilerDetailsCard: React.FC = ({ title, isLoading, noDataPlaceholderText, + chartType = 'line', }: ProfilerDetailsCardProps) => { + const theme = useTheme(); const { data, information } = chartCollection; const [activeKeys, setActiveKeys] = useState([]); const { showBrush, endIndex } = useMemo(() => { @@ -57,38 +65,60 @@ const ProfilerDetailsCard: React.FC = ({ }; }, [data]); - const handleClick: LegendProps['onClick'] = (event) => { + const handleClick = (dataKey: string) => { setActiveKeys((prevActiveKeys) => - updateActiveChartFilter(event.dataKey, prevActiveKeys) + updateActiveChartFilter(dataKey, prevActiveKeys) ); }; + if (isLoading) { + return ; + } + return ( - - - {title && ( - - {title} - - )} - + + {title && ( + + {title} + + )} + + - - + {data.length > 0 ? ( - - + + = ({ } /> {information.map((info) => ( - + + {chartType === 'area' && ( + + )} + + ))} - {showBrush && ( = ({ padding={{ left: 16, right: 16 }} /> )} - + ) : ( - - - - - + )} - - - + + + ); }; diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Database/Profiler/ProfilerLatestValue/ProfilerLatestValue.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Database/Profiler/ProfilerLatestValue/ProfilerLatestValue.tsx index 657caf48564..1dd2d8d63ee 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Database/Profiler/ProfilerLatestValue/ProfilerLatestValue.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Database/Profiler/ProfilerLatestValue/ProfilerLatestValue.tsx @@ -11,7 +11,7 @@ * limitations under the License. */ -import { Space, Statistic, Typography } from 'antd'; +import { Box, Stack, Typography, useTheme } from '@mui/material'; import { isUndefined } from 'lodash'; import { getStatisticsDisplayValue } from '../../../../utils/CommonUtils'; import '../ProfilerDashboard/profiler-dashboard.less'; @@ -21,7 +21,10 @@ const ProfilerLatestValue = ({ information, tickFormatter, stringValue = false, + onClick, }: ProfilerLatestValueProps) => { + const theme = useTheme(); + const getLatestValue = (value?: number | string) => { if (isUndefined(value)) { return '--'; @@ -35,23 +38,50 @@ const ProfilerLatestValue = ({ }; return ( - + {information.map((info) => ( - - {info.title} - - } - value={getLatestValue(info.latestValue)} - valueStyle={{ color: info.color, fontSize: '18px', fontWeight: 700 }} - /> + sx={{ + cursor: onClick ? 'pointer' : 'default', + }} + onClick={() => onClick?.(info.dataKey)}> + + {info.title} + + + {getLatestValue(info.latestValue)} + + ))} - + ); }; diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Database/Profiler/TableProfiler/TableProfilerChart/TableProfilerChart.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Database/Profiler/TableProfiler/TableProfilerChart/TableProfilerChart.tsx index 1716a9c64ee..171f268800e 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Database/Profiler/TableProfiler/TableProfilerChart/TableProfilerChart.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Database/Profiler/TableProfiler/TableProfilerChart/TableProfilerChart.tsx @@ -11,8 +11,7 @@ * limitations under the License. */ -import { Grid, Stack } from '@mui/material'; -import { Col } from 'antd'; +import { Box, Grid, Stack } from '@mui/material'; import { AxiosError } from 'axios'; import { pick } from 'lodash'; import { DateRangeObject } from 'Models'; @@ -220,50 +219,49 @@ const TableProfilerChart = ({ {showHeader && ( <> {!isSummaryLoading && !isProfilingEnabled && ( - + - + )} - - - {overallSummary?.map((summary) => ( - - - - ))} - - + + + {overallSummary?.map((summary) => ( + + + + ))} + )} - + - + {showSystemMetrics && ( <> - {operationDateMetricsCard} - {operationMetricsCard} + {operationDateMetricsCard} + {operationMetricsCard} )} - + - + ); }; diff --git a/openmetadata-ui/src/main/resources/ui/src/constants/constants.ts b/openmetadata-ui/src/main/resources/ui/src/constants/constants.ts index 89df4c6ac3c..acba170de1f 100644 --- a/openmetadata-ui/src/main/resources/ui/src/constants/constants.ts +++ b/openmetadata-ui/src/main/resources/ui/src/constants/constants.ts @@ -27,7 +27,7 @@ export const TEXT_BODY_COLOR = '#37352F'; export const TEXT_GREY_MUTED = '#757575'; export const SUCCESS_COLOR = '#008376'; export const DE_ACTIVE_COLOR = '#6B7280'; -export const GRAPH_BACKGROUND_COLOR = '#f5f5f5'; +export const GRAPH_BACKGROUND_COLOR = '#E9EAEB'; export const GRAYED_OUT_COLOR = '#959595'; export const BORDER_COLOR = '#0000001a'; export const BLACK_COLOR = '#000000';