fix loader and header issue (#20651)

This commit is contained in:
Shrushti Polekar 2025-04-05 14:59:07 +05:30 committed by GitHub
parent a59295a619
commit f8f6634809
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 14 additions and 8 deletions

View File

@ -112,7 +112,7 @@ const ActivityFeedListV1New = ({
isFullWidth,
]
);
if (isLoading && isForFeedTab) {
if (isLoading) {
return <Loader />;
}

View File

@ -66,9 +66,9 @@
.task-feed-card-v1-new {
.header-link {
word-wrap: break-word;
white-space: normal;
color: @blue-9;
font-weight: 600;
display: inline;
}
}
.feeds-widget-container {

View File

@ -13,6 +13,7 @@
import { Button, Dropdown, Menu, Segmented, Space, Typography } from 'antd';
import { AxiosError } from 'axios';
import classNames from 'classnames';
import { isEmpty } from 'lodash';
import {
default as React,
RefObject,
@ -115,6 +116,7 @@ export const ActivityFeedTab = ({
loading: false,
data: FEED_COUNT_INITIAL_DATA,
});
const [isFirstLoad, setIsFirstLoad] = useState<boolean>(true);
const {
selectedThread,
@ -150,8 +152,12 @@ export const ActivityFeedTab = ({
() => activeTab === ActivityFeedTabs.MENTIONS,
[activeTab]
);
useEffect(() => {
setIsFirstLoad(true);
}, [subTab]);
const handleTabChange = (subTab: string) => {
setIsFirstLoad(true);
history.push(
entityUtilClassBase.getEntityLink(
entityType,
@ -256,6 +262,7 @@ export const ActivityFeedTab = ({
const handleFeedFetchFromFeedList = useCallback(
(after?: string) => {
setIsFirstLoad(false);
getFeedData(feedFilter, after, threadType, entityType, fqn, taskFilter);
},
[threadType, feedFilter, entityType, fqn, taskFilter, getFeedData]
@ -611,14 +618,14 @@ export const ActivityFeedTab = ({
handlePanelResize={handlePanelResize}
isForFeedTab={false}
isFullWidth={isFullWidth}
isLoading={loading}
isLoading={isFirstLoad && loading}
selectedThread={selectedThread}
showThread={false}
onAfterClose={handleAfterTaskClose}
onFeedClick={handleFeedClick}
/>
{loader}
{entityThread.length > 0 && (
{!isFirstLoad && loader}
{!isEmpty(entityThread) && !loading && (
<div
className="w-full"
data-testid="observer-element"

View File

@ -214,7 +214,6 @@
.header-link {
word-wrap: break-word;
white-space: normal;
font-weight: 600;
.ant-typography,

View File

@ -327,12 +327,12 @@ export const TaskTabNew = ({
{taskColumnName}
<Typography.Text
className="break-all text-sm entity-link header-link"
className="break-all text-sm entity-link header-link whitespace-normal"
data-testid="entity-link">
{getNameFromFQN(entityFQN)}
</Typography.Text>
<Typography.Text className="p-l-xss entity-type header-link">{`(${entityType})`}</Typography.Text>
<Typography.Text className="p-l-xss entity-type header-link whitespace-normal">{`(${entityType})`}</Typography.Text>
</Button>
</EntityPopOverCard>
) : null,