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-90652: Create List & Loop pattern #19816

Merged

Conversation

derekhouck
Copy link
Contributor

@derekhouck derekhouck commented Nov 6, 2024

Description

Creates a Paragraph type in Drupal for the "List & Loop" pattern. (See the Multiple responses documentation for more details on the pattern.) The Paragraph type includes an "Optional?" boolean field. Adds the new Paragraph type to the list of available Paragraph types in the "Steps" field of the Digital Form content type.

Testing done

  • Manually created a Digital Form with a Step that included the "List & Loop" Paragraph type.
  • Ran the updated script in my local environment and verified the creation of Digital Forms with the proper Steps.

Screenshots

The "List & Loop" pattern as part of the "Add Step" modal:
Screenshot 2024-11-06 at 2 46 22 PM

An expanded "List & Loop" Paragraph inside the "Steps" field of a Digital Form:
Screenshot 2024-11-06 at 2 47 56 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: List & Loop" appears as one of the patterns in the "Add Step" modal.
  3. Click "Add" underneath "Digital Form: List & Loop"
    • Verify the "Digital Form: List & Loop" Paragraph appears expanded in the "Steps" field.
    • Verify the "Title" field is required and has a default value of "Multiple responses"
    • Verify a checkbox field is present labeled "Optional?"
  4. Select the "Optional?" checkbox
  5. Fill out the other required fields on the Digital Form and click "Save" at the bottom of the page.
    • Verify the Digital Form saves successfully.
    • Verify the "Multiple responses" Paragraph is included in the "Steps" field of the view page.
    • Verify the "Optional?" field is set to "Yes"

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

@derekhouck derekhouck linked an issue Nov 6, 2024 that may be closed by this pull request
2 tasks
@va-cms-bot va-cms-bot temporarily deployed to Tugboat November 6, 2024 20:44 Destroyed
Copy link

github-actions bot commented Nov 6, 2024

Checking composer.lock changes...

Copy link

github-actions bot commented Nov 6, 2024

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?

@derekhouck derekhouck changed the base branch from main to integration-form-engine-2 November 6, 2024 20:50
@derekhouck derekhouck marked this pull request as ready for review November 6, 2024 20:51
@derekhouck derekhouck requested review from a team as code owners November 6, 2024 20:51
@derekhouck derekhouck requested a review from ryguyk November 6, 2024 20:51
@github-actions github-actions bot added the CMS Team CMS Product team that manages both editor exp and devops label Nov 6, 2024
@va-cms-bot va-cms-bot temporarily deployed to Tugboat November 7, 2024 09:00 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat November 8, 2024 17:13 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat November 9, 2024 09:00 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat November 10, 2024 08:56 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat November 11, 2024 08:51 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat November 12, 2024 08:55 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.

This makes sense in the context of the approach you have mentioned (i.e. all List-and-Loop paragraphs will map to Employment History at the moment).

I do still have some questions/hesitations around that mental model, but I do agree that it can work. I think my biggest hesitation is that there's nothing immediately obvious here that this will be an Employment History component once it makes its way to the browser. But perhaps we just need to be ok with that for now.

Copy link
Contributor

Choose a reason for hiding this comment

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

This screenshot makes me wonder some more about the relationship between this general List-and-Loop component and the specific instance of it that we are interested in currently (Employment History). This screenshot makes sense here, but I think we might need one specific to Employment History for the Form Builder.

This is, of course, very speculative and dependent upon design decisions. But this is making me wonder about the more general underlying implementation of specific instances of List and Loop. For example, let's assume we'll offer an Employment History pattern in the Form Builder (this has been debated, to be clear). In that case, would we have a pre-defined Employment History paragraph, or would we map that Form-Builder component to an underlying List-and-Loop paragraph with generated/mapped fields?

None of this is critical right now. Just some things that come to mind as I look at this screenshot that looks much different than the others. The others show web-facing UI components. This shows something much different and caught my eye, which made me think about some of the deeper implications.

Copy link
Contributor Author

@derekhouck derekhouck Nov 12, 2024

Choose a reason for hiding this comment

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

Yeah, I don't think I documented this anywhere other than my mind, which is not the best. I see Employment History and all other List & Loop "variations" as options within the List & Loop Paragraph type. Initially, that may just be a single field called "variation" or something that has options like "Employment History" and "Treatment records." Eventually, I would expect us to need to support a "Custom" option that will require adding individual fields within it, but that would be an enhancement down the line.

Now, even though all these variations would live within the List & Loop Paragraph type, we can still present them as separate "Steps" in the Form Builder UI if we wish to do so. As you mentioned above, the Steps would map to a certain configuration of the List & Loop Paragraph.

@derekhouck derekhouck merged commit f7761fd into integration-form-engine-2 Nov 12, 2024
30 of 32 checks passed
@derekhouck derekhouck deleted the 90652-create-list-and-loop-pattern branch November 12, 2024 17:44
ryguyk pushed a commit that referenced this pull request Dec 12, 2024
Creates a Paragraph type in Drupal for the "List & Loop" pattern. The Paragraph type includes an "Optional?" boolean field. Adds the new Paragraph type to the list of available Paragraph types in the "Steps" field of the Digital Form content type.
ryguyk added a commit that referenced this pull request Dec 12, 2024
* VATEAM-90582: Add 21-4140 Digital Form to seed script (#19047)

* Add create_digital_forms

* Add 21-4140 to digital forms script

* Switch includeDob to snake case

* VATEAM-90628: Add Identification Information Paragraph type (#19190)

* Add OMB info fields to Digital Form (#19078)

* Add Identification Information pattern

* Add OMB Info to digital-forms script

* Add Identification Information to digital-forms script

* VATEAM-90650: Create Address Digital Form Pattern (#19331)

Creates a Paragraph type in Drupal for the "Address" pattern. The Paragraph type includes an "Include military address checkbox?" boolean field. Adds the new Paragraph type to the list of available Paragraph types in the "Steps" field of the Digital Form content type.

* VATEAM-90651: Create Phone and Email Digital Form pattern (#19464)

Creates a Paragraph type in Drupal for the "Phone and Email Address" pattern. The Paragraph type includes an "Include email address?" boolean field. Adds the new Paragraph type to the list of available Paragraph types in the "Steps" field of the Digital Form content type.

* VATEAM-94366: Create "Your personal information" Paragraph type (#19534)

Create a new Paragraph type called "Your personal information" that contains the "Name and Date of Birth" and "Identification Information" Paragraph types within it. Remove "Name and Date of Birth" and "Identification Information" as selectable Steps. Update the Digital Forms script to use the new Paragraph type.

* VATEAM-90652: Create List & Loop pattern (#19816)

Creates a Paragraph type in Drupal for the "List & Loop" pattern. The Paragraph type includes an "Optional?" boolean field. Adds the new Paragraph type to the list of available Paragraph types in the "Steps" field of the Digital Form content type.

---------

Co-authored-by: Derek Houck <derek@derekhouck.com>
Co-authored-by: Derek Houck <derek.houck@agile6.com>
Co-authored-by: Derek Houck <12766168+derekhouck@users.noreply.github.com>
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 List & Loop pattern
3 participants