chore: added current cycle to cycle dropdown (#6376)
This commit is contained in:
parent
88669af141
commit
76fdb81249
2 changed files with 6 additions and 1 deletions
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue