forked from github/plane
[WEB-850] chore: calendar layout add existing issue (#4094)
* chore: calendar layout add existing issue added in project issue * chore: code refactor
This commit is contained in:
parent
4c97098218
commit
bc0752f7e8
@ -82,9 +82,11 @@ export const CalendarQuickAddIssueForm: React.FC<Props> = observer((props) => {
|
|||||||
const [isExistingIssueModalOpen, setIsExistingIssueModalOpen] = useState(false);
|
const [isExistingIssueModalOpen, setIsExistingIssueModalOpen] = useState(false);
|
||||||
// derived values
|
// derived values
|
||||||
const projectDetail = projectId ? getProjectById(projectId.toString()) : null;
|
const projectDetail = projectId ? getProjectById(projectId.toString()) : null;
|
||||||
const ExistingIssuesListModalPayload = moduleId
|
const ExistingIssuesListModalPayload = addIssuesToView
|
||||||
? { module: moduleId.toString(), target_date: "none" }
|
? moduleId
|
||||||
: { cycle: true, target_date: "none" };
|
? { module: moduleId.toString(), target_date: "none" }
|
||||||
|
: { cycle: true, target_date: "none" }
|
||||||
|
: { target_date: "none" };
|
||||||
|
|
||||||
const {
|
const {
|
||||||
reset,
|
reset,
|
||||||
@ -234,33 +236,22 @@ export const CalendarQuickAddIssueForm: React.FC<Props> = observer((props) => {
|
|||||||
block: isMenuOpen,
|
block: isMenuOpen,
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
{addIssuesToView ? (
|
<CustomMenu
|
||||||
<CustomMenu
|
placement="bottom-start"
|
||||||
placement="bottom-start"
|
menuButtonOnClick={() => setIsMenuOpen(true)}
|
||||||
menuButtonOnClick={() => setIsMenuOpen(true)}
|
onMenuClose={() => setIsMenuOpen(false)}
|
||||||
onMenuClose={() => setIsMenuOpen(false)}
|
className="w-full"
|
||||||
className="w-full"
|
customButtonClassName="w-full"
|
||||||
customButtonClassName="w-full"
|
customButton={
|
||||||
customButton={
|
<div className="flex w-full items-center gap-x-[6px] rounded-md px-2 py-1.5 text-custom-primary-100">
|
||||||
<div className="flex w-full items-center gap-x-[6px] rounded-md px-2 py-1.5 text-custom-primary-100">
|
<PlusIcon className="h-3.5 w-3.5 stroke-2 flex-shrink-0" />
|
||||||
<PlusIcon className="h-3.5 w-3.5 stroke-2 flex-shrink-0" />
|
<span className="text-sm font-medium flex-shrink-0 text-custom-primary-100">New Issue</span>
|
||||||
<span className="text-sm font-medium flex-shrink-0 text-custom-primary-100">New Issue</span>
|
</div>
|
||||||
</div>
|
}
|
||||||
}
|
>
|
||||||
>
|
<CustomMenu.MenuItem onClick={handleNewIssue}>New Issue</CustomMenu.MenuItem>
|
||||||
<CustomMenu.MenuItem onClick={handleNewIssue}>New Issue</CustomMenu.MenuItem>
|
<CustomMenu.MenuItem onClick={handleExistingIssue}>Add existing issue</CustomMenu.MenuItem>
|
||||||
<CustomMenu.MenuItem onClick={handleExistingIssue}>Add existing issue</CustomMenu.MenuItem>
|
</CustomMenu>
|
||||||
</CustomMenu>
|
|
||||||
) : (
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
className="flex w-full items-center gap-x-[6px] rounded-md px-2 py-1.5 text-custom-primary-100"
|
|
||||||
onClick={handleNewIssue}
|
|
||||||
>
|
|
||||||
<PlusIcon className="h-3.5 w-3.5 stroke-2" />
|
|
||||||
<span className="text-sm font-medium text-custom-primary-100">New Issue</span>
|
|
||||||
</button>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
|
Loading…
Reference in New Issue
Block a user