From 4ae56337c9d1e613ddf036c6c20898b818b0e0b2 Mon Sep 17 00:00:00 2001 From: Pat Plunkett Date: Tue, 16 Nov 2021 11:27:22 -0800 Subject: [PATCH 1/2] chore: remove "special needs" from image tags --- sites/public/lib/helpers.tsx | 11 ++++++++--- sites/public/src/ListingView.tsx | 8 ++------ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/sites/public/lib/helpers.tsx b/sites/public/lib/helpers.tsx index b82c70c000..7861916903 100644 --- a/sites/public/lib/helpers.tsx +++ b/sites/public/lib/helpers.tsx @@ -40,6 +40,13 @@ const getListingCardSubtitle = (address: Address) => { return address ? `${street}, ${city} ${state}, ${zipCode}` : null } +export const getImageTagFromListing = (listing: Listing) => { + const reservedCommunityTypeName = listing.reservedCommunityType?.name + return reservedCommunityTypeName && reservedCommunityTypeName !== "specialNeeds" + ? t(`listings.reservedCommunityTypes.${listing.reservedCommunityType.name}`) + : undefined +} + const getListingTableData = (listing: Listing) => { if (listing.unitsSummary !== undefined && listing.unitsSummary.length > 0) { return getSummariesTableFromUnitsSummary(listing.unitsSummary) @@ -65,9 +72,7 @@ export const getListings = (listings) => { subtitle: getListingCardSubtitle(listing.buildingAddress), title: listing.name, href: `/listing/${listing.id}/${listing.urlSlug}`, - tagLabel: listing.reservedCommunityType - ? t(`listings.reservedCommunityTypes.${listing.reservedCommunityType.name}`) - : undefined, + tagLabel: getImageTagFromListing(listing), }} tableProps={{ headers: unitSummariesHeaders, diff --git a/sites/public/src/ListingView.tsx b/sites/public/src/ListingView.tsx index 89f1c442f3..378557e264 100644 --- a/sites/public/src/ListingView.tsx +++ b/sites/public/src/ListingView.tsx @@ -36,7 +36,7 @@ import { Message, } from "@bloom-housing/ui-components" import { ErrorPage } from "../pages/_error" -import { getGenericAddress, openInFuture } from "../lib/helpers" +import { getGenericAddress, getImageTagFromListing, openInFuture } from "../lib/helpers" interface ListingProps { listing: Listing @@ -241,11 +241,7 @@ export const ListingView = (props: ListingProps) => {

From 5cbb2a22e1e1a65c35701234aacdb18116695041 Mon Sep 17 00:00:00 2001 From: Pat Plunkett Date: Tue, 16 Nov 2021 13:19:32 -0800 Subject: [PATCH 2/2] chore: add TODO for accessibility tags --- sites/public/lib/helpers.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sites/public/lib/helpers.tsx b/sites/public/lib/helpers.tsx index 7861916903..653b731b5a 100644 --- a/sites/public/lib/helpers.tsx +++ b/sites/public/lib/helpers.tsx @@ -40,6 +40,8 @@ const getListingCardSubtitle = (address: Address) => { return address ? `${street}, ${city} ${state}, ${zipCode}` : null } +// TODO(#773): Determine the best way of surfacing accessibility-related +// information in listing views. export const getImageTagFromListing = (listing: Listing) => { const reservedCommunityTypeName = listing.reservedCommunityType?.name return reservedCommunityTypeName && reservedCommunityTypeName !== "specialNeeds"