NCIOCPL / cgov-digital-platform

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

Allow 3 Feature Card Row paragraph to be added to Mini Landing Pages #4363

Closed sarinapadilla closed 3 months ago

sarinapadilla commented 5 months ago

As a content editor, I want to be able to add a feature card row to my page, so that I can feature content.

Technical Resources

DoR Tasks

DoD Tasks

Acceptance Criteria

Scenario: A content editor adds an NCIDS 3 Feature Card Row to a Mini Landing Page with the NCIDS style
  Given a content editor is on the CMS
    And the content editor is creating or editing a Mini Landing Page
    And the Mini Landing Page has the NCIDS style
  When the content editor goes to the Contents section of the CMS page for the Mini Landing Page
  Then the content editor can choose from the dropdown to add an NCIDS 3 Feature Card Row to the Mini Landing Page
  When the NCIDS 3 Feature Card Row is added to the Mini Landing Page
  Then the content editor will see the Heading field
    And the Heading field is required
    And it is a text entry field
    And the tooltip says, "Displays above the row of cards. Used to concisely describe the featured content."
    And below the Heading field is the Feature Cards field
    And the Feature Cards field is optional
    And it allows the selection of the following types: NCIDS Feature Card Internal, NCIDS Feature Card External, NCIDS Feature Card Multimedia, and Raw HTML Content
    And an NCIDS Feature Card Internal will automatically be added to the NCIDS 3 Feature Card Row
    And the NCIDS Feature Card Internal will show the fields of that component (see Content Model)
    And at the bottom of the NCIDS 3 Feature Card Row paragraph there is a dropdown that allows the content editor to add other feature cards to the row
  When the content editor has three total cards in the NCIDS 3 Feature Card Row
  Then the dropdown button to add another feature card to the row will disappear
  When an NCIDS Feature Card Row has been added to a Mini Landing Page
  Then it will look exactly like the comps (see link above)
    And it will behave the same as the NCIDS 3 Feature Card Row and its feature cards as the component on the Home & Landing Pages

Analytics

Scenario: Analytics event for feature card clicks
  Given a user is on a Mini Landing Page
    And the Mini Landing Page uses the NCIDS style
    And the Mini Landing Page has a feature card
  When the user clicks on a feature card
  Then there will be an NCIDataLayer Other event
    And the event has the name "MLP:FeatureCard:LinkClick"
    And the event has the linkname "MLP:FeatureCard:LinkClick"
    And the event has the following data:
    | key | value |
    | location | Body |
    | pageType           | This will return the value of the page type and should match the dcterms.type meta data tag on the page.                                                                                                                 |
    | pageTemplate       | This will return the value of the page template and should match the cgdp.template meta data tag on the page.        
    | pageRows | This will return the total number of rows on the page overall |
    | pageRowIndex | This will return the index of the row number on the page of the click |
    | pageRowCols | This will return the total number of columns in the row of the click |
    | pageRowColIndex | This will return the index of the column in the row of the click |
    | containerItems | This will return the number of feature cards in the feature card row or the container holding the feature card |
    | containerItemIndex | This will return the index of the feature card clicked in the feature card row or the container holding the feature card |
    | componentType | Feature Card |
    | componentTheme | This will default to 'Light' |
    | componentVariant | This will return 'Default' |
    | linkText | This returns the displayed feature card title |
    | title | This returns the displayed feature card title |
    | linkType | This will return the value 'Card' |
    | linkArea | This will return 'Not Defined' |
    | totalLinks | Default will return 1 |
    | linkPosition | Default will return 1 |

Notes


Solution

Prerequisites

Technical Notes

dev-rana-publicis commented 4 months ago

Approach

bryanpizzillo commented 4 months ago

@andyvanavery31 / @sarinapadilla - Is the requirement above for "Optional row heading" still valid? I do not see any other notes about how this will work, nor do I see a change to the content model.

andyvanavery31 commented 4 months ago

@bryanpizzillo good catch, it is supposed to be required since it will behave the same as the current H&L 3 Feature Card row. I updated the requirement, and the AC's match. Please feel free to check off the Developer Review and Developer Approval of ACs if you are able to do both for the rest of this ticket.

bryanpizzillo commented 4 months ago

@andyvanavery31 / @sarinapadilla - Let remove the RAS scenario and replace it with the Understanding Cancer priority page from the comps. For content within the ODE content representing real pages we should mimic the priority pages.

Additionally for the "Chronicles and Adventures..." page, the media card will be "NCI at a Glance Infographic", as that already exists in ODE content and Implementation Science Infographic does not. When looking for ODE content you can go to https://www-dev.ac.cancer.gov and look at the Drupal content/media/blocks listings to see what the test content already contains.

adrianacastaneda commented 4 months ago

ACs and content model look good to me!

bryanpizzillo commented 4 months ago

So just to note this here on the ticket, a decision was made that the heading for the row should be optional on MLPs and required to always show on HPs. This ended up being easier to implement as a new paragraph type (ncids_3_feature_row_opt_head). Much of the NCIDS 3 feature row template HTML was moved into a macro so it can be reused.