From ae8f231b6ba59e205671252e6f701d04318bcdbb Mon Sep 17 00:00:00 2001 From: Jorge Monroy Date: Mon, 12 Aug 2024 11:08:30 -0400 Subject: [PATCH] Feat/[TM 1177] polygon filter (#430) * [TM-1177] add list of polygon filter * [TM-1177] correct name for no polygons --- .../modules/sites/components/SitesList.tsx | 9 ++++++- src/constants/options/status.ts | 24 ++++++++++++++++++- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/src/admin/modules/sites/components/SitesList.tsx b/src/admin/modules/sites/components/SitesList.tsx index 2696ba07f..cc9b664e0 100644 --- a/src/admin/modules/sites/components/SitesList.tsx +++ b/src/admin/modules/sites/components/SitesList.tsx @@ -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 "../.."; @@ -169,6 +169,13 @@ export const SitesList: FC = () => { source="monitoring_data" choices={monitoringDataChoices} className="select-page-admin" + />, + ]; diff --git a/src/constants/options/status.ts b/src/constants/options/status.ts index f15b9a296..49f7cc675 100644 --- a/src/constants/options/status.ts +++ b/src/constants/options/status.ts @@ -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) => [ {