Removed the error toasts shown for summary panel (#13309)

This commit is contained in:
Aniket Katkar 2023-09-22 17:09:26 +05:30 committed by GitHub
parent c5a4c5957e
commit 7524b673d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 20 additions and 71 deletions

View File

@ -31,7 +31,6 @@ import { SearchIndex } from 'generated/entity/data/searchIndex';
import { StoredProcedure } from 'generated/entity/data/storedProcedure'; import { StoredProcedure } from 'generated/entity/data/storedProcedure';
import { EntityDetailUnion } from 'Models'; import { EntityDetailUnion } from 'Models';
import React, { useEffect, useMemo, useState } from 'react'; import React, { useEffect, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { getDashboardByFqn } from 'rest/dashboardAPI'; import { getDashboardByFqn } from 'rest/dashboardAPI';
import { getDataModelsByName } from 'rest/dataModelsAPI'; import { getDataModelsByName } from 'rest/dataModelsAPI';
import { getMlModelByFQN } from 'rest/mlModelAPI'; import { getMlModelByFQN } from 'rest/mlModelAPI';
@ -53,7 +52,6 @@ import {
} from '../../../utils/EntityUtils'; } from '../../../utils/EntityUtils';
import { getEncodedFqn } from '../../../utils/StringsUtils'; import { getEncodedFqn } from '../../../utils/StringsUtils';
import { getEntityIcon } from '../../../utils/TableUtils'; import { getEntityIcon } from '../../../utils/TableUtils';
import { showErrorToast } from '../../../utils/ToastUtils';
import { SelectedNode } from '../EntityLineage/EntityLineage.interface'; import { SelectedNode } from '../EntityLineage/EntityLineage.interface';
import { LineageDrawerProps } from './EntityInfoDrawer.interface'; import { LineageDrawerProps } from './EntityInfoDrawer.interface';
import './EntityInfoDrawer.style.less'; import './EntityInfoDrawer.style.less';
@ -64,7 +62,6 @@ const EntityInfoDrawer = ({
selectedNode, selectedNode,
isMainNode = false, isMainNode = false,
}: LineageDrawerProps) => { }: LineageDrawerProps) => {
const { t } = useTranslation();
const [entityDetail, setEntityDetail] = useState<EntityDetailUnion>( const [entityDetail, setEntityDetail] = useState<EntityDetailUnion>(
{} as EntityDetailUnion {} as EntityDetailUnion
); );
@ -153,12 +150,6 @@ const EntityInfoDrawer = ({
break; break;
} }
setEntityDetail(response); setEntityDetail(response);
} catch (error) {
showErrorToast(
t('server.error-selected-node-name-details', {
selectedNodeName: selectedNode.name,
})
);
} finally { } finally {
setIsLoading(false); setIsLoading(false);
} }

View File

@ -12,7 +12,6 @@
*/ */
import { Col, Divider, Row, Typography } from 'antd'; import { Col, Divider, Row, Typography } from 'antd';
import { AxiosError } from 'axios';
import SummaryTagsDescription from 'components/common/SummaryTagsDescription/SummaryTagsDescription.component'; import SummaryTagsDescription from 'components/common/SummaryTagsDescription/SummaryTagsDescription.component';
import SummaryPanelSkeleton from 'components/Skeleton/SummaryPanelSkeleton/SummaryPanelSkeleton.component'; import SummaryPanelSkeleton from 'components/Skeleton/SummaryPanelSkeleton/SummaryPanelSkeleton.component';
import { ExplorePageTabs } from 'enums/Explore.enum'; import { ExplorePageTabs } from 'enums/Explore.enum';
@ -28,7 +27,6 @@ import { SummaryEntityType } from '../../../../enums/EntitySummary.enum';
import { Dashboard } from '../../../../generated/entity/data/dashboard'; import { Dashboard } from '../../../../generated/entity/data/dashboard';
import { fetchCharts } from '../../../../utils/DashboardDetailsUtils'; import { fetchCharts } from '../../../../utils/DashboardDetailsUtils';
import { getFormattedEntityData } from '../../../../utils/EntitySummaryPanelUtils'; import { getFormattedEntityData } from '../../../../utils/EntitySummaryPanelUtils';
import { showErrorToast } from '../../../../utils/ToastUtils';
import CommonEntitySummaryInfo from '../CommonEntitySummaryInfo/CommonEntitySummaryInfo'; import CommonEntitySummaryInfo from '../CommonEntitySummaryInfo/CommonEntitySummaryInfo';
import SummaryList from '../SummaryList/SummaryList.component'; import SummaryList from '../SummaryList/SummaryList.component';
import { BasicEntityInfo } from '../SummaryList/SummaryList.interface'; import { BasicEntityInfo } from '../SummaryList/SummaryList.interface';
@ -60,12 +58,7 @@ function DashboardSummary({
setCharts(updatedCharts); setCharts(updatedCharts);
} catch (err) { } catch (err) {
showErrorToast( // Error
err as AxiosError,
t('server.entity-fetch-error', {
entity: t('label.dashboard-detail-plural-lowercase'),
})
);
} }
}; };

View File

@ -12,7 +12,6 @@
*/ */
import { Col, Divider, Row, Space, Typography } from 'antd'; import { Col, Divider, Row, Space, Typography } from 'antd';
import { AxiosError } from 'axios';
import { OwnerLabel } from 'components/common/OwnerLabel/OwnerLabel.component'; import { OwnerLabel } from 'components/common/OwnerLabel/OwnerLabel.component';
import SummaryPanelSkeleton from 'components/Skeleton/SummaryPanelSkeleton/SummaryPanelSkeleton.component'; import SummaryPanelSkeleton from 'components/Skeleton/SummaryPanelSkeleton/SummaryPanelSkeleton.component';
import TagButton from 'components/TagButton/TagButton.component'; import TagButton from 'components/TagButton/TagButton.component';
@ -22,7 +21,6 @@ import React, { useCallback, useEffect, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import { getGlossaryTermByFQN } from 'rest/glossaryAPI'; import { getGlossaryTermByFQN } from 'rest/glossaryAPI';
import { getFormattedEntityData } from 'utils/EntitySummaryPanelUtils'; import { getFormattedEntityData } from 'utils/EntitySummaryPanelUtils';
import { showErrorToast } from 'utils/ToastUtils';
import SummaryList from '../SummaryList/SummaryList.component'; import SummaryList from '../SummaryList/SummaryList.component';
import { BasicEntityInfo } from '../SummaryList/SummaryList.interface'; import { BasicEntityInfo } from '../SummaryList/SummaryList.interface';
import { GlossaryTermSummaryProps } from './GlossaryTermSummary.interface'; import { GlossaryTermSummaryProps } from './GlossaryTermSummary.interface';
@ -38,7 +36,7 @@ function GlossaryTermSummary({
if (selectedData?.children) { if (selectedData?.children) {
return getFormattedEntityData( return getFormattedEntityData(
SummaryEntityType.COLUMN, SummaryEntityType.COLUMN,
(selectedData as GlossaryTerm).children selectedData.children
); );
} else { } else {
return []; return [];
@ -46,14 +44,11 @@ function GlossaryTermSummary({
}, [selectedData]); }, [selectedData]);
const reviewers = useMemo( const reviewers = useMemo(
() => (entityDetails as GlossaryTerm).reviewers || [], () => entityDetails.reviewers ?? [],
[selectedData] [selectedData]
); );
const synonyms = useMemo( const synonyms = useMemo(() => entityDetails.synonyms ?? [], [selectedData]);
() => (entityDetails as GlossaryTerm).synonyms || [],
[selectedData]
);
const fetchGlossaryTermDetails = useCallback(async () => { const fetchGlossaryTermDetails = useCallback(async () => {
try { try {
@ -63,7 +58,7 @@ function GlossaryTermSummary({
); );
setSelectedData(response); setSelectedData(response);
} catch (error) { } catch (error) {
showErrorToast(error as AxiosError); // Error
} }
}, [entityDetails.fullyQualifiedName, setSelectedData]); }, [entityDetails.fullyQualifiedName, setSelectedData]);

View File

@ -12,7 +12,6 @@
*/ */
import { Col, Divider, Row, Typography } from 'antd'; import { Col, Divider, Row, Typography } from 'antd';
import { AxiosError } from 'axios';
import SummaryTagsDescription from 'components/common/SummaryTagsDescription/SummaryTagsDescription.component'; import SummaryTagsDescription from 'components/common/SummaryTagsDescription/SummaryTagsDescription.component';
import { usePermissionProvider } from 'components/PermissionProvider/PermissionProvider'; import { usePermissionProvider } from 'components/PermissionProvider/PermissionProvider';
import { import {
@ -21,7 +20,6 @@ import {
} from 'components/PermissionProvider/PermissionProvider.interface'; } from 'components/PermissionProvider/PermissionProvider.interface';
import SummaryPanelSkeleton from 'components/Skeleton/SummaryPanelSkeleton/SummaryPanelSkeleton.component'; import SummaryPanelSkeleton from 'components/Skeleton/SummaryPanelSkeleton/SummaryPanelSkeleton.component';
import { mockTablePermission } from 'constants/mockTourData.constants'; import { mockTablePermission } from 'constants/mockTourData.constants';
import { ClientErrors } from 'enums/axios.enum';
import { ExplorePageTabs } from 'enums/Explore.enum'; import { ExplorePageTabs } from 'enums/Explore.enum';
import { isEmpty, isUndefined } from 'lodash'; import { isEmpty, isUndefined } from 'lodash';
import { import {
@ -47,7 +45,6 @@ import { SummaryEntityType } from '../../../../enums/EntitySummary.enum';
import { Table, TestSummary } from '../../../../generated/entity/data/table'; import { Table, TestSummary } from '../../../../generated/entity/data/table';
import { formTwoDigitNmber as formTwoDigitNumber } from '../../../../utils/CommonUtils'; import { formTwoDigitNmber as formTwoDigitNumber } from '../../../../utils/CommonUtils';
import { getFormattedEntityData } from '../../../../utils/EntitySummaryPanelUtils'; import { getFormattedEntityData } from '../../../../utils/EntitySummaryPanelUtils';
import { showErrorToast } from '../../../../utils/ToastUtils';
import CommonEntitySummaryInfo from '../CommonEntitySummaryInfo/CommonEntitySummaryInfo'; import CommonEntitySummaryInfo from '../CommonEntitySummaryInfo/CommonEntitySummaryInfo';
import SummaryList from '../SummaryList/SummaryList.component'; import SummaryList from '../SummaryList/SummaryList.component';
import { BasicEntityInfo } from '../SummaryList/SummaryList.interface'; import { BasicEntityInfo } from '../SummaryList/SummaryList.interface';
@ -88,7 +85,7 @@ function TableSummary({
setTestSuiteSummary(res?.testSuite?.summary); setTestSuiteSummary(res?.testSuite?.summary);
} }
} catch (error) { } catch (error) {
showErrorToast(error as AxiosError); // Error
} }
}; };
@ -108,15 +105,7 @@ function TableSummary({
} }
}); });
} catch (error) { } catch (error) {
const axiosError = error as AxiosError; // Error
if (axiosError.response?.status !== ClientErrors.FORBIDDEN) {
showErrorToast(
t('server.entity-details-fetch-error', {
entityType: t('label.table-lowercase'),
entityName: entityDetails.name,
})
);
}
} }
}, [entityDetails]); }, [entityDetails]);

View File

@ -12,7 +12,6 @@
*/ */
import { Col, Row, Typography } from 'antd'; import { Col, Row, Typography } from 'antd';
import { AxiosError } from 'axios';
import TableDataCardV2 from 'components/common/table-data-card-v2/TableDataCardV2'; import TableDataCardV2 from 'components/common/table-data-card-v2/TableDataCardV2';
import { EntityUnion } from 'components/Explore/explore.interface'; import { EntityUnion } from 'components/Explore/explore.interface';
import { SourceType } from 'components/searched-data/SearchedData.interface'; import { SourceType } from 'components/searched-data/SearchedData.interface';
@ -21,7 +20,6 @@ import { SearchIndex } from 'enums/search.enum';
import React, { useCallback, useEffect, useMemo, useState } from 'react'; import React, { useCallback, useEffect, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import { searchData } from 'rest/miscAPI'; import { searchData } from 'rest/miscAPI';
import { showErrorToast } from 'utils/ToastUtils';
import { TagsSummaryProps } from './TagsSummary.interface'; import { TagsSummaryProps } from './TagsSummary.interface';
function TagsSummary({ entityDetails, isLoading }: TagsSummaryProps) { function TagsSummary({ entityDetails, isLoading }: TagsSummaryProps) {
@ -45,7 +43,7 @@ function TagsSummary({ entityDetails, isLoading }: TagsSummaryProps) {
const sources = res.data.hits.hits.map((hit) => hit._source); const sources = res.data.hits.hits.map((hit) => hit._source);
setSelectedData(sources); setSelectedData(sources);
} catch (error) { } catch (error) {
showErrorToast(error as AxiosError); // Error
} }
}, [entityDetails.fullyQualifiedName, setSelectedData]); }, [entityDetails.fullyQualifiedName, setSelectedData]);

View File

@ -12,11 +12,9 @@
*/ */
import { Col, Divider, Row, Typography } from 'antd'; import { Col, Divider, Row, Typography } from 'antd';
import { AxiosError } from 'axios';
import SummaryTagsDescription from 'components/common/SummaryTagsDescription/SummaryTagsDescription.component'; import SummaryTagsDescription from 'components/common/SummaryTagsDescription/SummaryTagsDescription.component';
import SummaryPanelSkeleton from 'components/Skeleton/SummaryPanelSkeleton/SummaryPanelSkeleton.component'; import SummaryPanelSkeleton from 'components/Skeleton/SummaryPanelSkeleton/SummaryPanelSkeleton.component';
import { getTeamAndUserDetailsPath } from 'constants/constants'; import { getTeamAndUserDetailsPath } from 'constants/constants';
import { ClientErrors } from 'enums/axios.enum';
import { isArray, isEmpty } from 'lodash'; import { isArray, isEmpty } from 'lodash';
import React, { useCallback, useEffect, useMemo, useState } from 'react'; import React, { useCallback, useEffect, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
@ -26,7 +24,6 @@ import {
DRAWER_NAVIGATION_OPTIONS, DRAWER_NAVIGATION_OPTIONS,
getOwnerNameWithProfilePic, getOwnerNameWithProfilePic,
} from 'utils/EntityUtils'; } from 'utils/EntityUtils';
import { showErrorToast } from 'utils/ToastUtils';
import { SummaryEntityType } from '../../../../enums/EntitySummary.enum'; import { SummaryEntityType } from '../../../../enums/EntitySummary.enum';
import { TagLabel, Topic } from '../../../../generated/entity/data/topic'; import { TagLabel, Topic } from '../../../../generated/entity/data/topic';
import { getFormattedEntityData } from '../../../../utils/EntitySummaryPanelUtils'; import { getFormattedEntityData } from '../../../../utils/EntitySummaryPanelUtils';
@ -73,12 +70,12 @@ function TopicSummary({
return { return {
value: value:
getOwnerNameWithProfilePic(owner) || getOwnerNameWithProfilePic(owner) ??
t('label.no-entity', { t('label.no-entity', {
entity: t('label.owner'), entity: t('label.owner'),
}), }),
url: getTeamAndUserDetailsPath(owner?.name || ''), url: getTeamAndUserDetailsPath(owner?.name ?? ''),
isLink: owner?.name ? true : false, isLink: !isEmpty(owner?.name),
}; };
}, [entityDetails, topicDetails]); }, [entityDetails, topicDetails]);
@ -93,15 +90,7 @@ function TopicSummary({
setTopicDetails({ ...entityDetails, partitions, messageSchema }); setTopicDetails({ ...entityDetails, partitions, messageSchema });
} catch (error) { } catch (error) {
const axiosError = error as AxiosError; // Error
if (axiosError.response?.status !== ClientErrors.FORBIDDEN) {
showErrorToast(
t('server.entity-details-fetch-error', {
entityType: t('label.topic-lowercase'),
entityName: entityDetails.name,
})
);
}
} }
}, [entityDetails]); }, [entityDetails]);

View File

@ -586,22 +586,19 @@ const getDataModelOverview = (dataModelDetails: DashboardDataModel) => {
dataModelType, dataModelType,
fullyQualifiedName, fullyQualifiedName,
} = dataModelDetails; } = dataModelDetails;
const tier = getTierFromTableTags(tags || []); const tier = getTierFromTableTags(tags ?? []);
const overview = [ const overview = [
{ {
name: i18next.t('label.owner'), name: i18next.t('label.owner'),
value: value:
getOwnerNameWithProfilePic(owner) || getOwnerNameWithProfilePic(owner) ??
i18next.t('label.no-entity', { i18next.t('label.no-entity', {
entity: i18next.t('label.owner'), entity: i18next.t('label.owner'),
}), }),
url: getOwnerValue(owner as EntityReference), url: getOwnerValue(owner as EntityReference),
isLink: owner?.name ? true : false, isLink: !isEmpty(owner?.name),
visible: [ visible: [DRAWER_NAVIGATION_OPTIONS.lineage],
DRAWER_NAVIGATION_OPTIONS.lineage,
DRAWER_NAVIGATION_OPTIONS.explore,
],
}, },
{ {
name: `${i18next.t('label.data-model')} ${i18next.t( name: `${i18next.t('label.data-model')} ${i18next.t(
@ -666,22 +663,19 @@ const getStoredProcedureOverview = (
FQN_SEPARATOR_CHAR FQN_SEPARATOR_CHAR
).split(FQN_SEPARATOR_CHAR); ).split(FQN_SEPARATOR_CHAR);
const tier = getTierFromTableTags(tags || []); const tier = getTierFromTableTags(tags ?? []);
const overview = [ const overview = [
{ {
name: i18next.t('label.owner'), name: i18next.t('label.owner'),
value: value:
getOwnerNameWithProfilePic(owner) || getOwnerNameWithProfilePic(owner) ??
i18next.t('label.no-entity', { i18next.t('label.no-entity', {
entity: i18next.t('label.owner'), entity: i18next.t('label.owner'),
}), }),
url: getOwnerValue(owner as EntityReference), url: getOwnerValue(owner as EntityReference),
isLink: owner?.name ? true : false, isLink: !isEmpty(owner?.name),
visible: [ visible: [DRAWER_NAVIGATION_OPTIONS.lineage],
DRAWER_NAVIGATION_OPTIONS.lineage,
DRAWER_NAVIGATION_OPTIONS.explore,
],
}, },
{ {
name: i18next.t('label.service'), name: i18next.t('label.service'),