Skip to content

Commit

Permalink
[VACMS-19406]Don't build health care region pages for Manila (#2410)
Browse files Browse the repository at this point in the history
* Don't build health care region pages for Manila

* require presence of page but none of its attributes

* verify page is present before checking against
  • Loading branch information
SnowboardTechie authored Jan 22, 2025
1 parent 1444f74 commit deaf791
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/site/stages/build/drupal/process-manila-pages.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/* eslint-disable no-param-reassign */
const { ENTITY_BUNDLES } = require('../../../constants/content-modeling');

const MANILA_VA_CLINIC_ENTITY_ID = '1187';

function getManilaClinicUrl(path) {
Expand All @@ -13,14 +15,21 @@ function isManilaVAClinicPage(page) {
);
}

function isManillaVaRegionHomepage(page) {
return (
isManilaVAClinicPage(page) &&
page?.entityBundle === ENTITY_BUNDLES.HEALTH_CARE_REGION_PAGE
);
}

function updateManilaSystemLinks(page) {
// Update main URL path
if (page.entityUrl?.path) {
if (page?.entityUrl?.path) {
page.entityUrl.path = getManilaClinicUrl(page.entityUrl.path);
}

// Update breadcrumb links
if (page.entityUrl?.breadcrumb) {
if (page?.entityUrl?.breadcrumb) {
page.entityUrl.breadcrumb = page.entityUrl.breadcrumb.map(crumb => ({
...crumb,
url: crumb.url ? getManilaClinicUrl(crumb.url) : crumb.url,
Expand Down Expand Up @@ -53,6 +62,10 @@ function processManilaPages(drupalData) {
if (isManilaVAClinicPage(page)) {
acc.manilaVAClinicPages.push(page);
} else {
// Federal Region Homepage should not be created for Manila VA Clinic
if (isManillaVaRegionHomepage(page)) {
return acc;
}
acc.otherPages.push(page);
}

Expand Down

0 comments on commit deaf791

Please sign in to comment.