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) => {
{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 }