diff --git a/app/javascript/__tests__/modules/listingDetailsLottery/__snapshots__/ListingDetailsLotteryPreferencesEducator.test.tsx.snap b/app/javascript/__tests__/modules/listingDetailsLottery/__snapshots__/ListingDetailsLotteryPreferencesEducator.test.tsx.snap index f728dc02bc..689b2e6e49 100644 --- a/app/javascript/__tests__/modules/listingDetailsLottery/__snapshots__/ListingDetailsLotteryPreferencesEducator.test.tsx.snap +++ b/app/javascript/__tests__/modules/listingDetailsLottery/__snapshots__/ListingDetailsLotteryPreferencesEducator.test.tsx.snap @@ -340,38 +340,33 @@ exports[`ListingDetailsLotteryPreferencesEducatory displays 2 preferences - NRHP


-
+
+
+

+ General Pool +

+

+ Up to 1 unit +

+

+ 2 applicants are on this list. +

+

-
-

- General Pool -

-

- Any remaining units -

-

- 2 applicants are on this list. Please note, preference holders will be considered for all units first. -

-
-
`; @@ -716,38 +711,33 @@ exports[`ListingDetailsLotteryPreferencesEducatory displays 3 default preference


-
+
+
+

+ General Pool +

+

+ Up to 1 unit +

+

+ 2 applicants are on this list. +

+

-
-

- General Pool -

-

- Any remaining units -

-

- 2 applicants are on this list. Please note, preference holders will be considered for all units first. -

-
-
`; diff --git a/app/javascript/modules/constants.tsx b/app/javascript/modules/constants.tsx index cdff427b83..0a9834a491 100644 --- a/app/javascript/modules/constants.tsx +++ b/app/javascript/modules/constants.tsx @@ -8,6 +8,7 @@ export const PREFERENCES = { dalpGeneral: "DALP General", displacedTenant: "Displaced Tenant Housing Preference (DTHP)", employmentOrDisability: "Employment or Disability Preference", + generalLottery: "generalLottery", hud221d3: "HUD 221(d)(3) Statutory Preference; Federal or Presidential Disasters (HUD 221)", liveWorkInSf: "Live or Work in San Francisco Preference", neighborhoodResidence: "Neighborhood Resident Housing Preference (NRHP)", diff --git a/app/javascript/modules/listingDetailsLottery/ListingDetailsLotteryPreferencesEducator.tsx b/app/javascript/modules/listingDetailsLottery/ListingDetailsLotteryPreferencesEducator.tsx index 8326166730..599a350c3b 100644 --- a/app/javascript/modules/listingDetailsLottery/ListingDetailsLotteryPreferencesEducator.tsx +++ b/app/javascript/modules/listingDetailsLottery/ListingDetailsLotteryPreferencesEducator.tsx @@ -3,7 +3,7 @@ import { Heading, t } from "@bloom-housing/ui-components" import type { RailsLotteryResult } from "../../api/types/rails/listings/RailsLotteryResult" import { defaultIfNotTranslated, renderMarkup } from "../../util/languageUtil" import { preferenceNameHasVeteran } from "../../util/listingUtil" -import { LOTTERY_RANKING_VIDEO_URL } from "../constants" +import { LOTTERY_RANKING_VIDEO_URL, PREFERENCES } from "../constants" import { RailsLotteryBucket } from "../../api/types/rails/listings/RailsLotteryBucket" export interface ListingDetailsLotteryPreferencesProps { @@ -29,10 +29,12 @@ const LotteryPreferences = ({
- {defaultIfNotTranslated( - `listings.lotteryPreference.${preferenceName}.title`, - preferenceName - )} + {preferenceName === PREFERENCES.generalLottery + ? t("lottery.generalPool") + : defaultIfNotTranslated( + `listings.lotteryPreference.${preferenceName}.title`, + preferenceName + )}

{t("lottery.upToXUnitsAvailable", unitsAvailable)}

{numVeteranApps > 0 ? ( @@ -86,13 +88,14 @@ const LotteryBucketsContent = ({ // from the preference short code by adding in the 'V-' // e.g. The number of veteran applications for 'T1-COP' are stored in veteranAppsByBucketMap // under the key 'T1-V-COP', so we insert 'V-' using replace to get the veteran preference short code - const veteransPreferenceShortCode = bucket.preferenceShortCode.startsWith("T") + const veteransPreferenceShortCode = bucket.preferenceShortCode?.startsWith("T") ? bucket.preferenceShortCode.replace("-", "-V-") - : `V-${bucket.preferenceShortCode}` + : `V-${bucket.preferenceShortCode}` // may be 'V-null' if preferenceShortCode does not exist, which will not affect numVeteranApps const numVeteranApps = veteranAppsByBucketMap[veteransPreferenceShortCode] ?? 0 return ( bucket.preferenceName === "generalLottery" + (bucket) => bucket.preferenceName === PREFERENCES.generalLottery ) return ( @@ -188,30 +191,10 @@ export const ListingDetailsLotteryPreferencesEducator = ({ <> -
-
-
- {generalLottery.map((bucket) => ( - -
- - {t("lottery.generalPool")} - -

{t("lottery.anyRemainingUnits")}

-

- {t("lottery.numberApplicantsQualifiedForGeneralPool", bucket.totalSubmittedApps)} -

-
-
-
- ))} )}