fix: create issue modal bug

This commit is contained in:
Aaryan Khandelwal 2023-02-02 19:03:54 +05:30
parent 563921d0cf
commit 4f85773a48
3 changed files with 8 additions and 7 deletions

View File

@ -17,8 +17,6 @@ import useUser from "hooks/use-user";
import useToast from "hooks/use-toast"; import useToast from "hooks/use-toast";
// components // components
import { IssueForm } from "components/issues"; import { IssueForm } from "components/issues";
// common
import { renderDateFormat } from "helpers/date-time.helper";
// types // types
import type { IIssue, IssueResponse } from "types"; import type { IIssue, IssueResponse } from "types";
// fetch keys // fetch keys
@ -52,7 +50,10 @@ export const CreateUpdateIssueModal: React.FC<IssuesModalProps> = ({
const [activeProject, setActiveProject] = useState<string | null>(null); const [activeProject, setActiveProject] = useState<string | null>(null);
const router = useRouter(); 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 { user } = useUser();
const { setToastAlert } = useToast(); const { setToastAlert } = useToast();

View File

@ -282,13 +282,13 @@ const SingleCycle: React.FC<UserAuth> = (props) => {
title="Create a new issue" title="Create a new issue"
description="Click to create a new issue inside the cycle." description="Click to create a new issue inside the cycle."
Icon={PlusIcon} Icon={PlusIcon}
action={() => openCreateIssueModal()} action={openCreateIssueModal}
/> />
<EmptySpaceItem <EmptySpaceItem
title="Add an existing issue" title="Add an existing issue"
description="Open list" description="Open list"
Icon={ListBulletIcon} Icon={ListBulletIcon}
action={() => openIssuesListModal()} action={openIssuesListModal}
/> />
</EmptySpace> </EmptySpace>
</div> </div>

View File

@ -303,13 +303,13 @@ const SingleModule: React.FC<UserAuth> = (props) => {
title="Create a new issue" title="Create a new issue"
description="Click to create a new issue inside the module." description="Click to create a new issue inside the module."
Icon={PlusIcon} Icon={PlusIcon}
action={() => openCreateIssueModal()} action={openCreateIssueModal}
/> />
<EmptySpaceItem <EmptySpaceItem
title="Add an existing issue" title="Add an existing issue"
description="Open list" description="Open list"
Icon={ListBulletIcon} Icon={ListBulletIcon}
action={() => openIssuesListModal()} action={openIssuesListModal}
/> />
</EmptySpace> </EmptySpace>
</div> </div>