mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
chore: validation added to cycle issue transfer button (#3760)
This commit is contained in:
parent
02182e05c4
commit
9b54fe80a8
@ -16,12 +16,13 @@ import { CYCLE_DETAILS } from "constants/fetch-keys";
|
||||
|
||||
type Props = {
|
||||
handleClick: () => void;
|
||||
disabled?: boolean;
|
||||
};
|
||||
|
||||
const cycleService = new CycleService();
|
||||
|
||||
export const TransferIssues: React.FC<Props> = (props) => {
|
||||
const { handleClick } = props;
|
||||
const { handleClick, disabled = false } = props;
|
||||
|
||||
const router = useRouter();
|
||||
const { workspaceSlug, projectId, cycleId } = router.query;
|
||||
@ -46,7 +47,12 @@ export const TransferIssues: React.FC<Props> = (props) => {
|
||||
|
||||
{isEmpty(cycleDetails?.progress_snapshot) && transferableIssuesCount > 0 && (
|
||||
<div>
|
||||
<Button variant="primary" prependIcon={<TransferIcon color="white" />} onClick={handleClick}>
|
||||
<Button
|
||||
variant="primary"
|
||||
prependIcon={<TransferIcon color="white" />}
|
||||
onClick={handleClick}
|
||||
disabled={disabled}
|
||||
>
|
||||
Transfer Issues
|
||||
</Button>
|
||||
</div>
|
||||
|
@ -3,6 +3,7 @@ import { useRouter } from "next/router";
|
||||
import { observer } from "mobx-react-lite";
|
||||
import useSWR from "swr";
|
||||
import size from "lodash/size";
|
||||
import isEmpty from "lodash/isEmpty";
|
||||
// hooks
|
||||
import { useCycle, useIssues } from "hooks/store";
|
||||
// components
|
||||
@ -89,7 +90,12 @@ export const CycleLayoutRoot: React.FC = observer(() => {
|
||||
<>
|
||||
<TransferIssuesModal handleClose={() => setTransferIssuesModal(false)} isOpen={transferIssuesModal} />
|
||||
<div className="relative flex h-full w-full flex-col overflow-hidden">
|
||||
{cycleStatus === "completed" && <TransferIssues handleClick={() => setTransferIssuesModal(true)} />}
|
||||
{cycleStatus === "completed" && (
|
||||
<TransferIssues
|
||||
handleClick={() => setTransferIssuesModal(true)}
|
||||
disabled={!isEmpty(cycleDetails?.progress_snapshot) ?? false}
|
||||
/>
|
||||
)}
|
||||
<CycleAppliedFiltersRoot />
|
||||
|
||||
{issues?.groupedIssueIds?.length === 0 ? (
|
||||
|
Loading…
Reference in New Issue
Block a user