-
Notifications
You must be signed in to change notification settings - Fork 70
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
VATEAM-87711: Add Digital Form content type #18717
Conversation
GitHub Workflows (.github/workflows/*.yml)Have you...
|
There was a problem hiding this 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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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:
translatable: true translatable: true translatable: true translatable: true translatable: true translatable: 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.
There was a problem hiding this comment.
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.' |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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'] | ||
); | ||
} | ||
|
||
} |
There was a problem hiding this comment.
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.
There was a problem hiding this 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).
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. |
Merging into integration branch. That branch will need external review at some point. |
* Add Digital Form content type * Update Digital Form description --------- Co-authored-by: Derek Houck <[email protected]>
* Add Digital Form content type * Update Digital Form description --------- Co-authored-by: Derek Houck <[email protected]>
* Add Digital Form content type * Update Digital Form description --------- Co-authored-by: Derek Houck <[email protected]>
* Add Digital Form content type * Update Digital Form description --------- Co-authored-by: Derek Houck <[email protected]>
* Add Digital Form content type * Update Digital Form description --------- Co-authored-by: Derek Houck <[email protected]>
* 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]>
* 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]>
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
Digital Form listed as an option in the "Add Content" page
The Create Digital Form page
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
Definition of Done
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?