mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
fix: updated the tooltip and ui for cycle select
This commit is contained in:
parent
6bf9d84bea
commit
dcc28a180c
@ -10,11 +10,12 @@ import useOutsideClickDetector from "hooks/use-outside-click-detector";
|
|||||||
// components
|
// components
|
||||||
import { DropdownButton } from "./buttons";
|
import { DropdownButton } from "./buttons";
|
||||||
// icons
|
// icons
|
||||||
import { ContrastIcon } from "@plane/ui";
|
import { ContrastIcon, CycleGroupIcon } from "@plane/ui";
|
||||||
// helpers
|
// helpers
|
||||||
import { cn } from "helpers/common.helper";
|
import { cn } from "helpers/common.helper";
|
||||||
// types
|
// types
|
||||||
import { TDropdownProps } from "./types";
|
import { TDropdownProps } from "./types";
|
||||||
|
import { TCycleGroups } from "@plane/types";
|
||||||
// constants
|
// constants
|
||||||
import { BUTTON_VARIANTS_WITH_TEXT } from "./constants";
|
import { BUTTON_VARIANTS_WITH_TEXT } from "./constants";
|
||||||
|
|
||||||
@ -82,17 +83,22 @@ export const CycleDropdown: React.FC<Props> = observer((props) => {
|
|||||||
router: { workspaceSlug },
|
router: { workspaceSlug },
|
||||||
} = useApplication();
|
} = useApplication();
|
||||||
const { getProjectCycleIds, fetchAllCycles, getCycleById } = useCycle();
|
const { getProjectCycleIds, fetchAllCycles, getCycleById } = useCycle();
|
||||||
const cycleIds = getProjectCycleIds(projectId);
|
|
||||||
|
const cycleIds = (getProjectCycleIds(projectId) ?? [])?.filter((cycleId) => {
|
||||||
|
const cycleDetails = getCycleById(cycleId);
|
||||||
|
return cycleDetails?.status.toLowerCase() != "completed" ? true : false;
|
||||||
|
});
|
||||||
|
|
||||||
const options: DropdownOptions = cycleIds?.map((cycleId) => {
|
const options: DropdownOptions = cycleIds?.map((cycleId) => {
|
||||||
const cycleDetails = getCycleById(cycleId);
|
const cycleDetails = getCycleById(cycleId);
|
||||||
|
const cycleStatus = cycleDetails?.status ? (cycleDetails.status.toLocaleLowerCase() as TCycleGroups) : "draft";
|
||||||
|
|
||||||
return {
|
return {
|
||||||
value: cycleId,
|
value: cycleId,
|
||||||
query: `${cycleDetails?.name}`,
|
query: `${cycleDetails?.name}`,
|
||||||
content: (
|
content: (
|
||||||
<div className="flex items-center gap-2">
|
<div className="flex items-center gap-2">
|
||||||
<ContrastIcon className="h-3 w-3 flex-shrink-0" />
|
<CycleGroupIcon cycleGroup={cycleStatus} className="h-3.5 w-3.5 flex-shrink-0" />
|
||||||
<span className="flex-grow truncate">{cycleDetails?.name}</span>
|
<span className="flex-grow truncate">{cycleDetails?.name}</span>
|
||||||
</div>
|
</div>
|
||||||
),
|
),
|
||||||
|
Loading…
Reference in New Issue
Block a user