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

VAGOV-TEAM-99444: Form Info page #20311

Merged
merged 36 commits into from
Jan 24, 2025
Merged

VAGOV-TEAM-99444: Form Info page #20311

merged 36 commits into from
Jan 24, 2025

Conversation

ryguyk
Copy link
Contributor

@ryguyk ryguyk commented Jan 22, 2025

Description

  • Changes the existing "Start a conversion" page to "Form Info" page.
  • Makes the page handle both "create" and "edit" modes.
    • Create mode: This is what it originally was before this PR. The form creates a new Digital Form node.
    • Edit mode: The form can be revisited to update the form-info fields for an existing node.
  • Renders the form with a custom template.
  • Adds and wires up custom css specific to this page.
  • Adds unit and functional tests for new code.

Closes department-of-veterans-affairs/va.gov-team#99444

Testing done

  • Unit and functional tests added and updated.
  • Manual tests to ensure the form works as expected.
  • Manual tests to ensure other pages in Form Builder work as expected.

Screenshots

image

QA steps

  1. Run the user/content creation script: drush scr scripts/content/form-builder.php.
  2. Log in as test_user_form_builder.
  3. Navigate to form-builder/form-info.
    • Validate that the page loads and the (blank/uncompleted) form is visible.
  4. Fill in the form and click "Save and continue".
  • Validate that the form submission works.
  • Validate that you are taken to /form-builder/{nid}/name-and-dob
  1. On the name-and-dob page, click the "Back" button (this button will be going away, but for now it can be used to navigate back to the form-info page).
    • Validate that the form-info page now loads at url: /form-builder/{nid}/form-info
    • Validate that the form is populated with the fields you just added in the previous step.
  2. Make a change to the form data and click "Save and continue".
  3. On the name-and-dob page, again click the "Back" button.
    • Validate, again, that the form-info page loads at url: /form-builder/{nid}/form-info.
    • Validate that the form is populated and that the change you just made is reflected.

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
  • Form Engine

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

@va-cms-bot va-cms-bot temporarily deployed to Tugboat January 22, 2025 03:51 Destroyed
Copy link

Checking composer.lock changes...

@va-cms-bot va-cms-bot temporarily deployed to Tugboat January 22, 2025 03:56 Destroyed
Copy link

Checking composer.lock changes...

@va-cms-bot va-cms-bot temporarily deployed to Tugboat January 22, 2025 08:45 Destroyed
@va-cms-bot va-cms-bot temporarily deployed to Tugboat January 22, 2025 15:58 Destroyed
Copy link

Checking composer.lock changes...

@va-cms-bot va-cms-bot temporarily deployed to Tugboat January 22, 2025 16:25 Destroyed
Copy link

Checking composer.lock changes...

@va-cms-bot va-cms-bot temporarily deployed to Tugboat January 22, 2025 18:11 Destroyed
Copy link

Checking composer.lock changes...

@va-cms-bot va-cms-bot temporarily deployed to Tugboat January 22, 2025 21:25 Destroyed
Copy link

Checking composer.lock changes...

@va-cms-bot va-cms-bot temporarily deployed to Tugboat January 23, 2025 01:08 Destroyed
Copy link

Checking composer.lock changes...

@va-cms-bot va-cms-bot temporarily deployed to Tugboat January 23, 2025 08:45 Destroyed
@ryguyk ryguyk force-pushed the VAGOV-TEAM-99444-form-info branch from 2de78db to 175f283 Compare January 23, 2025 14:08
@va-cms-bot va-cms-bot temporarily deployed to Tugboat January 23, 2025 14:08 Destroyed
Copy link

Checking composer.lock changes...

@va-cms-bot va-cms-bot temporarily deployed to Tugboat January 23, 2025 14:59 Destroyed
Copy link

Checking composer.lock changes...

@ryguyk ryguyk requested a review from derekhouck January 23, 2025 15:23
@ryguyk ryguyk marked this pull request as ready for review January 23, 2025 15:23
@ryguyk ryguyk requested a review from a team as a code owner January 23, 2025 15:23
@va-cms-bot va-cms-bot temporarily deployed to Tugboat January 23, 2025 16:20 Destroyed
Copy link

Checking composer.lock changes...

Comment on lines -16 to -19
* After initially containing some logic, this function
* is now empty, and this entire class is a candiate
* for removal. Leaving it here for now, as it might prove
* necessary as we continue on.
Copy link
Contributor Author

@ryguyk ryguyk Jan 23, 2025

Choose a reason for hiding this comment

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

This base class was initially used, then went through a time where the only logic it had was removed. Now, the need for two layers here (three separate base classes) has gone away, and this class is the only base class, so a lot of the logic from the others has been moved in here and this class has gotten new life.

Comment on lines +46 to +53
// Add form themes.
$forms = ['form_info'];
foreach ($forms as $form) {
$theme['form__va_gov_form_builder__' . $form] = [
'path' => $path . '/templates/form',
'render element' => 'form',
];
}
Copy link
Contributor Author

@ryguyk ryguyk Jan 23, 2025

Choose a reason for hiding this comment

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

The steps for making a custom template work for a form page:

  1. Register the theme in hook_theme.
  2. Set the form #theme as the theme registered in step 1.
  3. Create the twig template and name in accordance with theme key registered in step 1.

$this->isCreate = FALSE;
}

$form['#theme'] = 'form__va_gov_form_builder__form_info';
Copy link
Contributor Author

@ryguyk ryguyk Jan 23, 2025

Choose a reason for hiding this comment

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

The steps for making a custom template work for a form page:

  1. Register the theme in hook_theme.
  2. Set the form #theme as the theme registered in step 1.
  3. Create the twig template and name in accordance with theme key registered in step 1.

@@ -0,0 +1,30 @@
{#
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The steps for making a custom template work for a form page:

  1. Register the theme in hook_theme.
  2. Set the form #theme as the theme registered in step 1.
  3. Create the twig template and name in accordance with theme key registered in step 1.

ryguyk added 24 commits January 24, 2025 17:13
- Updates test to handle change to button label.
- Removes tests related to back button.
- Updates controller tests to check for populated vs. empty fields on edit vs. create mode.
@ryguyk ryguyk force-pushed the VAGOV-TEAM-99444-form-info branch from 046da8c to 7f0adc4 Compare January 24, 2025 23:13
@va-cms-bot va-cms-bot temporarily deployed to Tugboat January 24, 2025 23:13 Destroyed
Copy link

Checking composer.lock changes...

@va-cms-bot
Copy link
Collaborator

Cypress Accessibility Violations

/test-data-quae

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"

@ryguyk ryguyk merged commit b9365f9 into main Jan 24, 2025
18 checks passed
@ryguyk ryguyk deleted the VAGOV-TEAM-99444-form-info branch January 24, 2025 23:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Form Builder Page: Form Info
3 participants