diff --git a/web/components/issues/issue-layouts/list/list-view-types.d.ts b/web/components/issues/issue-layouts/list/list-view-types.d.ts index 1838316cb..e369410af 100644 --- a/web/components/issues/issue-layouts/list/list-view-types.d.ts +++ b/web/components/issues/issue-layouts/list/list-view-types.d.ts @@ -1,3 +1,5 @@ +import { TIssue } from "@plane/types"; + export interface IQuickActionProps { issue: TIssue; handleDelete: () => Promise; diff --git a/web/components/issues/issue-layouts/quick-action-dropdowns/all-issue.tsx b/web/components/issues/issue-layouts/quick-action-dropdowns/all-issue.tsx index f97f1ea86..bc6518911 100644 --- a/web/components/issues/issue-layouts/quick-action-dropdowns/all-issue.tsx +++ b/web/components/issues/issue-layouts/quick-action-dropdowns/all-issue.tsx @@ -2,6 +2,7 @@ import { useState } from "react"; import { useRouter } from "next/router"; import { CustomMenu } from "@plane/ui"; import { Copy, Link, Pencil, Trash2 } from "lucide-react"; +import omit from "lodash/omit"; // hooks import useToast from "hooks/use-toast"; import { useEventTracker } from "hooks/store"; @@ -30,7 +31,7 @@ export const AllIssueQuickActions: React.FC = (props) => { const { setToastAlert } = useToast(); const handleCopyIssueLink = () => { - copyUrlToClipboard(`/${workspaceSlug}/projects/${issue.project}/issues/${issue.id}`).then(() => + copyUrlToClipboard(`/${workspaceSlug}/projects/${issue.project_id}/issues/${issue.id}`).then(() => setToastAlert({ type: "success", title: "Link copied", @@ -39,11 +40,13 @@ export const AllIssueQuickActions: React.FC = (props) => { ); }; - const duplicateIssuePayload = { - ...issue, - name: `${issue.name} (copy)`, - }; - delete duplicateIssuePayload.id; + const duplicateIssuePayload = omit( + { + ...issue, + name: `${issue.name} (copy)`, + }, + ["id"] + ); return ( <> @@ -87,7 +90,7 @@ export const AllIssueQuickActions: React.FC = (props) => { { setTrackElement("Global issues"); - setIssueToEdit(issue); + setIssueToEdit(issue); setCreateUpdateIssueModal(true); }} > @@ -99,7 +102,7 @@ export const AllIssueQuickActions: React.FC = (props) => { { setTrackElement("Global issues"); - setCreateUpdateIssueModal(true); + setCreateUpdateIssueModal(true); }} >
@@ -110,7 +113,7 @@ export const AllIssueQuickActions: React.FC = (props) => { { setTrackElement("Global issues"); - setDeleteIssueModal(true); + setDeleteIssueModal(true); }} >
diff --git a/web/components/issues/issue-layouts/quick-action-dropdowns/archived-issue.tsx b/web/components/issues/issue-layouts/quick-action-dropdowns/archived-issue.tsx index f96270176..e331d7182 100644 --- a/web/components/issues/issue-layouts/quick-action-dropdowns/archived-issue.tsx +++ b/web/components/issues/issue-layouts/quick-action-dropdowns/archived-issue.tsx @@ -4,7 +4,7 @@ import { CustomMenu } from "@plane/ui"; import { Link, Trash2 } from "lucide-react"; // hooks import useToast from "hooks/use-toast"; -import { useEventTracker, useIssues ,useUser} from "hooks/store"; +import { useEventTracker, useIssues, useUser } from "hooks/store"; // components import { DeleteArchivedIssueModal } from "components/issues"; // helpers @@ -37,7 +37,7 @@ export const ArchivedIssueQuickActions: React.FC = (props) => const activeLayout = `${issuesFilter.issueFilters?.displayFilters?.layout} layout`; const handleCopyIssueLink = () => { - copyUrlToClipboard(`${workspaceSlug}/projects/${issue.project}/archived-issues/${issue.id}`).then(() => + copyUrlToClipboard(`${workspaceSlug}/projects/${issue.project_id}/archived-issues/${issue.id}`).then(() => setToastAlert({ type: "success", title: "Link copied", @@ -75,7 +75,7 @@ export const ArchivedIssueQuickActions: React.FC = (props) => { setTrackElement(activeLayout); - setDeleteIssueModal(true); + setDeleteIssueModal(true); }} >
diff --git a/web/components/issues/issue-layouts/quick-action-dropdowns/cycle-issue.tsx b/web/components/issues/issue-layouts/quick-action-dropdowns/cycle-issue.tsx index 8c3beb3d2..4699b1c81 100644 --- a/web/components/issues/issue-layouts/quick-action-dropdowns/cycle-issue.tsx +++ b/web/components/issues/issue-layouts/quick-action-dropdowns/cycle-issue.tsx @@ -2,9 +2,10 @@ import { useState } from "react"; import { useRouter } from "next/router"; import { CustomMenu } from "@plane/ui"; import { Copy, Link, Pencil, Trash2, XCircle } from "lucide-react"; +import omit from "lodash/omit"; // hooks import useToast from "hooks/use-toast"; -import { useEventTracker, useIssues,useUser } from "hooks/store"; +import { useEventTracker, useIssues, useUser } from "hooks/store"; // components import { CreateUpdateIssueModal, DeleteIssueModal } from "components/issues"; // helpers @@ -49,7 +50,7 @@ export const CycleIssueQuickActions: React.FC = (props) => { const activeLayout = `${issuesFilter.issueFilters?.displayFilters?.layout} layout`; const handleCopyIssueLink = () => { - copyUrlToClipboard(`${workspaceSlug}/projects/${issue.project}/issues/${issue.id}`).then(() => + copyUrlToClipboard(`${workspaceSlug}/projects/${issue.project_id}/issues/${issue.id}`).then(() => setToastAlert({ type: "success", title: "Link copied", @@ -58,11 +59,13 @@ export const CycleIssueQuickActions: React.FC = (props) => { ); }; - const duplicateIssuePayload = { - ...issue, - name: `${issue.name} (copy)`, - }; - delete duplicateIssuePayload.id; + const duplicateIssuePayload = omit( + { + ...issue, + name: `${issue.name} (copy)`, + }, + ["id"] + ); return ( <> @@ -107,10 +110,10 @@ export const CycleIssueQuickActions: React.FC = (props) => { onClick={() => { setIssueToEdit({ ...issue, - cycle: cycleId?.toString() ?? null, + cycle_id: cycleId?.toString() ?? null, }); setTrackElement(activeLayout); - setCreateUpdateIssueModal(true); + setCreateUpdateIssueModal(true); }} >
@@ -131,7 +134,7 @@ export const CycleIssueQuickActions: React.FC = (props) => { { setTrackElement(activeLayout); - setCreateUpdateIssueModal(true); + setCreateUpdateIssueModal(true); }} >
@@ -142,7 +145,7 @@ export const CycleIssueQuickActions: React.FC = (props) => { { setTrackElement(activeLayout); - setDeleteIssueModal(true); + setDeleteIssueModal(true); }} >
diff --git a/web/components/issues/issue-layouts/quick-action-dropdowns/module-issue.tsx b/web/components/issues/issue-layouts/quick-action-dropdowns/module-issue.tsx index a3ed73ec0..6eabfda59 100644 --- a/web/components/issues/issue-layouts/quick-action-dropdowns/module-issue.tsx +++ b/web/components/issues/issue-layouts/quick-action-dropdowns/module-issue.tsx @@ -2,9 +2,10 @@ import { useState } from "react"; import { useRouter } from "next/router"; import { CustomMenu } from "@plane/ui"; import { Copy, Link, Pencil, Trash2, XCircle } from "lucide-react"; +import omit from "lodash/omit"; // hooks import useToast from "hooks/use-toast"; -import { useIssues, useEventTracker ,useUser } from "hooks/store"; +import { useIssues, useEventTracker, useUser } from "hooks/store"; // components import { CreateUpdateIssueModal, DeleteIssueModal } from "components/issues"; // helpers @@ -49,7 +50,7 @@ export const ModuleIssueQuickActions: React.FC = (props) => { const activeLayout = `${issuesFilter.issueFilters?.displayFilters?.layout} layout`; const handleCopyIssueLink = () => { - copyUrlToClipboard(`${workspaceSlug}/projects/${issue.project}/issues/${issue.id}`).then(() => + copyUrlToClipboard(`${workspaceSlug}/projects/${issue.project_id}/issues/${issue.id}`).then(() => setToastAlert({ type: "success", title: "Link copied", @@ -58,11 +59,13 @@ export const ModuleIssueQuickActions: React.FC = (props) => { ); }; - const duplicateIssuePayload = { - ...issue, - name: `${issue.name} (copy)`, - }; - delete duplicateIssuePayload.id; + const duplicateIssuePayload = omit( + { + ...issue, + name: `${issue.name} (copy)`, + }, + ["id"] + ); return ( <> @@ -105,9 +108,9 @@ export const ModuleIssueQuickActions: React.FC = (props) => { <> { - setIssueToEdit({ ...issue, module: moduleId?.toString() ?? null }); + setIssueToEdit({ ...issue, module_ids: moduleId ? [moduleId.toString()] : [] }); setTrackElement(activeLayout); - setCreateUpdateIssueModal(true); + setCreateUpdateIssueModal(true); }} >
@@ -128,7 +131,7 @@ export const ModuleIssueQuickActions: React.FC = (props) => { { setTrackElement(activeLayout); - setCreateUpdateIssueModal(true); + setCreateUpdateIssueModal(true); }} >
@@ -141,7 +144,7 @@ export const ModuleIssueQuickActions: React.FC = (props) => { e.preventDefault(); e.stopPropagation(); setTrackElement(activeLayout); - setDeleteIssueModal(true); + setDeleteIssueModal(true); }} >
diff --git a/web/components/issues/issue-layouts/quick-action-dropdowns/project-issue.tsx b/web/components/issues/issue-layouts/quick-action-dropdowns/project-issue.tsx index 65adc8542..1d6d88f25 100644 --- a/web/components/issues/issue-layouts/quick-action-dropdowns/project-issue.tsx +++ b/web/components/issues/issue-layouts/quick-action-dropdowns/project-issue.tsx @@ -2,6 +2,7 @@ import { useState } from "react"; import { useRouter } from "next/router"; import { CustomMenu } from "@plane/ui"; import { Copy, Link, Pencil, Trash2 } from "lucide-react"; +import omit from "lodash/omit"; // hooks import { useEventTracker, useIssues, useUser } from "hooks/store"; import useToast from "hooks/use-toast"; @@ -39,7 +40,7 @@ export const ProjectIssueQuickActions: React.FC = (props) => const { setToastAlert } = useToast(); const handleCopyIssueLink = () => { - copyUrlToClipboard(`${workspaceSlug}/projects/${issue.project}/issues/${issue.id}`).then(() => + copyUrlToClipboard(`${workspaceSlug}/projects/${issue.project_id}/issues/${issue.id}`).then(() => setToastAlert({ type: "success", title: "Link copied", @@ -48,11 +49,13 @@ export const ProjectIssueQuickActions: React.FC = (props) => ); }; - const duplicateIssuePayload = { - ...issue, - name: `${issue.name} (copy)`, - }; - delete duplicateIssuePayload.id; + const duplicateIssuePayload = omit( + { + ...issue, + name: `${issue.name} (copy)`, + }, + ["id"] + ); const isDraftIssue = router?.asPath?.includes("draft-issues") || false;