From 6e91c9231bad636bfbf690845cb01dd4d0bdf210 Mon Sep 17 00:00:00 2001 From: elenm <16543000+elenm@users.noreply.github.com> Date: Thu, 23 Sep 2021 14:58:10 -0700 Subject: [PATCH] [Filtering] Add senior housing filtering to the filter modal (#631) --- CHANGELOG.md | 1 + sites/public/pages/listings.tsx | 25 ++++++++++++------------- ui-components/src/locales/ar.json | 10 +++------- ui-components/src/locales/bn.json | 10 +++------- ui-components/src/locales/es.json | 10 +++------- ui-components/src/locales/general.json | 10 +++------- 6 files changed, 25 insertions(+), 41 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b4e8cc8812..2fa7f47864 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ All notable changes to this project will be documented in this file. The format - Partially Senior reserved community type ([#572](https://github.com/CityOfDetroit/bloom/pull/572)) - "About" page ([#589](https://github.com/CityOfDetroit/bloom/pull/589)) - RTL support ([#627](https://github.com/CityOfDetroit/bloom/pull/627)) + - Add senior housing filtering to the filter modal ([#631](https://github.com/CityOfDetroit/bloom/pull/631)) ## Detroit Team M11 diff --git a/sites/public/pages/listings.tsx b/sites/public/pages/listings.tsx index e9b181227d..fbbc46ba6a 100644 --- a/sites/public/pages/listings.tsx +++ b/sites/public/pages/listings.tsx @@ -123,15 +123,7 @@ const ListingsPage = () => { { value: "n", label: t("t.no") }, { value: "y", label: t("t.yes") }, ] - const communityTypeOptions: SelectOption[] = [ - EMPTY_OPTION, - { value: "all", label: t("listingFilters.communityTypeOptions.all") }, - { value: "senior", label: t("listingFilters.communityTypeOptions.senior") }, - { - value: "specialNeedsAndDisability", - label: t("listingFilters.communityTypeOptions.specialNeeds"), - }, - ] + const availabilityOptions: SelectOption[] = [ EMPTY_OPTION, { value: AvailabilityFilterEnum.hasAvailability, label: t("listingFilters.hasAvailability") }, @@ -139,6 +131,12 @@ const ListingsPage = () => { { value: AvailabilityFilterEnum.waitlist, label: t("listingFilters.waitlist") }, ] + const seniorHousingOptions: SelectOption[] = [ + EMPTY_OPTION, + { value: "true", label: t("t.yes") }, + { value: "false", label: t("t.no") }, + ] + function setQueryString(page: number, filters = filterState) { void router.push(`/listings?page=${page}${encodeToFrontendFilterString(filters)}`, undefined, { shallow: true, @@ -263,14 +261,15 @@ const ListingsPage = () => { register={register} controlClassName="control" options={adaCompliantOptions} + defaultValue={filterState?.seniorHousing?.toString()} />