From 7628419a26e9798bcb2a1000b0e9383c7f14f56b Mon Sep 17 00:00:00 2001 From: Anmol Singh Bhatia <121005188+anmolsinghbhatia@users.noreply.github.com> Date: Thu, 15 Feb 2024 19:31:38 +0530 Subject: [PATCH] fix: inbox description and mutation (#3677) * fix: inbox status mutation fix * fix: inbox description fix * chore: added description in inbox issue --------- Co-authored-by: NarayanBavisetti --- apiserver/plane/app/views/inbox.py | 4 ++-- web/components/inbox/inbox-issue-status.tsx | 5 +++-- web/components/issues/description-form.tsx | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/apiserver/plane/app/views/inbox.py b/apiserver/plane/app/views/inbox.py index 01eee78e3..f76c74d9c 100644 --- a/apiserver/plane/app/views/inbox.py +++ b/apiserver/plane/app/views/inbox.py @@ -27,7 +27,7 @@ from plane.app.serializers import ( InboxSerializer, InboxIssueSerializer, IssueCreateSerializer, - IssueStateInboxSerializer, + IssueDetailSerializer, ) from plane.utils.issue_filters import issue_filters from plane.bgtasks.issue_activites_task import issue_activity @@ -333,7 +333,7 @@ class InboxIssueViewSet(BaseViewSet): def retrieve(self, request, slug, project_id, inbox_id, issue_id): issue = self.get_queryset().filter(pk=issue_id).first() - serializer = IssueSerializer(issue, expand=self.expand,) + serializer = IssueDetailSerializer(issue, expand=self.expand,) return Response(serializer.data, status=status.HTTP_200_OK) def destroy(self, request, slug, project_id, inbox_id, issue_id): diff --git a/web/components/inbox/inbox-issue-status.tsx b/web/components/inbox/inbox-issue-status.tsx index 301583b4b..2d101f2aa 100644 --- a/web/components/inbox/inbox-issue-status.tsx +++ b/web/components/inbox/inbox-issue-status.tsx @@ -1,4 +1,5 @@ import React from "react"; +import { observer } from "mobx-react"; // hooks import { useInboxIssues } from "hooks/store"; // constants @@ -13,7 +14,7 @@ type Props = { showDescription?: boolean; }; -export const InboxIssueStatus: React.FC = (props) => { +export const InboxIssueStatus: React.FC = observer((props) => { const { workspaceSlug, projectId, inboxId, issueId, iconSize = 18, showDescription = false } = props; // hooks const { @@ -52,4 +53,4 @@ export const InboxIssueStatus: React.FC = (props) => { )} ); -}; +}); diff --git a/web/components/issues/description-form.tsx b/web/components/issues/description-form.tsx index 4d20fd978..c64c147ea 100644 --- a/web/components/issues/description-form.tsx +++ b/web/components/issues/description-form.tsx @@ -108,7 +108,7 @@ export const IssueDescriptionForm: FC = observer((props) => { description_html: issue.description_html === "" ? "

" : issue.description_html, }); setLocalTitleValue(issue.name); - }, [issue, reset]); + }, [issue, issue.description_html, reset]); // ADDING handleDescriptionFormSubmit TO DEPENDENCY ARRAY PRODUCES ADVERSE EFFECTS // TODO: Verify the exhaustive-deps warning