Skip to content

Commit

Permalink
Feat/[TM 1177] polygon filter (#430)
Browse files Browse the repository at this point in the history
* [TM-1177] add list of polygon filter

* [TM-1177] correct name for no polygons
  • Loading branch information
egrojMonroy authored Aug 12, 2024
1 parent 8edcdc0 commit ae8f231
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
9 changes: 8 additions & 1 deletion src/admin/modules/sites/components/SitesList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import Icon, { IconNames } from "@/components/extensive/Icon/Icon";
import { getCountriesOptions } from "@/constants/options/countries";
import { useFrameworkChoices } from "@/constants/options/frameworks";
import { getPolygonsSubmittedTypes } from "@/constants/options/polygonsSubmittedTypes";
import { getChangeRequestStatusOptions, getStatusOptions } from "@/constants/options/status";
import { getChangeRequestStatusOptions, getPolygonOptions, getStatusOptions } from "@/constants/options/status";
import { optionToChoices } from "@/utils/options";

import modules from "../..";
Expand Down Expand Up @@ -169,6 +169,13 @@ export const SitesList: FC = () => {
source="monitoring_data"
choices={monitoringDataChoices}
className="select-page-admin"
/>,
<SelectInput
key="polygon"
label="Polygon"
source="polygon"
choices={optionToChoices(getPolygonOptions())}
className="select-page-admin"
/>
];

Expand Down
24 changes: 23 additions & 1 deletion src/constants/options/status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,29 @@ export const getStatusOptions = (t: typeof useT | Function = (t: string) => t) =
title: t("More info requested")
}
] as Option[];

export const getPolygonOptions = (t: typeof useT | Function = (t: string) => t) =>
[
{
value: "no-polygons",
title: t("No polygons")
},
{
value: "approved",
title: t("Approved Polygons")
},
{
value: "submitted",
title: t("Submitted Polygons")
},
{
value: "needs-more-information",
title: t("Needs More Information Polygons")
},
{
value: "draft",
title: t("Draft Polygons")
}
] as Option[];
export const getChangeRequestStatusOptions = (t: typeof useT | Function = (t: string) => t) =>
[
{
Expand Down

0 comments on commit ae8f231

Please sign in to comment.