fix the redirect path of mention knowledge article and breadcrumb (#23519)

* fix the redirect path of mention knowledge article and breadcrumb

* added data-test id here

(cherry picked from commit 1d4aff0154775d7303c137e9a03c2f05ac0f3a18)
This commit is contained in:
Ashish Gupta 2025-09-23 23:41:58 +05:30
parent 3ef60771a5
commit 21d36b0a79
3 changed files with 7 additions and 2 deletions

View File

@ -116,6 +116,7 @@ export default forwardRef<
className={classNames('w-full cursor-pointer hashtag-item', {
'bg-grey-2': index === selectedIndex,
})}
data-testid={`hash-mention-${item.label}`}
direction="vertical"
id={`hashtag-item-${item.id}`}
key={item.id}

View File

@ -17,8 +17,8 @@ import tippy, { Instance, Props } from 'tippy.js';
import { EntityType } from '../../../../enums/entity.enum';
import { SearchIndex } from '../../../../enums/search.enum';
import { searchData } from '../../../../rest/miscAPI';
import { getEntityBreadcrumbs } from '../../../../utils/EntityUtils';
import { buildMentionLink } from '../../../../utils/FeedUtils';
import searchClassBase from '../../../../utils/SearchClassBase';
import { ExtensionRef } from '../../BlockEditor.interface';
import HashList from './HashList';
@ -45,7 +45,7 @@ export const hashtagSuggestion = () => ({
hit._source.fullyQualifiedName ?? ''
),
type: hit._source.entityType,
breadcrumbs: getEntityBreadcrumbs(
breadcrumbs: searchClassBase.getEntityBreadcrumbs(
hit._source,
hit._source.entityType as EntityType,
false

View File

@ -149,6 +149,10 @@ export const buildMentionLink = (entityType: string, entityFqn: string) => {
const classificationFqn = Fqn.split(entityFqn);
return `${document.location.protocol}//${document.location.host}/tags/${classificationFqn[0]}`;
} else if (entityType === EntityType.KNOWLEDGE_PAGE) {
return `${document.location.protocol}//${
document.location.host
}/knowledge-center/${getEncodedFqn(entityFqn)}`;
}
return `${document.location.protocol}//${