Skip to content
This repository was archived by the owner on May 21, 2026. It is now read-only.

Commit 7a14375

Browse files
eselkin-weselkinCopilot
authored andcommitted
VACMS 21049 - wires up the VET_CENTER_OUTSTATION feature to work with correct real data (#1886)
* [VACMS-21049] connect Vet Center Outstation pages to CMS Wires the Vet Center Outstation detail page to the CMS by switching the data loader from RESOURCE_TYPES.VET_CENTER to VET_CENTER_OUTSTATION, adding the route in [...slug].tsx, and extending NodeVetCenterOutstation with the centralized-content fields the existing formatter already reads. Adds null safety to buildFeaturedContentArray, buildFaqs, and a new buildCCWysiwyg helper so missing CC fields no longer crash the formatter on real CMS responses where editors haven't filled everything in. Outstation titles in the Vet Center location listing now link to the detail page via a new isVetCenterOutstation type guard. Adapted from the closed PR #1572. * Add in the optional (feature flagged) mission explainer and image to test that they work and also checked field_intro_text * qa data * Apply suggestions from code review Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * fix: update VetCenterOutstation types to allow null values and improve HTML fetching in formatter * fix: streamline banner media fetching logic in VetCenterOutstation query * returning h2 to VADS defaults --------- Co-authored-by: Eli Selkin <5606931+eselkin@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent b0df629 commit 7a14375

18 files changed

Lines changed: 3011 additions & 388 deletions

.qa-data/node--vet_center_locations_list.json

Lines changed: 916 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
{
2+
"resourceType": "node--vet_center_outstation",
3+
"paths": [
4+
{
5+
"path": "/anoka-vet-center/st-cloud-vet-center-outstation",
6+
"starred": true,
7+
"notes": "Now shows a page ... same for all other outstations ... not available on prior staging/prod"
8+
},
9+
{
10+
"path": "/manchester-vet-center/newington-outstation",
11+
"starred": true,
12+
"notes": "Now shows a page ... same for all other outstations ... not available on prior staging/prod"
13+
},
14+
{
15+
"path": "/huntington-vet-center/parkersburg-outstation",
16+
"starred": true,
17+
"notes": "Now shows a page ... same for all other outstations ... not available on prior staging/prod"
18+
},
19+
{
20+
"path": "/elkton-vet-center/salisbury-outstation",
21+
"starred": true,
22+
"notes": "Now shows a page ... same for all other outstations ... not available on prior staging/prod"
23+
},
24+
{
25+
"path": "/elkton-vet-center/aberdeen-outstation",
26+
"starred": true,
27+
"notes": "Now shows a page ... same for all other outstations ... not available on prior staging/prod"
28+
},
29+
{
30+
"path": "/us-virgin-islands-vet-center/st-croix-vet-center-outstation",
31+
"starred": true,
32+
"notes": "Now shows a page ... same for all other outstations ... not available on prior staging/prod"
33+
},
34+
{
35+
"path": "/fargo-vet-center/grand-forks-vet-center-outstation",
36+
"starred": true,
37+
"notes": "Now shows a page ... same for all other outstations ... not available on prior staging/prod"
38+
},
39+
{
40+
"path": "/la-crosse-vet-center/wausau-vet-center-outstation",
41+
"starred": true,
42+
"notes": "Now shows a page ... same for all other outstations ... not available on prior staging/prod"
43+
},
44+
{
45+
"path": "/anchorage-vet-center/kenai-outstation",
46+
"starred": true,
47+
"notes": "Now shows a page ... same for all other outstations ... not available on prior staging/prod"
48+
},
49+
{
50+
"path": "/tacoma-vet-center/lacey-outstation",
51+
"starred": true,
52+
"notes": "Now shows a page ... same for all other outstations ... not available on prior staging/prod"
53+
},
54+
{
55+
"path": "/salt-lake-city-vet-center/ogden-major-brent-taylor-vet-center-outstation",
56+
"starred": true,
57+
"notes": "Now shows a page ... same for all other outstations ... not available on prior staging/prod"
58+
},
59+
{
60+
"path": "/farmington-vet-center/navajo-outstation",
61+
"starred": true,
62+
"notes": "Now shows a page ... same for all other outstations ... not available on prior staging/prod"
63+
},
64+
{
65+
"path": "/farmington-vet-center/hopi-outstation",
66+
"starred": true,
67+
"notes": "Now shows a page ... same for all other outstations ... not available on prior staging/prod"
68+
},
69+
{
70+
"path": "/concord-vet-center/solano-county-vet-center-outstation",
71+
"starred": true,
72+
"notes": "Now shows a page ... same for all other outstations ... not available on prior staging/prod"
73+
},
74+
{
75+
"path": "/tucson-vet-center/sierra-vista-vet-center-outstation",
76+
"starred": true,
77+
"notes": "Now shows a page ... same for all other outstations ... not available on prior staging/prod"
78+
},
79+
{
80+
"path": "/white-river-junction-vet-center/keene-outstation",
81+
"starred": true,
82+
"notes": "Now shows a page ... same for all other outstations ... not available on prior staging/prod"
83+
},
84+
{
85+
"path": "/greensboro-vet-center/rutherford-vet-center-outstation",
86+
"starred": true,
87+
"notes": "Now shows a page ... same for all other outstations ... not available on prior staging/prod"
88+
},
89+
{
90+
"path": "/martinsburg-vet-center/leesburg-vet-center-outstation",
91+
"starred": true,
92+
"notes": "Now shows a page ... same for all other outstations ... not available on prior staging/prod"
93+
},
94+
{
95+
"path": "/great-falls-vet-center/helena-outstation",
96+
"starred": true,
97+
"notes": "Now shows a page ... same for all other outstations ... not available on prior staging/prod"
98+
}
99+
],
100+
"lastFetched": "2026-05-05T19:31:28.278Z"
101+
}

envs/.env.test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,4 @@ FEATURE_NEXT_BUILD_CONTENT_VAMC_SYSTEM_VA_POLICE=true
7171
FEATURE_NEXT_BUILD_CONTENT_VBA_FACILITY=true
7272
FEATURE_NEXT_BUILD_CONTENT_VET_CENTER=true
7373
FEATURE_NEXT_BUILD_CONTENT_VET_CENTER_LOCATIONS_LIST=true
74+
FEATURE_NEXT_BUILD_CONTENT_VET_CENTER_OUTSTATION=true

envs/.env.tugboat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,3 +89,4 @@ FEATURE_NEXT_BUILD_CONTENT_VAMC_SYSTEM_VA_POLICE=true
8989
FEATURE_NEXT_BUILD_CONTENT_VBA_FACILITY=true
9090
FEATURE_NEXT_BUILD_CONTENT_VET_CENTER=true
9191
FEATURE_NEXT_BUILD_CONTENT_VET_CENTER_LOCATIONS_LIST=true
92+
FEATURE_NEXT_BUILD_CONTENT_VET_CENTER_OUTSTATION=true

src/components/paragraph/ParagraphList.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ describe('ParagraphList Component', () => {
121121
},
122122
{
123123
type: 'paragraph--collapsible_panel',
124-
id: '2',
124+
id: '3',
125125
entityId: 1,
126126
paragraphs: [
127127
{

src/components/vetCenterLocationListing/VetCenterLocationInfo.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@ const isMobileVetCenter = (
4444
return vetCenter.type === 'node--vet_center_mobile_vet_center'
4545
}
4646

47+
const isVetCenterOutstation = (
48+
vetCenter: VetCenterInfoVariant
49+
): vetCenter is VetCenterOutstationLocationInfo => {
50+
return vetCenter.type === 'node--vet_center_outstation'
51+
}
52+
4753
/**
4854
* For the map widgets to work, certain global variables need to be set, which is
4955
* currently being done in the parent VetCenterLocationListing component.
@@ -113,7 +119,7 @@ export const VetCenterLocationInfo = ({
113119
className="vads-u-margin-bottom--1 vads-u-margin-top--0"
114120
aria-describedby={alsoCalledId}
115121
>
116-
{isMainOffice ? (
122+
{isMainOffice || isVetCenterOutstation(vetCenter) ? (
117123
<va-link href={vetCenter.path} text={title}></va-link>
118124
) : (
119125
<span>{title}</span>

src/components/vetCenterLocationListing/template.test.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -159,13 +159,14 @@ describe('VetCenterLocationListing with valid data', () => {
159159
test('renders outstation location', () => {
160160
render(<VetCenterLocationListing {...mockData} />)
161161

162-
// Check for outstation title
163-
expect(
164-
screen.getByText(/Sepulveda Vet Center Outstation/)
165-
).toBeInTheDocument()
162+
// Outstation title is rendered inside a va-link's `text` attribute
163+
const titleLinkElement = document.querySelector(
164+
'va-link[text="Helena Vet Center Outstation"]'
165+
)
166+
expect(titleLinkElement).toBeInTheDocument()
166167

167168
// Check for outstation address
168-
expect(screen.getByText(/9737 Haskell Ave/)).toBeInTheDocument()
169+
expect(screen.getByText(/1301 Elm Street/)).toBeInTheDocument()
169170
})
170171

171172
test('renders nearby mobile vet center', () => {

0 commit comments

Comments
 (0)