Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vacms 16144 VAMC service location paragraphs - and merge VBA #1912

Merged
merged 85 commits into from
May 14, 2024
Merged
Changes from 13 commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
61e7293
Move to Service Location Paragraphs in VAMC
eselkin Feb 8, 2024
0fb3301
Merge branch 'main' into VACMS-16144-VAMC-ServiceLocationParagraphs
eselkin Feb 8, 2024
c754702
merging of service_locations paragraphs
eselkin Feb 13, 2024
44f97e4
Service Hours
eselkin Feb 13, 2024
5e096b1
remove old service_location paragraphs
eselkin Feb 13, 2024
4807965
remove consolelog
eselkin Feb 13, 2024
81caa4a
typo on include
eselkin Feb 13, 2024
e7c2bea
conditions when to show Appointments
eselkin Feb 13, 2024
1fe7c78
show appointments simplification
eselkin Feb 14, 2024
5192b40
test not possible on paragraph
eselkin Feb 14, 2024
93082a0
testing
eselkin Feb 15, 2024
6bef6c6
naming
eselkin Feb 15, 2024
597ec0d
spacing
eselkin Feb 15, 2024
1a046d5
indent
eselkin Feb 15, 2024
d6bd0d9
non-clinical
eselkin Feb 17, 2024
f9874a5
clena up spacing
eselkin Feb 20, 2024
3332f22
spacing class
eselkin Feb 21, 2024
a748ad7
improving spacing slowly
eselkin Feb 21, 2024
8b5505c
spacing again
eselkin Feb 21, 2024
4a4d701
working spacing
eselkin Feb 23, 2024
0798252
more spacing
eselkin Feb 23, 2024
99c0a69
merge conflicts
eselkin Feb 26, 2024
24ce55c
correct order of phone numbers and h5 for appointment related phone n…
eselkin Feb 26, 2024
62ed5e9
order
eselkin Feb 26, 2024
46153f4
borders were not showing
eselkin Feb 27, 2024
2389eb6
bordered
eselkin Feb 27, 2024
0376b1c
accidental vet center accordion border
eselkin Feb 27, 2024
5cae020
fix headers
eselkin Feb 27, 2024
57da9c2
VA-15959: Update VBA Service Location query for int branch (#1936)
maxx1128 Feb 29, 2024
e51deb3
Merge branch 'main' into VACMS-16144-VAMC-ServiceLocationParagraphs
eselkin Mar 1, 2024
35cad11
fix for empty extensions
eselkin Mar 8, 2024
cb8c8ca
merge in Maxs work
eselkin Mar 8, 2024
2602bc7
v3 components added, built, updated
eselkin Mar 11, 2024
f5c1230
remove extra vetcenter attributes to liquid
eselkin Mar 11, 2024
5f7bf86
fix testing on phone numbers now that using va-telephone component
eselkin Mar 11, 2024
6e4f491
add more testing
eselkin Mar 11, 2024
f3c1225
make use of regexes better
eselkin Mar 12, 2024
0b8ba9b
explanation of matches
eselkin Mar 12, 2024
fd31417
allow for short codes
eselkin Mar 12, 2024
bf378cb
additional info uswds
eselkin Mar 13, 2024
8f06ed2
add missing data to graphql
eselkin Mar 14, 2024
3a0ffc3
spacing on Appointments header
eselkin Mar 14, 2024
8c299d3
remove Vet Center tests from this branch
eselkin Mar 14, 2024
ce99025
remove Vet Center tests from this branch
eselkin Mar 14, 2024
7b2a98e
Merge branch 'main' into VACMS-16945-VetCenter-v3-Component-Update
eselkin Mar 14, 2024
92eb7df
replace should have 2 args
eselkin Mar 14, 2024
b3b3860
remove debugging
eselkin Mar 15, 2024
e69b333
Merge branch 'main' into VACMS-16144-VAMC-ServiceLocationParagraphs
eselkin Mar 15, 2024
8b22f8a
Merge branch 'main' into VACMS-16945-VetCenter-v3-Component-Update
eselkin Mar 16, 2024
7a91e3a
Merge branch 'main' into VACMS-16945-VetCenter-v3-Component-Update
eselkin Mar 18, 2024
73fb012
remove extra div and strongs
eselkin Mar 19, 2024
ee5b26c
Merge branches 'VACMS-16945-VetCenter-v3-Component-Update' and 'main'…
eselkin Mar 19, 2024
23ee2a0
Merge branch 'main' into VACMS-16144-VAMC-ServiceLocationParagraphs
eselkin Mar 20, 2024
75f46cc
optional
eselkin Mar 20, 2024
8812728
Merge branch 'main' into VACMS-16144-VAMC-ServiceLocationParagraphs
eselkin Mar 21, 2024
d926410
merge main
eselkin Mar 27, 2024
8a9bd42
VACMS-17513: Remove unspecified referrals from front-end (#1982)
maxx1128 Mar 27, 2024
f170c5e
Merge branch 'main' into VACMS-16144-VAMC-ServiceLocationParagraphs
eselkin Apr 3, 2024
f0db30c
shows main phone or appt phone numbers and shows main phone or contac…
eselkin Apr 3, 2024
3e2cf88
Merge branch 'main' into VACMS-16144-VAMC-ServiceLocationParagraphs
eselkin Apr 4, 2024
2932d5f
Merge branch 'main' into VACMS-16144-VAMC-ServiceLocationParagraphs
eselkin Apr 8, 2024
f75ec1f
Merge branch 'main' into VACMS-16144-VAMC-ServiceLocationParagraphs
eselkin Apr 11, 2024
f9fd8e2
Appointments top section visible when walkins unspecified and not rem…
eselkin Apr 15, 2024
4a7cec7
merge
eselkin Apr 15, 2024
8518c10
not elsif (#2002)
eselkin Apr 16, 2024
096b179
Merge branch 'main' into VACMS-16144-VAMC-ServiceLocationParagraphs
eselkin Apr 17, 2024
5c4faff
Merge branch 'main' into VACMS-16144-VAMC-ServiceLocationParagraphs
eselkin Apr 18, 2024
f9f004a
Merge branch 'main' into VACMS-16144-VAMC-ServiceLocationParagraphs
eselkin Apr 24, 2024
57cb55f
VACMS 17632 no card on non-clinical service locations (#2024)
eselkin Apr 25, 2024
f13414a
VACMS 17844 update service options values for office visits and virtu…
eselkin Apr 26, 2024
6e41c40
Merge branch 'main' into VACMS-16144-VAMC-ServiceLocationParagraphs
eselkin Apr 26, 2024
9fdf94e
VA-17710: Change Online Schedule link for VBA Services (#2026)
maxx1128 Apr 29, 2024
5e46920
Merge branch 'main' into VACMS-16144-VAMC-ServiceLocationParagraphs
eselkin May 1, 2024
07514a1
Merge branch 'main' into VACMS-16144-VAMC-ServiceLocationParagraphs
maxx1128 May 3, 2024
ae91ef9
Merge branch 'main' into VACMS-16144-VAMC-ServiceLocationParagraphs
eselkin May 7, 2024
db8073c
Merge branch 'VACMS-16144-VAMC-ServiceLocationParagraphs' of github.c…
eselkin May 7, 2024
e49095d
merge
eselkin May 7, 2024
7b1f412
memBefore memAfter
eselkin May 7, 2024
39b9867
trying graceful fs
eselkin May 7, 2024
e17773e
fix from VACMS-18069-EMFILE-error-memoryUsage
eselkin May 8, 2024
bebe940
Merge branch 'main' into VACMS-16144-VAMC-ServiceLocationParagraphs
eselkin May 8, 2024
ffc2196
VA-17598: Manage Benefits online link update (#2057)
maxx1128 May 10, 2024
6da7e48
VA-17598: Add missing benefits paragraph (#2078)
maxx1128 May 10, 2024
192b226
Merge branch 'main' into VACMS-16144-VAMC-ServiceLocationParagraphs
eselkin May 13, 2024
6991141
hasAddress default to false
eselkin May 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/site/components/phone-number.drupal.liquid
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
<h{{ phoneHeaderLevel }}>{{ phoneLabel | default: 'Phone' }}</h{{ phoneHeaderLevel }}>
<div>
<va-telephone
{% if phoneNumberType %}
{{ phoneNumberType }}
{% endif %}
contact="{{ phoneNumber | removeDashes }}"
extension="{{ phoneExtension | default: '' }}"
message-aria-describedby="{{ phoneLabel }}" />
/>
</div>
4 changes: 4 additions & 0 deletions src/site/components/phone.drupal.liquid
Original file line number Diff line number Diff line change
@@ -8,6 +8,7 @@
phoneExtension = number.fieldPhoneExtension
phoneLabel = number.fieldPhoneLabel | default: 'Phone'
phoneHeaderLevel = phoneHeaderLevel
phoneNumberType = false
%}
{% endfor %}
{% endif %}
@@ -19,6 +20,7 @@
phoneExtension = number.fieldPhoneExtension
phoneLabel = number.fieldPhoneLabel | default: 'Fax'
phoneHeaderLevel = phoneHeaderLevel
phoneNumberType = false
%}
{% endfor %}
{% endif %}
@@ -30,6 +32,7 @@
phoneExtension = number.fieldPhoneExtension
phoneLabel = number.fieldPhoneLabel | default: 'SMS'
phoneHeaderLevel = phoneHeaderLevel
phoneNumberType = 'sms'
%}
{% endfor %}
{% endif %}
@@ -41,6 +44,7 @@
phoneExtension = number.fieldPhoneExtension
phoneLabel = number.fieldPhoneLabel | default: 'TTY'
phoneHeaderLevel = phoneHeaderLevel
phoneNumberType = 'tty'
%}
{% endfor %}
{% endif %}
Original file line number Diff line number Diff line change
@@ -1,89 +1,4 @@
<h4 data-template="facilities/health_care_local_health_service">Contact information</h4>

{% for location in locations %}
{% include "src/site/paragraphs/service_location.drupal.liquid" with
single = location.entity
serviceLocationSubHeaderLevel = 5
{% include "src/site/paragraphs/service_location.drupal.liquid" with single = location.entity serviceLocationSubHeaderLevel = 5
%}
{% endfor %}

{% if locationEntity.fieldReferralRequired or locationEntity.fieldWalkInsAccepted or locationEntity.fieldOnlineSchedulingAvailabl %}
<h5 data-template="facilities/health_care_local_health_service">Appointments</h5>

{% assign introText = 'Contact us to schedule, reschedule, or
cancel your appointment. If a referral is required, you’ll need to contact your
primary care provider first.'
%}

{% case locationEntity.fieldHserviceApptIntroSelect %}
{% when 'custom_intro_text' %}
{% if locationEntity.fieldHserviceApptLeadin != empty %}
{% assign introText = locationEntity.fieldHserviceApptLeadin %}
{% endif %}
{% when 'no_intro_text' %}
{% assign introText = '' %}
{% endcase %}

{% if introText != empty %}
<p class="vads-u-margin--0" data-template="facilities/health_care_local_health_service">
{{ introText }}
</p>
{% endif %}


{% comment %}
if fieldPhoneNumbersParagraph has values
use phone numbers from entities
{% endcomment %}
{% if locationEntity.fieldPhoneNumbersParagraph.length > 0 %}
<div class="vads-u-display--flex vads-u-flex-direction--column vads-u-margin-bottom--1" data-template="facilities/health_care_local_health_service">
{% for number in locationEntity.fieldPhoneNumbersParagraph %}
{% include "src/site/components/phone-number.drupal.liquid" with
phoneNumber = number.entity.fieldPhoneNumber
phoneExtension = number.entity.fieldPhoneExtension
phoneLabel = number.entity.fieldPhoneLabel
phoneHeaderLevel = 5
%}
{% endfor %}
</div>
{% else %}
<div class="vads-u-display--flex vads-u-flex-direction--column vads-u-margin-bottom--1" data-template="facilities/health_care_local_health_service">
{% include "src/site/components/phone-number.drupal.liquid" with
phoneNumber = fieldPhoneNumber
phoneLabel = 'Main Phone'
phoneHeaderLevel = 5
%}
</div>
{% endif %}

{% assign OMIT_REFERRAL_OR_WALKIN = "not_applicable, unknown" %}

{% if locationEntity.fieldReferralRequired %}
{% unless OMIT_REFERRAL_OR_WALKIN contains locationEntity.fieldReferralRequired %}
<p class="vads-u-margin-bottom--1" data-template="facilities/health_care_local_health_service">
<strong>Referral required?</strong>
{% if locationEntity.fieldReferralRequired == '1' %}Yes{% else %}No{% endif %}
</p>
{% endunless %}
{% endif %}

{% if locationEntity.fieldWalkInsAccepted %}
{% unless OMIT_REFERRAL_OR_WALKIN contains locationEntity.fieldWalkInsAccepted %}
<p class="vads-u-margin-bottom--1" data-template="facilities/health_care_local_health_service">
<strong>Walk-ins accepted?</strong>
{% if locationEntity.fieldWalkInsAccepted == '1' %}Yes{% else %}No{% endif %}
</p>
{% endunless %}
{% endif %}

{% if locationEntity.fieldOnlineSchedulingAvailabl == '1' %}
<a class="usa-button vads-u-margin-bottom--0"
data-entity-substitution="canonical"
data-entity-type="node"
data-template="facilities/health_care_local_health_service"
href="/health-care/schedule-view-va-appointments"
title="Schedule and manage health appointments">
Schedule an appointment online
</a>
{% endif %}
{% endif %}
{% endfor %}
33 changes: 19 additions & 14 deletions src/site/facilities/service_address.drupal.liquid
Original file line number Diff line number Diff line change
@@ -5,29 +5,34 @@
</h{{ serviceLocationAddressHeaderLevel }}>
{% endif %}

{% comment %}
Include street address only if fieldUseFacilityAddress is false
{% endcomment %}
{% if serviceLocationAddress.fieldUseFacilityAddress == false %}
{% if serviceLocationAddress.fieldAddress.addressLine1 %}
{% if serviceLocationAddress.fieldUseFacilityAddress and facilityAddress %}
{% assign hasAddress = true %}
{% assign addressData = facilityAddress %}
{% elsif location.entity.fieldServiceLocationAddress %}
{% assign hasAddress = true %}
{% assign addressData = location.entity.fieldServiceLocationAddress.entity.fieldAddress %}
{% endif %}

{% if hasAddress %}
{% if addressData.addressLine1 %}
<span class="vads-u-margin-bottom--0">
{{ serviceLocationAddress.fieldAddress.addressLine1 }}
{{ addressData.addressLine1 }}
</span>
{% endif %}

{% if serviceLocationAddress.fieldAddress.addressLine2 %}
{% if addressData.addressLine2 %}
<span class="vads-u-margin-bottom--0">
{{ serviceLocationAddress.fieldAddress.addressLine2 }}
{{ addressData.addressLine2 }}
</span>
{% endif %}

{% if serviceLocationAddress.fieldAddress.locality %}
{% if serviceLocationAddress.fieldAddress.administrativeArea%}
{% if serviceLocationAddress.fieldAddress.postalCode %}
{% if addressData.locality %}
{% if addressData.administrativeArea%}
{% if addressData.postalCode %}
<span class="vads-u-margin-bottom--0">
{{ serviceLocationAddress.fieldAddress.locality }},
{{ serviceLocationAddress.fieldAddress.administrativeArea }}
{{ serviceLocationAddress.fieldAddress.postalCode }}
{{ addressData.locality }},
{{ addressData.administrativeArea }}
{{ addressData.postalCode }}
</span>
{% endif %}
{% endif %}
1 change: 1 addition & 0 deletions src/site/filters/liquid.js
Original file line number Diff line number Diff line change
@@ -823,6 +823,7 @@ module.exports = function registerFilters() {
};

liquid.filters.replace = (string, oldVal, newVal) => {
if (!string) return null;
const regex = new RegExp(oldVal, 'g');
return string.replace(regex, newVal);
};
139 changes: 0 additions & 139 deletions src/site/includes/vba_facilities/service_location.liquid

This file was deleted.

4 changes: 2 additions & 2 deletions src/site/includes/vba_facilities/services.liquid
Original file line number Diff line number Diff line change
@@ -79,11 +79,11 @@
{% endif %}

{% for fServiceLocation in entity.facilityService.fieldServiceLocation %}
{% include "src/site/includes/vba_facilities/service_location.liquid" with location = fServiceLocation entityLabel = facilityLabel serviceHeader = facilityServiceHeader serviceDescription = facilityServiceDescription
{% include "src/site/paragraphs/service_location.drupal.liquid" with single = fServiceLocation.entity serviceLocationSubHeaderLevel = 5 serviceLocationType="VBA" serviceHeader = facilityServiceHeader serviceDescription = facilityServiceDescription
%}
{% endfor %}
{% for rServiceLocation in entity.regionalService.fieldServiceLocation %}
{% include "src/site/includes/vba_facilities/service_location.liquid" with location = rServiceLocation entityLabel = regionalLabel serviceHeader = regionalServiceHeader serviceDescription = regionalServiceDescription
{% include "src/site/paragraphs/service_location.drupal.liquid" with single = rServiceLocation.entity serviceLocationSubHeaderLevel = 5 serviceLocationType="VBA" serviceHeader = regionalServiceHeader serviceDescription = regionalServiceDescription
%}
{% endfor %}

230 changes: 171 additions & 59 deletions src/site/paragraphs/service_location.drupal.liquid
Original file line number Diff line number Diff line change
@@ -1,62 +1,174 @@
{% include "src/site/facilities/service_address.drupal.liquid" with
serviceLocationAddress = single.fieldServiceLocationAddress.entity
serviceLocationAddressHeaderLevel = serviceLocationSubHeaderLevel
%}

{% comment %}
single.fieldHours values:
- 0 = Use facility hours
- 1 = Do not specify hours
- 2 = Display specific hours
{% endcomment %}

{% if single.fieldHours != "1" %}
<h{{ serviceLocationSubHeaderLevel }} data-template="paragraphs/service_location">Hours</h{{ serviceLocationSubHeaderLevel }}>
{% endif %}

{% case single.fieldHours %}
{% when '2' %}
{% if single.fieldOfficeHours %}
{% include "src/site/includes/hours.liquid" with allHours = single.fieldOfficeHours headerType = 'included' %}
{% endif %}
{% when '0' %}
{% if fieldOfficeHours %}
{% include "src/site/includes/hours.liquid" with allHours = fieldOfficeHours headerType = 'included' %}
<div class="vads-u-padding-x--2 vads-u-margin-top--2 vads-u-margin-bottom--2 vads-u-border--1px">
{% if serviceHeader %}
<h4 class="vads-u-margin-top--2">
{{ serviceHeader }}
</h4>
{% endif %}

{% if serviceDescription %}
<p id="vba-service-body-{{ entityId }}">
{{ serviceDescription | drupalToVaPath | phoneLinks }}
</p>
{% endif %}


{% comment %}
possibly values for fieldOfficeVists
no
yes_appointment_only
yes_first_come_first_served_basis
yes_with_or_without_appointment
{% endcomment %}
{% if single.fieldOfficeVisits and single.fieldOfficeVisits != "no" %}
<div class="vads-u-margin-top--0p5" data-testid="service-location-field-office-visits">
<p>
<i class="fas fa-building vads-u-margin-right--0p5"></i>
{% case single.fieldOfficeVisits %}
{% when "yes_appointment_only" %}
Visit our office, with an appointment only
{% when "yes_with_or_without_appointment" %}
Visit our office, with or without an appointment
{% when "yes_first_come_first_served_basis" %}
Visit our office, first come, first served
{% endcase %}
</p>
</div>
{% endif %}

{% comment %}
possibly values for fieldVirtualSupport
value: 'no'
value: yes_appointment_only
value: yes_first_come_first_served_basis
value: yes_with_or_without_appointment
{% endcomment %}
{% if single.fieldVirtualSupport and single.fieldVirtualSupport != "no" %}
<div data-testid="service-location-virtual-support">
<p>
<i class="fas fa-calendar vads-u-margin-right--0p5"></i> Schedule a virtual appointment
</p>
</div>
{% endif %}


{% if fieldReferralRequired %}
<div>
<p>
{% case fieldReferralRequired %}
{% when "1","2" %}
<i class="fas fa-check-circle vads-u-margin-right--0p5"></i> A referral is required
{% when "not_applicable","0" %}
<i class="fas fa-times-circle vads-u-margin-right--0p5"></i> A referral is not required
{% endcase %}
</p>
</div>
{% endif %}

{% if single.fieldVirtualSupport == "yes_appointment_only" or single.fieldVirtualSupport == 'yes_with_or_without_appointment' or single.fieldOfficeVisits == 'yes_appointment_only' or single.fieldOfficeVisits == 'yes_with_or_without_appointment' %}
<div>
<h{{serviceLocationSubHeaderLevel}} class="vads-u-margin-top--0 vads-u-line-height--1 vads-u-margin-bottom--1" data-testid="service-location-appoinments-header">Appointments</h{{serviceLocationSubHeaderLevel}} >
</div>
{% if single.fieldApptIntroTextType != 'remove_text' %}
{% if single.fieldApptIntroTextType == 'customize_text' and single.fieldApptIntroTextCustom != empty %}
<p data-testid="service-location-custom-text">{{ single.fieldApptIntroTextCustom | drupalToVaPath | phoneLinks }}</p>
{% elsif single.fieldApptIntroTextType == 'use_default_text' %}
<p data-testid="service-location-default-text">
Contact us to schedule, reschedule, or cancel your appointment. If a referral is required,
you’ll need to contact your primary care provider first.
</p>
{% endif %}
{% endif %}
{% endcase %}

{% if single.fieldAdditionalHoursInfo %}
<span data-template="paragraphs/service_location"><i>{{ single.fieldAdditionalHoursInfo }}</i></span>
{% endif %}

{% comment %}
Conditionally display facility phone number
{% endcomment %}
{% if fieldPhoneNumber and single.fieldUseMainFacilityPhone %}
{% include "src/site/components/phone-number.drupal.liquid" with
phoneNumber = fieldPhoneNumber
phoneLabel = 'Main Phone'
{% endif %}

{% comment %}
Conditionally display facility phone number
{% endcomment %}
{% if fieldPhoneNumber and single.fieldUseMainFacilityPhone %}
<div class="vads-u-margin-bottom--2" data-testid="service-location-main-facility-phone">
{% include "src/site/components/phone-number.drupal.liquid" with
phoneNumber = fieldPhoneNumber
phoneLabel = 'Main Phone'
phoneHeaderLevel = serviceLocationSubHeaderLevel
%}
</div>
{% endif %}

{% if single.fieldOnlineSchedulingAvail == "yes" %}
<div class="vads-u-margin-bottom--2" data-testid="service-location-action-link-online">
<a class="vads-c-action-link--blue" href="/health-care/schedule-view-va-appointments">
Schedule an appointment online
</a>
</div>
{% endif %}


{% comment %} Includes header for clinic name {% endcomment %}
{% include "src/site/facilities/service_address.drupal.liquid" with
serviceLocationAddress = single.fieldServiceLocationAddress.entity
serviceLocationAddressHeaderLevel = serviceLocationSubHeaderLevel
%}

{% comment %}
Display each additional phone number provided
{% endcomment %}
{% include "src/site/components/phone.drupal.liquid" with
numbers = single.fieldPhone
phoneHeaderLevel = serviceLocationSubHeaderLevel
%}
{% endif %}

{% comment %}
Display each additional phone number provided
{% endcomment %}
{% include "src/site/components/phone.drupal.liquid" with
numbers = single.fieldPhone
phoneHeaderLevel = serviceLocationSubHeaderLevel
%}

{% if single.fieldEmailContacts %}
{% for email in single.fieldEmailContacts %}
<p class="vads-u-margin-y--1" data-template="paragraphs/service_location">
{% if email.entity.fieldEmailLabel %}
<h{{ serviceLocationSubHeaderLevel }}>{{ email.entity.fieldEmailLabel }} </h{{ serviceLocationSubHeaderLevel }}>
{% endif %}
<a aria-label="{{ email.entity.fieldEmailAddress }}"
data-template="paragraphs/service_location"
href="mailto:{{ email.entity.fieldEmailAddress }}">{{ email.entity.fieldEmailAddress }}
</a>
{% endfor %}
{% endif %}

{% if single.fieldOtherPhoneNumbers.length > 0 %}
<div class="vads-u-display--flex vads-u-flex-direction--column vads-u-margin-bottom--1" data-template="facilities/health_care_local_health_service" data-testid="service-location-show-other-phone-numbers">
{% for number in single.fieldOtherPhoneNumbers %}
{% include "src/site/components/phone-number.drupal.liquid" with
phoneNumber = number.entity.fieldPhoneNumber
phoneExtension = number.entity.fieldPhoneExtension
phoneLabel = number.entity.fieldPhoneLabel
phoneHeaderLevel = 5
%}
{% endfor %}
</div>
{% endif %}

{% if single.fieldEmailContacts %}
{% for email in single.fieldEmailContacts %}
<p class="vads-u-margin-y--1" data-template="paragraphs/service_location" data-testid="service-location-email-contact">
{% if email.entity.fieldEmailLabel %}
<h{{ serviceLocationSubHeaderLevel }}>{{ email.entity.fieldEmailLabel }} </h{{ serviceLocationSubHeaderLevel }}>
{% endif %}
<a aria-label="{{ email.entity.fieldEmailAddress }}"
data-template="paragraphs/service_location"
href="mailto:{{ email.entity.fieldEmailAddress }}">{{ email.entity.fieldEmailAddress }}
</a>
{% endfor %}
{% endif %}

{% comment %}
single.fieldHours values:
- 0 = Use facility hours
- 1 = Do not specify hours
- 2 = Display specific hours
{% endcomment %}

{% if single.fieldHours != "1" %}
<h{{ serviceLocationSubHeaderLevel }} data-template="paragraphs/service_location" data-testid="service-location-field-hours">Service Hours</h{{ serviceLocationSubHeaderLevel }}>
{% endif %}
{% if single.fieldHours != empty %}
<div class="vads-u-margin-bottom--2">
{% case single.fieldHours %}
{% when '2' %}
{% if single.fieldOfficeHours %}
{% include "src/site/includes/hours.liquid" with allHours = single.fieldOfficeHours headerType = 'included' %}
{% endif %}
{% when '0' %}
<p data-testid="service-location-field-hours-same-as-facility">
The service hours are the same as our facility hours.
</p>
{% endcase %}
</div>
{% endif %}
{% if single.fieldAdditionalHoursInfo %}
<p>
<span data-template="paragraphs/service_location"><i>{{ single.fieldAdditionalHoursInfo }}</i></span>
</p>
{% endif %}
</div>

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
{
"fieldAddress": {
"addressLine1": "1100 North College Avenue",
"addressLine2": null,
"postalCode": "72703-1944",
"locality": "Fayetteville",
"administrativeArea": "AR"
},
"reverseFieldFacilityLocationNode": {
"entities": [
{
"entityId": "46268",
"fieldServiceNameAndDescripti": {
"entity": {
"entityId": "1026",
"entityLabel": "Medical records",
"name": "Medical records"
},
"targetId": 1026
},
"fieldServiceLocation": [
{
"entity": {
"status": true,
"fieldAdditionalHoursInfo": null,
"fieldEmailContacts": [],
"fieldOfficeHours": [
{
"day": 1,
"starthours": 800,
"endhours": 1630,
"comment": ""
},
{
"day": 2,
"starthours": 800,
"endhours": 1630,
"comment": ""
},
{
"day": 3,
"starthours": 800,
"endhours": 1630,
"comment": ""
},
{
"day": 4,
"starthours": 800,
"endhours": 1630,
"comment": ""
},
{
"day": 5,
"starthours": 800,
"endhours": 1630,
"comment": ""
}
],
"fieldHours": "2",
"fieldPhone": [
{
"entity": {
"fieldPhoneLabel": "Medical Records",
"fieldPhoneNumber": "479-443-4301",
"fieldPhoneExtension": "65052",
"fieldPhoneNumberType": "tel"
}
}
],
"fieldUseMainFacilityPhone": false,
"fieldServiceLocationAddress": {
"entity": {
"fieldUseFacilityAddress": true,
"fieldBuildingNameNumber": "Building 1",
"fieldClinicName": "Room 1-44",
"fieldWingFloorOrRoomNumber": "Basement",
"fieldAddress": {
"addressLine1": "",
"addressLine2": "",
"postalCode": "",
"locality": "",
"administrativeArea": ""
}
}
}
}
}
]
}
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
/* eslint-disable @department-of-veterans-affairs/axe-check-required */
import { expect } from 'chai';
import { getByTestId } from '@testing-library/dom';
import { parseFixture, renderHTML } from '../../../tests/support';

describe('VBA accordions for Service Locations', () => {
const fixture = parseFixture(
'src/site/paragraphs/tests/vamc/template/fixtures/health_care_local_facility.json',
);
const processedFixture = {
fieldAddress: fixture.fieldAddress,
fieldPhoneNumber: fixture.fieldPhoneNumber,
fieldOfficeHours: fixture.fieldOfficeHours,
};
it('should render render contents of COVID service', async () => {
// has onlineScheduling
// has fieldOtherPhoneNumbers
// should show Appointments header
// should show main number
const covidVaccinesEntity =
fixture.fieldLocalHealthCareService[0].entity.fieldServiceLocation[0]
.entity;
const covidHTML = await renderHTML(
'src/site/paragraphs/service_location.drupal.liquid',
{
...processedFixture,
single: covidVaccinesEntity,
},
);
expect(getByTestId(covidHTML, 'service-location-field-office-visits')).to
.exist;
expect(getByTestId(covidHTML, 'service-location-appoinments-header')).to
.exist;
expect(getByTestId(covidHTML, 'service-location-main-facility-phone')).to
.exist;
expect(getByTestId(covidHTML, 'service-location-show-other-phone-numbers'))
.to.exist;
expect(getByTestId(covidHTML, 'service-location-field-hours')).to.exist;
expect(getByTestId(covidHTML, 'service-location-custom-text')).to.exist;
});
it('should render render contents of Anesthesia service', async () => {
// No onlineScheduling
// remove text
// no clinic name
// should show Appointments header (but because they say yes_with_appoinment)
// should show main number
const anesthesiaEntity =
fixture.fieldLocalHealthCareService[3].entity.fieldServiceLocation[0]
.entity;
const anesthesiaHTML = await renderHTML(
'src/site/paragraphs/service_location.drupal.liquid',
{
...processedFixture,
single: anesthesiaEntity,
},
);
expect(getByTestId(anesthesiaHTML, 'service-location-field-office-visits'))
.to.exist;
expect(getByTestId(anesthesiaHTML, 'service-location-appoinments-header'))
.to.exist; // this one is odd - since it says yes_with_appoinment
expect(getByTestId(anesthesiaHTML, 'service-location-main-facility-phone'))
.to.exist;
// other expects will cause to fail
});
it('should render render contents of Gynecology service', async () => {
// Yes onlineScheduling
// default text
// Has clinic name
// should show Appointments header
// should show icon for office visits
// should NOT show main number
// should show other phone numbers
const gynecologyEntity =
fixture.fieldLocalHealthCareService[4].entity.fieldServiceLocation[0]
.entity;
const gynecologyHTML = await renderHTML(
'src/site/paragraphs/service_location.drupal.liquid',
{
...processedFixture,
single: gynecologyEntity,
},
);
expect(getByTestId(gynecologyHTML, 'service-location-field-office-visits'))
.to.exist;
expect(getByTestId(gynecologyHTML, 'service-location-appoinments-header'))
.to.exist;
expect(
getByTestId(gynecologyHTML, 'service-location-show-other-phone-numbers'),
).to.exist;
expect(getByTestId(gynecologyHTML, 'service-location-field-hours')).to
.exist;
expect(getByTestId(gynecologyHTML, 'service-location-default-text')).to
.exist;
});
});
Original file line number Diff line number Diff line change
@@ -4,19 +4,5 @@
*
*/
module.exports = `
fieldHserviceApptLeadin
fieldHserviceApptIntroSelect
fieldOnlineSchedulingAvailabl
fieldReferralRequired
fieldWalkInsAccepted
fieldPhoneNumbersParagraph {
entity {
... on ParagraphPhoneNumber {
fieldPhoneExtension
fieldPhoneLabel
fieldPhoneNumber
fieldPhoneNumberType
}
}
}
`;
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
*
* Appointments info for a facility service under the Service Location
*
*/
module.exports = `
fieldVirtualSupport
fieldOnlineSchedulingAvail
fieldUseFacilityPhoneNumber
fieldOtherPhoneNumbers {
entity {
... on ParagraphPhoneNumber {
fieldPhoneNumber
fieldPhoneNumberType
fieldPhoneExtension
fieldPhoneLabel
}
}
}
fieldOfficeVisits
fieldApptIntroTextType
fieldApptIntroTextCustom
`;
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const appointmentServiceLocationItems = require('../file-fragments/appointmentServiceLocationItems.graphql');

/*
*
* A service location for a facility service.
@@ -7,6 +9,7 @@ module.exports = `
fieldServiceLocation {
entity {
... on ParagraphServiceLocation {
${appointmentServiceLocationItems}
status
fieldServiceLocationAddress {
entity {

Unchanged files with check annotations Beta

buildOptions.destination,
);
const entryFiles = Object.assign({}, apps, globalEntryFiles);

Check warning on line 31 in config/webpack.config.js

GitHub Actions / Linting

config/webpack.config.js:31:22:Use an object spread instead of `Object.assign` eg: `{ ...foo }`.
const isOptimizedBuild = [VAGOVSTAGING, VAGOVPROD].includes(buildtype);
return {
module.exports = function(results) {

Check warning on line 1 in script/github-actions/eslint-annotation-format.js

GitHub Actions / Linting

script/github-actions/eslint-annotation-format.js:1:18:Unexpected unnamed function.
const resultsArr = results || [];
const summary = resultsArr.reduce(
function(seq, current) {

Check warning on line 5 in script/github-actions/eslint-annotation-format.js

GitHub Actions / Linting

script/github-actions/eslint-annotation-format.js:5:5:Unexpected unnamed function.
current.messages.forEach(function(msg) {

Check warning on line 6 in script/github-actions/eslint-annotation-format.js

GitHub Actions / Linting

script/github-actions/eslint-annotation-format.js:6:32:Unexpected unnamed function.
const logMessage = {
filePath: current.filePath,
message: msg.message,
if (summary.errors.length > 0 || summary.warnings.length > 0) {
output = summary.errors
.concat(summary.warnings)
.map(function(msg) {

Check warning on line 34 in script/github-actions/eslint-annotation-format.js

GitHub Actions / Linting

script/github-actions/eslint-annotation-format.js:34:12:Unexpected unnamed function.
const filePath = msg.filePath
.split('/')
.splice(6)
}
const match = line.match(/\+\+\+ (b\/)?(.*$)/);
if (match) {
path = match[2];

Check warning on line 122 in script/pr-check.js

GitHub Actions / Linting

script/pr-check.js:122:7:Use array destructuring.
} else if (inNewFile && /@@ .* @@.*/.test(line)) {
// Only reset the position if our current line is the beginning of a diff chunk
// AND if the previous line marked the beginning of a new file
position = 1;
} else if (/@@ -[0-9]+(,[0-9]+)? \+([0-9]+)(,[0-9]+)? @@.*/.test(line)) {
// Increment the position when we reach the beginning of a new diff chunk
position++;

Check warning on line 129 in script/pr-check.js

GitHub Actions / Linting

script/pr-check.js:129:7:Unary operator '++' used.
} else if (/^([ +-]).*/.test(line)) {
// Only add to the output if this line of content is an addition (begins with a "+")
if (/^[+].*/.test(line)) output.push({ path, position, line });
// Increment position for each line of actual content in the diff
position++;

Check warning on line 134 in script/pr-check.js

GitHub Actions / Linting

script/pr-check.js:134:7:Unary operator '++' used.
}
inNewFile = !!match;
return output;
const commandLineArgs = require('command-line-args');
const printUnitTestHelp = require('./run-unit-test-help.js');

Check warning on line 2 in script/run-unit-test.js

GitHub Actions / Linting

script/run-unit-test.js:2:35:Unexpected use of file extension "js" for "./run-unit-test-help.js"
const { runCommand } = require('./utils');
// For usage instructions see https://github.com/department-of-veterans-affairs/vets-website#unit-tests
const { runCommandSync } = require('./utils');
const commandLineArgs = require('command-line-args');

Check warning on line 2 in script/serve.js

GitHub Actions / Linting

script/serve.js:2:25:`command-line-args` import should occur before import of `./utils`
const ENVIRONMENTS = require('../src/site/constants/environments');