NCIOCPL / cgov-digital-platform

The Cancer.gov Digital Communications Platform
GNU General Public License v2.0
11 stars 33 forks source link

Story: Update Cancer Information Summary content type with Hide On This Page field #3230

Closed sarinapadilla closed 2 years ago

sarinapadilla commented 3 years ago

As the system, I want to render a Cancer Information Summary content item with an optional OTP section, so that the users can have the option of either displaying or not displaying the OTP depending on the page’s SEO-informed structure for the SVPC initiative.

We need to update Drupal to reflect the inclusion of a “Hide On This Page” field on CDR cancer information summary documents. The OTP will display on the front-end depending on the value of this field. This will also update the Publish Preview display of the summary in the CDR.

This field should default to show the OTP.

Tasks: update schema for incoming CDR cancer information summaries, update pdq_cancer_information_summary UI, update pdq_cancer_information_summary front-end display (which also updates CDR Publish Preview), update syndication template

ESTIMATE 2

Acceptance Criteria

Drupal/CGov

UI:

Scenario: Content editor can see the unselected “Hide On This Page” field on the Liver Cancer Treatment content item in Drupal
Given the user is logged into the CMS as an editor
  And the incoming Liver Cancer Treatment CDR document has the "Hide On This Page" field as unselected
  And this CDR document has been successfully processed into the CMS
When the user edits the Liver Cancer Treatment pdq_cancer_information_summary content item
Then the system displays the “Hide On This Page” field as a checkbox
  And the system displays the “Hide On This Page” field as unselected
Scenario: Content editor can see the selected “Hide On This Page” field on the Liver Cancer Screening PDQ CIS content item in Drupal
Given the user is logged into the CMS as an editor
  And the incoming Liver Cancer Screening CDR document has the "Hide On This Page" field as selected
  And this CDR document has been successfully processed into the CMS
When the user edits the Liver Cancer Screening pdq_cancer_information_summary content item
Then the system displays the “Hide On This Page” field as a checkbox
  And the system displays the “Hide On This Page” field as selected

Desktop:

Scenario: User views the Liver Cancer Treatment content item showing On This Page on CGov on desktop
Given the Liver Cancer Treatment pdq_cancer_information_summary content item exists in the CMS
  And the content item has “Hide On This Page” unselected
When a user views the Liver Cancer Treatment page on CGov at the desktop breakpoint
Then “On This Page” section displays on the CGov page
  And "On This Page" section displays before the first body section title/body section
Scenario: User views the Liver Cancer Screening PDQ CIS content item hiding On This Page on CGov on desktop
Given the Liver Cancer Screening pdq_cancer_information_summary content item exists in the CMS
  And the content item has “Hide On This Page” selected
When a user views the Liver Cancer Screening page on CGov at the desktop breakpoint
Then “On This Page” section does not display on the CGov page
  And the next page section (intro text or body section title/body section) appears on the CGov page following the H2

Tablet:

Scenario: User views the Liver Cancer Treatment content item showing On This Page on CGov on tablet
Given the Liver Cancer Treatment pdq_cancer_information_summary content item exists in the CMS
  And the content item has “Hide On This Page” unselected
When a user views the Liver Cancer Treatment page on CGov at the tablet breakpoint
Then “On This Page” section displays on the CGov page
  And "On This Page" section displays before the first body section title/body section
Scenario: User views the Liver Cancer Screening PDQ CIS content item hiding On This Page on CGov on tablet
Given the Liver Cancer Screening pdq_cancer_information_summary content item exists in the CMS
  And the content item has “Hide On This Page” selected
When a user views the Liver Cancer Screening page on CGov at the tablet breakpoint
Then “On This Page” section does not display on the CGov page
  And the next page section (intro text or body section title/body section) appears on the CGov page following the H2

Mobile:

Scenario: User views the Liver Cancer Treatment content item showing On This Page on CGov on mobile
Given the Liver Cancer Treatment pdq_cancer_information_summary content item exists in the CMS
  And the content item has “Hides On This Page” unselected
When a user views the Liver Cancer Treatment page on CGov at the mobile breakpoint
Then the body section header accordion displays below the intro text
Scenario: User views the Liver Cancer Screening PDQ CIS content item, which has intro text and hides On This Page, on CGov on mobile
Given the Liver Cancer Screening pdq_cancer_information_summary content item exists in the CMS
  And the content item has “Hide On This Page” selected
When a user views the Liver Cancer Screening page on CGov at the mobile breakpoint
Then the body section header accordion does not display on the CGov page
  And you can still see all of the content of the page (not in an accordion)

Publish Preview

Scenario: User views the Liver Cancer Treatment PDQ CIS content item showing On This Page in CDR Publish Preview
Given a user is viewing the Liver Cancer Treatment PDQ CIS content item in CDR Publish Preview
  And the content item has the “Show On This Page” field selected
Then “On This Page” section displays on the summary document in Publish Preview following the H2
Scenario: User views the Liver Cancer Screening PDQ CIS content item hiding On This Page in CDR Publish Preview
Given a user is viewing the Liver Cancer Screening PDQ CIS content item in CDR Publish Preview
  And the content item does not have the “Show On This Page” field selected
Then “On This Page” section does not display on the summary document in Publish Preview

Resources:

Notes

Some complementary notes if necessary:


Solution

Prerequisites

Tasks

Technical Notes

bkline commented 2 years ago

@sarinapadilla This ticket lists "update syndication template" as one of the tasks. However, as far as I can tell, the existing syndication template never includes the "On This Page" section.

{#
/**
 * @file
 * Theme override for HHS Syndication of Cancer Information Summaries.
 *
 * This is a stripped-down version of the body, restricted to the
 * information in the summary. The bundle and theme names are embedded
 * in the template's file name to ensure that this overriding template
 * is selected.
 */
#}

{% import '@cgov_common/content_page_macros.twig' as contentPageMacros %}
<!-- ********************************* BEGIN Page Content ********************************** -->

<h2 id="bodyTitle">{{ node.label }}</h2>
<div id="bodyContent">
    <div class="summaryPage">
        {{ content.field_summary_sections }}
    </div>
</div>
<div id="footer">
    {{ contentPageMacros.syndicationFooter(content) }}
</div>

Were you thinking that we should change what we send to HHS syndication to start including the OTP block unless the new flag is set? My guess is that the comment at the top of the template reflected an intention to leave out stuff which was not included in the original summary, but was instead generated by the front end.

bkline commented 2 years ago

I proceeded with the assumption that it would not be appropriate to add the OTP links to the syndication output.

bkline commented 2 years ago

Installed on https://ncigovcdode444.prod.acquia-sites.com/