diff --git a/src/frontend/src/components/ProjectDetailsV2/Comments.tsx b/src/frontend/src/components/ProjectDetailsV2/Comments.tsx index 45784eafaa..e6771a5dec 100644 --- a/src/frontend/src/components/ProjectDetailsV2/Comments.tsx +++ b/src/frontend/src/components/ProjectDetailsV2/Comments.tsx @@ -27,8 +27,9 @@ const Comments = () => { return task?.id == selectedTask; })?.[0], }; + // filter out submission/feature level comments const filteredProjectCommentsList = projectCommentsList?.filter( - (entry) => !entry?.comment?.includes('-SUBMISSION_INST-'), + (entry) => !entry?.comment?.includes('-SUBMISSION_INST-') && !entry?.comment?.startsWith('#submissionId:uuid:'), ); useEffect(() => { diff --git a/src/frontend/src/components/ProjectSubmissions/UpdateReviewStatusModal.tsx b/src/frontend/src/components/ProjectSubmissions/UpdateReviewStatusModal.tsx index 0d4cdc6826..6868299161 100644 --- a/src/frontend/src/components/ProjectSubmissions/UpdateReviewStatusModal.tsx +++ b/src/frontend/src/components/ProjectSubmissions/UpdateReviewStatusModal.tsx @@ -122,7 +122,7 @@ const UpdateReviewStatusModal = () => { `${import.meta.env.VITE_API_URL}/tasks/${updateReviewStatusModal?.taskUid}/event?project_id=${updateReviewStatusModal?.projectId}`, { task_id: +updateReviewStatusModal?.taskUid, - comment: `${updateReviewStatusModal?.instanceId}-SUBMISSION_INST-${noteComments}`, + comment: `#submissionId:${updateReviewStatusModal?.instanceId} #featureId:${updateReviewStatusModal?.entity_id} ${noteComments}`, event: task_event.COMMENT, }, ), diff --git a/src/frontend/src/components/SubmissionInstance/SubmissionComments.tsx b/src/frontend/src/components/SubmissionInstance/SubmissionComments.tsx index f83821646d..153855983f 100644 --- a/src/frontend/src/components/SubmissionInstance/SubmissionComments.tsx +++ b/src/frontend/src/components/SubmissionInstance/SubmissionComments.tsx @@ -9,10 +9,17 @@ const SubmissionComments = () => { const submissionInstanceId = params.instanceId; const taskCommentsList = useAppSelector((state) => state?.project?.projectCommentsList); - const filteredTaskCommentsList = taskCommentsList + const taskGetCommentsLoading = useAppSelector((state) => state?.project?.projectGetCommentsLoading); + + // handle for old project comments + const oldfilteredTaskCommentsList = taskCommentsList ?.filter((entry) => entry?.comment.includes('-SUBMISSION_INST-')) .filter((entry) => entry.comment.split('-SUBMISSION_INST-')[0] === submissionInstanceId); - const taskGetCommentsLoading = useAppSelector((state) => state?.project?.projectGetCommentsLoading); + const newfilteredTaskCommentsList = taskCommentsList?.filter( + (comment) => comment?.comment?.split(' ')?.[0] === `#submissionId:${submissionInstanceId}`, + ); + + const filteredTaskCommentsList = [...oldfilteredTaskCommentsList, ...newfilteredTaskCommentsList]; return (
{entry?.username}
{entry?.created_at?.split('T')[0]}
{entry?.comment?.split('-SUBMISSION_INST-')[1]}
++ {entry?.comment?.split('-SUBMISSION_INST-')?.[1] || + entry?.comment?.replace(/#submissionId:uuid:[\w-]+|#featureId:[\w-]+/g, '')?.trim()} +