Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion web/core/components/dropdowns/cycle/cycle-options.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
});

Expand Down
3 changes: 3 additions & 0 deletions web/core/components/dropdowns/cycle/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ type Props = TDropdownProps & {
value: string | null;
canRemoveCycle?: boolean;
renderByDefault?: boolean;
currentCycleId?: string;
};

export const CycleDropdown: React.FC<Props> = observer((props) => {
Expand All @@ -49,6 +50,7 @@ export const CycleDropdown: React.FC<Props> = observer((props) => {
value,
canRemoveCycle = true,
renderByDefault = true,
currentCycleId,
} = props;
// states

Expand Down Expand Up @@ -145,6 +147,7 @@ export const CycleDropdown: React.FC<Props> = observer((props) => {
placement={placement}
referenceElement={referenceElement}
canRemoveCycle={canRemoveCycle}
currentCycleId={currentCycleId}
/>
)}
</ComboDropDown>
Expand Down
Loading