From 12a304b04fc26af226a6e1f983b331c5de643d68 Mon Sep 17 00:00:00 2001 From: Anmol Singh Bhatia <121005188+anmolsinghbhatia@users.noreply.github.com> Date: Mon, 2 Sep 2024 14:01:57 +0530 Subject: [PATCH] [WEB-2228] fix: dashboard peek overview issue fetch (#5442) * fix: dashboard peekoverview issue fetch * fix: intake issue modal remove parent issue action --- web/core/components/issues/peek-overview/root.tsx | 12 ++++++++++-- .../components/page-views/workspace-dashboard.tsx | 2 +- web/core/store/issue/issue-details/issue.store.ts | 13 ++++++++++--- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/web/core/components/issues/peek-overview/root.tsx b/web/core/components/issues/peek-overview/root.tsx index a55b0d546..3685767fd 100644 --- a/web/core/components/issues/peek-overview/root.tsx +++ b/web/core/components/issues/peek-overview/root.tsx @@ -20,10 +20,17 @@ interface IIssuePeekOverview { embedRemoveCurrentNotification?: () => void; is_archived?: boolean; is_draft?: boolean; + shouldReplaceIssueOnFetch?: boolean; } export const IssuePeekOverview: FC = observer((props) => { - const { embedIssue = false, embedRemoveCurrentNotification, is_archived = false, is_draft = false } = props; + const { + embedIssue = false, + embedRemoveCurrentNotification, + is_archived = false, + is_draft = false, + shouldReplaceIssueOnFetch = true, + } = props; // router const pathname = usePathname(); const { @@ -60,7 +67,8 @@ export const IssuePeekOverview: FC = observer((props) => { workspaceSlug, projectId, issueId, - is_archived ? "ARCHIVED" : is_draft ? "DRAFT" : "DEFAULT" + is_archived ? "ARCHIVED" : is_draft ? "DRAFT" : "DEFAULT", + shouldReplaceIssueOnFetch ); setLoader(false); setError(false); diff --git a/web/core/components/page-views/workspace-dashboard.tsx b/web/core/components/page-views/workspace-dashboard.tsx index 165bce60a..d986d1914 100644 --- a/web/core/components/page-views/workspace-dashboard.tsx +++ b/web/core/components/page-views/workspace-dashboard.tsx @@ -64,7 +64,7 @@ export const WorkspaceDashboardView = observer(() => { <> {joinedProjectIds.length > 0 || loader ? ( <> - +
Promise; updateIssue: (workspaceSlug: string, projectId: string, issueId: string, data: Partial) => Promise; removeIssue: (workspaceSlug: string, projectId: string, issueId: string) => Promise; @@ -61,7 +62,13 @@ export class IssueStore implements IIssueStore { }); // actions - fetchIssue = async (workspaceSlug: string, projectId: string, issueId: string, issueType = "DEFAULT") => { + fetchIssue = async ( + workspaceSlug: string, + projectId: string, + issueId: string, + issueType = "DEFAULT", + shouldReplace = true + ) => { const query = { expand: "issue_reactions,issue_attachment,issue_link,parent", }; @@ -107,7 +114,7 @@ export class IssueStore implements IIssueStore { is_subscribed: issue?.is_subscribed, }; - this.rootIssueDetailStore.rootIssueStore.issues.addIssue([issuePayload], true); + this.rootIssueDetailStore.rootIssueStore.issues.addIssue([issuePayload], shouldReplace); // store handlers from issue detail // parent