diff --git a/openmetadata-ui/src/main/resources/ui/src/components/DataInsightDetail/DailyActiveUsersChart.tsx b/openmetadata-ui/src/main/resources/ui/src/components/DataInsightDetail/DailyActiveUsersChart.tsx index 484c33baa79..a75e3b4e5f2 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/DataInsightDetail/DailyActiveUsersChart.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/DataInsightDetail/DailyActiveUsersChart.tsx @@ -39,6 +39,7 @@ import { } from '../../utils/DataInsightUtils'; import { showErrorToast } from '../../utils/ToastUtils'; import './DataInsightDetail.less'; +import { EmptyGraphPlaceholder } from './EmptyGraphPlaceholder'; interface Props { chartFilter: ChartFilter; @@ -91,21 +92,25 @@ const DailyActiveUsersChart: FC = ({ chartFilter }) => { }> - - - - - - } /> - - - + {dailyActiveUsers.length ? ( + + + + + + } /> + + + + ) : ( + + )} ); }; diff --git a/openmetadata-ui/src/main/resources/ui/src/components/DataInsightDetail/DescriptionInsight.tsx b/openmetadata-ui/src/main/resources/ui/src/components/DataInsightDetail/DescriptionInsight.tsx index cba87079950..8453fbfca65 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/DataInsightDetail/DescriptionInsight.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/DataInsightDetail/DescriptionInsight.tsx @@ -46,6 +46,7 @@ import { } from '../../utils/DataInsightUtils'; import { showErrorToast } from '../../utils/ToastUtils'; import './DataInsightDetail.less'; +import { EmptyGraphPlaceholder } from './EmptyGraphPlaceholder'; interface Props { chartFilter: ChartFilter; @@ -105,34 +106,40 @@ const DescriptionInsight: FC = ({ chartFilter }) => { }> - - - - + {data.length ? ( + + + + - - } /> - renderLegend(props as LegendProps, `${total}%`)} - layout="vertical" - verticalAlign="top" - wrapperStyle={{ left: '0px' }} - /> - {entities.map((entity) => ( - + } /> + + renderLegend(props as LegendProps, `${total}%`) + } + layout="vertical" + verticalAlign="top" + wrapperStyle={{ left: '0px' }} /> - ))} - - + {entities.map((entity) => ( + + ))} + + + ) : ( + + )} ); }; diff --git a/openmetadata-ui/src/main/resources/ui/src/components/DataInsightDetail/EmptyGraphPlaceholder.tsx b/openmetadata-ui/src/main/resources/ui/src/components/DataInsightDetail/EmptyGraphPlaceholder.tsx new file mode 100644 index 00000000000..57d6dd79866 --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/src/components/DataInsightDetail/EmptyGraphPlaceholder.tsx @@ -0,0 +1,16 @@ +import { Typography } from 'antd'; +import React from 'react'; +import { useTranslation } from 'react-i18next'; +import ErrorPlaceHolder from '../common/error-with-placeholder/ErrorPlaceHolder'; + +export const EmptyGraphPlaceholder = () => { + const { t } = useTranslation(); + + return ( + + + {t('label.no-data-available')} + + + ); +}; diff --git a/openmetadata-ui/src/main/resources/ui/src/components/DataInsightDetail/KPIChart.tsx b/openmetadata-ui/src/main/resources/ui/src/components/DataInsightDetail/KPIChart.tsx index e6c86758bee..d36fe96810f 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/DataInsightDetail/KPIChart.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/DataInsightDetail/KPIChart.tsx @@ -58,6 +58,7 @@ import { import { CustomTooltip, getKpiGraphData } from '../../utils/DataInsightUtils'; import { showErrorToast } from '../../utils/ToastUtils'; import './DataInsightDetail.less'; +import { EmptyGraphPlaceholder } from './EmptyGraphPlaceholder'; import KPILatestResults from './KPILatestResults'; interface Props { @@ -204,34 +205,40 @@ const KPIChart: FC = ({ chartFilter }) => { }> {kpiList.length ? ( - {!isUndefined(kpiLatestResults) && !isEmpty(kpiLatestResults) && ( - - - - )} + {graphData.length ? ( + <> + {!isUndefined(kpiLatestResults) && !isEmpty(kpiLatestResults) && ( + + + + )} - - - - - - - - } - /> - {kpis.map((kpi, i) => ( - - ))} - - - + + + + + + + + } + /> + {kpis.map((kpi, i) => ( + + ))} + + + + + ) : ( + + )} ) : ( = ({ chartFilter }) => { }> - - - - - - } /> - renderLegend(props as LegendProps, `${total}%`)} - layout="vertical" - verticalAlign="top" - wrapperStyle={{ left: '0px' }} - /> - {entities.map((entity) => ( - + + + + + } /> + + renderLegend(props as LegendProps, `${total}%`) + } + layout="vertical" + verticalAlign="top" + wrapperStyle={{ left: '0px' }} /> - ))} - - + {entities.map((entity) => ( + + ))} + + + ) : ( + + )} ); }; diff --git a/openmetadata-ui/src/main/resources/ui/src/components/DataInsightDetail/PageViewsByEntitiesChart.tsx b/openmetadata-ui/src/main/resources/ui/src/components/DataInsightDetail/PageViewsByEntitiesChart.tsx index 1aa34bd79b5..d61d896b97d 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/DataInsightDetail/PageViewsByEntitiesChart.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/DataInsightDetail/PageViewsByEntitiesChart.tsx @@ -44,6 +44,7 @@ import { } from '../../utils/DataInsightUtils'; import { showErrorToast } from '../../utils/ToastUtils'; import './DataInsightDetail.less'; +import { EmptyGraphPlaceholder } from './EmptyGraphPlaceholder'; interface Props { chartFilter: ChartFilter; @@ -102,30 +103,36 @@ const PageViewsByEntitiesChart: FC = ({ chartFilter }) => { }> - - - - - - } /> - renderLegend(props as LegendProps, `${total}`)} - layout="vertical" - verticalAlign="top" - wrapperStyle={{ left: '0px' }} - /> - {entities.map((entity) => ( - + + + + + } /> + + renderLegend(props as LegendProps, `${total}`) + } + layout="vertical" + verticalAlign="top" + wrapperStyle={{ left: '0px' }} /> - ))} - - + {entities.map((entity) => ( + + ))} + + + ) : ( + + )} ); }; diff --git a/openmetadata-ui/src/main/resources/ui/src/components/DataInsightDetail/TierInsight.tsx b/openmetadata-ui/src/main/resources/ui/src/components/DataInsightDetail/TierInsight.tsx index 2328adad433..3565342de67 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/DataInsightDetail/TierInsight.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/DataInsightDetail/TierInsight.tsx @@ -46,6 +46,7 @@ import { } from '../../utils/DataInsightUtils'; import { showErrorToast } from '../../utils/ToastUtils'; import './DataInsightDetail.less'; +import { EmptyGraphPlaceholder } from './EmptyGraphPlaceholder'; interface Props { chartFilter: ChartFilter; @@ -101,30 +102,36 @@ const TierInsight: FC = ({ chartFilter }) => { }> - - - - - - } /> - renderLegend(props as LegendProps, `${total}`)} - layout="vertical" - verticalAlign="top" - wrapperStyle={{ left: '0px' }} - /> - {tiers.map((tier) => ( - + + + + + } /> + + renderLegend(props as LegendProps, `${total}`) + } + layout="vertical" + verticalAlign="top" + wrapperStyle={{ left: '0px' }} /> - ))} - - + {tiers.map((tier) => ( + + ))} + + + ) : ( + + )} ); }; diff --git a/openmetadata-ui/src/main/resources/ui/src/components/DataInsightDetail/TotalEntityInsight.tsx b/openmetadata-ui/src/main/resources/ui/src/components/DataInsightDetail/TotalEntityInsight.tsx index 35339a39e86..a3354d2c481 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/DataInsightDetail/TotalEntityInsight.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/DataInsightDetail/TotalEntityInsight.tsx @@ -46,6 +46,7 @@ import { } from '../../utils/DataInsightUtils'; import { showErrorToast } from '../../utils/ToastUtils'; import './DataInsightDetail.less'; +import { EmptyGraphPlaceholder } from './EmptyGraphPlaceholder'; interface Props { chartFilter: ChartFilter; @@ -104,30 +105,36 @@ const TotalEntityInsight: FC = ({ chartFilter }) => { }> - - - - - - } /> - renderLegend(props as LegendProps, `${total}`)} - layout="vertical" - verticalAlign="top" - wrapperStyle={{ left: '0px' }} - /> - {entities.map((entity) => ( - + + + + + } /> + + renderLegend(props as LegendProps, `${total}`) + } + layout="vertical" + verticalAlign="top" + wrapperStyle={{ left: '0px' }} /> - ))} - - + {entities.map((entity) => ( + + ))} + + + ) : ( + + )} ); };