[WEB-2228] fix: dashboard peek overview issue fetch (#5442)

* fix: dashboard peekoverview issue fetch

* fix: intake issue modal remove parent issue action
This commit is contained in:
Anmol Singh Bhatia
2024-09-02 14:01:57 +05:30
committed by GitHub
parent bac5b53ffb
commit 12a304b04f
3 changed files with 21 additions and 6 deletions

View File

@@ -20,10 +20,17 @@ interface IIssuePeekOverview {
embedRemoveCurrentNotification?: () => void;
is_archived?: boolean;
is_draft?: boolean;
shouldReplaceIssueOnFetch?: boolean;
}
export const IssuePeekOverview: FC<IIssuePeekOverview> = 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<IIssuePeekOverview> = observer((props) => {
workspaceSlug,
projectId,
issueId,
is_archived ? "ARCHIVED" : is_draft ? "DRAFT" : "DEFAULT"
is_archived ? "ARCHIVED" : is_draft ? "DRAFT" : "DEFAULT",
shouldReplaceIssueOnFetch
);
setLoader(false);
setError(false);

View File

@@ -64,7 +64,7 @@ export const WorkspaceDashboardView = observer(() => {
<>
{joinedProjectIds.length > 0 || loader ? (
<>
<IssuePeekOverview />
<IssuePeekOverview shouldReplaceIssueOnFetch={false} />
<div
className={cn(
"space-y-7 md:p-7 p-3 bg-custom-background-90 h-full w-full flex flex-col overflow-y-auto",

View File

@@ -13,7 +13,8 @@ export interface IIssueStoreActions {
workspaceSlug: string,
projectId: string,
issueId: string,
issueType?: "DEFAULT" | "DRAFT" | "ARCHIVED"
issueType?: "DEFAULT" | "DRAFT" | "ARCHIVED",
shouldReplace?: boolean
) => Promise<TIssue>;
updateIssue: (workspaceSlug: string, projectId: string, issueId: string, data: Partial<TIssue>) => Promise<void>;
removeIssue: (workspaceSlug: string, projectId: string, issueId: string) => Promise<void>;
@@ -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