Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,13 @@ export const InboxIssueProperties: FC<TInboxIssueProperties> = observer((props)
<CustomMenu.MenuItem className="!p-1" onClick={() => setParentIssueModalOpen(true)}>
Change parent issue
</CustomMenu.MenuItem>
<CustomMenu.MenuItem className="!p-1" onClick={() => handleData("parent_id", "")}>
<CustomMenu.MenuItem
className="!p-1"
onClick={() => {
handleData("parent_id", "");
setSelectedParentIssue(undefined);
}}
>
Remove parent issue
</CustomMenu.MenuItem>
</>
Expand Down
12 changes: 10 additions & 2 deletions web/core/components/issues/peek-overview/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion web/core/components/page-views/workspace-dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
13 changes: 10 additions & 3 deletions web/core/store/issue/issue-details/issue.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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>;
Expand Down Expand Up @@ -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",
};
Expand Down Expand Up @@ -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
Expand Down