|
1 | 1 | import * as React from 'react'; |
2 | | -import { useEffect } from 'react'; |
| 2 | +import { useEffect, useMemo } from 'react'; |
| 3 | +import { useSelector } from 'react-redux'; |
3 | 4 | import classnames from 'classnames'; |
4 | 5 | import { useIntl } from 'react-intl'; |
5 | 6 | import Switch from 'rc-switch'; |
@@ -41,6 +42,9 @@ import { WorkflowLogRemovedPerformerGroup } from './WorkflowLogEvents/WorkflowLo |
41 | 42 |
|
42 | 43 | import styles from './WorkflowLog.css'; |
43 | 44 | import { IChangeWorkflowLogViewSettingsPayload, ISendWorkflowLogComment } from '../../../redux/workflows/types'; |
| 45 | +import { getUsers } from '../../../redux/selectors/user'; |
| 46 | +import { getNotDeletedUsers } from '../../../utils/users'; |
| 47 | +import { getMentionData } from '../../RichEditor/utils/getMentionData'; |
44 | 48 |
|
45 | 49 | export const WorkflowLog = ({ |
46 | 50 | theme, |
@@ -69,6 +73,12 @@ export const WorkflowLog = ({ |
69 | 73 | }: IWorkflowLogProps) => { |
70 | 74 | const { formatMessage } = useIntl(); |
71 | 75 |
|
| 76 | + const users = useSelector(getUsers); |
| 77 | + const mentions = useMemo( |
| 78 | + () => getMentionData(getNotDeletedUsers(users)), |
| 79 | + [users], |
| 80 | + ); |
| 81 | + |
72 | 82 | useEffect(() => { |
73 | 83 | return () => { |
74 | 84 | if (onUnmount) { |
@@ -213,7 +223,7 @@ export const WorkflowLog = ({ |
213 | 223 |
|
214 | 224 | return ( |
215 | 225 | <div className={styles['comment-field']}> |
216 | | - <PopupCommentFieldContainer sendComment={sendComment} taskId={taskId} /> |
| 226 | + <PopupCommentFieldContainer sendComment={sendComment} taskId={taskId} mentions={mentions} /> |
217 | 227 | </div> |
218 | 228 | ); |
219 | 229 | }; |
@@ -270,6 +280,7 @@ export const WorkflowLog = ({ |
270 | 280 | <WorkflowLogTaskCommentContainer |
271 | 281 | workflowStatus={workflowStatus} |
272 | 282 | isOnlyAttachmentsShown={isOnlyAttachmentsShown} |
| 283 | + mentions={mentions} |
273 | 284 | {...event} |
274 | 285 | /> |
275 | 286 | ), |
|
0 commit comments