From 3fe4adc4539bdd33643721da16745f2d2b293563 Mon Sep 17 00:00:00 2001 From: Ryan Lewis Date: Wed, 17 Apr 2024 17:40:47 -0700 Subject: [PATCH] rename to agency name lookup and change to parentheses on labels --- frontend/src/app/search/SearchForm.tsx | 8 +- frontend/src/app/search/page.tsx | 4 +- .../filterJSONLists/agencyFilterList.ts | 188 +++++++++--------- .../components/search/SearchResultsList.tsx | 8 +- .../search/SearchResultsListItem.tsx | 11 +- ...rLookup.ts => generateAgencyNameLookup.ts} | 12 +- 6 files changed, 116 insertions(+), 115 deletions(-) rename frontend/src/utils/search/{generateAgencyFilterLookup.ts => generateAgencyNameLookup.ts} (52%) diff --git a/frontend/src/app/search/SearchForm.tsx b/frontend/src/app/search/SearchForm.tsx index 0d369c0ed..70f8172bd 100644 --- a/frontend/src/app/search/SearchForm.tsx +++ b/frontend/src/app/search/SearchForm.tsx @@ -1,6 +1,6 @@ "use client"; -import { AgencyFilterLookup } from "src/utils/search/generateAgencyFilterLookup"; +import { AgencyNamyLookup } from "src/utils/search/generateAgencyNameLookup"; import { SearchAPIResponse } from "../../types/search/searchResponseTypes"; import SearchBar from "../../components/search/SearchBar"; import { SearchFetcherProps } from "../../services/search/searchfetcher/SearchFetcher"; @@ -17,13 +17,13 @@ import { useSearchFormState } from "../../hooks/useSearchFormState"; interface SearchFormProps { initialSearchResults: SearchAPIResponse; requestURLQueryParams: SearchFetcherProps; - agencyFilterLookup?: AgencyFilterLookup; + agencyNameLookup?: AgencyNamyLookup; } export function SearchForm({ initialSearchResults, requestURLQueryParams, - agencyFilterLookup, + agencyNameLookup, }: SearchFormProps) { // Capture top level logic, including useFormState in the useSearchFormState hook const { @@ -100,7 +100,7 @@ export function SearchForm({ {searchResults?.data?.length >= 1 ? ( diff --git a/frontend/src/app/search/page.tsx b/frontend/src/app/search/page.tsx index 9584dbb54..e9a0a889b 100644 --- a/frontend/src/app/search/page.tsx +++ b/frontend/src/app/search/page.tsx @@ -11,7 +11,7 @@ import SearchCallToAction from "../../components/search/SearchCallToAction"; import { SearchForm } from "./SearchForm"; import { convertSearchParamsToProperTypes } from "../../utils/search/convertSearchParamsToProperTypes"; import { cookies } from "next/headers"; -import { generateAgencyFilterLookup } from "src/utils/search/generateAgencyFilterLookup"; +import { generateAgencyNameLookup } from "src/utils/search/generateAgencyNameLookup"; import { getSearchFetcher } from "../../services/search/searchfetcher/SearchFetcherUtil"; import { notFound } from "next/navigation"; @@ -62,7 +62,7 @@ export default async function Search({ searchParams }: ServerPageProps) { ); diff --git a/frontend/src/components/search/SearchFilterAccordion/filterJSONLists/agencyFilterList.ts b/frontend/src/components/search/SearchFilterAccordion/filterJSONLists/agencyFilterList.ts index bbd2eaf2c..d8834aaa4 100644 --- a/frontend/src/components/search/SearchFilterAccordion/filterJSONLists/agencyFilterList.ts +++ b/frontend/src/components/search/SearchFilterAccordion/filterJSONLists/agencyFilterList.ts @@ -3,506 +3,506 @@ import { FilterOption } from "../SearchFilterAccordion"; export const agencyFilterList: FilterOption[] = [ { id: "ARPAH", - label: "All Advanced Research Projects Agency for Health [ARPAH]", + label: "All Advanced Research Projects Agency for Health (ARPAH)", value: "ARPAH", }, { id: "USAID", - label: "All Agency for International Development [USAID]", + label: "All Agency for International Development (USAID)", value: "USAID", children: [ { id: "USAID-AFG", - label: "Afghanistan USAID-Kabul [USAID-AFG]", + label: "Afghanistan USAID-Kabul (USAID-AFG)", value: "USAID-AFG", }, { id: "USAID", - label: "Agency for International Development [USAID]", + label: "Agency for International Development (USAID)", value: "USAID", }, { id: "USAID-ARM", - label: "Armenia USAID-Yerevan [USAID-ARM]", + label: "Armenia USAID-Yerevan (USAID-ARM)", value: "USAID-ARM", }, { id: "USAID-AZE", - label: "Azerbaijan USAID-Baku [USAID-AZE]", + label: "Azerbaijan USAID-Baku (USAID-AZE)", value: "USAID-AZE", }, { id: "USAID-BAN", - label: "Bangladesh USAID-Dhaka [USAID-BAN]", + label: "Bangladesh USAID-Dhaka (USAID-BAN)", value: "USAID-BAN", }, { id: "USAID-BEN", - label: "Benin USAID-Cotonou [USAID-BEN]", + label: "Benin USAID-Cotonou (USAID-BEN)", value: "USAID-BEN", }, ], }, { id: "AC", - label: "All AmeriCorps [AC]", + label: "All AmeriCorps (AC)", value: "AC", }, { id: "DC", - label: "All Denali Commission [DC]", + label: "All Denali Commission (DC)", value: "DC", }, { id: "USDA", - label: "All Department of Agriculture [USDA]", + label: "All Department of Agriculture (USDA)", value: "USDA", children: [ { id: "USDA-AMS", - label: "Agricultural Marketing Service [USDA-AMS]", + label: "Agricultural Marketing Service (USDA-AMS)", value: "USDA-AMS", }, { id: "USDA-FNS1", - label: "Food and Nutrition Service [USDA-FNS1]", + label: "Food and Nutrition Service (USDA-FNS1)", value: "USDA-FNS1", }, ], }, { id: "DOC", - label: "All Department of Commerce [DOC]", + label: "All Department of Commerce (DOC)", value: "DOC", children: [ { id: "DOC-DOCNOAAERA", - label: "DOC NOAA - ERA Production [DOC-DOCNOAAERA]", + label: "DOC NOAA - ERA Production (DOC-DOCNOAAERA)", value: "DOC-DOCNOAAERA", }, { id: "DOC-EDA", - label: "Economic Development Administration [DOC-EDA]", + label: "Economic Development Administration (DOC-EDA)", value: "DOC-EDA", }, { id: "DOC-NIST", - label: "National Institute of Standards and Technology [DOC-NIST]", + label: "National Institute of Standards and Technology (DOC-NIST)", value: "DOC-NIST", }, ], }, { id: "DOD", - label: "All Department of Defense [DOD]", + label: "All Department of Defense (DOD)", value: "DOD", children: [ { id: "DOD-AMC-ACCAPGN", - label: "ACC APG - Natick [DOD-AMC-ACCAPGN]", + label: "ACC APG - Natick (DOD-AMC-ACCAPGN)", value: "DOD-AMC-ACCAPGN", }, { id: "DOD-AMC-ACCAPGD", - label: "ACC-APG-Detrick [DOD-AMC-ACCAPGD]", + label: "ACC-APG-Detrick (DOD-AMC-ACCAPGD)", value: "DOD-AMC-ACCAPGD", }, { id: "DOD-AFRL-AFRLDET8", - label: "AFRL Kirtland AFB [DOD-AFRL-AFRLDET8]", + label: "AFRL Kirtland AFB (DOD-AFRL-AFRLDET8)", value: "DOD-AFRL-AFRLDET8", }, { id: "DOD-AFRL", - label: "Air Force -- Research Lab [DOD-AFRL]", + label: "Air Force -- Research Lab (DOD-AFRL)", value: "DOD-AFRL", }, { id: "DOD-USAFA", - label: "Air Force Academy [DOD-USAFA]", + label: "Air Force Academy (DOD-USAFA)", value: "DOD-USAFA", }, { id: "DOD-AFOSR", - label: "Air Force Office of Scientific Research [DOD-AFOSR]", + label: "Air Force Office of Scientific Research (DOD-AFOSR)", value: "DOD-AFOSR", }, { id: "DOD-DARPA-BTO", - label: "DARPA - Biological Technologies Office [DOD-DARPA-BTO]", + label: "DARPA - Biological Technologies Office (DOD-DARPA-BTO)", value: "DOD-DARPA-BTO", }, ], }, { id: "ED", - label: "All Department of Education [ED]", + label: "All Department of Education (ED)", value: "ED", }, { id: "DOE", - label: "All Department of Energy [DOE]", + label: "All Department of Energy (DOE)", value: "DOE", children: [ { id: "DOE-ARPAE", - label: "Advanced Research Projects Agency Energy [DOE-ARPAE]", + label: "Advanced Research Projects Agency Energy (DOE-ARPAE)", value: "DOE-ARPAE", }, { id: "DOE-GFO", - label: "Golden Field Office [DOE-GFO]", + label: "Golden Field Office (DOE-GFO)", value: "DOE-GFO", }, { id: "DOE-01", - label: "Headquarters [DOE-01]", + label: "Headquarters (DOE-01)", value: "DOE-01", }, ], }, { id: "PAMS", - label: "All Department of Energy - Office of Science [PAMS]", + label: "All Department of Energy - Office of Science (PAMS)", value: "PAMS", children: [ { id: "PAMS-SC", - label: "Office of Science [PAMS-SC]", + label: "Office of Science (PAMS-SC)", value: "PAMS-SC", }, ], }, { id: "HHS", - label: "All Department of Health and Human Services [HHS]", + label: "All Department of Health and Human Services (HHS)", value: "HHS", children: [ { id: "HHS-ACF-FYSB", label: - "Administration for Children & Families - ACYF/FYSB [HHS-ACF-FYSB]", + "Administration for Children & Families - ACYF/FYSB (HHS-ACF-FYSB)", value: "HHS-ACF-FYSB", }, { id: "HHS-ACF", - label: "Administration for Children and Families [HHS-ACF]", + label: "Administration for Children and Families (HHS-ACF)", value: "HHS-ACF", }, { id: "HHS-ACF-CB", label: - "Administration for Children and Families - ACYF/CB [HHS-ACF-CB]", + "Administration for Children and Families - ACYF/CB (HHS-ACF-CB)", value: "HHS-ACF-CB", }, ], }, { id: "DHS", - label: "All Department of Homeland Security [DHS]", + label: "All Department of Homeland Security (DHS)", value: "DHS", children: [ { id: "DHS-DHS", - label: "Department of Homeland Security - FEMA [DHS-DHS]", + label: "Department of Homeland Security - FEMA (DHS-DHS)", value: "DHS-DHS", }, { id: "DHS-OPO", - label: "Office of Procurement Operations - Grants Division [DHS-OPO]", + label: "Office of Procurement Operations - Grants Division (DHS-OPO)", value: "DHS-OPO", }, { id: "DHS-USCG", - label: "United States Coast Guard [DHS-USCG]", + label: "United States Coast Guard (DHS-USCG)", value: "DHS-USCG", }, ], }, { id: "HUD", - label: "All Department of Housing and Urban Development [HUD]", + label: "All Department of Housing and Urban Development (HUD)", value: "HUD", }, { id: "USDOJ", - label: "All Department of Justice [USDOJ]", + label: "All Department of Justice (USDOJ)", value: "USDOJ", children: [ { id: "USDOJ-OJP-BJA", - label: "Bureau of Justice Assistance [USDOJ-OJP-BJA]", + label: "Bureau of Justice Assistance (USDOJ-OJP-BJA)", value: "USDOJ-OJP-BJA", }, { id: "USDOJ-OJP-COPS", - label: "Community Oriented Policing Services [USDOJ-OJP-COPS]", + label: "Community Oriented Policing Services (USDOJ-OJP-COPS)", value: "USDOJ-OJP-COPS", }, ], }, { id: "DOL", - label: "All Department of Labor [DOL]", + label: "All Department of Labor (DOL)", value: "DOL", children: [ { id: "DOL-ETA-ILAB", - label: "Bureau of International Labor Affairs [DOL-ETA-ILAB]", + label: "Bureau of International Labor Affairs (DOL-ETA-ILAB)", value: "DOL-ETA-ILAB", }, { id: "DOL-ETA-CEO", - label: "Chief Evaluation Office [DOL-ETA-CEO]", + label: "Chief Evaluation Office (DOL-ETA-CEO)", value: "DOL-ETA-CEO", }, ], }, { id: "DOS", - label: "All Department of State [DOS]", + label: "All Department of State (DOS)", value: "DOS", children: [ { id: "DOS-NEA-AC", - label: "Assistance Coordination [DOS-NEA-AC]", + label: "Assistance Coordination (DOS-NEA-AC)", value: "DOS-NEA-AC", }, { id: "DOS-DRL", - label: "Bureau of Democracy Human Rights and Labor [DOS-DRL]", + label: "Bureau of Democracy Human Rights and Labor (DOS-DRL)", value: "DOS-DRL", }, { id: "DOS-ECA", - label: "Bureau Of Educational and Cultural Affairs [DOS-ECA]", + label: "Bureau Of Educational and Cultural Affairs (DOS-ECA)", value: "DOS-ECA", }, ], }, { id: "DOI", - label: "All Department of the Interior [DOI]", + label: "All Department of the Interior (DOI)", value: "DOI", children: [ { id: "DOI-BIA", - label: "Bureau of Indian Affairs [DOI-BIA]", + label: "Bureau of Indian Affairs (DOI-BIA)", value: "DOI-BIA", }, { id: "DOI-BLM", - label: "Bureau of Land Management [DOI-BLM]", + label: "Bureau of Land Management (DOI-BLM)", value: "DOI-BLM", }, { id: "DOI-BOR", - label: "Bureau of Reclamation [DOI-BOR]", + label: "Bureau of Reclamation (DOI-BOR)", value: "DOI-BOR", }, ], }, { id: "USDOT", - label: "All Department of the Treasury [USDOT]", + label: "All Department of the Treasury (USDOT)", value: "USDOT", children: [ { id: "USDOT-ORP", - label: "Office of Capital Access [USDOT-ORP]", + label: "Office of Capital Access (USDOT-ORP)", value: "USDOT-ORP", }, { id: "USDOT-DO-SIPPRA", - label: "SIPPRA [USDOT-DO-SIPPRA]", + label: "SIPPRA (USDOT-DO-SIPPRA)", value: "USDOT-DO-SIPPRA", }, { id: "USDOT-GCR", - label: "U.S. Dept. of Treasury RESTORE Act Program [USDOT-GCR]", + label: "U.S. Dept. of Treasury RESTORE Act Program (USDOT-GCR)", value: "USDOT-GCR", }, ], }, { id: "DOT", - label: "All Department of Transportation [DOT]", + label: "All Department of Transportation (DOT)", value: "DOT", children: [ { id: "DOT-DOT X-50", - label: "69A345 Office of the Under Secretary for Policy [DOT-DOT X-50]", + label: "69A345 Office of the Under Secretary for Policy (DOT-DOT X-50)", value: "DOT-DOT X-50", }, { id: "DOT-RITA", - label: "69A355 Research and Technology [DOT-RITA]", + label: "69A355 Research and Technology (DOT-RITA)", value: "DOT-RITA", }, { id: "DOT-FAA-FAA ARG", - label: "DOT - FAA Aviation Research Grants [DOT-FAA-FAA ARG]", + label: "DOT - FAA Aviation Research Grants (DOT-FAA-FAA ARG)", value: "DOT-FAA-FAA ARG", }, { id: "DOT-FRA", - label: "DOT - Federal Railroad Administration [DOT-FRA]", + label: "DOT - Federal Railroad Administration (DOT-FRA)", value: "DOT-FRA", }, { id: "DOT-FHWA", - label: "DOT Federal Highway Administration [DOT-FHWA]", + label: "DOT Federal Highway Administration (DOT-FHWA)", value: "DOT-FHWA", }, { id: "DOT-FTA", - label: "DOT/Federal Transit Administration [DOT-FTA]", + label: "DOT/Federal Transit Administration (DOT-FTA)", value: "DOT-FTA", }, { id: "DOT-FAA-FAA COE-AJFE", - label: "FAA-COE-AJFE [DOT-FAA-FAA COE-AJFE]", + label: "FAA-COE-AJFE (DOT-FAA-FAA COE-AJFE)", value: "DOT-FAA-FAA COE-AJFE", }, { id: "DOT-FAA-FAA COE-FAA JAMS", - label: "FAA-COE-JAMS [DOT-FAA-FAA COE-FAA JAMS]", + label: "FAA-COE-JAMS (DOT-FAA-FAA COE-FAA JAMS)", value: "DOT-FAA-FAA COE-FAA JAMS", }, { id: "DOT-FAA-FAA COE-TTHP", - label: "FAA-COE-TTHP [DOT-FAA-FAA COE-TTHP]", + label: "FAA-COE-TTHP (DOT-FAA-FAA COE-TTHP)", value: "DOT-FAA-FAA COE-TTHP", }, { id: "DOT-MA", - label: "Maritime Administration [DOT-MA]", + label: "Maritime Administration (DOT-MA)", value: "DOT-MA", }, { id: "DOT-NHTSA", - label: "National Highway Traffic Safety Administration [DOT-NHTSA]", + label: "National Highway Traffic Safety Administration (DOT-NHTSA)", value: "DOT-NHTSA", }, ], }, { id: "VA", - label: "All Department of Veterans Affairs [VA]", + label: "All Department of Veterans Affairs (VA)", value: "VA", children: [ { id: "VA-CSHF", - label: "Construction of State Home Facilities [VA-CSHF]", + label: "Construction of State Home Facilities (VA-CSHF)", value: "VA-CSHF", }, { id: "VA-HPGPDP", - label: "Homeless Providers Grant and Per Diem Program [VA-HPGPDP]", + label: "Homeless Providers Grant and Per Diem Program (VA-HPGPDP)", value: "VA-HPGPDP", }, { id: "VA-LSV", - label: "Legal Services for Veterans [VA-LSV]", + label: "Legal Services for Veterans (VA-LSV)", value: "VA-LSV", }, { id: "VA-NVSP", - label: "National Veterans Sports Programs [VA-NVSP]", + label: "National Veterans Sports Programs (VA-NVSP)", value: "VA-NVSP", }, { id: "VA-NCAC", - label: "NCA Contracting [VA-NCAC]", + label: "NCA Contracting (VA-NCAC)", value: "VA-NCAC", }, { id: "VA-OMHSP", - label: "Office of Mental Health and Suicide Prevention [VA-OMHSP]", + label: "Office of Mental Health and Suicide Prevention (VA-OMHSP)", value: "VA-OMHSP", }, { id: "VA-SSVF", - label: "Supportive Services for Veteran Families [VA-SSVF]", + label: "Supportive Services for Veteran Families (VA-SSVF)", value: "VA-SSVF", }, { id: "VA-NCA", - label: "VA National Cemetery Administration [VA-NCA]", + label: "VA National Cemetery Administration (VA-NCA)", value: "VA-NCA", }, { id: "VA-VLGP", - label: "Veterans Legacy Grants Program [VA-VLGP]", + label: "Veterans Legacy Grants Program (VA-VLGP)", value: "VA-VLGP", }, ], }, { id: "EPA", - label: "All Environmental Protection Agency [EPA]", + label: "All Environmental Protection Agency (EPA)", value: "EPA", }, { id: "IMLS", - label: "All Institute of Museum and Library Services [IMLS]", + label: "All Institute of Museum and Library Services (IMLS)", value: "IMLS", }, { id: "MCC", - label: "All Millennium Challenge Corporation [MCC]", + label: "All Millennium Challenge Corporation (MCC)", value: "MCC", }, { id: "NASA", - label: "All National Aeronautics and Space Administration [NASA]", + label: "All National Aeronautics and Space Administration (NASA)", value: "NASA", children: [ { id: "NASA-HQ", - label: "NASA Headquarters [NASA-HQ]", + label: "NASA Headquarters (NASA-HQ)", value: "NASA-HQ", }, { id: "NASA-JSC", - label: "NASA Johnson Space Center [NASA-JSC]", + label: "NASA Johnson Space Center (NASA-JSC)", value: "NASA-JSC", }, { id: "NASA-SFC", - label: "NASA Marshall Space Flight Center [NASA-SFC]", + label: "NASA Marshall Space Flight Center (NASA-SFC)", value: "NASA-SFC", }, { id: "NASA", - label: "National Aeronautics and Space Administration [NASA]", + label: "National Aeronautics and Space Administration (NASA)", value: "NASA", }, ], }, { id: "NARA", - label: "All National Archives and Records Administration [NARA]", + label: "All National Archives and Records Administration (NARA)", value: "NARA", }, { id: "NEA", - label: "All National Endowment for the Arts [NEA]", + label: "All National Endowment for the Arts (NEA)", value: "NEA", }, { id: "NEH", - label: "All National Endowment for the Humanities [NEH]", + label: "All National Endowment for the Humanities (NEH)", value: "NEH", }, { id: "NSF", - label: "All National Science Foundation [NSF]", + label: "All National Science Foundation (NSF)", value: "NSF", }, { id: "SSA", - label: "All Social Security Administration [SSA]", + label: "All Social Security Administration (SSA)", value: "SSA", }, ]; diff --git a/frontend/src/components/search/SearchResultsList.tsx b/frontend/src/components/search/SearchResultsList.tsx index b77056f28..e0b2feb44 100644 --- a/frontend/src/components/search/SearchResultsList.tsx +++ b/frontend/src/components/search/SearchResultsList.tsx @@ -1,6 +1,6 @@ "use client"; -import { AgencyFilterLookup } from "src/utils/search/generateAgencyFilterLookup"; +import { AgencyNamyLookup } from "src/utils/search/generateAgencyNameLookup"; import Loading from "../../app/search/loading"; import SearchErrorAlert from "src/components/search/error/SearchErrorAlert"; import { SearchResponseData } from "../../types/search/searchResponseTypes"; @@ -10,14 +10,14 @@ import { useFormStatus } from "react-dom"; interface SearchResultsListProps { searchResults: SearchResponseData; maxPaginationError: boolean; - agencyFilterLookup?: AgencyFilterLookup; + agencyNameLookup?: AgencyNamyLookup; errors?: unknown[] | null | undefined; // If passed in, there's been an issue with the fetch call } const SearchResultsList: React.FC = ({ searchResults, maxPaginationError, - agencyFilterLookup, + agencyNameLookup, errors, }) => { const { pending } = useFormStatus(); @@ -59,7 +59,7 @@ const SearchResultsList: React.FC = ({
  • ))} diff --git a/frontend/src/components/search/SearchResultsListItem.tsx b/frontend/src/components/search/SearchResultsListItem.tsx index 649f00a99..90b64bf5f 100644 --- a/frontend/src/components/search/SearchResultsListItem.tsx +++ b/frontend/src/components/search/SearchResultsListItem.tsx @@ -1,17 +1,17 @@ "use client"; -import { AgencyFilterLookup } from "src/utils/search/generateAgencyFilterLookup"; +import { AgencyNamyLookup } from "src/utils/search/generateAgencyNameLookup"; import { Opportunity } from "src/types/search/searchResponseTypes"; import { formatDate } from "../../utils/dateUtil"; interface SearchResultsListItemProps { opportunity: Opportunity; - agencyFilterLookup?: AgencyFilterLookup; + agencyNameLookup?: AgencyNamyLookup; } export default function SearchResultsListItem({ opportunity, - agencyFilterLookup, + agencyNameLookup, }: SearchResultsListItemProps) { // TODO: Confirm once deploying to lowers // relates to https://github.com/HHS/simpler-grants-gov/issues/1521 @@ -104,8 +104,9 @@ export default function SearchResultsListItem({ Agency:{" "} {opportunity?.summary?.agency_name && opportunity?.summary?.agency_code && - agencyFilterLookup - ? agencyFilterLookup[opportunity?.summary?.agency_code] + agencyNameLookup + ? // Use same exact label we're using for the agency filter list + agencyNameLookup[opportunity?.summary?.agency_code] : "--"} diff --git a/frontend/src/utils/search/generateAgencyFilterLookup.ts b/frontend/src/utils/search/generateAgencyNameLookup.ts similarity index 52% rename from frontend/src/utils/search/generateAgencyFilterLookup.ts rename to frontend/src/utils/search/generateAgencyNameLookup.ts index f6cb35811..1bdeb82a5 100644 --- a/frontend/src/utils/search/generateAgencyFilterLookup.ts +++ b/frontend/src/utils/search/generateAgencyNameLookup.ts @@ -1,21 +1,21 @@ import { agencyFilterList } from "src/components/search/SearchFilterAccordion/filterJSONLists/agencyFilterList"; -export interface AgencyFilterLookup { +export interface AgencyNamyLookup { [key: string]: string; } -export const generateAgencyFilterLookup = () => { - const valueLabelMap: AgencyFilterLookup = {}; +export const generateAgencyNameLookup = () => { + const agencyNameLookup: AgencyNamyLookup = {}; agencyFilterList.forEach((agency) => { if (agency.children) { agency.children.forEach((child) => { - valueLabelMap[child.value] = child.label; + agencyNameLookup[child.value] = child.label; }); } else { - valueLabelMap[agency.value] = agency.label; + agencyNameLookup[agency.value] = agency.label; } }); - return valueLabelMap; + return agencyNameLookup; };