mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-09-01 05:03:10 +00:00
fix(ui): update details on task resolve (#12117)
This commit is contained in:
parent
1116d98703
commit
881a63e5b4
@ -61,6 +61,7 @@ export const ActivityFeedTab = ({
|
|||||||
description,
|
description,
|
||||||
columns,
|
columns,
|
||||||
entityType,
|
entityType,
|
||||||
|
onUpdateEntityDetails,
|
||||||
}: ActivityFeedTabProps) => {
|
}: ActivityFeedTabProps) => {
|
||||||
const history = useHistory();
|
const history = useHistory();
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
@ -395,6 +396,7 @@ export const ActivityFeedTab = ({
|
|||||||
owner={owner}
|
owner={owner}
|
||||||
tags={tags}
|
tags={tags}
|
||||||
task={selectedThread}
|
task={selectedThread}
|
||||||
|
onUpdateEntityDetails={onUpdateEntityDetails}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<TaskTab
|
<TaskTab
|
||||||
@ -403,6 +405,7 @@ export const ActivityFeedTab = ({
|
|||||||
owner={owner}
|
owner={owner}
|
||||||
tags={tags}
|
tags={tags}
|
||||||
task={selectedThread}
|
task={selectedThread}
|
||||||
|
onUpdateEntityDetails={onUpdateEntityDetails}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
@ -26,6 +26,7 @@ export enum ActivityFeedTabs {
|
|||||||
export interface ActivityFeedTabBasicProps {
|
export interface ActivityFeedTabBasicProps {
|
||||||
fqn: string;
|
fqn: string;
|
||||||
onFeedUpdate: () => void;
|
onFeedUpdate: () => void;
|
||||||
|
onUpdateEntityDetails?: () => void;
|
||||||
owner?: EntityReference;
|
owner?: EntityReference;
|
||||||
tags?: TagLabel[];
|
tags?: TagLabel[];
|
||||||
description?: string;
|
description?: string;
|
||||||
|
@ -34,6 +34,7 @@ import {
|
|||||||
import { getDashboardDetailsPath } from 'constants/constants';
|
import { getDashboardDetailsPath } from 'constants/constants';
|
||||||
import { compare } from 'fast-json-patch';
|
import { compare } from 'fast-json-patch';
|
||||||
import { TagSource } from 'generated/type/schema';
|
import { TagSource } from 'generated/type/schema';
|
||||||
|
import { EntityFieldThreadCount } from 'interface/feed.interface';
|
||||||
import { isEmpty, isUndefined, map } from 'lodash';
|
import { isEmpty, isUndefined, map } from 'lodash';
|
||||||
import { EntityTags, TagOption } from 'Models';
|
import { EntityTags, TagOption } from 'Models';
|
||||||
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
||||||
@ -52,7 +53,11 @@ import { EntityTabs, EntityType } from '../../enums/entity.enum';
|
|||||||
import { Dashboard } from '../../generated/entity/data/dashboard';
|
import { Dashboard } from '../../generated/entity/data/dashboard';
|
||||||
import { ThreadType } from '../../generated/entity/feed/thread';
|
import { ThreadType } from '../../generated/entity/feed/thread';
|
||||||
import { LabelType, State, TagLabel } from '../../generated/type/tagLabel';
|
import { LabelType, State, TagLabel } from '../../generated/type/tagLabel';
|
||||||
import { getCurrentUserId, refreshPage } from '../../utils/CommonUtils';
|
import {
|
||||||
|
getCurrentUserId,
|
||||||
|
getFeedCounts,
|
||||||
|
refreshPage,
|
||||||
|
} from '../../utils/CommonUtils';
|
||||||
import { getEntityFieldThreadCounts } from '../../utils/FeedUtils';
|
import { getEntityFieldThreadCounts } from '../../utils/FeedUtils';
|
||||||
import { DEFAULT_ENTITY_PERMISSION } from '../../utils/PermissionsUtils';
|
import { DEFAULT_ENTITY_PERMISSION } from '../../utils/PermissionsUtils';
|
||||||
import { getTagsWithoutTier, getTierTags } from '../../utils/TableUtils';
|
import { getTagsWithoutTier, getTierTags } from '../../utils/TableUtils';
|
||||||
@ -79,10 +84,7 @@ const DashboardDetails = ({
|
|||||||
chartDescriptionUpdateHandler,
|
chartDescriptionUpdateHandler,
|
||||||
chartTagUpdateHandler,
|
chartTagUpdateHandler,
|
||||||
versionHandler,
|
versionHandler,
|
||||||
feedCount,
|
|
||||||
entityFieldThreadCount,
|
|
||||||
createThread,
|
createThread,
|
||||||
entityFieldTaskCount,
|
|
||||||
onDashboardUpdate,
|
onDashboardUpdate,
|
||||||
}: DashboardDetailsProps) => {
|
}: DashboardDetailsProps) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
@ -96,6 +98,13 @@ const DashboardDetails = ({
|
|||||||
chart: ChartType;
|
chart: ChartType;
|
||||||
index: number;
|
index: number;
|
||||||
}>();
|
}>();
|
||||||
|
const [feedCount, setFeedCount] = useState<number>(0);
|
||||||
|
const [entityFieldThreadCount, setEntityFieldThreadCount] = useState<
|
||||||
|
EntityFieldThreadCount[]
|
||||||
|
>([]);
|
||||||
|
const [entityFieldTaskCount, setEntityFieldTaskCount] = useState<
|
||||||
|
EntityFieldThreadCount[]
|
||||||
|
>([]);
|
||||||
|
|
||||||
const [tagFetchFailed, setTagFetchFailed] = useState<boolean>(false);
|
const [tagFetchFailed, setTagFetchFailed] = useState<boolean>(false);
|
||||||
const [isTagLoading, setIsTagLoading] = useState<boolean>(false);
|
const [isTagLoading, setIsTagLoading] = useState<boolean>(false);
|
||||||
@ -182,6 +191,20 @@ const DashboardDetails = ({
|
|||||||
}
|
}
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
const getEntityFeedCount = () => {
|
||||||
|
getFeedCounts(
|
||||||
|
EntityType.DASHBOARD,
|
||||||
|
dashboardFQN,
|
||||||
|
setEntityFieldThreadCount,
|
||||||
|
setEntityFieldTaskCount,
|
||||||
|
setFeedCount
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
getEntityFeedCount();
|
||||||
|
}, [dashboardFQN]);
|
||||||
|
|
||||||
const getAllChartsPermissions = useCallback(
|
const getAllChartsPermissions = useCallback(
|
||||||
async (charts: ChartType[]) => {
|
async (charts: ChartType[]) => {
|
||||||
const permissionsArray: Array<ChartsPermissions> = [];
|
const permissionsArray: Array<ChartsPermissions> = [];
|
||||||
@ -690,7 +713,7 @@ const DashboardDetails = ({
|
|||||||
<ActivityFeedTab
|
<ActivityFeedTab
|
||||||
entityType={EntityType.DASHBOARD}
|
entityType={EntityType.DASHBOARD}
|
||||||
fqn={dashboardDetails?.fullyQualifiedName ?? ''}
|
fqn={dashboardDetails?.fullyQualifiedName ?? ''}
|
||||||
onFeedUpdate={() => Promise.resolve()}
|
onFeedUpdate={getEntityFeedCount}
|
||||||
/>
|
/>
|
||||||
</ActivityFeedProvider>
|
</ActivityFeedProvider>
|
||||||
),
|
),
|
||||||
|
@ -16,7 +16,6 @@ import { Operation } from 'fast-json-patch';
|
|||||||
import { CreateThread } from '../../generated/api/feed/createThread';
|
import { CreateThread } from '../../generated/api/feed/createThread';
|
||||||
import { Chart } from '../../generated/entity/data/chart';
|
import { Chart } from '../../generated/entity/data/chart';
|
||||||
import { Dashboard } from '../../generated/entity/data/dashboard';
|
import { Dashboard } from '../../generated/entity/data/dashboard';
|
||||||
import { EntityFieldThreadCount } from '../../interface/feed.interface';
|
|
||||||
|
|
||||||
export interface ChartType extends Chart {
|
export interface ChartType extends Chart {
|
||||||
displayName: string;
|
displayName: string;
|
||||||
@ -29,9 +28,6 @@ export interface ChartsPermissions {
|
|||||||
export interface DashboardDetailsProps {
|
export interface DashboardDetailsProps {
|
||||||
charts: Array<ChartType>;
|
charts: Array<ChartType>;
|
||||||
dashboardDetails: Dashboard;
|
dashboardDetails: Dashboard;
|
||||||
feedCount: number;
|
|
||||||
entityFieldThreadCount: EntityFieldThreadCount[];
|
|
||||||
entityFieldTaskCount: EntityFieldThreadCount[];
|
|
||||||
createThread: (data: CreateThread) => void;
|
createThread: (data: CreateThread) => void;
|
||||||
followDashboardHandler: () => Promise<void>;
|
followDashboardHandler: () => Promise<void>;
|
||||||
unFollowDashboardHandler: () => Promise<void>;
|
unFollowDashboardHandler: () => Promise<void>;
|
||||||
|
@ -65,9 +65,6 @@ const dashboardDetailsProps: DashboardDetailsProps = {
|
|||||||
chartTagUpdateHandler: jest.fn(),
|
chartTagUpdateHandler: jest.fn(),
|
||||||
onDashboardUpdate: jest.fn(),
|
onDashboardUpdate: jest.fn(),
|
||||||
versionHandler: jest.fn(),
|
versionHandler: jest.fn(),
|
||||||
feedCount: 0,
|
|
||||||
entityFieldThreadCount: [],
|
|
||||||
entityFieldTaskCount: [],
|
|
||||||
createThread: jest.fn(),
|
createThread: jest.fn(),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -30,11 +30,13 @@ import { EntityField } from 'constants/Feeds.constants';
|
|||||||
import { CSMode } from 'enums/codemirror.enum';
|
import { CSMode } from 'enums/codemirror.enum';
|
||||||
import { EntityTabs, EntityType } from 'enums/entity.enum';
|
import { EntityTabs, EntityType } from 'enums/entity.enum';
|
||||||
import { LabelType, State, TagLabel, TagSource } from 'generated/type/tagLabel';
|
import { LabelType, State, TagLabel, TagSource } from 'generated/type/tagLabel';
|
||||||
import { isUndefined, toString } from 'lodash';
|
import { EntityFieldThreadCount } from 'interface/feed.interface';
|
||||||
|
import { isUndefined, noop, toString } from 'lodash';
|
||||||
import { EntityTags } from 'Models';
|
import { EntityTags } from 'Models';
|
||||||
import React, { useMemo, useState } from 'react';
|
import React, { useEffect, useMemo, useState } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { useHistory, useParams } from 'react-router-dom';
|
import { useHistory, useParams } from 'react-router-dom';
|
||||||
|
import { getFeedCounts } from 'utils/CommonUtils';
|
||||||
import { getEntityName, getEntityThreadLink } from 'utils/EntityUtils';
|
import { getEntityName, getEntityThreadLink } from 'utils/EntityUtils';
|
||||||
import { getEntityFieldThreadCounts } from 'utils/FeedUtils';
|
import { getEntityFieldThreadCounts } from 'utils/FeedUtils';
|
||||||
import { getTagsWithoutTier } from 'utils/TableUtils';
|
import { getTagsWithoutTier } from 'utils/TableUtils';
|
||||||
@ -42,8 +44,6 @@ import { DataModelDetailsProps } from './DataModelDetails.interface';
|
|||||||
import ModelTab from './ModelTab/ModelTab.component';
|
import ModelTab from './ModelTab/ModelTab.component';
|
||||||
|
|
||||||
const DataModelDetails = ({
|
const DataModelDetails = ({
|
||||||
entityFieldThreadCount,
|
|
||||||
feedCount,
|
|
||||||
dataModelData,
|
dataModelData,
|
||||||
dataModelPermissions,
|
dataModelPermissions,
|
||||||
createThread,
|
createThread,
|
||||||
@ -63,6 +63,10 @@ const DataModelDetails = ({
|
|||||||
|
|
||||||
const [isEditDescription, setIsEditDescription] = useState<boolean>(false);
|
const [isEditDescription, setIsEditDescription] = useState<boolean>(false);
|
||||||
const [threadLink, setThreadLink] = useState<string>('');
|
const [threadLink, setThreadLink] = useState<string>('');
|
||||||
|
const [feedCount, setFeedCount] = useState<number>(0);
|
||||||
|
const [entityFieldThreadCount, setEntityFieldThreadCount] = useState<
|
||||||
|
EntityFieldThreadCount[]
|
||||||
|
>([]);
|
||||||
|
|
||||||
const {
|
const {
|
||||||
hasEditDescriptionPermission,
|
hasEditDescriptionPermission,
|
||||||
@ -91,6 +95,20 @@ const DataModelDetails = ({
|
|||||||
};
|
};
|
||||||
}, [dataModelData]);
|
}, [dataModelData]);
|
||||||
|
|
||||||
|
const getEntityFeedCount = () => {
|
||||||
|
getFeedCounts(
|
||||||
|
EntityType.DASHBOARD_DATA_MODEL,
|
||||||
|
dashboardDataModelFQN,
|
||||||
|
setEntityFieldThreadCount,
|
||||||
|
noop,
|
||||||
|
setFeedCount
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
dashboardDataModelFQN && getEntityFeedCount();
|
||||||
|
}, [dashboardDataModelFQN]);
|
||||||
|
|
||||||
const handleUpdateDisplayName = async (data: EntityName) => {
|
const handleUpdateDisplayName = async (data: EntityName) => {
|
||||||
if (isUndefined(dataModelData)) {
|
if (isUndefined(dataModelData)) {
|
||||||
return;
|
return;
|
||||||
@ -247,7 +265,7 @@ const DataModelDetails = ({
|
|||||||
<ActivityFeedTab
|
<ActivityFeedTab
|
||||||
entityType={EntityType.DASHBOARD_DATA_MODEL}
|
entityType={EntityType.DASHBOARD_DATA_MODEL}
|
||||||
fqn={dataModelData?.fullyQualifiedName ?? ''}
|
fqn={dataModelData?.fullyQualifiedName ?? ''}
|
||||||
onFeedUpdate={() => Promise.resolve()}
|
onFeedUpdate={getEntityFeedCount}
|
||||||
/>
|
/>
|
||||||
</ActivityFeedProvider>
|
</ActivityFeedProvider>
|
||||||
),
|
),
|
||||||
|
@ -16,12 +16,9 @@ import { CreateThread } from 'generated/api/feed/createThread';
|
|||||||
import { DashboardDataModel } from 'generated/entity/data/dashboardDataModel';
|
import { DashboardDataModel } from 'generated/entity/data/dashboardDataModel';
|
||||||
import { Column } from 'generated/entity/data/table';
|
import { Column } from 'generated/entity/data/table';
|
||||||
import { EntityReference } from 'generated/entity/type';
|
import { EntityReference } from 'generated/entity/type';
|
||||||
import { EntityFieldThreadCount } from 'interface/feed.interface';
|
|
||||||
import { EntityTags } from 'Models';
|
import { EntityTags } from 'Models';
|
||||||
|
|
||||||
export interface DataModelDetailsProps {
|
export interface DataModelDetailsProps {
|
||||||
entityFieldThreadCount: EntityFieldThreadCount[];
|
|
||||||
feedCount: number;
|
|
||||||
dataModelData: DashboardDataModel;
|
dataModelData: DashboardDataModel;
|
||||||
dataModelPermissions: OperationPermission;
|
dataModelPermissions: OperationPermission;
|
||||||
createThread: (data: CreateThread) => void;
|
createThread: (data: CreateThread) => void;
|
||||||
|
@ -25,6 +25,7 @@ import { EntityName } from 'components/Modals/EntityNameModal/EntityNameModal.in
|
|||||||
import TabsLabel from 'components/TabsLabel/TabsLabel.component';
|
import TabsLabel from 'components/TabsLabel/TabsLabel.component';
|
||||||
import TagsContainerV1 from 'components/Tag/TagsContainerV1/TagsContainerV1';
|
import TagsContainerV1 from 'components/Tag/TagsContainerV1/TagsContainerV1';
|
||||||
import { TagLabel, TagSource } from 'generated/type/schema';
|
import { TagLabel, TagSource } from 'generated/type/schema';
|
||||||
|
import { EntityFieldThreadCount } from 'interface/feed.interface';
|
||||||
import { isEmpty } from 'lodash';
|
import { isEmpty } from 'lodash';
|
||||||
import { EntityTags } from 'Models';
|
import { EntityTags } from 'Models';
|
||||||
import React, { FC, useCallback, useEffect, useMemo, useState } from 'react';
|
import React, { FC, useCallback, useEffect, useMemo, useState } from 'react';
|
||||||
@ -40,7 +41,11 @@ import { MlHyperParameter } from '../../generated/api/data/createMlModel';
|
|||||||
import { Mlmodel, MlStore } from '../../generated/entity/data/mlmodel';
|
import { Mlmodel, MlStore } from '../../generated/entity/data/mlmodel';
|
||||||
import { ThreadType } from '../../generated/entity/feed/thread';
|
import { ThreadType } from '../../generated/entity/feed/thread';
|
||||||
import { LabelType, State } from '../../generated/type/tagLabel';
|
import { LabelType, State } from '../../generated/type/tagLabel';
|
||||||
import { getEmptyPlaceholder, refreshPage } from '../../utils/CommonUtils';
|
import {
|
||||||
|
getEmptyPlaceholder,
|
||||||
|
getFeedCounts,
|
||||||
|
refreshPage,
|
||||||
|
} from '../../utils/CommonUtils';
|
||||||
import { getEntityFieldThreadCounts } from '../../utils/FeedUtils';
|
import { getEntityFieldThreadCounts } from '../../utils/FeedUtils';
|
||||||
import { DEFAULT_ENTITY_PERMISSION } from '../../utils/PermissionsUtils';
|
import { DEFAULT_ENTITY_PERMISSION } from '../../utils/PermissionsUtils';
|
||||||
import { getTagsWithoutTier, getTierTags } from '../../utils/TableUtils';
|
import { getTagsWithoutTier, getTierTags } from '../../utils/TableUtils';
|
||||||
@ -62,10 +67,8 @@ const MlModelDetail: FC<MlModelDetailProp> = ({
|
|||||||
settingsUpdateHandler,
|
settingsUpdateHandler,
|
||||||
updateMlModelFeatures,
|
updateMlModelFeatures,
|
||||||
onExtensionUpdate,
|
onExtensionUpdate,
|
||||||
feedCount,
|
|
||||||
createThread,
|
createThread,
|
||||||
entityFieldTaskCount,
|
|
||||||
entityFieldThreadCount,
|
|
||||||
versionHandler,
|
versionHandler,
|
||||||
tagUpdateHandler,
|
tagUpdateHandler,
|
||||||
}) => {
|
}) => {
|
||||||
@ -76,6 +79,13 @@ const MlModelDetail: FC<MlModelDetailProp> = ({
|
|||||||
useParams<{ tab: EntityTabs; mlModelFqn: string }>();
|
useParams<{ tab: EntityTabs; mlModelFqn: string }>();
|
||||||
|
|
||||||
const [isEdit, setIsEdit] = useState<boolean>(false);
|
const [isEdit, setIsEdit] = useState<boolean>(false);
|
||||||
|
const [feedCount, setFeedCount] = useState<number>(0);
|
||||||
|
const [entityFieldThreadCount, setEntityFieldThreadCount] = useState<
|
||||||
|
EntityFieldThreadCount[]
|
||||||
|
>([]);
|
||||||
|
const [entityFieldTaskCount, setEntityFieldTaskCount] = useState<
|
||||||
|
EntityFieldThreadCount[]
|
||||||
|
>([]);
|
||||||
|
|
||||||
const [mlModelPermissions, setPipelinePermissions] = useState(
|
const [mlModelPermissions, setPipelinePermissions] = useState(
|
||||||
DEFAULT_ENTITY_PERMISSION
|
DEFAULT_ENTITY_PERMISSION
|
||||||
@ -127,6 +137,22 @@ const MlModelDetail: FC<MlModelDetailProp> = ({
|
|||||||
};
|
};
|
||||||
}, [mlModelDetail]);
|
}, [mlModelDetail]);
|
||||||
|
|
||||||
|
const fetchEntityFeedCount = () => {
|
||||||
|
getFeedCounts(
|
||||||
|
EntityType.MLMODEL,
|
||||||
|
mlModelFqn,
|
||||||
|
setEntityFieldThreadCount,
|
||||||
|
setEntityFieldTaskCount,
|
||||||
|
setFeedCount
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (mlModelPermissions.ViewAll || mlModelPermissions.ViewBasic) {
|
||||||
|
fetchEntityFeedCount();
|
||||||
|
}
|
||||||
|
}, [mlModelPermissions, mlModelFqn]);
|
||||||
|
|
||||||
const handleTabChange = (activeKey: string) => {
|
const handleTabChange = (activeKey: string) => {
|
||||||
if (activeKey !== activeTab) {
|
if (activeKey !== activeTab) {
|
||||||
history.push(getMlModelDetailsPath(mlModelFqn, activeKey));
|
history.push(getMlModelDetailsPath(mlModelFqn, activeKey));
|
||||||
@ -442,7 +468,7 @@ const MlModelDetail: FC<MlModelDetailProp> = ({
|
|||||||
<ActivityFeedTab
|
<ActivityFeedTab
|
||||||
entityType={EntityType.MLMODEL}
|
entityType={EntityType.MLMODEL}
|
||||||
fqn={mlModelDetail?.fullyQualifiedName ?? ''}
|
fqn={mlModelDetail?.fullyQualifiedName ?? ''}
|
||||||
onFeedUpdate={() => Promise.resolve()}
|
onFeedUpdate={fetchEntityFeedCount}
|
||||||
/>
|
/>
|
||||||
</ActivityFeedProvider>
|
</ActivityFeedProvider>
|
||||||
),
|
),
|
||||||
|
@ -14,12 +14,10 @@
|
|||||||
import { HTMLAttributes } from 'react';
|
import { HTMLAttributes } from 'react';
|
||||||
import { CreateThread } from '../../generated/api/feed/createThread';
|
import { CreateThread } from '../../generated/api/feed/createThread';
|
||||||
import { Mlmodel } from '../../generated/entity/data/mlmodel';
|
import { Mlmodel } from '../../generated/entity/data/mlmodel';
|
||||||
import { EntityFieldThreadCount } from '../../interface/feed.interface';
|
|
||||||
|
|
||||||
export interface MlModelDetailProp extends HTMLAttributes<HTMLDivElement> {
|
export interface MlModelDetailProp extends HTMLAttributes<HTMLDivElement> {
|
||||||
mlModelDetail: Mlmodel;
|
mlModelDetail: Mlmodel;
|
||||||
version?: string;
|
version?: string;
|
||||||
feedCount: number;
|
|
||||||
followMlModelHandler: () => Promise<void>;
|
followMlModelHandler: () => Promise<void>;
|
||||||
unFollowMlModelHandler: () => Promise<void>;
|
unFollowMlModelHandler: () => Promise<void>;
|
||||||
descriptionUpdateHandler: (updatedMlModel: Mlmodel) => Promise<void>;
|
descriptionUpdateHandler: (updatedMlModel: Mlmodel) => Promise<void>;
|
||||||
@ -28,7 +26,5 @@ export interface MlModelDetailProp extends HTMLAttributes<HTMLDivElement> {
|
|||||||
settingsUpdateHandler: (updatedMlModel: Mlmodel) => Promise<void>;
|
settingsUpdateHandler: (updatedMlModel: Mlmodel) => Promise<void>;
|
||||||
versionHandler: () => void;
|
versionHandler: () => void;
|
||||||
onExtensionUpdate: (updatedMlModel: Mlmodel) => Promise<void>;
|
onExtensionUpdate: (updatedMlModel: Mlmodel) => Promise<void>;
|
||||||
entityFieldThreadCount: EntityFieldThreadCount[];
|
|
||||||
entityFieldTaskCount: EntityFieldThreadCount[];
|
|
||||||
createThread: (data: CreateThread) => void;
|
createThread: (data: CreateThread) => void;
|
||||||
}
|
}
|
||||||
|
@ -700,7 +700,7 @@ const PipelineDetails = ({
|
|||||||
<ActivityFeedTab
|
<ActivityFeedTab
|
||||||
entityType={EntityType.PIPELINE}
|
entityType={EntityType.PIPELINE}
|
||||||
fqn={pipelineDetails?.fullyQualifiedName ?? ''}
|
fqn={pipelineDetails?.fullyQualifiedName ?? ''}
|
||||||
onFeedUpdate={() => Promise.resolve()}
|
onFeedUpdate={getEntityFeedCount}
|
||||||
/>
|
/>
|
||||||
</ActivityFeedProvider>
|
</ActivityFeedProvider>
|
||||||
),
|
),
|
||||||
|
@ -158,6 +158,7 @@ export const TaskTab = ({
|
|||||||
updateTask(TaskOperation.RESOLVE, taskDetails?.id + '', data)
|
updateTask(TaskOperation.RESOLVE, taskDetails?.id + '', data)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
showSuccessToast(t('server.task-resolved-successfully'));
|
showSuccessToast(t('server.task-resolved-successfully'));
|
||||||
|
rest.onUpdateEntityDetails?.();
|
||||||
history.push(getEntityLink(entityType ?? '', entityFQN ?? ''));
|
history.push(getEntityLink(entityType ?? '', entityFQN ?? ''));
|
||||||
})
|
})
|
||||||
.catch((err: AxiosError) => showErrorToast(err));
|
.catch((err: AxiosError) => showErrorToast(err));
|
||||||
|
@ -20,6 +20,7 @@ export type TaskTabProps = {
|
|||||||
task: Thread;
|
task: Thread;
|
||||||
owner?: EntityReference;
|
owner?: EntityReference;
|
||||||
tags?: TagLabel[];
|
tags?: TagLabel[];
|
||||||
|
onUpdateEntityDetails?: () => void;
|
||||||
description?: string;
|
description?: string;
|
||||||
} & (
|
} & (
|
||||||
| TableTaskTabProps
|
| TableTaskTabProps
|
||||||
|
@ -1077,7 +1077,7 @@ const TeamDetailsV1 = ({
|
|||||||
onChange={updateActiveTab}
|
onChange={updateActiveTab}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<div className="flex-grow d-flex flex-col tw-pt-4">
|
<div className="flex-grow d-flex flex-col">
|
||||||
{currentTab === TeamsPageTab.TEAMS &&
|
{currentTab === TeamsPageTab.TEAMS &&
|
||||||
(currentTeam.childrenCount === 0 && !searchTerm ? (
|
(currentTeam.childrenCount === 0 && !searchTerm ? (
|
||||||
fetchErrorPlaceHolder({
|
fetchErrorPlaceHolder({
|
||||||
@ -1113,6 +1113,7 @@ const TeamDetailsV1 = ({
|
|||||||
{t('label.deleted')}
|
{t('label.deleted')}
|
||||||
</Typography.Text>
|
</Typography.Text>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
data-testid="add-team"
|
data-testid="add-team"
|
||||||
disabled={!createTeamPermission}
|
disabled={!createTeamPermission}
|
||||||
|
@ -25,6 +25,7 @@ import TabsLabel from 'components/TabsLabel/TabsLabel.component';
|
|||||||
import TagsContainerV1 from 'components/Tag/TagsContainerV1/TagsContainerV1';
|
import TagsContainerV1 from 'components/Tag/TagsContainerV1/TagsContainerV1';
|
||||||
import { getTopicDetailsPath } from 'constants/constants';
|
import { getTopicDetailsPath } from 'constants/constants';
|
||||||
import { TagLabel } from 'generated/type/schema';
|
import { TagLabel } from 'generated/type/schema';
|
||||||
|
import { EntityFieldThreadCount } from 'interface/feed.interface';
|
||||||
import { EntityTags } from 'Models';
|
import { EntityTags } from 'Models';
|
||||||
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';
|
||||||
@ -36,7 +37,11 @@ import { EntityTabs, EntityType } from '../../enums/entity.enum';
|
|||||||
import { Topic } from '../../generated/entity/data/topic';
|
import { Topic } from '../../generated/entity/data/topic';
|
||||||
import { ThreadType } from '../../generated/entity/feed/thread';
|
import { ThreadType } from '../../generated/entity/feed/thread';
|
||||||
import { LabelType, State, TagSource } from '../../generated/type/tagLabel';
|
import { LabelType, State, TagSource } from '../../generated/type/tagLabel';
|
||||||
import { getCurrentUserId, refreshPage } from '../../utils/CommonUtils';
|
import {
|
||||||
|
getCurrentUserId,
|
||||||
|
getFeedCounts,
|
||||||
|
refreshPage,
|
||||||
|
} from '../../utils/CommonUtils';
|
||||||
import { getEntityFieldThreadCounts } from '../../utils/FeedUtils';
|
import { getEntityFieldThreadCounts } from '../../utils/FeedUtils';
|
||||||
import { DEFAULT_ENTITY_PERMISSION } from '../../utils/PermissionsUtils';
|
import { DEFAULT_ENTITY_PERMISSION } from '../../utils/PermissionsUtils';
|
||||||
import { getTagsWithoutTier, getTierTags } from '../../utils/TableUtils';
|
import { getTagsWithoutTier, getTierTags } from '../../utils/TableUtils';
|
||||||
@ -60,10 +65,8 @@ const TopicDetails: React.FC<TopicDetailsProps> = ({
|
|||||||
followTopicHandler,
|
followTopicHandler,
|
||||||
unFollowTopicHandler,
|
unFollowTopicHandler,
|
||||||
versionHandler,
|
versionHandler,
|
||||||
feedCount,
|
|
||||||
entityFieldThreadCount,
|
|
||||||
createThread,
|
createThread,
|
||||||
entityFieldTaskCount,
|
|
||||||
onTopicUpdate,
|
onTopicUpdate,
|
||||||
}: TopicDetailsProps) => {
|
}: TopicDetailsProps) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
@ -73,6 +76,13 @@ const TopicDetails: React.FC<TopicDetailsProps> = ({
|
|||||||
const history = useHistory();
|
const history = useHistory();
|
||||||
const [isEdit, setIsEdit] = useState(false);
|
const [isEdit, setIsEdit] = useState(false);
|
||||||
const [threadLink, setThreadLink] = useState<string>('');
|
const [threadLink, setThreadLink] = useState<string>('');
|
||||||
|
const [feedCount, setFeedCount] = useState<number>(0);
|
||||||
|
const [entityFieldThreadCount, setEntityFieldThreadCount] = useState<
|
||||||
|
EntityFieldThreadCount[]
|
||||||
|
>([]);
|
||||||
|
const [entityFieldTaskCount, setEntityFieldTaskCount] = useState<
|
||||||
|
EntityFieldThreadCount[]
|
||||||
|
>([]);
|
||||||
|
|
||||||
const [threadType, setThreadType] = useState<ThreadType>(
|
const [threadType, setThreadType] = useState<ThreadType>(
|
||||||
ThreadType.Conversation
|
ThreadType.Conversation
|
||||||
@ -261,6 +271,22 @@ const TopicDetails: React.FC<TopicDetailsProps> = ({
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const getEntityFeedCount = () => {
|
||||||
|
getFeedCounts(
|
||||||
|
EntityType.TOPIC,
|
||||||
|
topicFQN,
|
||||||
|
setEntityFieldThreadCount,
|
||||||
|
setEntityFieldTaskCount,
|
||||||
|
setFeedCount
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (topicPermissions.ViewAll || topicPermissions.ViewBasic) {
|
||||||
|
getEntityFeedCount();
|
||||||
|
}
|
||||||
|
}, [topicPermissions, topicFQN]);
|
||||||
|
|
||||||
const tabs = useMemo(
|
const tabs = useMemo(
|
||||||
() => [
|
() => [
|
||||||
{
|
{
|
||||||
@ -355,7 +381,7 @@ const TopicDetails: React.FC<TopicDetailsProps> = ({
|
|||||||
<ActivityFeedTab
|
<ActivityFeedTab
|
||||||
entityType={EntityType.TOPIC}
|
entityType={EntityType.TOPIC}
|
||||||
fqn={topicDetails?.fullyQualifiedName ?? ''}
|
fqn={topicDetails?.fullyQualifiedName ?? ''}
|
||||||
onFeedUpdate={() => Promise.resolve()}
|
onFeedUpdate={getEntityFeedCount}
|
||||||
/>
|
/>
|
||||||
</ActivityFeedProvider>
|
</ActivityFeedProvider>
|
||||||
),
|
),
|
||||||
|
@ -14,13 +14,9 @@
|
|||||||
import { CreateThread } from '../../generated/api/feed/createThread';
|
import { CreateThread } from '../../generated/api/feed/createThread';
|
||||||
import { CleanupPolicy, Topic } from '../../generated/entity/data/topic';
|
import { CleanupPolicy, Topic } from '../../generated/entity/data/topic';
|
||||||
import { SchemaType } from '../../generated/type/schema';
|
import { SchemaType } from '../../generated/type/schema';
|
||||||
import { EntityFieldThreadCount } from '../../interface/feed.interface';
|
|
||||||
|
|
||||||
export interface TopicDetailsProps {
|
export interface TopicDetailsProps {
|
||||||
topicDetails: Topic;
|
topicDetails: Topic;
|
||||||
feedCount: number;
|
|
||||||
entityFieldThreadCount: EntityFieldThreadCount[];
|
|
||||||
entityFieldTaskCount: EntityFieldThreadCount[];
|
|
||||||
createThread: (data: CreateThread) => void;
|
createThread: (data: CreateThread) => void;
|
||||||
followTopicHandler: () => Promise<void>;
|
followTopicHandler: () => Promise<void>;
|
||||||
unFollowTopicHandler: () => Promise<void>;
|
unFollowTopicHandler: () => Promise<void>;
|
||||||
|
@ -54,9 +54,6 @@ const topicDetailsProps: TopicDetailsProps = {
|
|||||||
unFollowTopicHandler: jest.fn(),
|
unFollowTopicHandler: jest.fn(),
|
||||||
onTopicUpdate: jest.fn(),
|
onTopicUpdate: jest.fn(),
|
||||||
versionHandler: jest.fn(),
|
versionHandler: jest.fn(),
|
||||||
feedCount: 0,
|
|
||||||
entityFieldThreadCount: [],
|
|
||||||
entityFieldTaskCount: [],
|
|
||||||
createThread: jest.fn(),
|
createThread: jest.fn(),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ import { SearchedDataProps } from 'components/searched-data/SearchedData.interfa
|
|||||||
import TabsLabel from 'components/TabsLabel/TabsLabel.component';
|
import TabsLabel from 'components/TabsLabel/TabsLabel.component';
|
||||||
import TeamsSelectable from 'components/TeamsSelectable/TeamsSelectable';
|
import TeamsSelectable from 'components/TeamsSelectable/TeamsSelectable';
|
||||||
import { EntityType } from 'enums/entity.enum';
|
import { EntityType } from 'enums/entity.enum';
|
||||||
import { isEmpty, toLower } from 'lodash';
|
import { isEmpty, noop, toLower } from 'lodash';
|
||||||
import { observer } from 'mobx-react';
|
import { observer } from 'mobx-react';
|
||||||
import React, {
|
import React, {
|
||||||
Fragment,
|
Fragment,
|
||||||
@ -729,7 +729,7 @@ const Users = ({
|
|||||||
<ActivityFeedTab
|
<ActivityFeedTab
|
||||||
entityType={EntityType.USER_NAME}
|
entityType={EntityType.USER_NAME}
|
||||||
fqn={username}
|
fqn={username}
|
||||||
onFeedUpdate={() => Promise.resolve()}
|
onFeedUpdate={noop}
|
||||||
/>
|
/>
|
||||||
</ActivityFeedProvider>
|
</ActivityFeedProvider>
|
||||||
);
|
);
|
||||||
|
@ -674,7 +674,8 @@ const ContainerPage = () => {
|
|||||||
<ActivityFeedTab
|
<ActivityFeedTab
|
||||||
entityType={EntityType.CONTAINER}
|
entityType={EntityType.CONTAINER}
|
||||||
fqn={containerName}
|
fqn={containerName}
|
||||||
onFeedUpdate={() => Promise.resolve()}
|
onFeedUpdate={getEntityFeedCount}
|
||||||
|
onUpdateEntityDetails={() => fetchContainerDetail(containerName)}
|
||||||
/>
|
/>
|
||||||
</ActivityFeedProvider>
|
</ActivityFeedProvider>
|
||||||
),
|
),
|
||||||
|
@ -36,12 +36,10 @@ import { EntityType } from '../../enums/entity.enum';
|
|||||||
import { CreateThread } from '../../generated/api/feed/createThread';
|
import { CreateThread } from '../../generated/api/feed/createThread';
|
||||||
import { Chart } from '../../generated/entity/data/chart';
|
import { Chart } from '../../generated/entity/data/chart';
|
||||||
import { Dashboard } from '../../generated/entity/data/dashboard';
|
import { Dashboard } from '../../generated/entity/data/dashboard';
|
||||||
import { EntityFieldThreadCount } from '../../interface/feed.interface';
|
|
||||||
import {
|
import {
|
||||||
addToRecentViewed,
|
addToRecentViewed,
|
||||||
getCurrentUserId,
|
getCurrentUserId,
|
||||||
getEntityMissingError,
|
getEntityMissingError,
|
||||||
getFeedCounts,
|
|
||||||
} from '../../utils/CommonUtils';
|
} from '../../utils/CommonUtils';
|
||||||
import {
|
import {
|
||||||
defaultFields,
|
defaultFields,
|
||||||
@ -69,14 +67,6 @@ const DashboardDetailsPage = () => {
|
|||||||
const [charts, setCharts] = useState<ChartType[]>([]);
|
const [charts, setCharts] = useState<ChartType[]>([]);
|
||||||
const [isError, setIsError] = useState(false);
|
const [isError, setIsError] = useState(false);
|
||||||
|
|
||||||
const [feedCount, setFeedCount] = useState<number>(0);
|
|
||||||
const [entityFieldThreadCount, setEntityFieldThreadCount] = useState<
|
|
||||||
EntityFieldThreadCount[]
|
|
||||||
>([]);
|
|
||||||
const [entityFieldTaskCount, setEntityFieldTaskCount] = useState<
|
|
||||||
EntityFieldThreadCount[]
|
|
||||||
>([]);
|
|
||||||
|
|
||||||
const [dashboardPermissions, setDashboardPermissions] = useState(
|
const [dashboardPermissions, setDashboardPermissions] = useState(
|
||||||
DEFAULT_ENTITY_PERMISSION
|
DEFAULT_ENTITY_PERMISSION
|
||||||
);
|
);
|
||||||
@ -102,16 +92,6 @@ const DashboardDetailsPage = () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const getEntityFeedCount = () => {
|
|
||||||
getFeedCounts(
|
|
||||||
EntityType.DASHBOARD,
|
|
||||||
dashboardFQN,
|
|
||||||
setEntityFieldThreadCount,
|
|
||||||
setEntityFieldTaskCount,
|
|
||||||
setFeedCount
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
const saveUpdatedDashboardData = (updatedData: Dashboard) => {
|
const saveUpdatedDashboardData = (updatedData: Dashboard) => {
|
||||||
const jsonPatch = compare(
|
const jsonPatch = compare(
|
||||||
omitBy(dashboardDetails, isUndefined),
|
omitBy(dashboardDetails, isUndefined),
|
||||||
@ -183,8 +163,6 @@ const DashboardDetailsPage = () => {
|
|||||||
[key]: response[key],
|
[key]: response[key],
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
getEntityFeedCount();
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
showErrorToast(error as AxiosError);
|
showErrorToast(error as AxiosError);
|
||||||
}
|
}
|
||||||
@ -198,7 +176,6 @@ const DashboardDetailsPage = () => {
|
|||||||
...prev,
|
...prev,
|
||||||
followers: [...(prev?.followers ?? []), ...newValue],
|
followers: [...(prev?.followers ?? []), ...newValue],
|
||||||
}));
|
}));
|
||||||
getEntityFeedCount();
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
showErrorToast(
|
showErrorToast(
|
||||||
error as AxiosError,
|
error as AxiosError,
|
||||||
@ -221,8 +198,6 @@ const DashboardDetailsPage = () => {
|
|||||||
(follower) => follower.id !== oldValue[0].id
|
(follower) => follower.id !== oldValue[0].id
|
||||||
) ?? [],
|
) ?? [],
|
||||||
}));
|
}));
|
||||||
|
|
||||||
getEntityFeedCount();
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
showErrorToast(
|
showErrorToast(
|
||||||
error as AxiosError,
|
error as AxiosError,
|
||||||
@ -267,7 +242,6 @@ const DashboardDetailsPage = () => {
|
|||||||
// which leads to wrong PATCH payload sent after further tags removal
|
// which leads to wrong PATCH payload sent after further tags removal
|
||||||
return sortTagsForCharts(charts);
|
return sortTagsForCharts(charts);
|
||||||
});
|
});
|
||||||
getEntityFeedCount();
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
showErrorToast(
|
showErrorToast(
|
||||||
error as AxiosError,
|
error as AxiosError,
|
||||||
@ -288,7 +262,6 @@ const DashboardDetailsPage = () => {
|
|||||||
const createThread = async (data: CreateThread) => {
|
const createThread = async (data: CreateThread) => {
|
||||||
try {
|
try {
|
||||||
await postThread(data);
|
await postThread(data);
|
||||||
getEntityFeedCount();
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
showErrorToast(
|
showErrorToast(
|
||||||
error as AxiosError,
|
error as AxiosError,
|
||||||
@ -302,7 +275,6 @@ const DashboardDetailsPage = () => {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (dashboardPermissions.ViewAll || dashboardPermissions.ViewBasic) {
|
if (dashboardPermissions.ViewAll || dashboardPermissions.ViewBasic) {
|
||||||
fetchDashboardDetail(dashboardFQN);
|
fetchDashboardDetail(dashboardFQN);
|
||||||
getEntityFeedCount();
|
|
||||||
}
|
}
|
||||||
}, [dashboardFQN, dashboardPermissions]);
|
}, [dashboardFQN, dashboardPermissions]);
|
||||||
|
|
||||||
@ -331,9 +303,6 @@ const DashboardDetailsPage = () => {
|
|||||||
charts={charts}
|
charts={charts}
|
||||||
createThread={createThread}
|
createThread={createThread}
|
||||||
dashboardDetails={dashboardDetails}
|
dashboardDetails={dashboardDetails}
|
||||||
entityFieldTaskCount={entityFieldTaskCount}
|
|
||||||
entityFieldThreadCount={entityFieldThreadCount}
|
|
||||||
feedCount={feedCount}
|
|
||||||
followDashboardHandler={followDashboard}
|
followDashboardHandler={followDashboard}
|
||||||
unFollowDashboardHandler={unFollowDashboard}
|
unFollowDashboardHandler={unFollowDashboard}
|
||||||
versionHandler={versionHandler}
|
versionHandler={versionHandler}
|
||||||
|
@ -22,13 +22,11 @@ import {
|
|||||||
ResourceEntity,
|
ResourceEntity,
|
||||||
} from 'components/PermissionProvider/PermissionProvider.interface';
|
} from 'components/PermissionProvider/PermissionProvider.interface';
|
||||||
import { ERROR_PLACEHOLDER_TYPE } from 'enums/common.enum';
|
import { ERROR_PLACEHOLDER_TYPE } from 'enums/common.enum';
|
||||||
import { EntityType } from 'enums/entity.enum';
|
|
||||||
import { compare } from 'fast-json-patch';
|
import { compare } from 'fast-json-patch';
|
||||||
import { CreateThread } from 'generated/api/feed/createThread';
|
import { CreateThread } from 'generated/api/feed/createThread';
|
||||||
import { DashboardDataModel } from 'generated/entity/data/dashboardDataModel';
|
import { DashboardDataModel } from 'generated/entity/data/dashboardDataModel';
|
||||||
import { Include } from 'generated/type/include';
|
import { Include } from 'generated/type/include';
|
||||||
import { LabelType, State, TagSource } from 'generated/type/tagLabel';
|
import { LabelType, State, TagSource } from 'generated/type/tagLabel';
|
||||||
import { EntityFieldThreadCount } from 'interface/feed.interface';
|
|
||||||
import { isUndefined, omitBy } from 'lodash';
|
import { isUndefined, omitBy } from 'lodash';
|
||||||
import { observer } from 'mobx-react';
|
import { observer } from 'mobx-react';
|
||||||
import { EntityTags } from 'Models';
|
import { EntityTags } from 'Models';
|
||||||
@ -48,11 +46,7 @@ import {
|
|||||||
removeDataModelFollower,
|
removeDataModelFollower,
|
||||||
} from 'rest/dataModelsAPI';
|
} from 'rest/dataModelsAPI';
|
||||||
import { postThread } from 'rest/feedsAPI';
|
import { postThread } from 'rest/feedsAPI';
|
||||||
import {
|
import { getCurrentUserId, getEntityMissingError } from 'utils/CommonUtils';
|
||||||
getCurrentUserId,
|
|
||||||
getEntityMissingError,
|
|
||||||
getFeedCounts,
|
|
||||||
} from 'utils/CommonUtils';
|
|
||||||
import { getSortedDataModelColumnTags } from 'utils/DataModelsUtils';
|
import { getSortedDataModelColumnTags } from 'utils/DataModelsUtils';
|
||||||
import { DEFAULT_ENTITY_PERMISSION } from 'utils/PermissionsUtils';
|
import { DEFAULT_ENTITY_PERMISSION } from 'utils/PermissionsUtils';
|
||||||
import { getTagsWithoutTier, getTierTags } from 'utils/TableUtils';
|
import { getTagsWithoutTier, getTierTags } from 'utils/TableUtils';
|
||||||
@ -73,13 +67,6 @@ const DataModelsPage = () => {
|
|||||||
{} as DashboardDataModel
|
{} as DashboardDataModel
|
||||||
);
|
);
|
||||||
|
|
||||||
const [feedCount, setFeedCount] = useState<number>(0);
|
|
||||||
const [entityFieldThreadCount, setEntityFieldThreadCount] = useState<
|
|
||||||
EntityFieldThreadCount[]
|
|
||||||
>([]);
|
|
||||||
|
|
||||||
const [, setEntityFieldTaskCount] = useState<EntityFieldThreadCount[]>([]);
|
|
||||||
|
|
||||||
// get current user details
|
// get current user details
|
||||||
const currentUser = useMemo(
|
const currentUser = useMemo(
|
||||||
() => AppState.getCurrentUserDetails(),
|
() => AppState.getCurrentUserDetails(),
|
||||||
@ -102,16 +89,6 @@ const DataModelsPage = () => {
|
|||||||
};
|
};
|
||||||
}, [dataModelData]);
|
}, [dataModelData]);
|
||||||
|
|
||||||
const getEntityFeedCount = () => {
|
|
||||||
getFeedCounts(
|
|
||||||
EntityType.DASHBOARD_DATA_MODEL,
|
|
||||||
dashboardDataModelFQN,
|
|
||||||
setEntityFieldThreadCount,
|
|
||||||
setEntityFieldTaskCount,
|
|
||||||
setFeedCount
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
const fetchResourcePermission = async (dashboardDataModelFQN: string) => {
|
const fetchResourcePermission = async (dashboardDataModelFQN: string) => {
|
||||||
setIsLoading(true);
|
setIsLoading(true);
|
||||||
try {
|
try {
|
||||||
@ -134,7 +111,6 @@ const DataModelsPage = () => {
|
|||||||
const createThread = async (data: CreateThread) => {
|
const createThread = async (data: CreateThread) => {
|
||||||
try {
|
try {
|
||||||
await postThread(data);
|
await postThread(data);
|
||||||
getEntityFeedCount();
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
showErrorToast(
|
showErrorToast(
|
||||||
error as AxiosError,
|
error as AxiosError,
|
||||||
@ -180,7 +156,6 @@ const DataModelsPage = () => {
|
|||||||
description: newDescription,
|
description: newDescription,
|
||||||
version,
|
version,
|
||||||
}));
|
}));
|
||||||
getEntityFeedCount();
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
showErrorToast(error as AxiosError);
|
showErrorToast(error as AxiosError);
|
||||||
}
|
}
|
||||||
@ -226,7 +201,6 @@ const DataModelsPage = () => {
|
|||||||
tags: newTags,
|
tags: newTags,
|
||||||
version,
|
version,
|
||||||
}));
|
}));
|
||||||
getEntityFeedCount();
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
showErrorToast(error as AxiosError);
|
showErrorToast(error as AxiosError);
|
||||||
}
|
}
|
||||||
@ -245,7 +219,6 @@ const DataModelsPage = () => {
|
|||||||
owner: newOwner,
|
owner: newOwner,
|
||||||
version,
|
version,
|
||||||
}));
|
}));
|
||||||
getEntityFeedCount();
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
showErrorToast(error as AxiosError);
|
showErrorToast(error as AxiosError);
|
||||||
}
|
}
|
||||||
@ -274,7 +247,6 @@ const DataModelsPage = () => {
|
|||||||
tags: newTags,
|
tags: newTags,
|
||||||
version,
|
version,
|
||||||
}));
|
}));
|
||||||
getEntityFeedCount();
|
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
showErrorToast(error as AxiosError);
|
showErrorToast(error as AxiosError);
|
||||||
@ -295,7 +267,6 @@ const DataModelsPage = () => {
|
|||||||
columns: getSortedDataModelColumnTags(newColumns),
|
columns: getSortedDataModelColumnTags(newColumns),
|
||||||
version,
|
version,
|
||||||
}));
|
}));
|
||||||
getEntityFeedCount();
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
showErrorToast(error as AxiosError);
|
showErrorToast(error as AxiosError);
|
||||||
}
|
}
|
||||||
@ -313,7 +284,6 @@ const DataModelsPage = () => {
|
|||||||
[key]: response[key],
|
[key]: response[key],
|
||||||
version: response.version,
|
version: response.version,
|
||||||
}));
|
}));
|
||||||
getEntityFeedCount();
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
showErrorToast(error as AxiosError);
|
showErrorToast(error as AxiosError);
|
||||||
}
|
}
|
||||||
@ -322,7 +292,6 @@ const DataModelsPage = () => {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (hasViewPermission) {
|
if (hasViewPermission) {
|
||||||
fetchDataModelDetails(dashboardDataModelFQN);
|
fetchDataModelDetails(dashboardDataModelFQN);
|
||||||
getEntityFeedCount();
|
|
||||||
}
|
}
|
||||||
}, [dashboardDataModelFQN, dataModelPermissions]);
|
}, [dashboardDataModelFQN, dataModelPermissions]);
|
||||||
|
|
||||||
@ -352,8 +321,6 @@ const DataModelsPage = () => {
|
|||||||
createThread={createThread}
|
createThread={createThread}
|
||||||
dataModelData={dataModelData}
|
dataModelData={dataModelData}
|
||||||
dataModelPermissions={dataModelPermissions}
|
dataModelPermissions={dataModelPermissions}
|
||||||
entityFieldThreadCount={entityFieldThreadCount}
|
|
||||||
feedCount={feedCount}
|
|
||||||
handleColumnUpdateDataModel={handleColumnUpdateDataModel}
|
handleColumnUpdateDataModel={handleColumnUpdateDataModel}
|
||||||
handleFollowDataModel={handleFollowDataModel}
|
handleFollowDataModel={handleFollowDataModel}
|
||||||
handleUpdateDescription={handleUpdateDescription}
|
handleUpdateDescription={handleUpdateDescription}
|
||||||
|
@ -741,7 +741,8 @@ const DatabaseSchemaPage: FunctionComponent = () => {
|
|||||||
<ActivityFeedTab
|
<ActivityFeedTab
|
||||||
entityType={EntityType.DATABASE_SCHEMA}
|
entityType={EntityType.DATABASE_SCHEMA}
|
||||||
fqn={databaseSchema?.fullyQualifiedName ?? ''}
|
fqn={databaseSchema?.fullyQualifiedName ?? ''}
|
||||||
onFeedUpdate={() => Promise.resolve()}
|
onFeedUpdate={getEntityFeedCount}
|
||||||
|
onUpdateEntityDetails={getDetailsByFQN}
|
||||||
/>
|
/>
|
||||||
</ActivityFeedProvider>
|
</ActivityFeedProvider>
|
||||||
)}
|
)}
|
||||||
|
@ -35,11 +35,9 @@ import { getVersionPath } from '../../constants/constants';
|
|||||||
import { EntityType } from '../../enums/entity.enum';
|
import { EntityType } from '../../enums/entity.enum';
|
||||||
import { CreateThread } from '../../generated/api/feed/createThread';
|
import { CreateThread } from '../../generated/api/feed/createThread';
|
||||||
import { Mlmodel } from '../../generated/entity/data/mlmodel';
|
import { Mlmodel } from '../../generated/entity/data/mlmodel';
|
||||||
import { EntityFieldThreadCount } from '../../interface/feed.interface';
|
|
||||||
import {
|
import {
|
||||||
getCurrentUserId,
|
getCurrentUserId,
|
||||||
getEntityMissingError,
|
getEntityMissingError,
|
||||||
getFeedCounts,
|
|
||||||
sortTagsCaseInsensitive,
|
sortTagsCaseInsensitive,
|
||||||
} from '../../utils/CommonUtils';
|
} from '../../utils/CommonUtils';
|
||||||
import { getEntityName } from '../../utils/EntityUtils';
|
import { getEntityName } from '../../utils/EntityUtils';
|
||||||
@ -59,14 +57,6 @@ const MlModelPage = () => {
|
|||||||
DEFAULT_ENTITY_PERMISSION
|
DEFAULT_ENTITY_PERMISSION
|
||||||
);
|
);
|
||||||
|
|
||||||
const [feedCount, setFeedCount] = useState<number>(0);
|
|
||||||
const [entityFieldThreadCount, setEntityFieldThreadCount] = useState<
|
|
||||||
EntityFieldThreadCount[]
|
|
||||||
>([]);
|
|
||||||
const [entityFieldTaskCount, setEntityFieldTaskCount] = useState<
|
|
||||||
EntityFieldThreadCount[]
|
|
||||||
>([]);
|
|
||||||
|
|
||||||
const [currentVersion, setCurrentVersion] = useState<string>();
|
const [currentVersion, setCurrentVersion] = useState<string>();
|
||||||
|
|
||||||
const { getEntityPermissionByFqn } = usePermissionProvider();
|
const { getEntityPermissionByFqn } = usePermissionProvider();
|
||||||
@ -90,16 +80,6 @@ const MlModelPage = () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const fetchEntityFeedCount = () => {
|
|
||||||
getFeedCounts(
|
|
||||||
EntityType.MLMODEL,
|
|
||||||
mlModelFqn,
|
|
||||||
setEntityFieldThreadCount,
|
|
||||||
setEntityFieldTaskCount,
|
|
||||||
setFeedCount
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
const fetchMlModelDetails = async (name: string) => {
|
const fetchMlModelDetails = async (name: string) => {
|
||||||
setIsDetailLoading(true);
|
setIsDetailLoading(true);
|
||||||
try {
|
try {
|
||||||
@ -113,6 +93,12 @@ const MlModelPage = () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (mlModelPermissions.ViewAll || mlModelPermissions.ViewBasic) {
|
||||||
|
fetchMlModelDetails(mlModelFqn);
|
||||||
|
}
|
||||||
|
}, [mlModelPermissions, mlModelFqn]);
|
||||||
|
|
||||||
const saveUpdatedMlModelData = (updatedData: Mlmodel) => {
|
const saveUpdatedMlModelData = (updatedData: Mlmodel) => {
|
||||||
const jsonPatch = compare(omitBy(mlModelDetail, isUndefined), updatedData);
|
const jsonPatch = compare(omitBy(mlModelDetail, isUndefined), updatedData);
|
||||||
|
|
||||||
@ -128,7 +114,6 @@ const MlModelPage = () => {
|
|||||||
...preVDetail,
|
...preVDetail,
|
||||||
description: description,
|
description: description,
|
||||||
}));
|
}));
|
||||||
fetchEntityFeedCount();
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
showErrorToast(error as AxiosError);
|
showErrorToast(error as AxiosError);
|
||||||
}
|
}
|
||||||
@ -142,7 +127,6 @@ const MlModelPage = () => {
|
|||||||
...preVDetail,
|
...preVDetail,
|
||||||
followers: [...(mlModelDetail.followers || []), ...newValue],
|
followers: [...(mlModelDetail.followers || []), ...newValue],
|
||||||
}));
|
}));
|
||||||
fetchEntityFeedCount();
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
showErrorToast(
|
showErrorToast(
|
||||||
error as AxiosError,
|
error as AxiosError,
|
||||||
@ -163,7 +147,6 @@ const MlModelPage = () => {
|
|||||||
(follower) => follower.id !== oldValue[0].id
|
(follower) => follower.id !== oldValue[0].id
|
||||||
),
|
),
|
||||||
}));
|
}));
|
||||||
fetchEntityFeedCount();
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
showErrorToast(
|
showErrorToast(
|
||||||
error as AxiosError,
|
error as AxiosError,
|
||||||
@ -182,7 +165,6 @@ const MlModelPage = () => {
|
|||||||
tags: sortTagsCaseInsensitive(res.tags || []),
|
tags: sortTagsCaseInsensitive(res.tags || []),
|
||||||
}));
|
}));
|
||||||
setCurrentVersion(res.version?.toString());
|
setCurrentVersion(res.version?.toString());
|
||||||
fetchEntityFeedCount();
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
showErrorToast(
|
showErrorToast(
|
||||||
error as AxiosError,
|
error as AxiosError,
|
||||||
@ -205,7 +187,6 @@ const MlModelPage = () => {
|
|||||||
tags: res.tags,
|
tags: res.tags,
|
||||||
}));
|
}));
|
||||||
setCurrentVersion(res.version?.toString());
|
setCurrentVersion(res.version?.toString());
|
||||||
fetchEntityFeedCount();
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
showErrorToast(
|
showErrorToast(
|
||||||
error as AxiosError,
|
error as AxiosError,
|
||||||
@ -224,7 +205,6 @@ const MlModelPage = () => {
|
|||||||
mlFeatures: response.mlFeatures,
|
mlFeatures: response.mlFeatures,
|
||||||
}));
|
}));
|
||||||
setCurrentVersion(response.version?.toString());
|
setCurrentVersion(response.version?.toString());
|
||||||
fetchEntityFeedCount();
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
showErrorToast(error as AxiosError);
|
showErrorToast(error as AxiosError);
|
||||||
}
|
}
|
||||||
@ -235,7 +215,6 @@ const MlModelPage = () => {
|
|||||||
const data = await saveUpdatedMlModelData(updatedMlModel);
|
const data = await saveUpdatedMlModelData(updatedMlModel);
|
||||||
setMlModelDetail(data);
|
setMlModelDetail(data);
|
||||||
setCurrentVersion(data.version?.toString());
|
setCurrentVersion(data.version?.toString());
|
||||||
fetchEntityFeedCount();
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
showErrorToast(
|
showErrorToast(
|
||||||
error as AxiosError,
|
error as AxiosError,
|
||||||
@ -249,7 +228,6 @@ const MlModelPage = () => {
|
|||||||
const createThread = async (data: CreateThread) => {
|
const createThread = async (data: CreateThread) => {
|
||||||
try {
|
try {
|
||||||
await postThread(data);
|
await postThread(data);
|
||||||
fetchEntityFeedCount();
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
showErrorToast(
|
showErrorToast(
|
||||||
error as AxiosError,
|
error as AxiosError,
|
||||||
@ -266,13 +244,6 @@ const MlModelPage = () => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (mlModelPermissions.ViewAll || mlModelPermissions.ViewBasic) {
|
|
||||||
fetchMlModelDetails(mlModelFqn);
|
|
||||||
fetchEntityFeedCount();
|
|
||||||
}
|
|
||||||
}, [mlModelPermissions, mlModelFqn]);
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
fetchResourcePermission(mlModelFqn);
|
fetchResourcePermission(mlModelFqn);
|
||||||
}, [mlModelFqn]);
|
}, [mlModelFqn]);
|
||||||
@ -302,9 +273,6 @@ const MlModelPage = () => {
|
|||||||
<MlModelDetailComponent
|
<MlModelDetailComponent
|
||||||
createThread={createThread}
|
createThread={createThread}
|
||||||
descriptionUpdateHandler={descriptionUpdateHandler}
|
descriptionUpdateHandler={descriptionUpdateHandler}
|
||||||
entityFieldTaskCount={entityFieldTaskCount}
|
|
||||||
entityFieldThreadCount={entityFieldThreadCount}
|
|
||||||
feedCount={feedCount}
|
|
||||||
followMlModelHandler={followMlModel}
|
followMlModelHandler={followMlModel}
|
||||||
mlModelDetail={mlModelDetail}
|
mlModelDetail={mlModelDetail}
|
||||||
settingsUpdateHandler={settingsUpdateHandler}
|
settingsUpdateHandler={settingsUpdateHandler}
|
||||||
|
@ -516,6 +516,7 @@ const TableDetailsPageV1 = () => {
|
|||||||
owner={tableDetails?.owner}
|
owner={tableDetails?.owner}
|
||||||
tags={tableDetails?.tags}
|
tags={tableDetails?.tags}
|
||||||
onFeedUpdate={getEntityFeedCount}
|
onFeedUpdate={getEntityFeedCount}
|
||||||
|
onUpdateEntityDetails={fetchTableDetails}
|
||||||
/>
|
/>
|
||||||
</ActivityFeedProvider>
|
</ActivityFeedProvider>
|
||||||
),
|
),
|
||||||
|
@ -38,12 +38,10 @@ import { getVersionPath } from '../../constants/constants';
|
|||||||
import { EntityType, TabSpecificField } from '../../enums/entity.enum';
|
import { EntityType, TabSpecificField } from '../../enums/entity.enum';
|
||||||
import { CreateThread } from '../../generated/api/feed/createThread';
|
import { CreateThread } from '../../generated/api/feed/createThread';
|
||||||
import { Topic } from '../../generated/entity/data/topic';
|
import { Topic } from '../../generated/entity/data/topic';
|
||||||
import { EntityFieldThreadCount } from '../../interface/feed.interface';
|
|
||||||
import {
|
import {
|
||||||
addToRecentViewed,
|
addToRecentViewed,
|
||||||
getCurrentUserId,
|
getCurrentUserId,
|
||||||
getEntityMissingError,
|
getEntityMissingError,
|
||||||
getFeedCounts,
|
|
||||||
sortTagsCaseInsensitive,
|
sortTagsCaseInsensitive,
|
||||||
} from '../../utils/CommonUtils';
|
} from '../../utils/CommonUtils';
|
||||||
import { getEntityName } from '../../utils/EntityUtils';
|
import { getEntityName } from '../../utils/EntityUtils';
|
||||||
@ -61,28 +59,10 @@ const TopicDetailsPage: FunctionComponent = () => {
|
|||||||
const [isLoading, setLoading] = useState<boolean>(true);
|
const [isLoading, setLoading] = useState<boolean>(true);
|
||||||
const [isError, setIsError] = useState(false);
|
const [isError, setIsError] = useState(false);
|
||||||
|
|
||||||
const [feedCount, setFeedCount] = useState<number>(0);
|
|
||||||
const [entityFieldThreadCount, setEntityFieldThreadCount] = useState<
|
|
||||||
EntityFieldThreadCount[]
|
|
||||||
>([]);
|
|
||||||
const [entityFieldTaskCount, setEntityFieldTaskCount] = useState<
|
|
||||||
EntityFieldThreadCount[]
|
|
||||||
>([]);
|
|
||||||
|
|
||||||
const [topicPermissions, setTopicPermissions] = useState<OperationPermission>(
|
const [topicPermissions, setTopicPermissions] = useState<OperationPermission>(
|
||||||
DEFAULT_ENTITY_PERMISSION
|
DEFAULT_ENTITY_PERMISSION
|
||||||
);
|
);
|
||||||
|
|
||||||
const getEntityFeedCount = () => {
|
|
||||||
getFeedCounts(
|
|
||||||
EntityType.TOPIC,
|
|
||||||
topicFQN,
|
|
||||||
setEntityFieldThreadCount,
|
|
||||||
setEntityFieldTaskCount,
|
|
||||||
setFeedCount
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
const { id: topicId, version: currentVersion } = topicDetails;
|
const { id: topicId, version: currentVersion } = topicDetails;
|
||||||
|
|
||||||
const saveUpdatedTopicData = (updatedData: Topic) => {
|
const saveUpdatedTopicData = (updatedData: Topic) => {
|
||||||
@ -110,7 +90,6 @@ const TopicDetailsPage: FunctionComponent = () => {
|
|||||||
[key]: res[key],
|
[key]: res[key],
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
getEntityFeedCount();
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
showErrorToast(error as AxiosError);
|
showErrorToast(error as AxiosError);
|
||||||
}
|
}
|
||||||
@ -181,7 +160,6 @@ const TopicDetailsPage: FunctionComponent = () => {
|
|||||||
...prev,
|
...prev,
|
||||||
followers: [...(prev?.followers ?? []), ...newValue],
|
followers: [...(prev?.followers ?? []), ...newValue],
|
||||||
}));
|
}));
|
||||||
getEntityFeedCount();
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
showErrorToast(
|
showErrorToast(
|
||||||
error as AxiosError,
|
error as AxiosError,
|
||||||
@ -202,7 +180,6 @@ const TopicDetailsPage: FunctionComponent = () => {
|
|||||||
(follower) => follower.id !== oldValue[0].id
|
(follower) => follower.id !== oldValue[0].id
|
||||||
),
|
),
|
||||||
}));
|
}));
|
||||||
getEntityFeedCount();
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
showErrorToast(
|
showErrorToast(
|
||||||
error as AxiosError,
|
error as AxiosError,
|
||||||
@ -223,7 +200,6 @@ const TopicDetailsPage: FunctionComponent = () => {
|
|||||||
const createThread = async (data: CreateThread) => {
|
const createThread = async (data: CreateThread) => {
|
||||||
try {
|
try {
|
||||||
await postThread(data);
|
await postThread(data);
|
||||||
getEntityFeedCount();
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
showErrorToast(
|
showErrorToast(
|
||||||
error as AxiosError,
|
error as AxiosError,
|
||||||
@ -241,7 +217,6 @@ const TopicDetailsPage: FunctionComponent = () => {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (topicPermissions.ViewAll || topicPermissions.ViewBasic) {
|
if (topicPermissions.ViewAll || topicPermissions.ViewBasic) {
|
||||||
fetchTopicDetail(topicFQN);
|
fetchTopicDetail(topicFQN);
|
||||||
getEntityFeedCount();
|
|
||||||
}
|
}
|
||||||
}, [topicPermissions, topicFQN]);
|
}, [topicPermissions, topicFQN]);
|
||||||
|
|
||||||
@ -262,9 +237,6 @@ const TopicDetailsPage: FunctionComponent = () => {
|
|||||||
return (
|
return (
|
||||||
<TopicDetails
|
<TopicDetails
|
||||||
createThread={createThread}
|
createThread={createThread}
|
||||||
entityFieldTaskCount={entityFieldTaskCount}
|
|
||||||
entityFieldThreadCount={entityFieldThreadCount}
|
|
||||||
feedCount={feedCount}
|
|
||||||
followTopicHandler={followTopic}
|
followTopicHandler={followTopic}
|
||||||
topicDetails={topicDetails}
|
topicDetails={topicDetails}
|
||||||
unFollowTopicHandler={unFollowTopic}
|
unFollowTopicHandler={unFollowTopic}
|
||||||
|
@ -894,7 +894,7 @@ const DatabaseDetails: FunctionComponent = () => {
|
|||||||
<ActivityFeedTab
|
<ActivityFeedTab
|
||||||
entityType={EntityType.DATABASE}
|
entityType={EntityType.DATABASE}
|
||||||
fqn={database?.fullyQualifiedName ?? ''}
|
fqn={database?.fullyQualifiedName ?? ''}
|
||||||
onFeedUpdate={() => Promise.resolve()}
|
onFeedUpdate={getEntityFeedCount}
|
||||||
/>
|
/>
|
||||||
</ActivityFeedProvider>
|
</ActivityFeedProvider>
|
||||||
)}
|
)}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user