chore: estimate dropdownn option order

This commit is contained in:
Anmol Singh Bhatia 2023-12-26 16:39:10 +05:30
parent e14baf17a7
commit 53759dffff

View File

@ -3,6 +3,7 @@ import { usePopper } from "react-popper";
import { observer } from "mobx-react-lite"; import { observer } from "mobx-react-lite";
import { Combobox } from "@headlessui/react"; import { Combobox } from "@headlessui/react";
import { Check, ChevronDown, Search, Triangle } from "lucide-react"; import { Check, ChevronDown, Search, Triangle } from "lucide-react";
import { sortBy } from "lodash";
// ui // ui
import { Tooltip } from "@plane/ui"; import { Tooltip } from "@plane/ui";
// types // types
@ -63,8 +64,9 @@ export const IssuePropertyEstimates: React.FC<IIssuePropertyEstimates> = observe
const estimatePoints = const estimatePoints =
projectDetails && isEstimateEnabled ? estimates?.find((e) => e.id === projectDetails.estimate)?.points : null; projectDetails && isEstimateEnabled ? estimates?.find((e) => e.id === projectDetails.estimate)?.points : null;
const options: { value: number | null; query: string; content: any }[] | undefined = (estimatePoints ?? []).map( const options: { value: number | null; query: string; content: any }[] | undefined = (
(estimate) => ({ sortBy(estimatePoints, "key") ?? []
).map((estimate) => ({
value: estimate.key, value: estimate.key,
query: estimate.value, query: estimate.value,
content: ( content: (
@ -73,8 +75,7 @@ export const IssuePropertyEstimates: React.FC<IIssuePropertyEstimates> = observe
{estimate.value} {estimate.value}
</div> </div>
), ),
}) }));
);
options?.unshift({ options?.unshift({
value: null, value: null,
query: "none", query: "none",