From b94d3be456e1432287430771024d30b11f65163c Mon Sep 17 00:00:00 2001 From: Rohit Jain <60229265+Rohit0301@users.noreply.github.com> Date: Tue, 28 Oct 2025 19:17:03 +0530 Subject: [PATCH] Fix: Fixed incorrect re-direction link in mention tab (#24025) * Fix: Fixed incorrect re-direction link in mention tab * Fix: minor fix --- .../NotificationBox.component.tsx | 2 ++ .../NotificationFeedCard.component.tsx | 3 ++- .../NotificationFeedCard.interface.tsx | 1 + .../NotificationFeedCard.test.tsx | 21 +++++++++++++++++++ 4 files changed, 26 insertions(+), 1 deletion(-) diff --git a/openmetadata-ui/src/main/resources/ui/src/components/NotificationBox/NotificationBox.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/NotificationBox/NotificationBox.component.tsx index 8fa0db99740..464e1f6e11b 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/NotificationBox/NotificationBox.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/NotificationBox/NotificationBox.component.tsx @@ -73,6 +73,7 @@ const NotificationBox = ({ let actualUser = mainFeed.from; let actualTimestamp = mainFeed.postTs; let feedType = feed.type || ThreadType.Conversation; + const isConversationFeed = feed.type === ThreadType.Conversation; if ( activeTab === ThreadType.Conversation && @@ -100,6 +101,7 @@ const NotificationBox = ({ entityFQN={entityFQN as string} entityType={entityType as string} feedType={feedType} + isConversationFeed={isConversationFeed} key={`${actualUser} ${mainFeed.id}`} task={feed} timestamp={actualTimestamp} diff --git a/openmetadata-ui/src/main/resources/ui/src/components/NotificationBox/NotificationFeedCard.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/NotificationBox/NotificationFeedCard.component.tsx index 9d9bbf3a49b..b7afbbdd548 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/NotificationBox/NotificationFeedCard.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/NotificationBox/NotificationFeedCard.component.tsx @@ -37,6 +37,7 @@ const NotificationFeedCard: FC = ({ timestamp, feedType, task, + isConversationFeed = false, }) => { const { t } = useTranslation(); const { task: taskDetails } = task ?? {}; @@ -95,7 +96,7 @@ const NotificationFeedCard: FC = ({ diff --git a/openmetadata-ui/src/main/resources/ui/src/components/NotificationBox/NotificationFeedCard.interface.tsx b/openmetadata-ui/src/main/resources/ui/src/components/NotificationBox/NotificationFeedCard.interface.tsx index 36a2d75e908..57377aaf557 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/NotificationBox/NotificationFeedCard.interface.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/NotificationBox/NotificationFeedCard.interface.tsx @@ -21,4 +21,5 @@ export interface NotificationFeedProp entityType: string; entityFQN: string; timestamp?: number; + isConversationFeed?: boolean; } diff --git a/openmetadata-ui/src/main/resources/ui/src/components/NotificationBox/NotificationFeedCard.test.tsx b/openmetadata-ui/src/main/resources/ui/src/components/NotificationBox/NotificationFeedCard.test.tsx index 2646d921639..c1bbab92eca 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/NotificationBox/NotificationFeedCard.test.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/NotificationBox/NotificationFeedCard.test.tsx @@ -224,6 +224,7 @@ describe('Test NotificationFeedCard Component', () => { const conversationProps = { ...mockProps, feedType: ThreadType.Conversation, + isConversationFeed: true, }; await act(async () => { @@ -243,6 +244,25 @@ describe('Test NotificationFeedCard Component', () => { expect(linkElement).toHaveAttribute('data-to', conversationUrl); }); + it('should call getTaskDetailPath for task feed entity links in mention notifications tab', async () => { + const entityLinkUrl = '/database/test.entity/activity_feed/all'; + mockPrepareFeedLink.mockReturnValue(entityLinkUrl); + + const conversationProps = { + ...mockProps, + feedType: ThreadType.Conversation, + isConversationFeed: false, + }; + + await act(async () => { + render(); + }); + + // Should be called twice - once for main link, once for entity name link + expect(mockGetTaskDetailPath).toHaveBeenCalledTimes(2); + expect(mockGetTaskDetailPath).toHaveBeenCalledWith(mockThread); + }); + it('should call prepareFeedLink with ALL subtab for entity links in conversation notifications', async () => { const entityLinkUrl = '/database/test.entity/activity_feed/all'; mockPrepareFeedLink.mockReturnValue(entityLinkUrl); @@ -250,6 +270,7 @@ describe('Test NotificationFeedCard Component', () => { const conversationProps = { ...mockProps, feedType: ThreadType.Conversation, + isConversationFeed: true, }; await act(async () => {