mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-07-25 18:30:00 +00:00
fix(ui): infinite scroll issue in user activity feed page (#12617)
* fix the infinite scroll issue in user activity feed page * fix the functionality issue in activity thread on entity page * minor code fixes
This commit is contained in:
parent
515c68d488
commit
fde17d44b8
@ -68,7 +68,7 @@ const ActivityFeedListV1 = ({
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="feed-list-container p-y-md m-b-sm h-full" id="feedData">
|
<div className="feed-list-container p-y-md" id="feedData">
|
||||||
{entityThread.length === 0 && (
|
{entityThread.length === 0 && (
|
||||||
<div
|
<div
|
||||||
className="h-full p-x-md"
|
className="h-full p-x-md"
|
||||||
|
@ -126,10 +126,6 @@ const ActivityFeedProvider = ({ children, user }: Props) => {
|
|||||||
);
|
);
|
||||||
setEntityThread((prev) => (after ? [...prev, ...data] : [...data]));
|
setEntityThread((prev) => (after ? [...prev, ...data] : [...data]));
|
||||||
setEntityPaging(paging);
|
setEntityPaging(paging);
|
||||||
|
|
||||||
setLoading(false);
|
|
||||||
|
|
||||||
return data;
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
showErrorToast(
|
showErrorToast(
|
||||||
err as AxiosError,
|
err as AxiosError,
|
||||||
@ -137,8 +133,6 @@ const ActivityFeedProvider = ({ children, user }: Props) => {
|
|||||||
entity: t('label.activity-feed'),
|
entity: t('label.activity-feed'),
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
return [];
|
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
|
@ -51,7 +51,7 @@ export interface ActivityFeedProviderContextType {
|
|||||||
type?: ThreadType,
|
type?: ThreadType,
|
||||||
entityType?: EntityType,
|
entityType?: EntityType,
|
||||||
fqn?: string
|
fqn?: string
|
||||||
) => Promise<Thread[]>;
|
) => Promise<void>;
|
||||||
showDrawer: (thread: Thread) => void;
|
showDrawer: (thread: Thread) => void;
|
||||||
hideDrawer: () => void;
|
hideDrawer: () => void;
|
||||||
updateEditorFocus: (isFocused: boolean) => void;
|
updateEditorFocus: (isFocused: boolean) => void;
|
||||||
|
@ -14,6 +14,7 @@ import { Menu, Space, Typography } from 'antd';
|
|||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import Loader from 'components/Loader/Loader';
|
import Loader from 'components/Loader/Loader';
|
||||||
import { TaskTab } from 'components/Task/TaskTab/TaskTab.component';
|
import { TaskTab } from 'components/Task/TaskTab/TaskTab.component';
|
||||||
|
import { ICON_DIMENSION } from 'constants/constants';
|
||||||
import { observerOptions } from 'constants/Mydata.constants';
|
import { observerOptions } from 'constants/Mydata.constants';
|
||||||
import { EntityTabs, EntityType } from 'enums/entity.enum';
|
import { EntityTabs, EntityType } from 'enums/entity.enum';
|
||||||
import { FeedFilter } from 'enums/mydata.enum';
|
import { FeedFilter } from 'enums/mydata.enum';
|
||||||
@ -22,7 +23,6 @@ import {
|
|||||||
ThreadTaskStatus,
|
ThreadTaskStatus,
|
||||||
ThreadType,
|
ThreadType,
|
||||||
} from 'generated/entity/feed/thread';
|
} from 'generated/entity/feed/thread';
|
||||||
import { Paging } from 'generated/type/paging';
|
|
||||||
import { useElementInView } from 'hooks/useElementInView';
|
import { useElementInView } from 'hooks/useElementInView';
|
||||||
import { noop } from 'lodash';
|
import { noop } from 'lodash';
|
||||||
import {
|
import {
|
||||||
@ -50,12 +50,10 @@ import {
|
|||||||
ActivityFeedTabs,
|
ActivityFeedTabs,
|
||||||
TaskFilter,
|
TaskFilter,
|
||||||
} from './ActivityFeedTab.interface';
|
} from './ActivityFeedTab.interface';
|
||||||
import { ReactComponent as CheckIcon } from '/assets/svg/ic-check.svg';
|
|
||||||
import { ReactComponent as TaskIcon } from '/assets/svg/ic-task.svg';
|
|
||||||
|
|
||||||
import { ICON_DIMENSION } from 'constants/constants';
|
|
||||||
import { ReactComponent as AllActivityIcon } from '/assets/svg/all-activity-v2.svg';
|
import { ReactComponent as AllActivityIcon } from '/assets/svg/all-activity-v2.svg';
|
||||||
|
import { ReactComponent as CheckIcon } from '/assets/svg/ic-check.svg';
|
||||||
import { ReactComponent as MentionIcon } from '/assets/svg/ic-mentions.svg';
|
import { ReactComponent as MentionIcon } from '/assets/svg/ic-mentions.svg';
|
||||||
|
import { ReactComponent as TaskIcon } from '/assets/svg/ic-task.svg';
|
||||||
import { ReactComponent as TaskListIcon } from '/assets/svg/task-ic.svg';
|
import { ReactComponent as TaskListIcon } from '/assets/svg/task-ic.svg';
|
||||||
|
|
||||||
export const ActivityFeedTab = ({
|
export const ActivityFeedTab = ({
|
||||||
@ -67,7 +65,11 @@ export const ActivityFeedTab = ({
|
|||||||
}: ActivityFeedTabProps) => {
|
}: ActivityFeedTabProps) => {
|
||||||
const history = useHistory();
|
const history = useHistory();
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [elementRef, isInView] = useElementInView(observerOptions);
|
const [elementRef, isInView] = useElementInView({
|
||||||
|
...observerOptions,
|
||||||
|
root: document.querySelector('#center-container'),
|
||||||
|
rootMargin: '0px 0px 2px 0px',
|
||||||
|
});
|
||||||
const { subTab: activeTab = ActivityFeedTabs.ALL } =
|
const { subTab: activeTab = ActivityFeedTabs.ALL } =
|
||||||
useParams<{ subTab: ActivityFeedTabs }>();
|
useParams<{ subTab: ActivityFeedTabs }>();
|
||||||
const [taskFilter, setTaskFilter] = useState<TaskFilter>('open');
|
const [taskFilter, setTaskFilter] = useState<TaskFilter>('open');
|
||||||
@ -204,7 +206,7 @@ export const ActivityFeedTab = ({
|
|||||||
(after?: string) => {
|
(after?: string) => {
|
||||||
getFeedData(feedFilter, after, threadType, entityType, fqn);
|
getFeedData(feedFilter, after, threadType, entityType, fqn);
|
||||||
},
|
},
|
||||||
[threadType, feedFilter, entityType, fqn]
|
[threadType, feedFilter, entityType, fqn, getFeedData]
|
||||||
);
|
);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@ -220,19 +222,9 @@ export const ActivityFeedTab = ({
|
|||||||
[setActiveThread]
|
[setActiveThread]
|
||||||
);
|
);
|
||||||
|
|
||||||
const fetchMoreThread = (
|
|
||||||
isElementInView: boolean,
|
|
||||||
pagingObj: Paging,
|
|
||||||
isLoading: boolean
|
|
||||||
) => {
|
|
||||||
if (isElementInView && pagingObj?.after && !isLoading) {
|
|
||||||
handleFeedFetchFromFeedList(pagingObj.after);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (fqn) {
|
if (fqn && isInView && entityPaging.after && !loading) {
|
||||||
fetchMoreThread(isInView, entityPaging, loading);
|
handleFeedFetchFromFeedList(entityPaging.after);
|
||||||
}
|
}
|
||||||
}, [entityPaging, loading, isInView, fqn]);
|
}, [entityPaging, loading, isInView, fqn]);
|
||||||
|
|
||||||
@ -340,7 +332,7 @@ export const ActivityFeedTab = ({
|
|||||||
onClick={(info) => handleTabChange(info.key)}
|
onClick={(info) => handleTabChange(info.key)}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<div className=" center-container">
|
<div className="center-container" id="center-container">
|
||||||
{isTaskActiveTab && (
|
{isTaskActiveTab && (
|
||||||
<div className="d-flex gap-4 p-sm p-x-lg activity-feed-task">
|
<div className="d-flex gap-4 p-sm p-x-lg activity-feed-task">
|
||||||
<Typography.Text
|
<Typography.Text
|
||||||
|
@ -14,9 +14,7 @@
|
|||||||
import { Col, Row, Space, Table, Tabs, Typography } from 'antd';
|
import { Col, Row, Space, Table, Tabs, Typography } from 'antd';
|
||||||
import { ColumnsType } from 'antd/lib/table';
|
import { ColumnsType } from 'antd/lib/table';
|
||||||
import { AxiosError } from 'axios';
|
import { AxiosError } from 'axios';
|
||||||
import ActivityFeedProvider, {
|
import { useActivityFeedProvider } from 'components/ActivityFeed/ActivityFeedProvider/ActivityFeedProvider';
|
||||||
useActivityFeedProvider,
|
|
||||||
} from 'components/ActivityFeed/ActivityFeedProvider/ActivityFeedProvider';
|
|
||||||
import { ActivityFeedTab } from 'components/ActivityFeed/ActivityFeedTab/ActivityFeedTab.component';
|
import { ActivityFeedTab } from 'components/ActivityFeed/ActivityFeedTab/ActivityFeedTab.component';
|
||||||
import DescriptionV1 from 'components/common/description/DescriptionV1';
|
import DescriptionV1 from 'components/common/description/DescriptionV1';
|
||||||
import ErrorPlaceHolder from 'components/common/error-with-placeholder/ErrorPlaceHolder';
|
import ErrorPlaceHolder from 'components/common/error-with-placeholder/ErrorPlaceHolder';
|
||||||
@ -66,6 +64,7 @@ import {
|
|||||||
DashboardDetailsProps,
|
DashboardDetailsProps,
|
||||||
} from './DashboardDetails.interface';
|
} from './DashboardDetails.interface';
|
||||||
|
|
||||||
|
import { withActivityFeed } from 'components/router/withActivityFeed';
|
||||||
import TableDescription from 'components/TableDescription/TableDescription.component';
|
import TableDescription from 'components/TableDescription/TableDescription.component';
|
||||||
import { DisplayType } from 'components/Tag/TagsViewer/TagsViewer.interface';
|
import { DisplayType } from 'components/Tag/TagsViewer/TagsViewer.interface';
|
||||||
|
|
||||||
@ -650,14 +649,12 @@ const DashboardDetails = ({
|
|||||||
),
|
),
|
||||||
key: EntityTabs.ACTIVITY_FEED,
|
key: EntityTabs.ACTIVITY_FEED,
|
||||||
children: (
|
children: (
|
||||||
<ActivityFeedProvider>
|
<ActivityFeedTab
|
||||||
<ActivityFeedTab
|
entityType={EntityType.DASHBOARD}
|
||||||
entityType={EntityType.DASHBOARD}
|
fqn={dashboardDetails?.fullyQualifiedName ?? ''}
|
||||||
fqn={dashboardDetails?.fullyQualifiedName ?? ''}
|
onFeedUpdate={getEntityFeedCount}
|
||||||
onFeedUpdate={getEntityFeedCount}
|
onUpdateEntityDetails={fetchDashboard}
|
||||||
onUpdateEntityDetails={fetchDashboard}
|
/>
|
||||||
/>
|
|
||||||
</ActivityFeedProvider>
|
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -778,4 +775,4 @@ const DashboardDetails = ({
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default DashboardDetails;
|
export default withActivityFeed<DashboardDetailsProps>(DashboardDetails);
|
||||||
|
@ -12,9 +12,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { Card, Col, Row, Space, Tabs } from 'antd';
|
import { Card, Col, Row, Space, Tabs } from 'antd';
|
||||||
import ActivityFeedProvider, {
|
import { useActivityFeedProvider } from 'components/ActivityFeed/ActivityFeedProvider/ActivityFeedProvider';
|
||||||
useActivityFeedProvider,
|
|
||||||
} from 'components/ActivityFeed/ActivityFeedProvider/ActivityFeedProvider';
|
|
||||||
import { ActivityFeedTab } from 'components/ActivityFeed/ActivityFeedTab/ActivityFeedTab.component';
|
import { ActivityFeedTab } from 'components/ActivityFeed/ActivityFeedTab/ActivityFeedTab.component';
|
||||||
import ActivityThreadPanel from 'components/ActivityFeed/ActivityThreadPanel/ActivityThreadPanel';
|
import ActivityThreadPanel from 'components/ActivityFeed/ActivityThreadPanel/ActivityThreadPanel';
|
||||||
import DescriptionV1 from 'components/common/description/DescriptionV1';
|
import DescriptionV1 from 'components/common/description/DescriptionV1';
|
||||||
@ -22,6 +20,7 @@ import PageLayoutV1 from 'components/containers/PageLayoutV1';
|
|||||||
import { DataAssetsHeader } from 'components/DataAssets/DataAssetsHeader/DataAssetsHeader.component';
|
import { DataAssetsHeader } from 'components/DataAssets/DataAssetsHeader/DataAssetsHeader.component';
|
||||||
import EntityLineageComponent from 'components/EntityLineage/EntityLineage.component';
|
import EntityLineageComponent from 'components/EntityLineage/EntityLineage.component';
|
||||||
import { EntityName } from 'components/Modals/EntityNameModal/EntityNameModal.interface';
|
import { EntityName } from 'components/Modals/EntityNameModal/EntityNameModal.interface';
|
||||||
|
import { withActivityFeed } from 'components/router/withActivityFeed';
|
||||||
import SchemaEditor from 'components/schema-editor/SchemaEditor';
|
import SchemaEditor from 'components/schema-editor/SchemaEditor';
|
||||||
import { SourceType } from 'components/searched-data/SearchedData.interface';
|
import { SourceType } from 'components/searched-data/SearchedData.interface';
|
||||||
import TabsLabel from 'components/TabsLabel/TabsLabel.component';
|
import TabsLabel from 'components/TabsLabel/TabsLabel.component';
|
||||||
@ -270,14 +269,12 @@ const DataModelDetails = ({
|
|||||||
),
|
),
|
||||||
key: EntityTabs.ACTIVITY_FEED,
|
key: EntityTabs.ACTIVITY_FEED,
|
||||||
children: (
|
children: (
|
||||||
<ActivityFeedProvider>
|
<ActivityFeedTab
|
||||||
<ActivityFeedTab
|
entityType={EntityType.DASHBOARD_DATA_MODEL}
|
||||||
entityType={EntityType.DASHBOARD_DATA_MODEL}
|
fqn={dataModelData?.fullyQualifiedName ?? ''}
|
||||||
fqn={dataModelData?.fullyQualifiedName ?? ''}
|
onFeedUpdate={getEntityFeedCount}
|
||||||
onFeedUpdate={getEntityFeedCount}
|
onUpdateEntityDetails={fetchDataModel}
|
||||||
onUpdateEntityDetails={fetchDataModel}
|
/>
|
||||||
/>
|
|
||||||
</ActivityFeedProvider>
|
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
...(dataModelData?.sql
|
...(dataModelData?.sql
|
||||||
@ -377,4 +374,4 @@ const DataModelDetails = ({
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default DataModelDetails;
|
export default withActivityFeed<DataModelDetailsProps>(DataModelDetails);
|
||||||
|
@ -14,15 +14,14 @@
|
|||||||
import { Col, Row, Space, Table, Tabs, Typography } from 'antd';
|
import { Col, Row, Space, Table, Tabs, Typography } from 'antd';
|
||||||
import { ColumnsType } from 'antd/lib/table';
|
import { ColumnsType } from 'antd/lib/table';
|
||||||
import { AxiosError } from 'axios';
|
import { AxiosError } from 'axios';
|
||||||
import ActivityFeedProvider, {
|
import { useActivityFeedProvider } from 'components/ActivityFeed/ActivityFeedProvider/ActivityFeedProvider';
|
||||||
useActivityFeedProvider,
|
|
||||||
} from 'components/ActivityFeed/ActivityFeedProvider/ActivityFeedProvider';
|
|
||||||
import { ActivityFeedTab } from 'components/ActivityFeed/ActivityFeedTab/ActivityFeedTab.component';
|
import { ActivityFeedTab } from 'components/ActivityFeed/ActivityFeedTab/ActivityFeedTab.component';
|
||||||
import DescriptionV1 from 'components/common/description/DescriptionV1';
|
import DescriptionV1 from 'components/common/description/DescriptionV1';
|
||||||
import ErrorPlaceHolder from 'components/common/error-with-placeholder/ErrorPlaceHolder';
|
import ErrorPlaceHolder from 'components/common/error-with-placeholder/ErrorPlaceHolder';
|
||||||
import PageLayoutV1 from 'components/containers/PageLayoutV1';
|
import PageLayoutV1 from 'components/containers/PageLayoutV1';
|
||||||
import { DataAssetsHeader } from 'components/DataAssets/DataAssetsHeader/DataAssetsHeader.component';
|
import { DataAssetsHeader } from 'components/DataAssets/DataAssetsHeader/DataAssetsHeader.component';
|
||||||
import { EntityName } from 'components/Modals/EntityNameModal/EntityNameModal.interface';
|
import { EntityName } from 'components/Modals/EntityNameModal/EntityNameModal.interface';
|
||||||
|
import { withActivityFeed } from 'components/router/withActivityFeed';
|
||||||
import TabsLabel from 'components/TabsLabel/TabsLabel.component';
|
import TabsLabel from 'components/TabsLabel/TabsLabel.component';
|
||||||
import TagsContainerV2 from 'components/Tag/TagsContainerV2/TagsContainerV2';
|
import TagsContainerV2 from 'components/Tag/TagsContainerV2/TagsContainerV2';
|
||||||
import { DisplayType } from 'components/Tag/TagsViewer/TagsViewer.interface';
|
import { DisplayType } from 'components/Tag/TagsViewer/TagsViewer.interface';
|
||||||
@ -472,14 +471,12 @@ const MlModelDetail: FC<MlModelDetailProp> = ({
|
|||||||
),
|
),
|
||||||
key: EntityTabs.ACTIVITY_FEED,
|
key: EntityTabs.ACTIVITY_FEED,
|
||||||
children: (
|
children: (
|
||||||
<ActivityFeedProvider>
|
<ActivityFeedTab
|
||||||
<ActivityFeedTab
|
entityType={EntityType.MLMODEL}
|
||||||
entityType={EntityType.MLMODEL}
|
fqn={mlModelDetail?.fullyQualifiedName ?? ''}
|
||||||
fqn={mlModelDetail?.fullyQualifiedName ?? ''}
|
onFeedUpdate={fetchEntityFeedCount}
|
||||||
onFeedUpdate={fetchEntityFeedCount}
|
onUpdateEntityDetails={fetchMlModel}
|
||||||
onUpdateEntityDetails={fetchMlModel}
|
/>
|
||||||
/>
|
|
||||||
</ActivityFeedProvider>
|
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -596,4 +593,4 @@ const MlModelDetail: FC<MlModelDetailProp> = ({
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default MlModelDetail;
|
export default withActivityFeed<MlModelDetailProp>(MlModelDetail);
|
||||||
|
@ -14,9 +14,7 @@
|
|||||||
import { Card, Col, Radio, Row, Space, Tabs, Typography } from 'antd';
|
import { Card, Col, Radio, Row, Space, Tabs, Typography } from 'antd';
|
||||||
import Table, { ColumnsType } from 'antd/lib/table';
|
import Table, { ColumnsType } from 'antd/lib/table';
|
||||||
import { AxiosError } from 'axios';
|
import { AxiosError } from 'axios';
|
||||||
import ActivityFeedProvider, {
|
import { useActivityFeedProvider } from 'components/ActivityFeed/ActivityFeedProvider/ActivityFeedProvider';
|
||||||
useActivityFeedProvider,
|
|
||||||
} from 'components/ActivityFeed/ActivityFeedProvider/ActivityFeedProvider';
|
|
||||||
import { ActivityFeedTab } from 'components/ActivityFeed/ActivityFeedTab/ActivityFeedTab.component';
|
import { ActivityFeedTab } from 'components/ActivityFeed/ActivityFeedTab/ActivityFeedTab.component';
|
||||||
import { CustomPropertyTable } from 'components/common/CustomPropertyTable/CustomPropertyTable';
|
import { CustomPropertyTable } from 'components/common/CustomPropertyTable/CustomPropertyTable';
|
||||||
import { CustomPropertyProps } from 'components/common/CustomPropertyTable/CustomPropertyTable.interface';
|
import { CustomPropertyProps } from 'components/common/CustomPropertyTable/CustomPropertyTable.interface';
|
||||||
@ -27,6 +25,7 @@ import { DataAssetsHeader } from 'components/DataAssets/DataAssetsHeader/DataAss
|
|||||||
import EntityLineageComponent from 'components/EntityLineage/EntityLineage.component';
|
import EntityLineageComponent from 'components/EntityLineage/EntityLineage.component';
|
||||||
import ExecutionsTab from 'components/Execution/Execution.component';
|
import ExecutionsTab from 'components/Execution/Execution.component';
|
||||||
import { EntityName } from 'components/Modals/EntityNameModal/EntityNameModal.interface';
|
import { EntityName } from 'components/Modals/EntityNameModal/EntityNameModal.interface';
|
||||||
|
import { withActivityFeed } from 'components/router/withActivityFeed';
|
||||||
import TableDescription from 'components/TableDescription/TableDescription.component';
|
import TableDescription from 'components/TableDescription/TableDescription.component';
|
||||||
import TableTags from 'components/TableTags/TableTags.component';
|
import TableTags from 'components/TableTags/TableTags.component';
|
||||||
import TabsLabel from 'components/TabsLabel/TabsLabel.component';
|
import TabsLabel from 'components/TabsLabel/TabsLabel.component';
|
||||||
@ -648,14 +647,12 @@ const PipelineDetails = ({
|
|||||||
),
|
),
|
||||||
key: EntityTabs.ACTIVITY_FEED,
|
key: EntityTabs.ACTIVITY_FEED,
|
||||||
children: (
|
children: (
|
||||||
<ActivityFeedProvider>
|
<ActivityFeedTab
|
||||||
<ActivityFeedTab
|
entityType={EntityType.PIPELINE}
|
||||||
entityType={EntityType.PIPELINE}
|
fqn={pipelineDetails?.fullyQualifiedName ?? ''}
|
||||||
fqn={pipelineDetails?.fullyQualifiedName ?? ''}
|
onFeedUpdate={getEntityFeedCount}
|
||||||
onFeedUpdate={getEntityFeedCount}
|
onUpdateEntityDetails={fetchPipeline}
|
||||||
onUpdateEntityDetails={fetchPipeline}
|
/>
|
||||||
/>
|
|
||||||
</ActivityFeedProvider>
|
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -803,4 +800,4 @@ const PipelineDetails = ({
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default PipelineDetails;
|
export default withActivityFeed<PipeLineDetailsProp>(PipelineDetails);
|
||||||
|
@ -13,9 +13,7 @@
|
|||||||
|
|
||||||
import { Col, Row, Space, Tabs } from 'antd';
|
import { Col, Row, Space, Tabs } from 'antd';
|
||||||
import { AxiosError } from 'axios';
|
import { AxiosError } from 'axios';
|
||||||
import ActivityFeedProvider, {
|
import { useActivityFeedProvider } from 'components/ActivityFeed/ActivityFeedProvider/ActivityFeedProvider';
|
||||||
useActivityFeedProvider,
|
|
||||||
} from 'components/ActivityFeed/ActivityFeedProvider/ActivityFeedProvider';
|
|
||||||
import { ActivityFeedTab } from 'components/ActivityFeed/ActivityFeedTab/ActivityFeedTab.component';
|
import { ActivityFeedTab } from 'components/ActivityFeed/ActivityFeedTab/ActivityFeedTab.component';
|
||||||
import DescriptionV1 from 'components/common/description/DescriptionV1';
|
import DescriptionV1 from 'components/common/description/DescriptionV1';
|
||||||
import ErrorPlaceHolder from 'components/common/error-with-placeholder/ErrorPlaceHolder';
|
import ErrorPlaceHolder from 'components/common/error-with-placeholder/ErrorPlaceHolder';
|
||||||
@ -24,6 +22,7 @@ import PageLayoutV1 from 'components/containers/PageLayoutV1';
|
|||||||
import { DataAssetsHeader } from 'components/DataAssets/DataAssetsHeader/DataAssetsHeader.component';
|
import { DataAssetsHeader } from 'components/DataAssets/DataAssetsHeader/DataAssetsHeader.component';
|
||||||
import EntityLineageComponent from 'components/EntityLineage/EntityLineage.component';
|
import EntityLineageComponent from 'components/EntityLineage/EntityLineage.component';
|
||||||
import { EntityName } from 'components/Modals/EntityNameModal/EntityNameModal.interface';
|
import { EntityName } from 'components/Modals/EntityNameModal/EntityNameModal.interface';
|
||||||
|
import { withActivityFeed } from 'components/router/withActivityFeed';
|
||||||
import SampleDataTopic from 'components/SampleDataTopic/SampleDataTopic';
|
import SampleDataTopic from 'components/SampleDataTopic/SampleDataTopic';
|
||||||
import TabsLabel from 'components/TabsLabel/TabsLabel.component';
|
import TabsLabel from 'components/TabsLabel/TabsLabel.component';
|
||||||
import TagsContainerV2 from 'components/Tag/TagsContainerV2/TagsContainerV2';
|
import TagsContainerV2 from 'components/Tag/TagsContainerV2/TagsContainerV2';
|
||||||
@ -360,14 +359,12 @@ const TopicDetails: React.FC<TopicDetailsProps> = ({
|
|||||||
),
|
),
|
||||||
key: EntityTabs.ACTIVITY_FEED,
|
key: EntityTabs.ACTIVITY_FEED,
|
||||||
children: (
|
children: (
|
||||||
<ActivityFeedProvider>
|
<ActivityFeedTab
|
||||||
<ActivityFeedTab
|
entityType={EntityType.TOPIC}
|
||||||
entityType={EntityType.TOPIC}
|
fqn={topicDetails?.fullyQualifiedName ?? ''}
|
||||||
fqn={topicDetails?.fullyQualifiedName ?? ''}
|
onFeedUpdate={getEntityFeedCount}
|
||||||
onFeedUpdate={getEntityFeedCount}
|
onUpdateEntityDetails={fetchTopic}
|
||||||
onUpdateEntityDetails={fetchTopic}
|
/>
|
||||||
/>
|
|
||||||
</ActivityFeedProvider>
|
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -492,4 +489,4 @@ const TopicDetails: React.FC<TopicDetailsProps> = ({
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default TopicDetails;
|
export default withActivityFeed<TopicDetailsProps>(TopicDetails);
|
||||||
|
@ -102,6 +102,19 @@ const Users = ({
|
|||||||
}
|
}
|
||||||
}, [tab, ownedEntities, followingEntities]);
|
}, [tab, ownedEntities, followingEntities]);
|
||||||
|
|
||||||
|
const activityFeed = useMemo(
|
||||||
|
() => (
|
||||||
|
<ActivityFeedProvider user={userData.id}>
|
||||||
|
<ActivityFeedTab
|
||||||
|
entityType={EntityType.USER_NAME}
|
||||||
|
fqn={username}
|
||||||
|
onFeedUpdate={noop}
|
||||||
|
/>
|
||||||
|
</ActivityFeedProvider>
|
||||||
|
),
|
||||||
|
[userData, username]
|
||||||
|
);
|
||||||
|
|
||||||
const tabDetails = useMemo(() => {
|
const tabDetails = useMemo(() => {
|
||||||
switch (tab) {
|
switch (tab) {
|
||||||
case UserPageTabs.FOLLOWING:
|
case UserPageTabs.FOLLOWING:
|
||||||
@ -152,15 +165,7 @@ const Users = ({
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
case UserPageTabs.ACTIVITY:
|
case UserPageTabs.ACTIVITY:
|
||||||
return (
|
return activityFeed;
|
||||||
<ActivityFeedProvider user={userData.id}>
|
|
||||||
<ActivityFeedTab
|
|
||||||
entityType={EntityType.USER_NAME}
|
|
||||||
fqn={username}
|
|
||||||
onFeedUpdate={noop}
|
|
||||||
/>
|
|
||||||
</ActivityFeedProvider>
|
|
||||||
);
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return <></>;
|
return <></>;
|
||||||
@ -172,6 +177,7 @@ const Users = ({
|
|||||||
isUserEntitiesLoading,
|
isUserEntitiesLoading,
|
||||||
userPageFilterList,
|
userPageFilterList,
|
||||||
entityDetails,
|
entityDetails,
|
||||||
|
activityFeed,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -41,29 +41,11 @@ const FeedsWidget = () => {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (activeTab === ActivityFeedTabs.ALL) {
|
if (activeTab === ActivityFeedTabs.ALL) {
|
||||||
getFeedData(FeedFilter.OWNER, undefined, ThreadType.Conversation).catch(
|
getFeedData(FeedFilter.OWNER, undefined, ThreadType.Conversation);
|
||||||
() => {
|
|
||||||
// ignore since error is displayed in toast in the parent promise.
|
|
||||||
// Added block for sonar code smell
|
|
||||||
}
|
|
||||||
);
|
|
||||||
} else if (activeTab === ActivityFeedTabs.MENTIONS) {
|
} else if (activeTab === ActivityFeedTabs.MENTIONS) {
|
||||||
getFeedData(FeedFilter.MENTIONS).catch(() => {
|
getFeedData(FeedFilter.MENTIONS);
|
||||||
// ignore since error is displayed in toast in the parent promise.
|
|
||||||
// Added block for sonar code smell
|
|
||||||
});
|
|
||||||
} else if (activeTab === ActivityFeedTabs.TASKS) {
|
} else if (activeTab === ActivityFeedTabs.TASKS) {
|
||||||
getFeedData(FeedFilter.OWNER, undefined, ThreadType.Task)
|
getFeedData(FeedFilter.OWNER, undefined, ThreadType.Task);
|
||||||
.then((data) => {
|
|
||||||
const openTasks = data.filter(
|
|
||||||
(item) => item.task?.status === ThreadTaskStatus.Open
|
|
||||||
);
|
|
||||||
setTaskCount(openTasks.length);
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
// ignore since error is displayed in toast in the parent promise.
|
|
||||||
// Added block for sonar code smell
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}, [activeTab]);
|
}, [activeTab]);
|
||||||
|
|
||||||
|
@ -0,0 +1,24 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2023 Collate.
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
import ActivityFeedProvider from 'components/ActivityFeed/ActivityFeedProvider/ActivityFeedProvider';
|
||||||
|
import React, { FC } from 'react';
|
||||||
|
|
||||||
|
export const withActivityFeed =
|
||||||
|
<T extends unknown>(Component: FC<T>) =>
|
||||||
|
(props: JSX.IntrinsicAttributes & { children?: React.ReactNode } & T) => {
|
||||||
|
return (
|
||||||
|
<ActivityFeedProvider>
|
||||||
|
<Component {...props} />
|
||||||
|
</ActivityFeedProvider>
|
||||||
|
);
|
||||||
|
};
|
@ -13,9 +13,7 @@
|
|||||||
import { Col, Row, Space, Tabs } from 'antd';
|
import { Col, Row, Space, Tabs } from 'antd';
|
||||||
import AppState from 'AppState';
|
import AppState from 'AppState';
|
||||||
import { AxiosError } from 'axios';
|
import { AxiosError } from 'axios';
|
||||||
import ActivityFeedProvider, {
|
import { useActivityFeedProvider } from 'components/ActivityFeed/ActivityFeedProvider/ActivityFeedProvider';
|
||||||
useActivityFeedProvider,
|
|
||||||
} from 'components/ActivityFeed/ActivityFeedProvider/ActivityFeedProvider';
|
|
||||||
import { ActivityFeedTab } from 'components/ActivityFeed/ActivityFeedTab/ActivityFeedTab.component';
|
import { ActivityFeedTab } from 'components/ActivityFeed/ActivityFeedTab/ActivityFeedTab.component';
|
||||||
import ActivityThreadPanel from 'components/ActivityFeed/ActivityThreadPanel/ActivityThreadPanel';
|
import ActivityThreadPanel from 'components/ActivityFeed/ActivityThreadPanel/ActivityThreadPanel';
|
||||||
import { CustomPropertyTable } from 'components/common/CustomPropertyTable/CustomPropertyTable';
|
import { CustomPropertyTable } from 'components/common/CustomPropertyTable/CustomPropertyTable';
|
||||||
@ -34,6 +32,7 @@ import {
|
|||||||
OperationPermission,
|
OperationPermission,
|
||||||
ResourceEntity,
|
ResourceEntity,
|
||||||
} from 'components/PermissionProvider/PermissionProvider.interface';
|
} from 'components/PermissionProvider/PermissionProvider.interface';
|
||||||
|
import { withActivityFeed } from 'components/router/withActivityFeed';
|
||||||
import TabsLabel from 'components/TabsLabel/TabsLabel.component';
|
import TabsLabel from 'components/TabsLabel/TabsLabel.component';
|
||||||
import TagsContainerV2 from 'components/Tag/TagsContainerV2/TagsContainerV2';
|
import TagsContainerV2 from 'components/Tag/TagsContainerV2/TagsContainerV2';
|
||||||
import { DisplayType } from 'components/Tag/TagsViewer/TagsViewer.interface';
|
import { DisplayType } from 'components/Tag/TagsViewer/TagsViewer.interface';
|
||||||
@ -560,14 +559,12 @@ const ContainerPage = () => {
|
|||||||
),
|
),
|
||||||
key: EntityTabs.ACTIVITY_FEED,
|
key: EntityTabs.ACTIVITY_FEED,
|
||||||
children: (
|
children: (
|
||||||
<ActivityFeedProvider>
|
<ActivityFeedTab
|
||||||
<ActivityFeedTab
|
entityType={EntityType.CONTAINER}
|
||||||
entityType={EntityType.CONTAINER}
|
fqn={containerName}
|
||||||
fqn={containerName}
|
onFeedUpdate={getEntityFeedCount}
|
||||||
onFeedUpdate={getEntityFeedCount}
|
onUpdateEntityDetails={() => fetchContainerDetail(containerName)}
|
||||||
onUpdateEntityDetails={() => fetchContainerDetail(containerName)}
|
/>
|
||||||
/>
|
|
||||||
</ActivityFeedProvider>
|
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -731,4 +728,4 @@ const ContainerPage = () => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default observer(ContainerPage);
|
export default withActivityFeed(observer(ContainerPage));
|
||||||
|
@ -13,9 +13,7 @@
|
|||||||
import { Col, Row, Space, Tabs, Typography } from 'antd';
|
import { Col, Row, Space, Tabs, Typography } from 'antd';
|
||||||
import { AxiosError } from 'axios';
|
import { AxiosError } from 'axios';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import ActivityFeedProvider, {
|
import { useActivityFeedProvider } from 'components/ActivityFeed/ActivityFeedProvider/ActivityFeedProvider';
|
||||||
useActivityFeedProvider,
|
|
||||||
} from 'components/ActivityFeed/ActivityFeedProvider/ActivityFeedProvider';
|
|
||||||
import { ActivityFeedTab } from 'components/ActivityFeed/ActivityFeedTab/ActivityFeedTab.component';
|
import { ActivityFeedTab } from 'components/ActivityFeed/ActivityFeedTab/ActivityFeedTab.component';
|
||||||
import ActivityThreadPanel from 'components/ActivityFeed/ActivityThreadPanel/ActivityThreadPanel';
|
import ActivityThreadPanel from 'components/ActivityFeed/ActivityThreadPanel/ActivityThreadPanel';
|
||||||
import { CustomPropertyTable } from 'components/common/CustomPropertyTable/CustomPropertyTable';
|
import { CustomPropertyTable } from 'components/common/CustomPropertyTable/CustomPropertyTable';
|
||||||
@ -33,6 +31,7 @@ import {
|
|||||||
OperationPermission,
|
OperationPermission,
|
||||||
ResourceEntity,
|
ResourceEntity,
|
||||||
} from 'components/PermissionProvider/PermissionProvider.interface';
|
} from 'components/PermissionProvider/PermissionProvider.interface';
|
||||||
|
import { withActivityFeed } from 'components/router/withActivityFeed';
|
||||||
import SampleDataTableComponent from 'components/SampleDataTable/SampleDataTable.component';
|
import SampleDataTableComponent from 'components/SampleDataTable/SampleDataTable.component';
|
||||||
import SchemaTab from 'components/SchemaTab/SchemaTab.component';
|
import SchemaTab from 'components/SchemaTab/SchemaTab.component';
|
||||||
import { SourceType } from 'components/searched-data/SearchedData.interface';
|
import { SourceType } from 'components/searched-data/SearchedData.interface';
|
||||||
@ -549,16 +548,14 @@ const TableDetailsPageV1 = () => {
|
|||||||
),
|
),
|
||||||
key: EntityTabs.ACTIVITY_FEED,
|
key: EntityTabs.ACTIVITY_FEED,
|
||||||
children: (
|
children: (
|
||||||
<ActivityFeedProvider>
|
<ActivityFeedTab
|
||||||
<ActivityFeedTab
|
columns={tableDetails?.columns}
|
||||||
columns={tableDetails?.columns}
|
entityType={EntityType.TABLE}
|
||||||
entityType={EntityType.TABLE}
|
fqn={tableDetails?.fullyQualifiedName ?? ''}
|
||||||
fqn={tableDetails?.fullyQualifiedName ?? ''}
|
owner={tableDetails?.owner}
|
||||||
owner={tableDetails?.owner}
|
onFeedUpdate={getEntityFeedCount}
|
||||||
onFeedUpdate={getEntityFeedCount}
|
onUpdateEntityDetails={fetchTableDetails}
|
||||||
onUpdateEntityDetails={fetchTableDetails}
|
/>
|
||||||
/>
|
|
||||||
</ActivityFeedProvider>
|
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -935,4 +932,4 @@ const TableDetailsPageV1 = () => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default TableDetailsPageV1;
|
export default withActivityFeed(TableDetailsPageV1);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user