mirror of
https://github.com/makeplane/plane
synced 2025-08-07 19:59:33 +00:00
chore: added current cycle to cycle dropdown (#6376)
This commit is contained in:
@@ -31,10 +31,11 @@ type CycleOptionsProps = {
|
||||
placement: Placement | undefined;
|
||||
isOpen: boolean;
|
||||
canRemoveCycle: boolean;
|
||||
currentCycleId?: string;
|
||||
};
|
||||
|
||||
export const CycleOptions: FC<CycleOptionsProps> = observer((props) => {
|
||||
const { projectId, isOpen, referenceElement, placement, canRemoveCycle } = props;
|
||||
const { projectId, isOpen, referenceElement, placement, canRemoveCycle, currentCycleId } = props;
|
||||
//state hooks
|
||||
const [query, setQuery] = useState("");
|
||||
const [popperElement, setPopperElement] = useState<HTMLDivElement | null>(null);
|
||||
@@ -68,6 +69,7 @@ export const CycleOptions: FC<CycleOptionsProps> = observer((props) => {
|
||||
|
||||
const cycleIds = (getProjectCycleIds(projectId) ?? [])?.filter((cycleId) => {
|
||||
const cycleDetails = getCycleById(cycleId);
|
||||
if (currentCycleId && currentCycleId === cycleId) return false;
|
||||
return cycleDetails?.status ? (cycleDetails?.status.toLowerCase() != "completed" ? true : false) : true;
|
||||
});
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ type Props = TDropdownProps & {
|
||||
value: string | null;
|
||||
canRemoveCycle?: boolean;
|
||||
renderByDefault?: boolean;
|
||||
currentCycleId?: string;
|
||||
};
|
||||
|
||||
export const CycleDropdown: React.FC<Props> = observer((props) => {
|
||||
@@ -49,6 +50,7 @@ export const CycleDropdown: React.FC<Props> = observer((props) => {
|
||||
value,
|
||||
canRemoveCycle = true,
|
||||
renderByDefault = true,
|
||||
currentCycleId,
|
||||
} = props;
|
||||
// states
|
||||
|
||||
@@ -145,6 +147,7 @@ export const CycleDropdown: React.FC<Props> = observer((props) => {
|
||||
placement={placement}
|
||||
referenceElement={referenceElement}
|
||||
canRemoveCycle={canRemoveCycle}
|
||||
currentCycleId={currentCycleId}
|
||||
/>
|
||||
)}
|
||||
</ComboDropDown>
|
||||
|
||||
Reference in New Issue
Block a user