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 15315 front end match style to sketch, testing #1790

Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
a43b9f1
working va-telephone components, cc benefits hotline, cc cannot find …
eselkin Nov 12, 2023
ef5bb45
working va-telephone components, cc benefits hotline, cc cannot find …
eselkin Nov 12, 2023
082cc12
back to top and above footer
eselkin Nov 13, 2023
6b8b57a
Merge branch 'va-14940-vba-facility-content-skeleton' into VACMS-1531…
eselkin Nov 13, 2023
e5c35af
describe structure of processed better
eselkin Nov 13, 2023
56493a0
Update 21-0966 url (#1780)
ndsprinkle Nov 14, 2023
9008b5b
update cypress to 13.5 (#1793)
pjhill Nov 14, 2023
210a9d5
Add breadcrumb data and update component
maxx1128 Nov 14, 2023
6f77f73
matching tags
eselkin Nov 14, 2023
d189423
Updates graceful-fs to a version without bug. (#1795)
ndouglas Nov 14, 2023
1f54c5f
accept incoming
eselkin Nov 14, 2023
dd1bb1c
update mochawesome to 7.1.3 (#1796)
pjhill Nov 15, 2023
bc5c687
Bump actions/checkout from 3.5.2 to 4.1.1 (#1750)
dependabot[bot] Nov 15, 2023
917fa58
update mocha to 10.2.0 (#1797)
pjhill Nov 15, 2023
96c0354
p tags and testing
eselkin Nov 15, 2023
469c23e
p tags with margin top 0
eselkin Nov 15, 2023
50034de
error in quotes
eselkin Nov 16, 2023
cf7e597
uswds on alert, office hours, etc
eselkin Nov 17, 2023
25f2008
lint
eselkin Nov 17, 2023
c44c90f
Merge branch 'va-14940-vba-facility-content-skeleton' into VACMS-1531…
eselkin Nov 17, 2023
72d70ce
social updates
eselkin Nov 18, 2023
cdcf912
Fix typo in breadcrumb link for 10-10EZR application (#1799)
longmd Nov 19, 2023
437a0eb
move promo banner into header tag (#1798)
chriskim2311 Nov 20, 2023
01aea4e
vba links at top
eselkin Nov 20, 2023
994a345
Enable form 21-0966 (#1783)
Thrillberg Nov 20, 2023
9e7099c
testing for updates filters
eselkin Nov 20, 2023
cc23713
Merge branch 'main' into VACMS-15315-front-end-match-style-testing
eselkin Nov 20, 2023
67529e1
fix mock data
eselkin Nov 20, 2023
4ec8a0a
claim status link
eselkin Nov 21, 2023
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
37 changes: 28 additions & 9 deletions src/site/facilities/main_buttons.drupal.liquid
Original file line number Diff line number Diff line change
@@ -1,14 +1,33 @@
{% comment %}
This is used for Region Landing page and Contact us page
Also used for VBA with parameter
{% endcomment %}
<div data-template="facilities/main_buttons">
<div>
<a class="vads-c-action-link--blue" href="/{{ path }}/make-an-appointment">Make an appointment</a>
</div>
<div class="vads-u-margin-y--2">
<a class="vads-c-action-link--blue" href="/{{ path }}/health-services">View all health services</a>
</div>
<div>
<a class="vads-c-action-link--blue" href="/{{ path }}/register-for-care">Register for care</a>
</div>
{% if buttonType == 'vba' %}
<div>
<a class="vads-c-action-link--blue" href="https://va.my.site.com/VAVERA/s/">Make an appointment</a>
</div>
{% else %}
<div>
<a class="vads-c-action-link--blue" href="/{{ path }}/make-an-appointment">Make an appointment</a>
</div>
{% endif %}
{% if buttonType == 'vba' %}
<div class="vads-u-margin-y--2">
<a class="vads-c-action-link--blue" href="https://ask.va.gov">Ask a benefit question</a>
</div>
{% else %}
<div class="vads-u-margin-y--2">
<a class="vads-c-action-link--blue" href="/{{ path }}/health-services">View all health services</a>
</div>
{% endif %}
{% if buttonType == 'vba' %}
<div>
<a class="vads-c-action-link--blue" href="/{{ path }}/claim-or-appeal-status">Check a claim status</a>
</div>
{% else %}
<div>
<a class="vads-c-action-link--blue" href="/{{ path }}/register-for-care">Register for care</a>
</div>
{% endif %}
</div>
65 changes: 65 additions & 0 deletions src/site/facilities/vba_social_links.drupal.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<section data-template="facilities/facility_social_links" class="feature vads-u-background-color--gray-lightest vads-u-margin-top--4 small-screen:vads-u-margin-top--6 vads-u-padding-x--3 vads-u-padding-y--2p5">
<h2 class="vads-u-margin-bottom--2">Get updates from {{ regionNickname }}</h2>
<div class="va-c-list-link-teasers usa-grid usa-grid-full">

<div class="usa-width-one-half social-links">
{% if fieldNews != empty %}
<div class="social-links-email vads-u-margin-bottom--2">
<a class="vads-u-display--flex vads-u-align-items--baseline vads-u-text-decoration--none" rel="noreferrer"
href="{{fieldNews.uri}}">
<i class="fas fa-envelope vads-u-margin-right--1"></i>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

icon found

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@laflannery since we're using raw anchor tags here, is there some description about how these should be conveyed textually?

<span class="vads-u-text-decoration--underline">{{ fieldNews.title }}</span>
</a>
</div>
{% endif %}
{% if fieldFacebook != empty %}
<div class="social-links social-links-facebook vads-u-margin-bottom--2">
<a class="vads-u-display--flex vads-u-align-items--baseline vads-u-text-decoration--none" rel="noreferrer" href="{{ fieldFacebook.uri }}">
<i class="fab fa-facebook-square vads-u-margin-right--1"></i>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

icon found

<span class="vads-u-text-decoration--underline">{{ fieldFacebook.title }}</span>
</a>
</div>
{% endif %}
</div>
{% if fieldTwitter != empty || fieldFlickr != empty || fieldInstagram != empty %}
<div class="usa-width-one-half social-links">
<div class="">
{% if fieldTwitter != empty %}
<div class="social-links social-links-twitter vads-u-margin-bottom--2">
<a class="vads-u-display--flex vads-u-align-items--baseline vads-u-text-decoration--none" rel="noreferrer" href="{{ fieldTwitter.uri }}">
<i class="fab fa-twitter vads-u-text-decoration--none vads-u-margin-right--1"></i>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

icon found

<span class="vads-u-text-decoration--underline">{{ fieldTwitter.title }}</span>
</a>
</div>
{% endif %}
{% if fieldFlickr != empty %}
<div class="social-links social-links-flickr vads-u-margin-bottom--2">
<a class="vads-u-display--flex vads-u-align-items--baseline vads-u-text-decoration--none" rel="noreferrer" href="{{ fieldFlickr.uri }}">
<i class="fab fa-flickr vads-u-text-decoration--none vads-u-margin-right--1"></i>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

icon found

<span class="vads-u-text-decoration--underline">{{ fieldFlickr.title }}</span>
</a>
</div>
{% endif %}

{% if fieldInstagram != empty %}
<div class="social-links social-links-instagram vads-u-margin-bottom--2">
<a class="vads-u-display--flex vads-u-align-items--baseline vads-u-text-decoration--none" rel="noreferrer" href="{{ fieldInstagram.uri }}">
<i class="fab fa-instagram vads-u-text-decoration--none vads-u-margin-right--1"></i>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

icon found

<span class="vads-u-text-decoration--underline">{{ fieldInstagram.title }}</span>
</a>
</div>
{% endif %}

{% if fieldYoutube != empty %}
<div class="social-links social-links-youtube vads-u-margin-bottom--2">
<a class="vads-u-display--flex vads-u-align-items--baseline vads-u-text-decoration--none" rel="noreferrer" href="{{ fieldYoutube.uri }}">
<i class="fab fa-youtube vads-u-text-decoration--none vads-u-margin-right--1"></i>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

icon found

<span class="vads-u-text-decoration--underline">{{ fieldYoutube.title }}</span>
</a>
</div>
{% endif %}
</div>
</div>
{% endif %}
</div>
</section>
66 changes: 66 additions & 0 deletions src/site/filters/liquid.js
Original file line number Diff line number Diff line change
Expand Up @@ -863,6 +863,59 @@ module.exports = function registerFilters() {
});
};

liquid.filters.processCentralizedUpdatesVBA = fieldCcGetUpdatesFromVba => {
if (!fieldCcGetUpdatesFromVba || !fieldCcGetUpdatesFromVba.fetched)
return null;

const processed = {
links: {},
sectionHeader: '',
};
const { fetched } = fieldCcGetUpdatesFromVba;
processed.sectionHeader = fetched.fieldSectionHeader[0].value;
for (const link of fetched.fieldLinks) {
if (link.url.path.startsWith('/')) {
processed.links.news = {
title: link.title,
uri: link.url.path,
};
} else {
// may throw if we get something that's not a URL in the data
const url = new URL(link.url.path);
const hostnameParts = url.hostname.split('.');
// just retrieving the domain part i.e. facebook/flickr/twitter
processed.links[hostnameParts.slice(-2, -1)[0]] = {
title: link.title,
uri: link.url.path,
};
}
}
// example:
// processed = {sectionHeader: "Veteran Benefits Administration", links:{ news: { uri: '', title: '' }, flickr: { uri: '', title: '' } }}
return processed;
};

// Processes the necessary components to display the Centralized Content
// of Can't Find Benefits. It is not the same as the other centralized content
// since the url path is necessary
liquid.filters.processfieldCcCantFindBenefits = field => {
if (!field || !field.fetched) return null;

const processed = {
fieldCta: {},
fieldSectionHeader: '',
fieldDescription: '',
};
processed.fieldSectionHeader = field.fetched.fieldSectionHeader[0].value;
eselkin marked this conversation as resolved.
Show resolved Hide resolved

const ctaEntity = field.fetched.fieldCta[0].entity;
processed.fieldCta.label = ctaEntity.fieldButtonLabel[0].value;
processed.fieldCta.link = ctaEntity.fieldButtonLink[0].url.path;

processed.fieldDescription = field.fetched.fieldDescription[0].processed;
return processed;
};

liquid.filters.processCentralizedContent = (entity, contentType) => {
if (!entity) return null;

Expand Down Expand Up @@ -974,6 +1027,18 @@ module.exports = function registerFilters() {
return he.encode(string, { useNamedReferences: true });
};

// fieldCcBenefitsHotline is odd because it has no entity
liquid.filters.processCentralizedBenefitsHotline = fieldCcBenefitsHotline => {
if (!fieldCcBenefitsHotline || !fieldCcBenefitsHotline.fetched) {
return null;
}
const processedFetched = {};
for (const [key, value] of Object.entries(fieldCcBenefitsHotline.fetched)) {
processedFetched[key] = value[0].value;
}
return processedFetched;
};

// fieldCcVetCenterFeaturedCon data structure is different
// from objects inside fieldVetCenterFeatureContent. Recreates the array
// with the expected structure so that it can be directly passed inside the template
Expand Down Expand Up @@ -1010,6 +1075,7 @@ module.exports = function registerFilters() {
entity: {
fieldButtonLink: {
uri: fieldCta[0]?.entity.fieldButtonLink[0].uri,
url: fieldCta[0]?.entity.fieldButtonLink[0].url?.path,
},
fieldButtonLabel: fieldCta[0].entity.fieldButtonLabel[0].value,
},
Expand Down
33 changes: 32 additions & 1 deletion src/site/filters/liquid.unit.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import vetCenterHoursData from '../layouts/tests/vet_center/template/fixtures/ve
import healthCareRegionNonClinicalServicesData from './fixtures/healthCareRegionNonClinicalServicesData.json';
import stagingSurveys from './medalliaStagingSurveys.json';
import prodSurveys from './medalliaProdSurveys.json';
import vbaDataCantFind from '../layouts/tests/vba/template/fixtures/vba_facility_data_cant_find_benefits.json';
import vbaDataBenefitHotline from '../layouts/tests/vba/template/fixtures/vba_facility_data_benefits_hotline.json';

// Register filters.
registerFilters();
Expand Down Expand Up @@ -1602,7 +1604,36 @@ describe('getValueFromObjPath', () => {
).to.eq(1);
});
});

describe('processfieldCcCantFindBenefits', () => {
it('returns null if null is passed', () => {
expect(liquid.filters.processfieldCcCantFindBenefits(null)).to.be.null;
});
it('returns Cannot Find Benefits data in simplified object', () => {
const data = liquid.filters.processfieldCcCantFindBenefits(vbaDataCantFind);
expect(data.fieldSectionHeader).to.be.equal(
vbaDataCantFind.fetched.fieldSectionHeader[0].value,
);
expect(data.fieldDescription).to.be.equal(
vbaDataCantFind.fetched.fieldDescription[0].processed,
);
const { entity } = vbaDataCantFind.fetched.fieldCta[0];
expect(data.fieldCta.label).to.be.equal(entity.fieldButtonLabel[0].value);
expect(data.fieldCta.link).to.be.equal(entity.fieldButtonLink[0].url.path);
});
});
describe('processCentralizedBenefitsHotline', () => {
it('returns null if null is passed', () => {
expect(liquid.filters.processCentralizedBenefitsHotline(null)).to.be.null;
});
it('returns hotline data in simplified object', () => {
const data = liquid.filters.processCentralizedBenefitsHotline(
vbaDataBenefitHotline,
);
expect(data.fieldPhoneExtension).to.be.equal(
vbaDataBenefitHotline.fetched.fieldPhoneExtension[0].value,
);
});
});
describe('processCentralizedContent', () => {
it('returns null if null is passed', () => {
expect(liquid.filters.processCentralizedContent(null, 'wysiwyg')).to.be
Expand Down
2 changes: 1 addition & 1 deletion src/site/includes/hours-item.liquid
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<li>
{% if headerType == 'clinical' %}
{% if headerType == 'clinical' or boldDay == true %}
<b class="abbrv-day">{{ hours.day | officeHoursDayFormatter }}:</b>
{% else %}
<span class="abbrv-day">{{ hours.day | officeHoursDayFormatter }}.</span>
Expand Down
4 changes: 4 additions & 0 deletions src/site/includes/hours.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
<h2 class="vads-u-margin-top--2p5 vads-u-margin-bottom--1">
Clinical hours
</h2>
{% elsif headerType == 'office' %}
<h3 class="vads-u-font-size--lg vads-u-margin-top--0 vads-u-line-height--1 vads-u-margin-bottom--1">
Office hours</h3>
<p>Hours may vary for different services. Select a service on this page to check the hours.</p>
{% endif %}
<div class="vads-u-display--flex vads-u-flex-direction--column small-screen:vads-u-flex-direction--row vads-u-margin-bottom--0">
<ul class="vads-u-flex--1 va-c-facility-hours-list vads-u-margin-top--0 vads-u-margin-bottom--1 small-screen:vads-u-margin-bottom--0 vads-u-margin-right--3">
Expand Down
24 changes: 24 additions & 0 deletions src/site/includes/vba_facilities/spotlight_content.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<div class="feature featured-content-list-item vads-u-flex--fill vads-u-padding-y--1p5 vads-u-padding-x--1p5 vads-u-margin-bottom--0 medium-screen:vads-u-margin-bottom--2">
<script>console.log({{entity.fieldCta|json}})</script>

{% if entity.fieldSectionHeader != empty %}
<h3 class="force-small-header vads-u-margin-bottom--2">{{ entity.fieldSectionHeader }}</h3>
<hr class="featured-content-hr vads-u-margin-y--1p5 vads-u-border-color--primary">
{% endif %}
{% if entity.fieldDescription %}
<div id="featured-content-description{{ entity.fieldSectionHeader }}}}">
maxx1128 marked this conversation as resolved.
Show resolved Hide resolved
{{ entity.fieldDescription.processed | drupalToVaPath | phoneLinks }}
</div>
{% endif %}
{% if entity.fieldCta.entity.fieldButtonLink %}
{% if entity.fieldCta.entity.fieldButtonLink.url %}
<div class="vads-u-padding-top--1">
maxx1128 marked this conversation as resolved.
Show resolved Hide resolved
<p>
<a class="vads-u-display--block" href="{{ entity.fieldCta.entity.fieldButtonLink.url }}" >
<span> {{ entity.fieldCta.entity.fieldButtonLabel }} <i class="fa fa-chevron-right vads-facility-hub-cta-arrow" aria-hidden="true"></i></span>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

icon found

</a>
</p>
</div>
{% endif %}
{% endif %}
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"fetched": {
"fieldPhoneExtension": [
{
"value": "4023022840"
}
],
"fieldPhoneLabel": [
{
"value": "VA benefits hotline"
}
],
"fieldPhoneNumber": [
{
"value": "800-827-1000"
}
],
"fieldPhoneNumberType": [
{
"value": "tel"
}
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"fetched": {
"fieldCta": [
{
"entity": {
"targetId": "139797",
"targetRevisionId": "1104167",
"entityType": "paragraph",
"entityBundle": "button",
"pid": "139797",
"label": "VBA -- benefit office content > Content > Call to Action",
"status": true,
"langcode": "en",
"fieldButtonLabel": [
{
"value": "Find a VA benefits location"
}
],
"fieldButtonLink": [
{
"uri": "https://www.va.gov/find-locations/?facilityType=benefits",
"title": "",
"options": {
"href": "https://www.va.gov/find-locations/?facilityType=benefits",
"dataEntityType": "",
"dataEntityUuid": "",
"dataEntitySubstitution": ""
},
"url": {
"path": "https://www.va.gov/find-locations/?facilityType=benefits"
}
}
]
}
}
],
"fieldDescription": [
{
"value": "<p>Call our VA benefits hotline at <a aria-label=\"8 0 0. 8 2 7. 1 0 0 0.\" href=\"tel:+18008271000\">800-827-1000</a> (<a aria-label=\"TTY. 7 1 1.\" href=\"tel:711\">TTY: 711</a>). We’re here 8:00 a.m. to 9:00 p.m. ET, Monday through Friday.</p>\r\n\r\n<p>&nbsp;</p>\r\n",
"format": "rich_text_limited",
"processed": "<p>Call our VA benefits hotline at <a aria-label=\"8 0 0. 8 2 7. 1 0 0 0.\" href=\"tel:+18008271000\">800-827-1000</a> (<a aria-label=\"TTY. 7 1 1.\" href=\"tel:711\">TTY: 711</a>). We’re here 8:00 a.m. to 9:00 p.m. ET, Monday through Friday.</p>\n<p> </p>\n"
}
],
"fieldSectionHeader": [
{
"value": "Can't find the service you're looking for?"
}
]
}
}
Loading
Loading