diff --git a/app/assets/javascripts/short-form/templates/a3-custom-educator-screening.html.slim b/app/assets/javascripts/short-form/templates/a3-custom-educator-screening.html.slim index 511e024e8d..47b945fa89 100644 --- a/app/assets/javascripts/short-form/templates/a3-custom-educator-screening.html.slim +++ b/app/assets/javascripts/short-form/templates/a3-custom-educator-screening.html.slim @@ -31,7 +31,7 @@ section.app-container.focus-container // job classification text field label.form-label for="customEducatorJobClassificationNumber" | {{ 'a3_custom_educator_screening.enter_your_job_code' | translate }} - p.form-note.margin-bottom--half translate="a3_custom_educator_screening.job_classification_number_info" translate-value-url="https://sf.gov/node/10956" + p.form-note.margin-bottom--half translate="a3_custom_educator_screening.job_classification_number_info" translate-value-url="https://www.sf.gov/information--find-your-sfusd-job-code" input( ng-model="application.customEducatorJobClassificationNumber" ng-required="true" diff --git a/app/assets/javascripts/short-form/templates/e7a-veterans-preference.html.slim b/app/assets/javascripts/short-form/templates/e7a-veterans-preference.html.slim index 241550a60b..62d92d0fd8 100644 --- a/app/assets/javascripts/short-form/templates/e7a-veterans-preference.html.slim +++ b/app/assets/javascripts/short-form/templates/e7a-veterans-preference.html.slim @@ -14,7 +14,7 @@ | {{ 'e7a_veterans_preference.instructions_p3' | translate }} p.t-bold.margin-bottom translate="e7a_veterans_preference.instructions_p4" p.margin-bottom - a.lined target="_blank" href="https://sf.gov/node/11450" translate="e7a_veterans_preference.instructions_p5" aria-label="{{'e7a_veterans_preference.instructions_p5' | translate}} - Opens in new window" + a.lined target="_blank" href="https://www.sf.gov/get-priority-housing-lottery-if-you-are-veteran" translate="e7a_veterans_preference.instructions_p5" aria-label="{{'e7a_veterans_preference.instructions_p5' | translate}} - Opens in new window" .app-inner.inset .form-group ng-class="{ error: inputInvalid('veteransPreference') }" diff --git a/app/assets/javascripts/short-form/templates/f2-review-terms.html.slim b/app/assets/javascripts/short-form/templates/f2-review-terms.html.slim index 2efc8c4bdd..eee738c9da 100644 --- a/app/assets/javascripts/short-form/templates/f2-review-terms.html.slim +++ b/app/assets/javascripts/short-form/templates/f2-review-terms.html.slim @@ -11,7 +11,7 @@ p translate="f2_review_terms.p3_dalp" ng-if='listingIsDalp()' p translate="f2_review_terms.p4_rental" ng-if='listingIsRental()' p translate="f2_review_terms.p4_sale" ng-if='listingIsSale() && !listingIsDalp()' translate-value-url="https://sfmohcd.org/after-homebuyer-lottery" - p translate="f2_review_terms.p4_dalp" ng-if='listingIsDalp()' translate-value-url="https://sf.gov/node/7128" + p translate="f2_review_terms.p4_dalp" ng-if='listingIsDalp()' translate-value-url="https://www.sf.gov/reports--december-2024--downpayment-assistance-loan-program-dalp" p translate="f2_review_terms.p4.5_dalp" ng-if='listingIsDalp()' p translate="f2_review_terms.p5" p translate="f2_review_terms.p6" diff --git a/app/assets/json/additional-resources.json b/app/assets/json/additional-resources.json index d4a8477427..c49c9f3f41 100644 --- a/app/assets/json/additional-resources.json +++ b/app/assets/json/additional-resources.json @@ -8,22 +8,19 @@ "title": "assistance.additionalResources.sfHousingResources.fcfs.title", "agency": "assistance.additionalResources.sfHousingResources.fcfs.agency", "description": "assistance.additionalResources.sfHousingResources.fcfs.description", - "externalUrl": "https://sf.gov/reports/january-2023/first-come-first-served-bmr-listings", - "sfGovNode": 6396 + "externalUrl": "https://sf.gov/reports/january-2023/first-come-first-served-bmr-listings" }, { "title": "assistance.additionalResources.sfHousingResources.downpayment.title", "agency": "assistance.additionalResources.sfHousingResources.downpayment.agency", "description": "assistance.additionalResources.sfHousingResources.downpayment.description", - "externalUrl": "https://sf.gov/reports/december-2022/city-second-program-current-listings", - "sfGovNode": 7189 + "externalUrl": "https://sf.gov/reports/december-2022/city-second-program-current-listings" }, { "title": "assistance.additionalResources.sfHousingResources.rental.title", "agency": "assistance.additionalResources.sfHousingResources.rental.agency", "description": "assistance.additionalResources.sfHousingResources.rental.description", - "externalUrl": "https://sf.gov/information/san-francisco-rental-opportunities", - "sfGovNode": 7153 + "externalUrl": "https://sf.gov/information/san-francisco-rental-opportunities" }, { "title": "assistance.additionalResources.sfHousingResources.support.title", diff --git a/app/javascript/__tests__/util/languageUtil.test.ts b/app/javascript/__tests__/util/languageUtil.test.ts index 40fa7c627d..8da9db0350 100644 --- a/app/javascript/__tests__/util/languageUtil.test.ts +++ b/app/javascript/__tests__/util/languageUtil.test.ts @@ -208,20 +208,25 @@ describe("languageUtil", () => { }) describe("getSfGovUrl", () => { - const node = 55 it("returns the correct url for a sf.gov link", () => { const enLink = "https://sf.gov/departments/mayors-office-housing-and-community-development" - expect(getSfGovUrl(enLink, node, "https://housing.sfgov.org")).toBe(enLink) - expect(getSfGovUrl(enLink, node, "es")).toBe("https://sf.gov/es/node/55") - expect(getSfGovUrl(enLink, node, "zh")).toBe("https://sf.gov/zh-hant/node/55") - expect(getSfGovUrl(enLink, node, "tl")).toBe("https://sf.gov/fil/node/55") + expect(getSfGovUrl(enLink, "https://housing.sfgov.org")).toBe(enLink) + expect(getSfGovUrl(enLink, "es")).toBe( + "https://sf.gov/es/departments/mayors-office-housing-and-community-development" + ) + expect(getSfGovUrl(enLink, "zh")).toBe( + "https://sf.gov/zh-hant/departments/mayors-office-housing-and-community-development" + ) + expect(getSfGovUrl(enLink, "tl")).toBe( + "https://sf.gov/fil/departments/mayors-office-housing-and-community-development" + ) }) it("returns the same url if not an sf.gov link", () => { const enLink = "https://housing.acgov.org" - expect(getSfGovUrl(enLink, node, "https://housing.sfgov.org")).toBe(enLink) - expect(getSfGovUrl(enLink, node, "es")).toBe(enLink) - expect(getSfGovUrl(enLink, node, "zh")).toBe(enLink) - expect(getSfGovUrl(enLink, node, "tl")).toBe(enLink) + expect(getSfGovUrl(enLink, "https://housing.sfgov.org")).toBe(enLink) + expect(getSfGovUrl(enLink, "es")).toBe(enLink) + expect(getSfGovUrl(enLink, "zh")).toBe(enLink) + expect(getSfGovUrl(enLink, "tl")).toBe(enLink) }) }) }) diff --git a/app/javascript/components/BeforeApplyingForSale.tsx b/app/javascript/components/BeforeApplyingForSale.tsx index c618c9cbcc..d0c64340a9 100644 --- a/app/javascript/components/BeforeApplyingForSale.tsx +++ b/app/javascript/components/BeforeApplyingForSale.tsx @@ -57,10 +57,7 @@ export const BeforeApplyingForSale = ({ beforeApplyingType }: BeforeApplyingForS ) { requirements = renderInlineMarkup( `${t("saleDirectory.beforeApplying.readFullList", { - url: getSfGovUrl( - "https://sf.gov/determine-if-you-can-buy-affordable-housing-program", - 7164 - ), + url: getSfGovUrl("https://sf.gov/determine-if-you-can-buy-affordable-housing-program"), })}` ) listItems = [ @@ -68,17 +65,14 @@ export const BeforeApplyingForSale = ({ beforeApplyingType }: BeforeApplyingForS { content: renderInlineMarkup( `${t("saleDirectory.beforeApplying.step2", { - url: getSfGovUrl( - "https://sf.gov/determine-if-you-can-buy-affordable-housing-program", - 7164 - ), + url: getSfGovUrl("https://sf.gov/determine-if-you-can-buy-affordable-housing-program"), })}` ), }, { content: renderInlineMarkup( `${t("saleDirectory.beforeApplying.step3", { - url: getSfGovUrl("https://sf.gov/sign-complete-homebuyer-education", 212), + url: getSfGovUrl("https://sf.gov/sign-complete-homebuyer-education"), })}` ), }, @@ -86,8 +80,7 @@ export const BeforeApplyingForSale = ({ beforeApplyingType }: BeforeApplyingForS content: renderInlineMarkup( `${t("saleDirectory.beforeApplying.step4", { url: getSfGovUrl( - "https://sf.gov/reports/october-2023/find-lender-below-market-rate-program", - 6953 + "https://sf.gov/reports/october-2023/find-lender-below-market-rate-program" ), })}` ), diff --git a/app/javascript/layouts/Layout.tsx b/app/javascript/layouts/Layout.tsx index 11c6aab29c..9b8b0f8663 100644 --- a/app/javascript/layouts/Layout.tsx +++ b/app/javascript/layouts/Layout.tsx @@ -197,8 +197,7 @@ const Layout = (props: LayoutProps) => { {t("footer.dahliaDescription", { mohcdUrl: getSfGovUrl( - "https://sf.gov/departments/mayors-office-housing-and-community-development", - 55 + "https://sf.gov/departments/mayors-office-housing-and-community-development" ), })} @@ -207,13 +206,9 @@ const Layout = (props: LayoutProps) => { {t("footer.inPartnershipWith", { sfdsUrl: getSfGovUrl( - "https://sf.gov/departments/city-administrator/digital-services", - 1788 - ), - mayorUrl: getSfGovUrl( - "https://sf.gov/departments/mayors-office-innovation", - 3095 + "https://sf.gov/departments/city-administrator/digital-services" ), + mayorUrl: getSfGovUrl("https://sf.gov/departments/mayors-office-innovation"), })}

diff --git a/app/javascript/layouts/Sidebar/ContactSidebarBlock.tsx b/app/javascript/layouts/Sidebar/ContactSidebarBlock.tsx index 34d425b609..08c0f3684d 100644 --- a/app/javascript/layouts/Sidebar/ContactSidebarBlock.tsx +++ b/app/javascript/layouts/Sidebar/ContactSidebarBlock.tsx @@ -10,8 +10,7 @@ const SidebarContactInfo = () => ( {renderInlineMarkup( t("assistance.contact.questionsAboutPrograms.contactWebsite", { url: getSfGovUrl( - "https://sf.gov/departments/mayors-office-housing-and-community-development", - 55 + "https://sf.gov/departments/mayors-office-housing-and-community-development" ), }) )} @@ -45,7 +44,7 @@ const SidebarSFHelp = () => (
{renderInlineMarkup( t("assistance.contact.helpLine.subtitle", { - url: getSfGovUrl("https://sf.gov/departments/311-customer-service-center", 217), + url: getSfGovUrl("https://sf.gov/departments/311-customer-service-center"), }) )}

diff --git a/app/javascript/layouts/Sidebar/GetHelpSidebarBlock.tsx b/app/javascript/layouts/Sidebar/GetHelpSidebarBlock.tsx index 65daa57e82..f5ee2ea141 100644 --- a/app/javascript/layouts/Sidebar/GetHelpSidebarBlock.tsx +++ b/app/javascript/layouts/Sidebar/GetHelpSidebarBlock.tsx @@ -16,10 +16,7 @@ const GetHelpSidebarBlock = () => ( {t("housingCounselor.findAHousingCounselor")} diff --git a/app/javascript/modules/constants.tsx b/app/javascript/modules/constants.tsx index 3584bcdd21..803bfde8c5 100644 --- a/app/javascript/modules/constants.tsx +++ b/app/javascript/modules/constants.tsx @@ -100,7 +100,7 @@ export const SFGOV_LINKS = [ "https://sf.gov/information/special-calculations-household-income", "https://sf.gov/after-rental-housing-lottery", "https://www.sf.gov/step-by-step/buy-home-without-entering-lottery", - "https://www.sf.gov/node/14246", + "https://www.sf.gov/step-by-step--buy-home-without-entering-lottery", "https://www.sf.gov/resource/2022/homebuyer-program-counseling-agencies", // Salesforce links that redirect to sf.gov pages "http://sfmohcd.org/certificate-preference", diff --git a/app/javascript/modules/listingDetails/ListingDetailsChisholmPreferences.tsx b/app/javascript/modules/listingDetails/ListingDetailsChisholmPreferences.tsx index d78b3ed431..f6243fe7fb 100644 --- a/app/javascript/modules/listingDetails/ListingDetailsChisholmPreferences.tsx +++ b/app/javascript/modules/listingDetails/ListingDetailsChisholmPreferences.tsx @@ -24,8 +24,7 @@ export const ListingDetailsChisholmPreferences = ({ {renderInlineMarkup( t("listings.customListingType.educator.preferences.part4a", { chisholmLotteryLink: getSfGovUrl( - "https://sf.gov/information/learn-how-lottery-works-shirley-chisholm-village", - 10493 + "https://sf.gov/information/learn-how-lottery-works-shirley-chisholm-village" ), }) )} @@ -34,8 +33,7 @@ export const ListingDetailsChisholmPreferences = ({ {renderInlineMarkup( t("listings.customListingType.educator.preferences.part4b", { preferencesLink: getSfGovUrl( - "https://sf.gov/information/learn-about-housing-lottery-preference-programs", - 3274 + "https://sf.gov/information/learn-about-housing-lottery-preference-programs" ), }) )} diff --git a/app/javascript/modules/listingDetails/ListingDetailsEligibility.tsx b/app/javascript/modules/listingDetails/ListingDetailsEligibility.tsx index 1aab9ddc50..c795707737 100644 --- a/app/javascript/modules/listingDetails/ListingDetailsEligibility.tsx +++ b/app/javascript/modules/listingDetails/ListingDetailsEligibility.tsx @@ -155,8 +155,7 @@ export const ListingDetailsEligibility = ({ {renderInlineMarkup( t("listings.customListingType.educator.eligibility.part2", { chisholmLink: getSfGovUrl( - "https://sf.gov/apply-shirley-chisholm-village-housing", - 10543 + "https://sf.gov/apply-shirley-chisholm-village-housing" ), }) )} @@ -204,8 +203,7 @@ export const ListingDetailsEligibility = ({ {renderInlineMarkup( t("listings.customListingType.educator.eligibility.part2", { chisholmLink: getSfGovUrl( - "https://sf.gov/apply-shirley-chisholm-village-housing", - 10543 + "https://sf.gov/apply-shirley-chisholm-village-housing" ), }) )} @@ -259,8 +257,7 @@ export const ListingDetailsEligibility = ({ {renderMarkup( t("listings.incomeExceptions.intro", { url: getSfGovUrl( - "https://sf.gov/information/special-calculations-household-income", - 7080 + "https://sf.gov/information/special-calculations-household-income" ), }) )} diff --git a/app/javascript/modules/listingDetails/ListingDetailsHabitat.tsx b/app/javascript/modules/listingDetails/ListingDetailsHabitat.tsx index eec036c74c..85253c4c1a 100644 --- a/app/javascript/modules/listingDetails/ListingDetailsHabitat.tsx +++ b/app/javascript/modules/listingDetails/ListingDetailsHabitat.tsx @@ -58,10 +58,7 @@ export const ListingDetailsHabitat = ({ listing }: ListingDetailsHabitatProps) =
{renderMarkup( t("listings.incomeExceptions.intro", { - url: getSfGovUrl( - "https://sf.gov/information/special-calculations-household-income", - 7080 - ), + url: getSfGovUrl("https://sf.gov/information/special-calculations-household-income"), }) )}
diff --git a/app/javascript/modules/listingDetails/ListingDetailsPreferences.tsx b/app/javascript/modules/listingDetails/ListingDetailsPreferences.tsx index 854d98d21d..b3fd0d580c 100644 --- a/app/javascript/modules/listingDetails/ListingDetailsPreferences.tsx +++ b/app/javascript/modules/listingDetails/ListingDetailsPreferences.tsx @@ -35,23 +35,6 @@ export interface ListingDetailsPreferencesProps { translations?: RailsTranslations } -export const mapPreferenceLink = (link: string): string => { - switch (link) { - case "http://sfmohcd.org/certificate-preference": - return getSfGovUrl(link, 3275) - case "http://sfmohcd.org/displaced-tenant-housing-preference": - return getSfGovUrl(link, 7488) - case "http://sfmohcd.org/housing-preference-programs": - return getSfGovUrl(link, 3274) - case "http://sfmohcd.org/neighborhood-resident-housing-preference": - return getSfGovUrl(link, 3274) - case "https://www.sf.gov/certain-buildings-have-special-lottery-preferences": - return getSfGovUrl(link, 11931) - default: - return link - } -} - export const ListingDetailsPreferences = ({ listingID, translations, @@ -85,7 +68,7 @@ export const ListingDetailsPreferences = ({ if (preference.readMoreUrl) { links.push({ title: t("label.readMore"), - url: mapPreferenceLink(preference.readMoreUrl), + url: getSfGovUrl(preference.readMoreUrl), ariaLabel: t(`listings.lotteryPreference.${preference.preferenceName}.readMore`), }) } diff --git a/app/javascript/modules/listingDetailsAside/ListingDetailsApply.tsx b/app/javascript/modules/listingDetailsAside/ListingDetailsApply.tsx index ffb15d5972..b0f918e321 100644 --- a/app/javascript/modules/listingDetailsAside/ListingDetailsApply.tsx +++ b/app/javascript/modules/listingDetailsAside/ListingDetailsApply.tsx @@ -86,8 +86,7 @@ const StandardHowToApply = ({ url: isHabitatListing ? "https://habitatgsf.org/amber-drive-info/" : getSfGovUrl( - "https://sf.gov/determine-if-you-can-buy-affordable-housing-program", - 7164 + "https://sf.gov/determine-if-you-can-buy-affordable-housing-program" ), }) )} diff --git a/app/javascript/modules/listingDetailsAside/ListingDetailsNeedHelp.tsx b/app/javascript/modules/listingDetailsAside/ListingDetailsNeedHelp.tsx index 8875cae568..1589ed355b 100644 --- a/app/javascript/modules/listingDetailsAside/ListingDetailsNeedHelp.tsx +++ b/app/javascript/modules/listingDetailsAside/ListingDetailsNeedHelp.tsx @@ -11,8 +11,7 @@ export const NeedHelpBlock = ({ listing }: { listing: RailsSaleListing | RailsRe const isListingRental = isRental(listing) const salesNeedHelpLink = getSfGovUrl( - "https://www.sf.gov/resource/2022/homebuyer-program-counseling-agencies", - 7209 + "https://www.sf.gov/resource/2022/homebuyer-program-counseling-agencies" ) return ( diff --git a/app/javascript/modules/listingDetailsLottery/ListingDetailsLotteryRanking.tsx b/app/javascript/modules/listingDetailsLottery/ListingDetailsLotteryRanking.tsx index 0a63cd3b9f..9b09e020e3 100644 --- a/app/javascript/modules/listingDetailsLottery/ListingDetailsLotteryRanking.tsx +++ b/app/javascript/modules/listingDetailsLottery/ListingDetailsLotteryRanking.tsx @@ -110,7 +110,7 @@ export const ListingDetailsLotteryRanking = ({ {t("lottery.nextStepsLearnMore")} diff --git a/app/javascript/modules/noLotteryRequired/fcfsNoLotteryRequired.tsx b/app/javascript/modules/noLotteryRequired/fcfsNoLotteryRequired.tsx index 60aca977cc..061ac12bdd 100644 --- a/app/javascript/modules/noLotteryRequired/fcfsNoLotteryRequired.tsx +++ b/app/javascript/modules/noLotteryRequired/fcfsNoLotteryRequired.tsx @@ -20,10 +20,7 @@ export const fcfsNoLotteryRequired = () => { { diff --git a/app/javascript/pages/getAssistance/document-checklist.tsx b/app/javascript/pages/getAssistance/document-checklist.tsx index 3f6d92f030..ec6c082ba1 100644 --- a/app/javascript/pages/getAssistance/document-checklist.tsx +++ b/app/javascript/pages/getAssistance/document-checklist.tsx @@ -73,7 +73,7 @@ const DocumentChecklist = () => {

{renderInlineMarkup( t("documentChecklist.copDoc2", { - url: getSfGovUrl("https://sf.gov/learn-about-certificate-preference-cop", 3275), + url: getSfGovUrl("https://sf.gov/learn-about-certificate-preference-cop"), }) )}

@@ -90,10 +90,7 @@ const DocumentChecklist = () => {

{renderInlineMarkup( t("documentChecklist.dthpDoc3", { - url: getSfGovUrl( - "https://sf.gov/displaced-tenant-housing-preference-program-dthp", - 7488 - ), + url: getSfGovUrl("https://sf.gov/displaced-tenant-housing-preference-program-dthp"), }) )}

@@ -187,8 +184,7 @@ const DocumentChecklist = () => { {renderInlineMarkup( t("documentChecklist.p3", { url: getSfGovUrl( - "https://sf.gov/information/learn-about-housing-lottery-preference-programs", - 3274 + "https://sf.gov/information/learn-about-housing-lottery-preference-programs" ), }) )} @@ -208,8 +204,7 @@ const DocumentChecklist = () => { {renderInlineMarkup( t("documentChecklist.homebuyerLoanDesc", { url: getSfGovUrl( - "https://sf.gov/reports/february-2023/find-lender-below-market-rate-program", - 6953 + "https://sf.gov/reports/february-2023/find-lender-below-market-rate-program" ), }) )} diff --git a/app/javascript/pages/howToApply/how-to-apply.tsx b/app/javascript/pages/howToApply/how-to-apply.tsx index f6eb6caa5e..11965d8c33 100644 --- a/app/javascript/pages/howToApply/how-to-apply.tsx +++ b/app/javascript/pages/howToApply/how-to-apply.tsx @@ -114,10 +114,10 @@ const HowLongItTakesSection = ({ listing }: { listing: RailsSaleListing }) => { ) } -const renderInlineSfGovUrl = (key: string, url: string, node: number) => { +const renderInlineSfGovUrl = (key: string, url: string) => { return renderInlineMarkup( `${t(key, { - url: getSfGovUrl(url, node), + url: getSfGovUrl(url), })}` ) } @@ -127,17 +127,14 @@ const eligibilityListItems = [ { index: 2, link: "https://sf.gov/determine-if-you-can-buy-affordable-housing-program", - node: 7164, }, { index: 3, link: "https://sf.gov/sign-complete-homebuyer-education", - node: 212, }, { index: 4, link: "https://sf.gov/reports/october-2023/find-lender-below-market-rate-program", - node: 6953, }, { index: 5 }, ] @@ -202,8 +199,7 @@ const BeforeYouStartSection = ({ listing }: { listing: RailsSaleListing }) => { renderInlineSfGovUrl( `howToApplyPage.beforeYouStartSection.eligibilityList.listItem${item.index}`, - item.link, - item.node + item.link ) } @@ -409,7 +405,7 @@ const WhatHappensNextSection = () => { {t("listings.fcfs.bmrSales.noLotteryRequired.footer")} diff --git a/app/javascript/util/languageUtil.tsx b/app/javascript/util/languageUtil.tsx index 558c4a0049..619595db3f 100644 --- a/app/javascript/util/languageUtil.tsx +++ b/app/javascript/util/languageUtil.tsx @@ -143,15 +143,16 @@ export const getCurrentLanguage = (path?: string | undefined): LanguagePrefix => * Get an SF.gov url given the DAHLIA language prefix using the sf.gov node suffix * */ -export const getSfGovUrl = (enLink: string, node?: number, path?: string) => { +export const getSfGovUrl = (enLink: string, path?: string) => { if (!SFGOV_LINKS.includes(enLink) || enLink.includes("pdf")) return enLink + const linkPath = new URL(enLink).pathname switch (getCurrentLanguage(path || window.location.pathname)) { case LanguagePrefix.Spanish: - return `https://sf.gov/es/node/${node}` + return `https://sf.gov/es${linkPath}` case LanguagePrefix.Tagalog: - return `https://sf.gov/fil/node/${node}` + return `https://sf.gov/fil${linkPath}` case LanguagePrefix.Chinese: - return `https://sf.gov/zh-hant/node/${node}` + return `https://sf.gov/zh-hant${linkPath}` default: return enLink }