From bc0752f7e80ed0b557de81a0426a761d66783e13 Mon Sep 17 00:00:00 2001 From: Anmol Singh Bhatia <121005188+anmolsinghbhatia@users.noreply.github.com> Date: Wed, 3 Apr 2024 20:46:19 +0530 Subject: [PATCH] [WEB-850] chore: calendar layout add existing issue (#4094) * chore: calendar layout add existing issue added in project issue * chore: code refactor --- .../calendar/quick-add-issue-form.tsx | 51 ++++++++----------- 1 file changed, 21 insertions(+), 30 deletions(-) diff --git a/web/components/issues/issue-layouts/calendar/quick-add-issue-form.tsx b/web/components/issues/issue-layouts/calendar/quick-add-issue-form.tsx index 7e17496d4..7f992d8c9 100644 --- a/web/components/issues/issue-layouts/calendar/quick-add-issue-form.tsx +++ b/web/components/issues/issue-layouts/calendar/quick-add-issue-form.tsx @@ -82,9 +82,11 @@ export const CalendarQuickAddIssueForm: React.FC = observer((props) => { const [isExistingIssueModalOpen, setIsExistingIssueModalOpen] = useState(false); // derived values const projectDetail = projectId ? getProjectById(projectId.toString()) : null; - const ExistingIssuesListModalPayload = moduleId - ? { module: moduleId.toString(), target_date: "none" } - : { cycle: true, target_date: "none" }; + const ExistingIssuesListModalPayload = addIssuesToView + ? moduleId + ? { module: moduleId.toString(), target_date: "none" } + : { cycle: true, target_date: "none" } + : { target_date: "none" }; const { reset, @@ -234,33 +236,22 @@ export const CalendarQuickAddIssueForm: React.FC = observer((props) => { block: isMenuOpen, })} > - {addIssuesToView ? ( - setIsMenuOpen(true)} - onMenuClose={() => setIsMenuOpen(false)} - className="w-full" - customButtonClassName="w-full" - customButton={ -
- - New Issue -
- } - > - New Issue - Add existing issue -
- ) : ( - - )} + setIsMenuOpen(true)} + onMenuClose={() => setIsMenuOpen(false)} + className="w-full" + customButtonClassName="w-full" + customButton={ +
+ + New Issue +
+ } + > + New Issue + Add existing issue +
)}