[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:
parent
bac5b53ffb
commit
12a304b04f
3 changed files with 21 additions and 6 deletions
|
|
@ -20,10 +20,17 @@ interface IIssuePeekOverview {
|
||||||
embedRemoveCurrentNotification?: () => void;
|
embedRemoveCurrentNotification?: () => void;
|
||||||
is_archived?: boolean;
|
is_archived?: boolean;
|
||||||
is_draft?: boolean;
|
is_draft?: boolean;
|
||||||
|
shouldReplaceIssueOnFetch?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const IssuePeekOverview: FC<IIssuePeekOverview> = observer((props) => {
|
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
|
// router
|
||||||
const pathname = usePathname();
|
const pathname = usePathname();
|
||||||
const {
|
const {
|
||||||
|
|
@ -60,7 +67,8 @@ export const IssuePeekOverview: FC<IIssuePeekOverview> = observer((props) => {
|
||||||
workspaceSlug,
|
workspaceSlug,
|
||||||
projectId,
|
projectId,
|
||||||
issueId,
|
issueId,
|
||||||
is_archived ? "ARCHIVED" : is_draft ? "DRAFT" : "DEFAULT"
|
is_archived ? "ARCHIVED" : is_draft ? "DRAFT" : "DEFAULT",
|
||||||
|
shouldReplaceIssueOnFetch
|
||||||
);
|
);
|
||||||
setLoader(false);
|
setLoader(false);
|
||||||
setError(false);
|
setError(false);
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ export const WorkspaceDashboardView = observer(() => {
|
||||||
<>
|
<>
|
||||||
{joinedProjectIds.length > 0 || loader ? (
|
{joinedProjectIds.length > 0 || loader ? (
|
||||||
<>
|
<>
|
||||||
<IssuePeekOverview />
|
<IssuePeekOverview shouldReplaceIssueOnFetch={false} />
|
||||||
<div
|
<div
|
||||||
className={cn(
|
className={cn(
|
||||||
"space-y-7 md:p-7 p-3 bg-custom-background-90 h-full w-full flex flex-col overflow-y-auto",
|
"space-y-7 md:p-7 p-3 bg-custom-background-90 h-full w-full flex flex-col overflow-y-auto",
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,8 @@ export interface IIssueStoreActions {
|
||||||
workspaceSlug: string,
|
workspaceSlug: string,
|
||||||
projectId: string,
|
projectId: string,
|
||||||
issueId: string,
|
issueId: string,
|
||||||
issueType?: "DEFAULT" | "DRAFT" | "ARCHIVED"
|
issueType?: "DEFAULT" | "DRAFT" | "ARCHIVED",
|
||||||
|
shouldReplace?: boolean
|
||||||
) => Promise<TIssue>;
|
) => Promise<TIssue>;
|
||||||
updateIssue: (workspaceSlug: string, projectId: string, issueId: string, data: Partial<TIssue>) => Promise<void>;
|
updateIssue: (workspaceSlug: string, projectId: string, issueId: string, data: Partial<TIssue>) => Promise<void>;
|
||||||
removeIssue: (workspaceSlug: string, projectId: string, issueId: string) => Promise<void>;
|
removeIssue: (workspaceSlug: string, projectId: string, issueId: string) => Promise<void>;
|
||||||
|
|
@ -61,7 +62,13 @@ export class IssueStore implements IIssueStore {
|
||||||
});
|
});
|
||||||
|
|
||||||
// actions
|
// 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 = {
|
const query = {
|
||||||
expand: "issue_reactions,issue_attachment,issue_link,parent",
|
expand: "issue_reactions,issue_attachment,issue_link,parent",
|
||||||
};
|
};
|
||||||
|
|
@ -107,7 +114,7 @@ export class IssueStore implements IIssueStore {
|
||||||
is_subscribed: issue?.is_subscribed,
|
is_subscribed: issue?.is_subscribed,
|
||||||
};
|
};
|
||||||
|
|
||||||
this.rootIssueDetailStore.rootIssueStore.issues.addIssue([issuePayload], true);
|
this.rootIssueDetailStore.rootIssueStore.issues.addIssue([issuePayload], shouldReplace);
|
||||||
|
|
||||||
// store handlers from issue detail
|
// store handlers from issue detail
|
||||||
// parent
|
// parent
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue