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-87711: Add Digital Form content type #18717

Merged

Conversation

derekhouck
Copy link
Contributor

@derekhouck derekhouck commented Jul 23, 2024

Description

Closes #87711

Testing done

Unit tests added for the Digital Form bundle class and the new fields attached to it.

Screenshots

Digital Form in the list of content types
Screenshot 2024-07-23 at 2 20 08 PM

Digital Form listed as an option in the "Add Content" page
Screenshot 2024-07-23 at 2 21 39 PM

The Create Digital Form page
Screenshot 2024-07-23 at 2 23 04 PM

QA steps

What needs to be checked to prove this works?
Digital Form creation, updating, and deletion

What needs to be checked to prove it didn't break any related things?
Creation, updating, and deletion of other content types

What variations of circumstances (users, actions, values) need to be checked?
Only administrators should be able to create Digital Forms at this time.

As an administrator

  1. Go to Manage > Content > Add content
    • Verify "Digital Form" appears as an option.
  2. Click "Digital Form"
    • Verify the form contains the following sections:
      • Form Name
      • Section
      • Form number
      • OMB Number
  3. Fill out the required fields and click "Save"
    • Verify the Digital Form saves successfully and the data you entered appears on the "View" page.
  4. Click the "Edit" tab and verify you can successfully edit data.
  5. Click the "Delete" tab and verify you can successfully delete a Digital Form.

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

@va-cms-bot va-cms-bot temporarily deployed to Tugboat July 23, 2024 17:57 Destroyed
Copy link

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-poc July 23, 2024 19:18
@derekhouck derekhouck marked this pull request as ready for review July 23, 2024 19:41
@derekhouck derekhouck requested review from a team as code owners July 23, 2024 19:41
@derekhouck derekhouck requested a review from ryguyk July 23, 2024 19:42
@github-actions github-actions bot added the CMS Team CMS Product team that manages both editor exp and devops label Jul 23, 2024
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.

Approved with a couple questions. Nothing is pressing, as these would be simple changes going forward. The biggest one is around the description of the content type.

module: core
locked: false
cardinality: 1
translatable: true
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not certain whether this distinction is critical in practice, in this case, but it feels odd that this field would be translatable.

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 no longer seem able to edit this setting in the Drupal UI for this field type. I could manually edit it, but I'm a little hesitant to do so in case it creates an unworkable configuration.

Copy link
Contributor

Choose a reason for hiding this comment

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

I believe the UI limitation is because you have content created already. Once we create content, things are much more set in stone. So I do think now is the time to ensure we get things as right as they can be, because once we push this to production and start using it, we're kind of stuck.

I'm not sure what that means here. As I said, I'm not sure what significance it will have, in practice, if this field is marked as translatable. I just imagine that this would never be something we would want to translate.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This might be a limitation of this being a string field. I have been unable to find an example of a string field type that is not translatable in our config, but I have found other examples of string field types that are probably not ever going to be translated with this attribute set to true:

That is not to say we should definitely follow their example, but it seems we would not be unique in leaving this attribute at its default value.

Copy link
Contributor

Choose a reason for hiding this comment

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

This is compelling. Probably not how these fields should be, but good evidence that it probably doesn't have a practical downside in our context.

Very nice discovery!

when_to_delete: 0
name: 'Digital Form'
type: digital_form
description: 'An online form created by the Form Builder tool.'
Copy link
Contributor

Choose a reason for hiding this comment

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

This description feels slightly confusing to me. It feels interesting to me to describe a piece of content of this type as something that is "created by the Form Builder tool", when, in fact, this content type is, effectively, the Form Builder tool. I'm not sure what is the chicken and what is the egg.

That said, I'm not sure I have a better idea. Perhaps something like, "Configuration for an online form presented to Veterans."

Just a thought. Not a hill I'm going to die on. Maybe this is a UX question, after all.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It probably is a UX question, but I went ahead and updated the description to your suggestion until we get a more definitive answer from Design.

@@ -0,0 +1,22 @@
uuid: ac87a752-cc60-4bde-bd33-18098f65e851
langcode: en
status: true
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems like we wouldn't need this field. I think that means we could set status: false (or perhaps remove this file altogether). That said, I'm not seeing this on the UI. So I'm a bit perplexed. I need to dig in further to understand what's going on. I imagine a lot of this is happening automatically with config export, but I don't know enough to know why.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, this is one of those fields that I had to manually disable in the Drupal UI, as it was added automatically. I'm hesitant to remove it for fear that something depends on it.

Comment on lines +19 to +40
public function testBundleClass() {
$digital_form_attrs = [
'field_va_form_number' => '12345',
'field_omb_number' => '1234-5678',
'title' => 'Test Digital Form',
'type' => 'digital_form',
];

$node = $this->createNode($digital_form_attrs);
$this->assertEquals(DigitalForm::class, get_class($node));
$this->assertEquals($node->getTitle(), $digital_form_attrs['title']);
$this->assertEquals(
$node->get('field_va_form_number')->getString(),
$digital_form_attrs['field_va_form_number']
);
$this->assertEquals(
$node->get('field_omb_number')->getString(),
$digital_form_attrs['field_omb_number']
);
}

}
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks good. I need to chew a bit on this to establish any real convictions about what I think we need to test in this space, but this looks reasonable at first pass.

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.

I also wonder if we will want any validation around the format of the OMB number. We have a constraint on the length, but that doesn't currently preclude an editor from entering a 9-digit string without a dash (or from entering a 3-digit string, for example).

@va-cms-bot va-cms-bot temporarily deployed to Tugboat July 24, 2024 19:52 Destroyed
@derekhouck
Copy link
Contributor Author

I also wonder if we will want any validation around the format of the OMB number. We have a constraint on the length, but that doesn't currently preclude an editor from entering a 9-digit string without a dash (or from entering a 3-digit string, for example).

I did not see an easy way to add pattern validation without getting into module development. We can certainly pursue that, as I expect we will eventually need to do some module work, but I was attempting to see what we could gain without it.

@derekhouck derekhouck changed the title Add Digital Form content type VATEAM-87711: Add Digital Form content type Jul 24, 2024
@va-cms-bot va-cms-bot temporarily deployed to Tugboat July 29, 2024 17:48 Destroyed
@ryguyk
Copy link
Contributor

ryguyk commented Jul 31, 2024

Merging into integration branch. That branch will need external review at some point.

@ryguyk ryguyk merged commit b613dc1 into integration-form-engine-poc Jul 31, 2024
16 of 18 checks passed
@ryguyk ryguyk deleted the 87711-add-digital-form-content-type branch July 31, 2024 16:57
ryguyk pushed a commit that referenced this pull request Aug 26, 2024
* Add Digital Form content type

* Update Digital Form description

---------

Co-authored-by: Derek Houck <[email protected]>
ryguyk pushed a commit that referenced this pull request Sep 3, 2024
* Add Digital Form content type

* Update Digital Form description

---------

Co-authored-by: Derek Houck <[email protected]>
ryguyk pushed a commit that referenced this pull request Sep 4, 2024
* Add Digital Form content type

* Update Digital Form description

---------

Co-authored-by: Derek Houck <[email protected]>
ryguyk pushed a commit that referenced this pull request Sep 16, 2024
* Add Digital Form content type

* Update Digital Form description

---------

Co-authored-by: Derek Houck <[email protected]>
ryguyk pushed a commit that referenced this pull request Sep 17, 2024
* Add Digital Form content type

* Update Digital Form description

---------

Co-authored-by: Derek Houck <[email protected]>
ryguyk added a commit that referenced this pull request Sep 20, 2024
* VATEAM-87711: Add Digital Form content type (#18717)

* Add Digital Form content type

* Update Digital Form description

---------

Co-authored-by: Derek Houck <[email protected]>

* Add chapters field to Digital Form

* Add screenshot of name and dob pattern

* VATEAM-88658: Script to add Digital Forms test data (#19025)

* WIP: Create digital form script

* Add steps

* Rename exit_if_wrong_env

---------

Co-authored-by: Derek Houck <[email protected]>
Co-authored-by: Derek Houck <[email protected]>
Co-authored-by: Derek Houck <[email protected]>
Co-authored-by: Tim Cosgrove <[email protected]>
keisterj-oddball pushed a commit that referenced this pull request Sep 20, 2024
* VATEAM-87711: Add Digital Form content type (#18717)

* Add Digital Form content type

* Update Digital Form description

---------

Co-authored-by: Derek Houck <[email protected]>

* Add chapters field to Digital Form

* Add screenshot of name and dob pattern

* VATEAM-88658: Script to add Digital Forms test data (#19025)

* WIP: Create digital form script

* Add steps

* Rename exit_if_wrong_env

---------

Co-authored-by: Derek Houck <[email protected]>
Co-authored-by: Derek Houck <[email protected]>
Co-authored-by: Derek Houck <[email protected]>
Co-authored-by: Tim Cosgrove <[email protected]>
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.

3 participants