Fix #5114 UI : Broken link for users on request description for conversations (#5115)

This commit is contained in:
Sachin Chaurasiya 2022-05-24 16:38:19 +05:30 committed by GitHub
parent 157e749ffd
commit a694dd5a04
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,6 +14,7 @@
import { isEmpty, isUndefined } from 'lodash';
import { EntityFieldThreads } from 'Models';
import React, { Fragment } from 'react';
import { entityUrlMap } from '../constants/feed.constants';
import { EntityReference } from '../generated/entity/teams/user';
import { getEntityFeedLink } from './EntityUtils';
import { getThreadField } from './FeedUtils';
@ -82,7 +83,9 @@ export const getDefaultValue = (owner: EntityReference) => {
const name = owner.name;
const displayName = owner.displayName;
const entityType = owner.type;
const mention = `<a href=${`${document.location.protocol}//${document.location.host}/${entityType}/${name}`}>@${displayName}</a>`;
const mention = `<a href=${`/${
entityUrlMap[entityType as keyof typeof entityUrlMap]
}/${name}`}>@${displayName}</a>`;
return `${mention} ${message}`;
}