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

VATEAM-101160: Create "Custom Step" paragraph and text input component in Drupal #20402

Merged
merged 11 commits into from
Feb 18, 2025

Conversation

derekhouck
Copy link
Contributor

@derekhouck derekhouck commented Feb 4, 2025

Description

Creates several new Paragraph and field types:

  • Custom Step is a new step that allows form builders to create steps following the Single Response pattern. It includes a step header and pages.
  • Page is a new paragraph type representing a form page from the above pattern. It includes a page title, body text, and one or more components.
  • Text Input Component is the first of several components that can be embedded within Custom Step Pages. It contains fields common to all Custom Step Components: "Label," "Hint text", and "Required?"

These will all be used within the Digital Form content type.

Testing done

Manually created a Digital Form with a Custom Step that featured multiple pages and components within it.

Screenshots

The turducken of a Digital Form containing a Custom Step containing a Page containing a Text Input Component
Screenshot 2025-02-04 at 2 51 17 PM

QA steps

As an administrator

  1. Go to Manage > Content > Add content > Digital Form
  2. In the "Steps" field, click "Add Step"
    • Verify "Digital Form: Custom Step" appears as the top pattern in the "Add Step" modal.
  3. Click "Add" underneath "Digital Form: Custom Step"
    • Verify the "Digital Form: Custom Step" Paragraph appears expanded in the "Steps" field.
    • Verify the "Step header" field is required
    • Verify the "Pages" field is present and populated with a Digital Form: Page Paragraph
    • Verify the Digital Form: Page Paragraph is expanded in the "Pages" field.
    • Verify the "Page title" field is required
    • Verify the "Body text" field is optional
    • Verify the "Components" field is present and populated with a Digital Form: Text Input Component Paragraph
    • Verify the Digital Form: Text Input Component Paragraph is expanded in the "Components" field.
    • Verify the "Label" field is required.
    • Verify the "Required?" checkbox is unchecked.
    • Verify the "Hint text" field is optional.
  4. Fill out the required fields on the Digital Form and click "Save" at the bottom of the page.
    • Verify the Digital Form saves successfully.
    • Verify the "Digital Form: Custom Step" Paragraph is included in the "Steps" field of the view page.
    • Verify all the data you entered is reflected on the view page.

Definition of Done

  • Documentation has been updated, if applicable.
  • Tests have been added if necessary.
  • Automated tests have passed.
  • Code Quality Tests have passed.
  • Acceptance Criteria in related issue are met.
  • Manual Code Review Approved.
  • If there are field changes, front end output has been thoroughly checked.

Select Team for PR review

  • CMS Team
  • Public websites
  • Facilities
  • User support
  • Accelerated Publishing

Is this PR blocked by another PR?

  • DO NOT MERGE

Does this PR need review from a Product Owner

  • Needs PO review

CMS user-facing announcement

Is an announcement needed to let editors know of this change?

  • Yes, and it's written in issue ____ and queued for publication.
    • Merge and ping the UX writer so they are ready to publish after deployment
  • Yes, but it hasn't yet been written
    • Don't merge yet -- ping the UX writer to write and queue content
  • No announcement is needed for this code change.
    • Merge & carry on unburdened by announcements

Copy link

github-actions bot commented Feb 4, 2025

GitHub Workflows (.github/workflows/*.yml)

Have you...

  • pinned all affected GitHub Actions at a specific commit by SHA?
  • reviewed the source code of the action at the commit you are pinning?
  • confirmed that no GitHub security measures are being bypassed?
  • checked for any injection of user content into protected contexts?
  • reviewed Security hardening for GitHub Actions?
  • reviewed GitHub Workflows?

Copy link

github-actions bot commented Feb 4, 2025

Checking composer.lock changes...

@derekhouck derekhouck requested a review from ryguyk February 4, 2025 21:12
@derekhouck derekhouck marked this pull request as ready for review February 4, 2025 21:13
@derekhouck derekhouck requested review from a team as code owners February 4, 2025 21:13
@github-actions github-actions bot added the CMS Team CMS Product team that manages both editor exp and devops label Feb 4, 2025
@va-cms-bot va-cms-bot temporarily deployed to Tugboat February 5, 2025 08:50 Destroyed
@laflannery
Copy link
Contributor

  • All Text input fields:
    • There are character limits on these fields but I am not told I've hit it, my typing just stops. The user needs feedback as to what is happening.
    • Please follow the format/UX of the Page title field on the Benefits Detail page (I know many other fields also have this same character counter I just picked this as the example)
    • Screen shots:
      Screenshot 2025-02-05 at 8 35 30 AM
      Screenshot 2025-02-05 at 8 35 53 AM
  • Body text field:
    • Please make the "t" in the label Body text lower case to match VA style guide (they use sentence case and we do our best within the CMS to adhere to that as well)
    • Within the help text, it is suggested that if necessary, the user could use an additional info component, however they aren't given the option to add this component anywhere.
      • (Apologies if this is out of scope for this particular PR but I wanted to make sure it was noted just in case)
    • I might suggest adding a character count to this field as well especially since there is a word count suggested in the help text
  • Label field:
    • I think it could be beneficial to add help text to the label field. However, without more context as to what exactly this is and who the user base is I can't say for sure.
    • Overall we have been adding more help text to fields lately so I would definitely encourage it or at least reviewing this with your own UX folks and thinking about this more long term - if this were to be opened up to more users, would having help text be beneficial?
  • Paragraph images:
    • We don't typically use these little paragraph images within the CMS, are these able to be removed?
    • If not, could the title attribute be removed from both of them? There are very few instances in which the title attributes should be used and in this case it is not necessary and just adds noise.
      Screenshot 2025-02-05 at 8 47 56 AM

Please let me know if there are any questions on any of the above feedback

@va-cms-bot va-cms-bot temporarily deployed to Tugboat February 5, 2025 17:03 Destroyed
Copy link

github-actions bot commented Feb 5, 2025

Checking composer.lock changes...

@va-cms-bot va-cms-bot temporarily deployed to Tugboat February 5, 2025 17:49 Destroyed
Copy link

github-actions bot commented Feb 5, 2025

Checking composer.lock changes...

@va-cms-bot va-cms-bot temporarily deployed to Tugboat February 5, 2025 18:47 Destroyed
Copy link

github-actions bot commented Feb 5, 2025

Checking composer.lock changes...

@va-cms-bot va-cms-bot temporarily deployed to Tugboat February 5, 2025 20:55 Destroyed
Copy link

github-actions bot commented Feb 5, 2025

Checking composer.lock changes...

@derekhouck
Copy link
Contributor Author

@laflannery, I believe I have addressed all your feedback and the PR is ready for review.

@va-cms-bot va-cms-bot temporarily deployed to Tugboat February 6, 2025 08:52 Destroyed
Copy link
Contributor

@laflannery laflannery left a comment

Choose a reason for hiding this comment

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

Looks good!

@va-cms-bot va-cms-bot temporarily deployed to Tugboat February 7, 2025 08:51 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat February 8, 2025 08:46 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat February 9, 2025 08:55 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat February 10, 2025 08:52 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat February 11, 2025 08:56 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat February 12, 2025 08:58 Destroyed
Copy link
Contributor

@ryguyk ryguyk left a comment

Choose a reason for hiding this comment

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

Very nice work!

I left one question about a very small text consideration.

More notably, the work here to add character counters, for example, brings to the forefront the distinction between the default node-edit form and our Form Builder UI's forms. Currently, these configurations (like character counters) do not come over to the Form Builder UI. For one, they are not called for in the designs. For two, getting them to come over is not automatic. We can pull the widgets into our Form Builder UI, but we need to decide if that's something we want to do.

entity_type: paragraph
bundle: digital_form_page
label: 'Body text'
description: 'Use body text to add clarifying information that is relevant to all the information under a page title. The body text should either clarify what type of information we need, or explain what we’re going to do with the data. Aim for fewer than fifty words in the body text.'
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this say "50" rather than "fifty"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I copied it from VADS and went with whatever they used.

@laflannery
Copy link
Contributor

laflannery commented Feb 12, 2025

@ryguyk Regarding your character counter comments, my comments were more from an accessibility and usability standpoint rather than a "let's match the Drupal UI" standpoint. If something is not happening (e.g. the text I'm trying to type is not actually typing), the user should know why. So I'm up for doing it a different way in your From build UI if that's better for you all but there should be some feedback for the user in these types of instances.

Let me know if you think we should discuss further. And in general when I provide feedback I'm probably always going to default to the Drupal UI I know but if you ever need to push back always feel free and we can discuss the why and see if there's a better solution for what you all are building

@va-cms-bot va-cms-bot temporarily deployed to Tugboat February 12, 2025 22:27 Destroyed
Copy link

Checking composer.lock changes...

@va-cms-bot va-cms-bot temporarily deployed to Tugboat February 13, 2025 08:54 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat February 13, 2025 19:31 Destroyed
Copy link

Checking composer.lock changes...

@va-cms-bot va-cms-bot temporarily deployed to Tugboat February 13, 2025 20:34 Destroyed
Copy link

Checking composer.lock changes...

@va-cms-bot va-cms-bot temporarily deployed to Tugboat February 14, 2025 08:40 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat February 15, 2025 08:39 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat February 16, 2025 08:35 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat February 17, 2025 08:36 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat February 18, 2025 08:36 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat February 18, 2025 16:06 Destroyed
Copy link

Checking composer.lock changes...

@va-cms-bot
Copy link
Collaborator

Cypress Accessibility Violations

/test-data-soluta

ID: button-name
Impact: critical
Tags: cat.name-role-value, wcag2a, wcag412, section508, section508.22.a, TTv5, TT6.a, EN-301-549, EN-9.4.1.2, ACT
Description: Ensure buttons have discernible text
Help: Buttons must have discernible text
Nodes:

  • HTML: <button class="proofing-element-help" role="tooltip" data-proofing-help-title="About 'Page introduction' field" data-proofing-help="Add an introduction that helps visitors understand if information on the page is relevant to them."> <span aria-hidden="true">i</span> </button>
    Impact: critical
    Target: .field--name-field-intro-text-limited-html > .field__label > .proofing-element-help[role="tooltip"]
    Summary: Fix any of the following:
    Element does not have inner text that is visible to screen readers
    aria-label attribute does not exist or is empty
    aria-labelledby attribute does not exist, references elements that do not exist or references elements that are empty
    Element has no title attribute
    Element does not have an implicit (wrapped) <label>
    Element does not have an explicit <label>
    Element's default semantics were not overridden with role="none" or role="presentation"

  • HTML: <button class="proofing-element-help" role="tooltip" data-proofing-help-title="About 'Generate a table of contents from major headings' field" data-proofing-help="By checking this box, all h2's below this point on the page will be linked with with anchor links. This helps users navigate content on very long pages. Do not check this box unless there is at least 2 h2's on the page.">
    Impact: critical
    Target: .field--name-field-table-of-contents-boolean > .field__label > .proofing-element-help[role="tooltip"]
    Summary: Fix any of the following:
    Element does not have inner text that is visible to screen readers
    aria-label attribute does not exist or is empty
    aria-labelledby attribute does not exist, references elements that do not exist or references elements that are empty
    Element has no title attribute
    Element does not have an implicit (wrapped) <label>
    Element does not have an explicit <label>
    Element's default semantics were not overridden with role="none" or role="presentation"

  • HTML: <button class="proofing-element-help" role="tooltip" data-proofing-help-title="About 'Main content' field" data-proofing-help="The main body of the page, which appears below the featured content."> <span aria-hidden="true">i</span> </button>
    Impact: critical
    Target: button[data-proofing-help-title="About 'Main content' field"]
    Summary: Fix any of the following:
    Element does not have inner text that is visible to screen readers
    aria-label attribute does not exist or is empty
    aria-labelledby attribute does not exist, references elements that do not exist or references elements that are empty
    Element has no title attribute
    Element does not have an implicit (wrapped) <label>
    Element does not have an explicit <label>
    Element's default semantics were not overridden with role="none" or role="presentation"

@derekhouck derekhouck merged commit d6187a1 into main Feb 18, 2025
18 checks passed
@derekhouck derekhouck deleted the 101160-custom-step-paragraph branch February 18, 2025 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CMS Team CMS Product team that manages both editor exp and devops
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create "Custom Step" paragraph and text input component in Drupal
4 participants