From a43b9f13c09c75ce0a634363fa7168bb524dc34e Mon Sep 17 00:00:00 2001 From: Eli Selkin Date: Sun, 12 Nov 2023 14:49:00 -0800 Subject: [PATCH 01/25] working va-telephone components, cc benefits hotline, cc cannot find benefits --- src/site/filters/liquid.js | 30 +++++++++ .../vba_facilities/spotlight_content.liquid | 22 +++++++ src/site/layouts/vba_facility.drupal.liquid | 66 ++++++++++++------- .../drupal/graphql/vbaFacility.graphql.js | 6 ++ 4 files changed, 101 insertions(+), 23 deletions(-) create mode 100644 src/site/includes/vba_facilities/spotlight_content.liquid diff --git a/src/site/filters/liquid.js b/src/site/filters/liquid.js index 3b1b19c7de..22d14a6e48 100644 --- a/src/site/filters/liquid.js +++ b/src/site/filters/liquid.js @@ -863,6 +863,23 @@ module.exports = function registerFilters() { }); }; + // 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: {} }; + processed.fieldSectionHeader = field.fetched.fieldSectionHeader[0].value; + + 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].value; + return processed; + }; + liquid.filters.processCentralizedContent = (entity, contentType) => { if (!entity) return null; @@ -974,6 +991,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 @@ -1010,6 +1039,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, }, diff --git a/src/site/includes/vba_facilities/spotlight_content.liquid b/src/site/includes/vba_facilities/spotlight_content.liquid new file mode 100644 index 0000000000..abbea4b5fb --- /dev/null +++ b/src/site/includes/vba_facilities/spotlight_content.liquid @@ -0,0 +1,22 @@ + diff --git a/src/site/layouts/vba_facility.drupal.liquid b/src/site/layouts/vba_facility.drupal.liquid index 6ea567cafe..0702551b64 100644 --- a/src/site/layouts/vba_facility.drupal.liquid +++ b/src/site/layouts/vba_facility.drupal.liquid @@ -23,7 +23,7 @@ {% endif %}
+ class="usa-grid usa-grid-full vads-u-margin-top--1p5 vads-u-margin-bottom--3"> {% assign basePath = entityUrl.path | regionBasePath %} {% include "src/site/facilities/main_buttons.drupal.liquid" with path = basePath %}
@@ -46,7 +46,6 @@ {% include "src/site/includes/operatingStatusFlagsLinks.drupal.liquid" %} {% endif %} -
From 01aea4ee2220d63c93c394cc99c92fa0b98571f9 Mon Sep 17 00:00:00 2001 From: Eli Selkin Date: Mon, 20 Nov 2023 09:52:02 -0800 Subject: [PATCH 21/25] vba links at top --- src/site/layouts/vba_facility.drupal.liquid | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/site/layouts/vba_facility.drupal.liquid b/src/site/layouts/vba_facility.drupal.liquid index b650baf687..ed45ea310c 100644 --- a/src/site/layouts/vba_facility.drupal.liquid +++ b/src/site/layouts/vba_facility.drupal.liquid @@ -25,7 +25,7 @@
{% assign basePath = entityUrl.path | regionBasePath %} - {% include "src/site/facilities/main_buttons.drupal.liquid" with path = basePath %} + {% include "src/site/facilities/main_buttons.drupal.liquid" with path = basePath buttonType = 'vba'%}
From 994a34581a367ba5f5d80471373307bd60571650 Mon Sep 17 00:00:00 2001 From: Eric Tillberg Date: Mon, 20 Nov 2023 13:56:17 -0500 Subject: [PATCH 22/25] Enable form 21-0966 (#1783) --- src/applications/registry.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/applications/registry.json b/src/applications/registry.json index 1efdb8eba0..f0ac6f1051 100644 --- a/src/applications/registry.json +++ b/src/applications/registry.json @@ -1426,7 +1426,7 @@ "rootUrl": "/supporting-forms-for-claims/intent-to-file-form-21-0966", "productId": "8233bd78-20c6-4498-b36f-55ec0028b1e5", "template": { - "vagovprod": false, + "vagovprod": true, "layout": "page-react.html", "includeBreadcrumbs": true, "breadcrumbs_override": [ @@ -1679,4 +1679,4 @@ "layout": "page-react.html" } } -] +] \ No newline at end of file From 9e7099c83430073f427b88e4b18e68b1e2e17ebb Mon Sep 17 00:00:00 2001 From: Eli Selkin Date: Mon, 20 Nov 2023 12:58:55 -0800 Subject: [PATCH 23/25] testing for updates filters --- src/site/filters/liquid.unit.spec.js | 16 +++++ .../fixtures/vba_facility_data_updates.json | 66 +++++++++++++++++++ 2 files changed, 82 insertions(+) create mode 100644 src/site/layouts/tests/vba/template/fixtures/vba_facility_data_updates.json diff --git a/src/site/filters/liquid.unit.spec.js b/src/site/filters/liquid.unit.spec.js index 55e572844d..146ff734e6 100644 --- a/src/site/filters/liquid.unit.spec.js +++ b/src/site/filters/liquid.unit.spec.js @@ -16,6 +16,7 @@ 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'; +import vbaDataUpdates from '../layouts/tests/vba/template/fixtures/vba_facility_data_updates.json'; // Register filters. registerFilters(); @@ -1634,6 +1635,21 @@ describe('processCentralizedBenefitsHotline', () => { ); }); }); +describe('processCentralizedUpdatesVBA', () => { + it('returns null if null is passed', () => { + expect(liquid.filters.processCentralizedUpdatesVBA(null)).to.be.null; + }); + it('returns simple object of VBA updates', () => { + const data = liquid.filters.processCentralizedUpdatesVBA(vbaDataUpdates); + expect(data.sectionHeader).to.be.equal( + vbaDataUpdates.fetched.fieldSectionHeader[0].value, + ); + expect(Object.keys(data.links).length).to.be.equal( + vbaDataUpdates.fetched.fieldLinks.length, + ); + }); +}); + describe('processCentralizedContent', () => { it('returns null if null is passed', () => { expect(liquid.filters.processCentralizedContent(null, 'wysiwyg')).to.be diff --git a/src/site/layouts/tests/vba/template/fixtures/vba_facility_data_updates.json b/src/site/layouts/tests/vba/template/fixtures/vba_facility_data_updates.json new file mode 100644 index 0000000000..13314d8f4e --- /dev/null +++ b/src/site/layouts/tests/vba/template/fixtures/vba_facility_data_updates.json @@ -0,0 +1,66 @@ +{ + "fetched": { + "fieldLink": [], + "fieldLinks": [ + { + "uri": "entity:node/46129", + "title": "Subscribe to VBA news", + "options": { + "href": "entity:node/46129", + "dataEntityType": "node", + "dataEntityUuid": "9016392b-9dfd-4c7d-a98f-b222a69a9bd0", + "dataEntitySubstitution": "canonical" + }, + "url": { + "path": "/boston-health-care/work-with-us/internships-and-fellowships/faculty-development/newsletter" + } + }, + { + "uri": "https://facebook.com", + "title": "Get updates from the VBA Facebook page", + "options": { + "href": "https://facebook.com", + "dataEntityType": "", + "dataEntityUuid": "", + "dataEntitySubstitution": "" + }, + "url": { + "path": "https://facebook.com" + } + }, + { + "uri": "https://twitter.com", + "title": "Get updates from the VBA Twitter page", + "options": { + "href": "https://twitter.com", + "dataEntityType": "", + "dataEntityUuid": "", + "dataEntitySubstitution": "" + }, + "url": { + "path": "https://twitter.com" + } + }, + { + "uri": "https://flickr.com", + "title": "Get updates from the VBA Flickr", + "options": { + "href": "", + "dataEntityType": "", + "dataEntityUuid": "", + "dataEntitySubstitution": "" + }, + "url": { + "path": "https://flickr.com" + } + } + ], + "fieldSectionHeader": [ + { + "value": "Get updates from the Veterans Benefits Administration" + } + ] + } +}, +"fieldMedia": null +} \ No newline at end of file From 67529e1847c4433f56d3a62b687b089bdb6583ef Mon Sep 17 00:00:00 2001 From: Eli Selkin Date: Mon, 20 Nov 2023 15:48:43 -0800 Subject: [PATCH 24/25] fix mock data --- src/site/filters/liquid.unit.spec.js | 2 ++ .../tests/vba/template/fixtures/vba_facility_data_updates.json | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/site/filters/liquid.unit.spec.js b/src/site/filters/liquid.unit.spec.js index 146ff734e6..ee3c0686db 100644 --- a/src/site/filters/liquid.unit.spec.js +++ b/src/site/filters/liquid.unit.spec.js @@ -1605,6 +1605,7 @@ describe('getValueFromObjPath', () => { ).to.eq(1); }); }); + describe('processfieldCcCantFindBenefits', () => { it('returns null if null is passed', () => { expect(liquid.filters.processfieldCcCantFindBenefits(null)).to.be.null; @@ -1622,6 +1623,7 @@ describe('processfieldCcCantFindBenefits', () => { 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; diff --git a/src/site/layouts/tests/vba/template/fixtures/vba_facility_data_updates.json b/src/site/layouts/tests/vba/template/fixtures/vba_facility_data_updates.json index 13314d8f4e..7795a9a7f5 100644 --- a/src/site/layouts/tests/vba/template/fixtures/vba_facility_data_updates.json +++ b/src/site/layouts/tests/vba/template/fixtures/vba_facility_data_updates.json @@ -61,6 +61,4 @@ } ] } -}, -"fieldMedia": null } \ No newline at end of file From 4ec8a0a88e2f7a10a11293bec69b426ace9ac77c Mon Sep 17 00:00:00 2001 From: Eli Selkin Date: Mon, 20 Nov 2023 16:44:08 -0800 Subject: [PATCH 25/25] claim status link --- src/site/facilities/main_buttons.drupal.liquid | 2 +- src/site/filters/liquid.unit.spec.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/site/facilities/main_buttons.drupal.liquid b/src/site/facilities/main_buttons.drupal.liquid index 36af882cc7..abf6d5d7ab 100644 --- a/src/site/facilities/main_buttons.drupal.liquid +++ b/src/site/facilities/main_buttons.drupal.liquid @@ -23,7 +23,7 @@ {% endif %} {% if buttonType == 'vba' %} {% else %}
diff --git a/src/site/filters/liquid.unit.spec.js b/src/site/filters/liquid.unit.spec.js index ee3c0686db..a8a71b97b0 100644 --- a/src/site/filters/liquid.unit.spec.js +++ b/src/site/filters/liquid.unit.spec.js @@ -1637,6 +1637,7 @@ describe('processCentralizedBenefitsHotline', () => { ); }); }); + describe('processCentralizedUpdatesVBA', () => { it('returns null if null is passed', () => { expect(liquid.filters.processCentralizedUpdatesVBA(null)).to.be.null;