mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-11-24 14:45:55 +00:00
Fix: Fixed incorrect re-direction link in mention tab (#24025)
* Fix: Fixed incorrect re-direction link in mention tab * Fix: minor fix
This commit is contained in:
parent
a34f50a6d0
commit
b94d3be456
@ -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}
|
||||
|
||||
@ -37,6 +37,7 @@ const NotificationFeedCard: FC<NotificationFeedProp> = ({
|
||||
timestamp,
|
||||
feedType,
|
||||
task,
|
||||
isConversationFeed = false,
|
||||
}) => {
|
||||
const { t } = useTranslation();
|
||||
const { task: taskDetails } = task ?? {};
|
||||
@ -95,7 +96,7 @@ const NotificationFeedCard: FC<NotificationFeedProp> = ({
|
||||
<Link
|
||||
className="no-underline"
|
||||
to={
|
||||
feedType === ThreadType.Conversation
|
||||
isConversationFeed
|
||||
? prepareFeedLink(entityType, entityFQN, ActivityFeedTabs.ALL)
|
||||
: getTaskDetailPath(task)
|
||||
}>
|
||||
|
||||
@ -21,4 +21,5 @@ export interface NotificationFeedProp
|
||||
entityType: string;
|
||||
entityFQN: string;
|
||||
timestamp?: number;
|
||||
isConversationFeed?: boolean;
|
||||
}
|
||||
|
||||
@ -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(<NotificationFeedCard {...conversationProps} />);
|
||||
});
|
||||
|
||||
// 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 () => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user