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:
Ashish Gupta 2022-12-17 14:30:46 +05:30 committed by GitHub
parent d0efcef6b0
commit c632ee81e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 2 deletions

View File

@ -17,6 +17,7 @@ import React, { FC, useEffect, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { Link, useParams } from 'react-router-dom';
import { getAggregateChartData } from '../../axiosAPIs/DataInsightAPI';
import { getTeamByName } from '../../axiosAPIs/teamsAPI';
import { getUserPath } from '../../constants/constants';
import {
ENTITIES_CHARTS,
@ -28,10 +29,12 @@ import {
DataInsightChartType,
} from '../../generated/dataInsight/dataInsightChartResult';
import { MostActiveUsers } from '../../generated/dataInsight/type/mostActiveUsers';
import { Team } from '../../generated/entity/teams/team';
import {
ChartFilter,
DataInsightTabs,
} from '../../interface/data-insight.interface';
import { getEntityName } from '../../utils/CommonUtils';
import {
getEntitiesChartSummary,
getWebChartSummary,
@ -60,6 +63,8 @@ const DataInsightSummary: FC<Props> = ({ chartFilter, onScrollToChart }) => {
const [mostActiveUser, setMostActiveUser] = useState<MostActiveUsers>();
const [OrganizationDetails, setOrganizationDetails] = useState<Team>();
const entitiesSummaryList = useMemo(
() => getEntitiesChartSummary(entitiesCharts),
[entitiesCharts]
@ -72,6 +77,15 @@ const DataInsightSummary: FC<Props> = ({ chartFilter, onScrollToChart }) => {
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 () => {
setIsLoading(true);
try {
@ -157,6 +171,7 @@ const DataInsightSummary: FC<Props> = ({ chartFilter, onScrollToChart }) => {
};
useEffect(() => {
fetchOrganizationDetails();
fetchEntitiesChartData();
fetchMostActiveUser();
fetchWebChartData();
@ -169,7 +184,10 @@ const DataInsightSummary: FC<Props> = ({ chartFilter, onScrollToChart }) => {
loading={isLoading}
title={
<Typography.Title level={5}>
{t('label.data-insight-summary')}
{t('label.data-insight-summary', {
organization:
getEntityName(OrganizationDetails) || t('label.open-metadata'),
})}
</Typography.Title>
}>
<Row data-testid="summary-card-content" gutter={[16, 16]}>

View File

@ -176,7 +176,7 @@
"pipeline": "Pipeline",
"dashboard": "Dashboard",
"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-owner-summary": "Percentage of Data Assets with Owners",
"data-insight-tier-summary": "Total Data Assets by Tier",