Skip to content

Commit

Permalink
working query and beginning of page - not clickable sidenav for VA Po…
Browse files Browse the repository at this point in the history
…lice
  • Loading branch information
eselkin committed Dec 6, 2023
1 parent f898e20 commit 21e5b29
Show file tree
Hide file tree
Showing 6 changed files with 314 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/site/constants/content-modeling.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ const ENTITY_BUNDLES = {
VA_FORM: 'va_form',
VAMC_OPERATING_STATUS_AND_ALERTS: 'vamc_operating_status_and_alerts',
VBA_FACILITY: 'vba_facility',
VA_POLICE_PAGE: 'va_police',
};

module.exports = {
Expand Down
214 changes: 214 additions & 0 deletions src/site/layouts/vamc_system_va_police.drupal.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,214 @@
{% include "src/site/includes/header.html" %}
{% include "src/site/includes/preview-edit.drupal.liquid" %}
{% include "src/site/includes/breadcrumbs.drupal.liquid" with hideHomeBreadcrumb = true %}

<div id="content" class="interior">
<main class="va-l-detail-page va-facility-page">
<div class="usa-grid usa-grid-full">
{% include 'src/site/navigation/facility_sidebar_nav.drupal.liquid' with sidebarData = facilitySidebar %}
<div class="usa-width-three-fourths">
<article class="usa-content">
{% include "src/site/includes/lovell-switch-link.drupal.liquid" with
entityUrl = entityUrl
%}

<h1>{{ title }}</h1>
{% assign image = fieldMedia.entity.image %}

<div
class="duotone darken lighten medium-screen:vads-u-margin-bottom--0p5">
<img class="system-img" src="{{ image.derivative.url }}" aria-hidden="true" role="presentation" alt="" width="100%">
</div>

<div
class="usa-grid usa-grid-full vads-u-margin-top--0 vads-u-margin-bottom--3">
{% assign basePath = entityUrl.path | regionBasePath %}
{% include "src/site/facilities/main_buttons.drupal.liquid" with path = basePath %}
</div>

{% if fieldIntroText != empty %}
<div class="va-introtext">
<p class="vads-u-margin-bottom--0">{{ fieldIntroText }}</p>
</div>
{% endif %}

<section>
<h2
class="vads-u-font-size--xl vads-u-margin-top--3 medium-screen:vads-u-margin-top--5 medium-screen:vads-u-margin-bottom--2p5">
Locations</h2>
{% for main in mainFacilities.entities %}
{% include 'src/site/includes/facilityListing.drupal.liquid' with
entity = main
fieldVaHealthConnectPhone = fieldVaHealthConnectPhone
%}
{% endfor %} <a
onClick="recordEvent({ event: 'nav-secondary-button-click' });"
class="usa-button usa-button-secondary vads-facility-hub-button vads-u-width--full medium-screen:vads-u-width--auto vads-u-font-size--md"
href="{{ entityUrl.path }}/locations">
See all locations <i
class="fa fa-chevron-right va-l-font-size--12px">&nbsp;</i>
</a>
</section>

<!-- "Manage your health online" section -->
{% comment %} Hide this section for Lovell TRICARE {% endcomment %}
{% if fieldAdministration.entity.entityId != '1039' %}
<section>
{% if fieldAdministration.entity.entityId == '1040' %}
<h3>Manage your VA health online</h3>
{% else %}
<h3>Manage your health online</h3>
{% endif %}
<div
class="vads-u-display--flex medium-screen:vads-u-flex-direction--row vads-u-flex-direction--column">
<div
class="vads-u-margin-right--0 medium-screen:vads-u-margin-right--3">
<div class="vads-facility-hub-cta">
<a onClick="recordEvent({ event: 'cta-hub-link-click' });"
href="{{ fieldVamcEhrSystem | topTaskUrl: "refill-track-prescriptions/", buildtype }}"
class="top-task-link vads-u-height--full vads-u-width--full">
<i
class=" fa fa-prescription-bottle vads-facility-hub-cta-circle">&nbsp;</i>
<span class="vads-facility-hub-cta-label">Refill and track
your prescriptions<i
class="fa fa-chevron-right vads-facility-hub-cta-arrow">&nbsp;</i></span>
</a>
</div>
<div class="vads-facility-hub-cta">
<a onClick="recordEvent({ event: 'cta-hub-link-click' });"
href="{{ fieldVamcEhrSystem | topTaskUrl: "secure-messaging/", buildtype }}"
class="top-task-link vads-u-height--full vads-u-width--full">
<i
class="far fa-comments vads-facility-hub-cta-circle">&nbsp;</i>
<span class="vads-facility-hub-cta-label">Send a secure
message to your health care team<i
class="fa fa-chevron-right vads-facility-hub-cta-arrow">&nbsp;</i></span>
</a>
</div>
<div
class="vads-facility-hub-cta vads-u-border-color--primary-alt-light medium-screen:vads-u-border-bottom--1px">
<a onClick="recordEvent({ event: 'cta-hub-link-click' });"
href="{{ fieldVamcEhrSystem | topTaskUrl: "schedule-view-va-appointments/", buildtype }}"
class="top-task-link vads-u-height--full vads-u-width--full">
<i
class="far fa-calendar-check vads-facility-hub-cta-circle">&nbsp;</i>
<span class="vads-facility-hub-cta-label">Schedule and manage
health appointments<i
class="fa fa-chevron-right vads-facility-hub-cta-arrow">&nbsp;</i></span>
</a>
</div>
</div>
<div>
<div class="vads-facility-hub-cta">
<a onClick="recordEvent({ event: 'cta-hub-link-click' });"
href="{{ fieldVamcEhrSystem | topTaskUrl: "get-medical-records/", buildtype }}"
class="top-task-link vads-u-height--full vads-u-width--full">
<i
class="fa fa-file-medical vads-facility-hub-cta-circle">&nbsp;</i>
<span class="vads-facility-hub-cta-label">Download your VA
medical records (Blue Button)<i
class="fa fa-chevron-right vads-facility-hub-cta-arrow">&nbsp;</i></span>
</a>
</div>
<div class="vads-facility-hub-cta">
<a onClick="recordEvent({ event: 'cta-hub-link-click' });"
href="{{ fieldVamcEhrSystem | topTaskUrl: "view-test-and-lab-results/", buildtype }}"
class="top-task-link vads-u-height--full vads-u-width--full">
<i
class="fa fa-clipboard-list vads-facility-hub-cta-circle">&nbsp;</i>
<span class="vads-facility-hub-cta-label">View your lab and
test results<i
class="fa fa-chevron-right vads-facility-hub-cta-arrow">&nbsp;</i></span>
</a>
</div>
<div
class="vads-facility-hub-cta vads-facility-hub-cta-last-line vads-u-border-top--1px vads-u-border-color--primary-alt-light">
<a onClick="recordEvent({ event: 'cta-hub-link-click' });"
href="/health-care/order-hearing-aid-batteries-and-accessories/"
class="vads-u-height--full vads-u-width--full">
<i
class="fa fa-deaf vads-facility-hub-cta-circle">&nbsp;</i>
<span class="vads-facility-hub-cta-label">Order hearing aid batteries <br/> and accessories<i class="fa fa-chevron-right vads-facility-hub-cta-arrow">&nbsp;</i></span>
</a>
</div>
</div>
</div>
</section>
{% endif %}


<!-- List of links section -->
<div class="vads-u-margin-top--5">
{% include "src/site/paragraphs/facilities/list_of_link_teasers_facility.drupal.liquid"
with paragraph = fieldRelatedLinks.entity
regionNickname = title
%}
</div>

{% assign header = "h3" %}
<!-- Stories -->
{% if newsStoryTeasersFeatured.entities.0.reverseFieldListingNode.entities.length %}
{% assign featuredStories = newsStoryTeasersFeatured.entities.0.reverseFieldListingNode.entities %}
<section>
<h2
class="vads-u-margin-bottom--3 medium-screen:vads-u-margin-top--5">
Stories</h2>

{% for story in featuredStories limit:2 %}
{% assign node = story %}
{% include "src/site/teasers/news_story.drupal.liquid" with node = story %}
{% endfor %}
<a onClick="recordEvent({ event: 'nav-secondary-button-click' });"
class="usa-button usa-button-secondary vads-facility-hub-button vads-u-width--full medium-screen:vads-u-width--auto vads-u-font-size--md vads-u-margin--0"
href="{{ entityUrl.path }}/stories">
See all stories <i
class="fa fa-chevron-right va-l-font-size--12px"></i>
</a>
</section>
{% endif %}

<!-- Events -->
{% if eventTeasersFeatured.entities.0.reverseFieldListingNode.entities.length %}
<section>
<h2
class="vads-u-margin-top--4 vads-u-margin-bottom--2 medium-screen:vads-u-margin-bottom--2p5">
Events</h2>
{% for event in eventTeasersFeatured.entities.0.reverseFieldListingNode.entities %}
{% assign node = event %}
{% include "src/site/teasers/event.drupal.liquid" %}
{% endfor %}
<a onClick="recordEvent({ event: 'nav-secondary-button-click' });"
class="usa-button usa-button-secondary vads-facility-hub-button vads-u-width--full medium-screen:vads-u-width--auto vads-u-font-size--md vads-u-margin--0"
href="{{ entityUrl.path }}/events">
See all events <i
class="fa fa-chevron-right va-l-font-size--12px"></i>
</a>
</section>
{% elsif eventTeasersAll.entities.0.reverseFieldListingNode.entities.length %}
{% assign upcomingEvents = eventTeasersAll.entities.0.reverseFieldListingNode.entities %}
{% assign sortedEvents = upcomingEvents | filterAndSortEvents %}
<section>
<h2
class="vads-u-margin-top--4 vads-u-margin-bottom--2 medium-screen:vads-u-margin-bottom--2p5">
Events</h2>
{% for event in sortedEvents limit:1 %}
{% assign node = event %}
{% include "src/site/teasers/event.drupal.liquid" %}
{% endfor %}
<a onClick="recordEvent({ event: 'nav-secondary-button-click' });"
class="usa-button usa-button-secondary vads-facility-hub-button vads-u-width--full medium-screen:vads-u-width--auto vads-u-font-size--md vads-u-margin--0"
href="{{ entityUrl.path }}/events">
See all events <i class="fa fa-chevron-right va-l-font-size--12px" aria-hidden="true"></i>
</a>
</section>
{% endif %}
{% include "src/site/facilities/facility_social_links.drupal.liquid" with regionNickname = title %}

</article>
<!-- Last updated & feedback button-->
{% include "src/site/includes/above-footer-elements.drupal.liquid" %}
</div>
</div>
</main>
{% include "src/site/includes/footer.html" %}
{% include "src/site/includes/debug.drupal.liquid" %}
10 changes: 10 additions & 0 deletions src/site/stages/build/drupal/graphql/CountEntityTypes.graphql.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,16 @@ const CountEntityTypes = `
count
}
vaPolicePage: nodeQuery(
filter: {
conditions: [
{field: "status", value: ["1"]},
{field: "type", value: ["vamc_system_va_police"]}
]}
) {
count
}
healthServicesListing: nodeQuery(
filter: {
conditions: [
Expand Down
86 changes: 86 additions & 0 deletions src/site/stages/build/drupal/graphql/vaPolice.graphql.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
const { generatePaginatedQueries } = require('../individual-queries-helpers');

const draftContentOverride = process.env.UNPUBLISHED_CONTENT === 'true';
const entityElementsFromPages = require('./entityElementsForPages.graphql');

const vaPoliceFragment = `
fragment vaPoliceFragment on NodeVamcSystemVaPolice {
${entityElementsFromPages}
... on NodeVamcSystemVaPolice {
fieldOffice {
entity {
... on NodeHealthCareRegionPage {
entityLabel
title
}
}
}
title
entityLabel
fieldCcFaq {
fetched
}
fieldCcVaPoliceOverview {
fetched
}
fieldCcTermDefinitionsNation {
fetched
}
fieldCcPoliceReport{
fetched
}
fieldAdministration {
entity{
name
path {
alias
pid
langcode
pathauto
}
}
}
}
}`;

const getVaPoliceSlice = (operationName, offset, limit) => {
return `
${vaPoliceFragment}
query GetVaPolicePages${
!draftContentOverride ? '($onlyPublishedContent: Boolean!)' : ''
} {
nodeQuery(
limit: ${limit}
offset: ${offset}
filter: {
conditions: [
${
!draftContentOverride
? '{ field: "status", value: ["1"], enabled: $onlyPublishedContent },'
: ''
}
{ field: "type", value: ["vamc_system_va_police"] }
]
}) {
entities {
... vaPoliceFragment
}
}
}
`;
};

const getVaPoliceQueries = entityCounts => {
return generatePaginatedQueries({
operationNamePrefix: 'GetVaPolicePages',
entitiesPerSlice: 25,
totalEntities: entityCounts.data.vaPolicePage.count,
getSlice: getVaPoliceSlice,
});
};

module.exports = {
fragment: vaPoliceFragment,
getVaPoliceQueries,
};
3 changes: 2 additions & 1 deletion src/site/stages/build/drupal/individual-queries.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ const {

const { getVetCenterQueries } = require('./graphql/vetCenter.graphql');
const { getVbaFacilityQueries } = require('./graphql/vbaFacility.graphql');

const { getVaPoliceQueries } = require('./graphql/vaPolice.graphql');
const {
GetVetCenterLocations,
} = require('./graphql/vetCenterLocations.graphql');
Expand All @@ -122,6 +122,7 @@ function getNodeQueries(entityCounts) {
GetNodePressReleaseListingPages,
...getNodeEventListingQueries(entityCounts),
...getNodeEventQueries(entityCounts),
...getVaPoliceQueries(entityCounts),
GetNodeStoryListingPages,
GetNodeLocationsListingPages,
GetNodeLeadershipListingPages,
Expand Down
1 change: 1 addition & 0 deletions src/site/stages/build/drupal/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,7 @@ function compilePage(page, contentData) {
case 'health_care_region_page':
case 'press_release':
case 'vba_facility':
case 'vamc_system_va_police':
pageCompiled = Object.assign(
page,
facilitySidebarNavItems,
Expand Down

0 comments on commit 21e5b29

Please sign in to comment.