diff --git a/web/components/analytics/custom-analytics/table.tsx b/web/components/analytics/custom-analytics/table.tsx index 1d578b0d8..5c7bb1146 100644 --- a/web/components/analytics/custom-analytics/table.tsx +++ b/web/components/analytics/custom-analytics/table.tsx @@ -69,6 +69,7 @@ export const AnalyticsTable: React.FC = ({ analytics, barGraphData, param }`} > {params.x_axis === "priority" ? ( + // TODO: incorrect priority icon being rendered ) : ( = ({ issueDetails }) => { +export const InboxIssueActivity: React.FC = observer(({ issueDetails }) => { const router = useRouter(); const { workspaceSlug, projectId, inboxIssueId } = router.query; + const { user: userStore } = useMobxStore(); + const { setToastAlert } = useToast(); - const { user } = useUser(); - const { data: issueActivity, mutate: mutateIssueActivity } = useSWR( - workspaceSlug && projectId && inboxIssueId ? PROJECT_ISSUES_ACTIVITY(inboxIssueId.toString()) : null, - workspaceSlug && projectId && inboxIssueId - ? () => issueService.getIssueActivities(workspaceSlug.toString(), projectId.toString(), inboxIssueId.toString()) + workspaceSlug && projectId && issueDetails ? PROJECT_ISSUES_ACTIVITY(issueDetails.id) : null, + workspaceSlug && projectId && issueDetails + ? () => issueService.getIssueActivities(workspaceSlug.toString(), projectId.toString(), issueDetails.id) : null ); + const user = userStore.currentUser; + const handleCommentUpdate = async (commentId: string, data: Partial) => { - if (!workspaceSlug || !projectId || !inboxIssueId) return; + if (!workspaceSlug || !projectId || !inboxIssueId || !user) return; await issueCommentService .patchIssueComment(workspaceSlug as string, projectId as string, inboxIssueId as string, commentId, data, user) @@ -44,7 +46,7 @@ export const InboxIssueActivity: React.FC = ({ issueDetails }) => { }; const handleCommentDelete = async (commentId: string) => { - if (!workspaceSlug || !projectId || !inboxIssueId) return; + if (!workspaceSlug || !projectId || !inboxIssueId || !user) return; mutateIssueActivity((prevData: any) => prevData?.filter((p: any) => p.id !== commentId), false); @@ -54,7 +56,7 @@ export const InboxIssueActivity: React.FC = ({ issueDetails }) => { }; const handleAddComment = async (formData: IIssueComment) => { - if (!workspaceSlug || !issueDetails) return; + if (!workspaceSlug || !issueDetails || !user) return; await issueCommentService .createIssueComment(workspaceSlug.toString(), issueDetails.project, issueDetails.id, formData, user) @@ -81,4 +83,4 @@ export const InboxIssueActivity: React.FC = ({ issueDetails }) => { ); -}; +});