mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-08-31 20:51:26 +00:00
UI : Added Organization displayName in DataInsight health glance (#9359)
* Added Organization displayName in DataInsight health glance * changes as per comments Co-authored-by: Shailesh Parmar <shailesh.parmar.webdev@gmail.com>
This commit is contained in:
parent
d0efcef6b0
commit
c632ee81e2
@ -17,6 +17,7 @@ import React, { FC, useEffect, useMemo, useState } from 'react';
|
|||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { Link, useParams } from 'react-router-dom';
|
import { Link, useParams } from 'react-router-dom';
|
||||||
import { getAggregateChartData } from '../../axiosAPIs/DataInsightAPI';
|
import { getAggregateChartData } from '../../axiosAPIs/DataInsightAPI';
|
||||||
|
import { getTeamByName } from '../../axiosAPIs/teamsAPI';
|
||||||
import { getUserPath } from '../../constants/constants';
|
import { getUserPath } from '../../constants/constants';
|
||||||
import {
|
import {
|
||||||
ENTITIES_CHARTS,
|
ENTITIES_CHARTS,
|
||||||
@ -28,10 +29,12 @@ import {
|
|||||||
DataInsightChartType,
|
DataInsightChartType,
|
||||||
} from '../../generated/dataInsight/dataInsightChartResult';
|
} from '../../generated/dataInsight/dataInsightChartResult';
|
||||||
import { MostActiveUsers } from '../../generated/dataInsight/type/mostActiveUsers';
|
import { MostActiveUsers } from '../../generated/dataInsight/type/mostActiveUsers';
|
||||||
|
import { Team } from '../../generated/entity/teams/team';
|
||||||
import {
|
import {
|
||||||
ChartFilter,
|
ChartFilter,
|
||||||
DataInsightTabs,
|
DataInsightTabs,
|
||||||
} from '../../interface/data-insight.interface';
|
} from '../../interface/data-insight.interface';
|
||||||
|
import { getEntityName } from '../../utils/CommonUtils';
|
||||||
import {
|
import {
|
||||||
getEntitiesChartSummary,
|
getEntitiesChartSummary,
|
||||||
getWebChartSummary,
|
getWebChartSummary,
|
||||||
@ -60,6 +63,8 @@ const DataInsightSummary: FC<Props> = ({ chartFilter, onScrollToChart }) => {
|
|||||||
|
|
||||||
const [mostActiveUser, setMostActiveUser] = useState<MostActiveUsers>();
|
const [mostActiveUser, setMostActiveUser] = useState<MostActiveUsers>();
|
||||||
|
|
||||||
|
const [OrganizationDetails, setOrganizationDetails] = useState<Team>();
|
||||||
|
|
||||||
const entitiesSummaryList = useMemo(
|
const entitiesSummaryList = useMemo(
|
||||||
() => getEntitiesChartSummary(entitiesCharts),
|
() => getEntitiesChartSummary(entitiesCharts),
|
||||||
[entitiesCharts]
|
[entitiesCharts]
|
||||||
@ -72,6 +77,15 @@ const DataInsightSummary: FC<Props> = ({ chartFilter, onScrollToChart }) => {
|
|||||||
|
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
|
const fetchOrganizationDetails = async () => {
|
||||||
|
try {
|
||||||
|
const data = await getTeamByName('Organization');
|
||||||
|
setOrganizationDetails(data);
|
||||||
|
} catch (err) {
|
||||||
|
// for this API do not show the toast message
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const fetchEntitiesChartData = async () => {
|
const fetchEntitiesChartData = async () => {
|
||||||
setIsLoading(true);
|
setIsLoading(true);
|
||||||
try {
|
try {
|
||||||
@ -157,6 +171,7 @@ const DataInsightSummary: FC<Props> = ({ chartFilter, onScrollToChart }) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
fetchOrganizationDetails();
|
||||||
fetchEntitiesChartData();
|
fetchEntitiesChartData();
|
||||||
fetchMostActiveUser();
|
fetchMostActiveUser();
|
||||||
fetchWebChartData();
|
fetchWebChartData();
|
||||||
@ -169,7 +184,10 @@ const DataInsightSummary: FC<Props> = ({ chartFilter, onScrollToChart }) => {
|
|||||||
loading={isLoading}
|
loading={isLoading}
|
||||||
title={
|
title={
|
||||||
<Typography.Title level={5}>
|
<Typography.Title level={5}>
|
||||||
{t('label.data-insight-summary')}
|
{t('label.data-insight-summary', {
|
||||||
|
organization:
|
||||||
|
getEntityName(OrganizationDetails) || t('label.open-metadata'),
|
||||||
|
})}
|
||||||
</Typography.Title>
|
</Typography.Title>
|
||||||
}>
|
}>
|
||||||
<Row data-testid="summary-card-content" gutter={[16, 16]}>
|
<Row data-testid="summary-card-content" gutter={[16, 16]}>
|
||||||
|
@ -176,7 +176,7 @@
|
|||||||
"pipeline": "Pipeline",
|
"pipeline": "Pipeline",
|
||||||
"dashboard": "Dashboard",
|
"dashboard": "Dashboard",
|
||||||
"find-in-table": "Find in table",
|
"find-in-table": "Find in table",
|
||||||
"data-insight-summary": "OpenMetadata health at a glance",
|
"data-insight-summary": "{{organization}} health at a glance",
|
||||||
"data-insight-description-summary": "Percentage of Data Assets with Description",
|
"data-insight-description-summary": "Percentage of Data Assets with Description",
|
||||||
"data-insight-owner-summary": "Percentage of Data Assets with Owners",
|
"data-insight-owner-summary": "Percentage of Data Assets with Owners",
|
||||||
"data-insight-tier-summary": "Total Data Assets by Tier",
|
"data-insight-tier-summary": "Total Data Assets by Tier",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user