mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-11-24 22:52:09 +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 actualUser = mainFeed.from;
|
||||||
let actualTimestamp = mainFeed.postTs;
|
let actualTimestamp = mainFeed.postTs;
|
||||||
let feedType = feed.type || ThreadType.Conversation;
|
let feedType = feed.type || ThreadType.Conversation;
|
||||||
|
const isConversationFeed = feed.type === ThreadType.Conversation;
|
||||||
|
|
||||||
if (
|
if (
|
||||||
activeTab === ThreadType.Conversation &&
|
activeTab === ThreadType.Conversation &&
|
||||||
@ -100,6 +101,7 @@ const NotificationBox = ({
|
|||||||
entityFQN={entityFQN as string}
|
entityFQN={entityFQN as string}
|
||||||
entityType={entityType as string}
|
entityType={entityType as string}
|
||||||
feedType={feedType}
|
feedType={feedType}
|
||||||
|
isConversationFeed={isConversationFeed}
|
||||||
key={`${actualUser} ${mainFeed.id}`}
|
key={`${actualUser} ${mainFeed.id}`}
|
||||||
task={feed}
|
task={feed}
|
||||||
timestamp={actualTimestamp}
|
timestamp={actualTimestamp}
|
||||||
|
|||||||
@ -37,6 +37,7 @@ const NotificationFeedCard: FC<NotificationFeedProp> = ({
|
|||||||
timestamp,
|
timestamp,
|
||||||
feedType,
|
feedType,
|
||||||
task,
|
task,
|
||||||
|
isConversationFeed = false,
|
||||||
}) => {
|
}) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { task: taskDetails } = task ?? {};
|
const { task: taskDetails } = task ?? {};
|
||||||
@ -95,7 +96,7 @@ const NotificationFeedCard: FC<NotificationFeedProp> = ({
|
|||||||
<Link
|
<Link
|
||||||
className="no-underline"
|
className="no-underline"
|
||||||
to={
|
to={
|
||||||
feedType === ThreadType.Conversation
|
isConversationFeed
|
||||||
? prepareFeedLink(entityType, entityFQN, ActivityFeedTabs.ALL)
|
? prepareFeedLink(entityType, entityFQN, ActivityFeedTabs.ALL)
|
||||||
: getTaskDetailPath(task)
|
: getTaskDetailPath(task)
|
||||||
}>
|
}>
|
||||||
|
|||||||
@ -21,4 +21,5 @@ export interface NotificationFeedProp
|
|||||||
entityType: string;
|
entityType: string;
|
||||||
entityFQN: string;
|
entityFQN: string;
|
||||||
timestamp?: number;
|
timestamp?: number;
|
||||||
|
isConversationFeed?: boolean;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -224,6 +224,7 @@ describe('Test NotificationFeedCard Component', () => {
|
|||||||
const conversationProps = {
|
const conversationProps = {
|
||||||
...mockProps,
|
...mockProps,
|
||||||
feedType: ThreadType.Conversation,
|
feedType: ThreadType.Conversation,
|
||||||
|
isConversationFeed: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
await act(async () => {
|
await act(async () => {
|
||||||
@ -243,6 +244,25 @@ describe('Test NotificationFeedCard Component', () => {
|
|||||||
expect(linkElement).toHaveAttribute('data-to', conversationUrl);
|
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 () => {
|
it('should call prepareFeedLink with ALL subtab for entity links in conversation notifications', async () => {
|
||||||
const entityLinkUrl = '/database/test.entity/activity_feed/all';
|
const entityLinkUrl = '/database/test.entity/activity_feed/all';
|
||||||
mockPrepareFeedLink.mockReturnValue(entityLinkUrl);
|
mockPrepareFeedLink.mockReturnValue(entityLinkUrl);
|
||||||
@ -250,6 +270,7 @@ describe('Test NotificationFeedCard Component', () => {
|
|||||||
const conversationProps = {
|
const conversationProps = {
|
||||||
...mockProps,
|
...mockProps,
|
||||||
feedType: ThreadType.Conversation,
|
feedType: ThreadType.Conversation,
|
||||||
|
isConversationFeed: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
await act(async () => {
|
await act(async () => {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user