diff --git a/apps/app/components/issues/modal.tsx b/apps/app/components/issues/modal.tsx index cec62c17f..426b8a554 100644 --- a/apps/app/components/issues/modal.tsx +++ b/apps/app/components/issues/modal.tsx @@ -17,8 +17,6 @@ import useUser from "hooks/use-user"; import useToast from "hooks/use-toast"; // components import { IssueForm } from "components/issues"; -// common -import { renderDateFormat } from "helpers/date-time.helper"; // types import type { IIssue, IssueResponse } from "types"; // fetch keys @@ -52,7 +50,10 @@ export const CreateUpdateIssueModal: React.FC = ({ const [activeProject, setActiveProject] = useState(null); const router = useRouter(); - const { workspaceSlug, projectId } = router.query; + const { workspaceSlug, projectId, cycleId, moduleId } = router.query; + + if (cycleId) prePopulateData = { ...prePopulateData, cycle: cycleId as string }; + if (moduleId) prePopulateData = { ...prePopulateData, module: moduleId as string }; const { user } = useUser(); const { setToastAlert } = useToast(); diff --git a/apps/app/pages/[workspaceSlug]/projects/[projectId]/cycles/[cycleId].tsx b/apps/app/pages/[workspaceSlug]/projects/[projectId]/cycles/[cycleId].tsx index f55f71b38..ce2ba8939 100644 --- a/apps/app/pages/[workspaceSlug]/projects/[projectId]/cycles/[cycleId].tsx +++ b/apps/app/pages/[workspaceSlug]/projects/[projectId]/cycles/[cycleId].tsx @@ -282,13 +282,13 @@ const SingleCycle: React.FC = (props) => { title="Create a new issue" description="Click to create a new issue inside the cycle." Icon={PlusIcon} - action={() => openCreateIssueModal()} + action={openCreateIssueModal} /> openIssuesListModal()} + action={openIssuesListModal} /> diff --git a/apps/app/pages/[workspaceSlug]/projects/[projectId]/modules/[moduleId].tsx b/apps/app/pages/[workspaceSlug]/projects/[projectId]/modules/[moduleId].tsx index 97471ebd6..6d823f9af 100644 --- a/apps/app/pages/[workspaceSlug]/projects/[projectId]/modules/[moduleId].tsx +++ b/apps/app/pages/[workspaceSlug]/projects/[projectId]/modules/[moduleId].tsx @@ -303,13 +303,13 @@ const SingleModule: React.FC = (props) => { title="Create a new issue" description="Click to create a new issue inside the module." Icon={PlusIcon} - action={() => openCreateIssueModal()} + action={openCreateIssueModal} /> openIssuesListModal()} + action={openIssuesListModal} />