From 8ee97619fe285581b8e3f2bc8249bf0064ced10d Mon Sep 17 00:00:00 2001
From: elenm <16543000+elenm@users.noreply.github.com>
Date: Thu, 23 Sep 2021 14:36:56 -0400
Subject: [PATCH 1/2] Add senior housing filter to the filter modal.
---
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 +++-------
5 files changed, 24 insertions(+), 41 deletions(-)
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()}
/>
diff --git a/ui-components/src/locales/ar.json b/ui-components/src/locales/ar.json
index 425b746d0b..08cc2caa9b 100644
--- a/ui-components/src/locales/ar.json
+++ b/ui-components/src/locales/ar.json
@@ -1347,19 +1347,15 @@
"zipCode": "الرمز البريدي",
"zipCodeDescription": "أدخل الرمز البريدي",
"adaCompliant": "متوافق مع ADA",
- "communityType": "نوع المجتمع",
- "communityTypeOptions": {
- "all": "الجميع",
- "senior": "مساكن كبار السن (62+)",
- "specialNeeds": "ذوي الاحتياجات الخاصة والإعاقة"
- },
"availability": "توفر الوحدة",
"hasAvailability": "لديها توافر",
"noAvailability": "لا يوجد توافر",
"waitlist": "قائمة الانتظار",
"applyFilters": "تطبيق المرشحات",
"noResults": "لا نتائج",
- "noResultsSubtitle": "تحرير أو إزالة عوامل التصفية للحصول على أفضل النتائج."
+ "noResultsSubtitle": "تحرير أو إزالة عوامل التصفية للحصول على أفضل النتائج.",
+ "senior": "مساكن كبار السن (62+)",
+ "specialNeeds": "ذوي الاحتياجات الخاصة والإعاقة"
},
"eligibility": {
"progress": {
diff --git a/ui-components/src/locales/bn.json b/ui-components/src/locales/bn.json
index dca0f8eed4..befbd1bf18 100644
--- a/ui-components/src/locales/bn.json
+++ b/ui-components/src/locales/bn.json
@@ -1347,19 +1347,15 @@
"zipCode": "জিপ কোড",
"zipCodeDescription": "জিপ কোড প্রবেশ",
"adaCompliant": "ADA অনুগত",
- "communityType": "সম্প্রদায়ের ধরন",
- "communityTypeOptions": {
- "all": "সব",
- "senior": "সিনিয়র হাউজিং (62+)",
- "specialNeeds": "বিশেষ চাহিদা এবং অক্ষমতা"
- },
"availability": "ইউনিট প্রাপ্যতা",
"hasAvailability": "প্রাপ্যতা আছে",
"noAvailability": "সক্ষমতা নেই",
"waitlist": "প্রতীক্ষার তালিকা",
"applyFilters": "ফিল্টার প্রয়োগ করুন",
"noResults": "কোন ফলাফল নেই",
- "noResultsSubtitle": "সেরা ফলাফলের জন্য ফিল্টার সম্পাদনা বা অপসারণ করুন।"
+ "noResultsSubtitle": "সেরা ফলাফলের জন্য ফিল্টার সম্পাদনা বা অপসারণ করুন।",
+ "senior": "সিনিয়র হাউজিং (62+)",
+ "specialNeeds": "বিশেষ চাহিদা এবং অক্ষমতা"
},
"eligibility": {
"progress": {
diff --git a/ui-components/src/locales/es.json b/ui-components/src/locales/es.json
index d0ef40eb08..fd704c52ff 100644
--- a/ui-components/src/locales/es.json
+++ b/ui-components/src/locales/es.json
@@ -1222,19 +1222,15 @@
"zipCode": "Código postal",
"zipCodeDescription": "Introduzca código postal",
"adaCompliant": "Cumple con la ADA",
- "communityType": "Tipo de comunidad",
- "communityTypeOptions": {
- "all": "Todos",
- "senior": "Vivienda para personas mayores (62+)",
- "specialNeeds": "Necesidades especiales y discapacidad"
- },
"availability": "Disponibilidad de la unidad",
"hasAvailability": "Tiene disponibilidad",
"noAvailability": "No disponible",
"waitlist": "Lista de espera",
"applyFilters": "Aplicar filtros",
"noResults": "No hay resultados",
- "noResultsSubtitle": "Edite o elimine filtros para obtener mejores resultados."
+ "noResultsSubtitle": "Edite o elimine filtros para obtener mejores resultados.",
+ "senior": "Vivienda para personas mayores (62+)",
+ "specialNeeds": "Necesidades especiales y discapacidad"
},
"eligibility": {
"progress": {
diff --git a/ui-components/src/locales/general.json b/ui-components/src/locales/general.json
index 09dc4d085a..d1c6ddf2ba 100644
--- a/ui-components/src/locales/general.json
+++ b/ui-components/src/locales/general.json
@@ -1368,19 +1368,15 @@
"zipCode": "Zip code",
"zipCodeDescription": "Enter zip code",
"adaCompliant": "ADA Compliant",
- "communityType": "Community Type",
- "communityTypeOptions": {
- "all": "All",
- "senior": "Senior housing (62+)",
- "specialNeeds": "Special needs and disability"
- },
"availability": "Unit Availability",
"hasAvailability": "Has Availability",
"noAvailability": "No Availability",
"waitlist": "Waitlist",
"applyFilters": "Apply Filters",
"noResults": "No results",
- "noResultsSubtitle": "Edit or remove filters for best results."
+ "noResultsSubtitle": "Edit or remove filters for best results.",
+ "senior": "Senior housing (62+)",
+ "specialNeeds": "Special needs and disability"
},
"eligibility": {
"progress": {
From fe882b669c6ce9e412cfc19fb796b0845209a498 Mon Sep 17 00:00:00 2001
From: elenm <16543000+elenm@users.noreply.github.com>
Date: Thu, 23 Sep 2021 14:46:54 -0400
Subject: [PATCH 2/2] Add change log entry for the senior housing filter.
---
CHANGELOG.md | 1 +
1 file changed, 1 insertion(+)
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