diff --git a/web/components/issues/delete-issue-modal.tsx b/web/components/issues/delete-issue-modal.tsx index 50f53911d..2f53a825f 100644 --- a/web/components/issues/delete-issue-modal.tsx +++ b/web/components/issues/delete-issue-modal.tsx @@ -3,6 +3,8 @@ import { Dialog, Transition } from "@headlessui/react"; import { AlertTriangle } from "lucide-react"; // ui import { Button } from "@plane/ui"; +// hooks +import useToast from "hooks/use-toast"; // types import type { IIssue } from "types"; @@ -18,6 +20,8 @@ export const DeleteIssueModal: React.FC = (props) => { const [isDeleteLoading, setIsDeleteLoading] = useState(false); + const { setToastAlert } = useToast(); + useEffect(() => { setIsDeleteLoading(false); }, [isOpen]); @@ -31,7 +35,21 @@ export const DeleteIssueModal: React.FC = (props) => { setIsDeleteLoading(true); if (onSubmit) await onSubmit() - .then(() => onClose()) + .then(() => { + setToastAlert({ + title: "Success", + type: "success", + message: "Issue deleted successfully", + }); + onClose(); + }) + .catch(() => { + setToastAlert({ + title: "Error", + type: "error", + message: "Failed to delete issue", + }); + }) .finally(() => setIsDeleteLoading(false)); }; diff --git a/web/components/issues/issue-layouts/kanban/base-kanban-root.tsx b/web/components/issues/issue-layouts/kanban/base-kanban-root.tsx index 57ab8418c..05799f728 100644 --- a/web/components/issues/issue-layouts/kanban/base-kanban-root.tsx +++ b/web/components/issues/issue-layouts/kanban/base-kanban-root.tsx @@ -195,25 +195,12 @@ export const BaseKanBanRoot: React.FC = observer((props: IBas const handleDeleteIssue = async () => { if (!handleDragDrop) return; - await handleDragDrop(dragState.source, dragState.destination, sub_group_by, group_by, issues, issueIds) - .then(() => { - setToastAlert({ - title: "Success", - type: "success", - message: "Issue deleted successfully", - }); - }) - .catch(() => { - setToastAlert({ - title: "Error", - type: "error", - message: "Failed to delete issue", - }); - }) - .finally(() => { + await handleDragDrop(dragState.source, dragState.destination, sub_group_by, group_by, issues, issueIds).finally( + () => { setDeleteIssueModal(false); setDragState({}); - }); + } + ); }; const handleKanBanToggle = (toggle: "groupByHeaderMinMax" | "subgroupByIssuesVisibility", value: string) => { diff --git a/web/components/issues/issue-layouts/spreadsheet/spreadsheet-view.tsx b/web/components/issues/issue-layouts/spreadsheet/spreadsheet-view.tsx index ef6215003..69ac625e8 100644 --- a/web/components/issues/issue-layouts/spreadsheet/spreadsheet-view.tsx +++ b/web/components/issues/issue-layouts/spreadsheet/spreadsheet-view.tsx @@ -77,6 +77,13 @@ export const SpreadsheetView: React.FC = observer((props) => { }; }, []); + if (!issues || issues.length === 0) + return ( +
+ +
+ ); + return (
@@ -84,7 +91,7 @@ export const SpreadsheetView: React.FC = observer((props) => { ref={containerRef} className="horizontal-scroll-enable flex divide-x-[0.5px] divide-custom-border-200 overflow-y-auto" > - {issues && issues.length > 0 ? ( + {issues && issues.length > 0 && ( <>
= observer((props) => { states={states} /> - ) : ( -
- -
)}
{/* empty div to show right most border */}
diff --git a/web/pages/profile/activity.tsx b/web/pages/profile/activity.tsx index 744ecae64..02317799f 100644 --- a/web/pages/profile/activity.tsx +++ b/web/pages/profile/activity.tsx @@ -100,7 +100,9 @@ const ProfileActivityPage: NextPageWithLayout = () => { activityItem.field !== "estimate" ? ( created{" "} - + this issue. diff --git a/web/store/issues/project-issues/cycle/issue.store.ts b/web/store/issues/project-issues/cycle/issue.store.ts index ed1bdcfeb..7d5355010 100644 --- a/web/store/issues/project-issues/cycle/issue.store.ts +++ b/web/store/issues/project-issues/cycle/issue.store.ts @@ -257,6 +257,7 @@ export class CycleIssuesStore extends IssueBaseStore implements ICycleIssuesStor if (!_issues) _issues = {}; if (!_issues[cycleId]) _issues[cycleId] = {}; delete _issues?.[cycleId]?.[issueId]; + _issues[cycleId] = { ..._issues[cycleId] }; runInAction(() => { this.issues = _issues; diff --git a/web/store/issues/project-issues/module/issue.store.ts b/web/store/issues/project-issues/module/issue.store.ts index 1f1d1c190..8135eacaa 100644 --- a/web/store/issues/project-issues/module/issue.store.ts +++ b/web/store/issues/project-issues/module/issue.store.ts @@ -250,6 +250,7 @@ export class ModuleIssuesStore extends IssueBaseStore implements IModuleIssuesSt if (!_issues) _issues = {}; if (!_issues[moduleId]) _issues[moduleId] = {}; delete _issues?.[moduleId]?.[issueId]; + _issues[moduleId] = { ..._issues[moduleId] }; runInAction(() => { this.issues = _issues; diff --git a/web/store/issues/project-issues/project/issue.store.ts b/web/store/issues/project-issues/project/issue.store.ts index e2c2b8ad6..9b1b83801 100644 --- a/web/store/issues/project-issues/project/issue.store.ts +++ b/web/store/issues/project-issues/project/issue.store.ts @@ -175,6 +175,7 @@ export class ProjectIssuesStore extends IssueBaseStore implements IProjectIssues if (!_issues) _issues = {}; if (!_issues[projectId]) _issues[projectId] = {}; delete _issues?.[projectId]?.[issueId]; + _issues[projectId] = { ..._issues[projectId] }; runInAction(() => { this.issues = _issues;