From f4716841fae70327a83c1b81b844bc38f92ad4ea Mon Sep 17 00:00:00 2001 From: Derek Houck Date: Wed, 31 Jul 2024 11:57:37 -0500 Subject: [PATCH] VATEAM-87711: Add Digital Form content type (#18717) * Add Digital Form content type * Update Digital Form description --------- Co-authored-by: Derek Houck --- ...eld_override.node.digital_form.promote.yml | 22 +++++ ...field_override.node.digital_form.title.yml | 18 ++++ ...form_display.node.digital_form.default.yml | 96 +++++++++++++++++++ ...view_display.node.digital_form.default.yml | 43 +++++++++ ...lay.node.digital_form.external_content.yml | 57 +++++++++++ ..._view_display.node.digital_form.teaser.yml | 50 ++++++++++ ...node.digital_form.field_administration.yml | 39 ++++++++ ...tal_form.field_last_saved_by_an_editor.yml | 26 +++++ ...ield.node.digital_form.field_meta_tags.yml | 25 +++++ ...eld.node.digital_form.field_omb_number.yml | 24 +++++ ...node.digital_form.field_va_form_number.yml | 24 +++++ .../field.storage.node.field_omb_number.yml | 21 ++++ ...age.content_settings.node.digital_form.yml | 11 +++ config/sync/node.type.digital_form.yml | 30 ++++++ config/sync/prometheus_exporter.settings.yml | 1 + config/sync/workflows.workflow.editorial.yml | 2 + .../src/Entity/DigitalForm.php | 10 ++ .../va_gov_content_types.module | 2 + .../functional/Entity/DigitalFormTest.php | 40 ++++++++ 19 files changed, 541 insertions(+) create mode 100644 config/sync/core.base_field_override.node.digital_form.promote.yml create mode 100644 config/sync/core.base_field_override.node.digital_form.title.yml create mode 100644 config/sync/core.entity_form_display.node.digital_form.default.yml create mode 100644 config/sync/core.entity_view_display.node.digital_form.default.yml create mode 100644 config/sync/core.entity_view_display.node.digital_form.external_content.yml create mode 100644 config/sync/core.entity_view_display.node.digital_form.teaser.yml create mode 100644 config/sync/field.field.node.digital_form.field_administration.yml create mode 100644 config/sync/field.field.node.digital_form.field_last_saved_by_an_editor.yml create mode 100644 config/sync/field.field.node.digital_form.field_meta_tags.yml create mode 100644 config/sync/field.field.node.digital_form.field_omb_number.yml create mode 100644 config/sync/field.field.node.digital_form.field_va_form_number.yml create mode 100644 config/sync/field.storage.node.field_omb_number.yml create mode 100644 config/sync/language.content_settings.node.digital_form.yml create mode 100644 config/sync/node.type.digital_form.yml create mode 100644 docroot/modules/custom/va_gov_content_types/src/Entity/DigitalForm.php create mode 100644 tests/phpunit/va_gov_content_types/functional/Entity/DigitalFormTest.php diff --git a/config/sync/core.base_field_override.node.digital_form.promote.yml b/config/sync/core.base_field_override.node.digital_form.promote.yml new file mode 100644 index 0000000000..761d74473c --- /dev/null +++ b/config/sync/core.base_field_override.node.digital_form.promote.yml @@ -0,0 +1,22 @@ +uuid: ac87a752-cc60-4bde-bd33-18098f65e851 +langcode: en +status: true +dependencies: + config: + - node.type.digital_form +id: node.digital_form.promote +field_name: promote +entity_type: node +bundle: digital_form +label: 'Promoted to front page' +description: '' +required: false +translatable: true +default_value: + - + value: 0 +default_value_callback: '' +settings: + on_label: 'On' + off_label: 'Off' +field_type: boolean diff --git a/config/sync/core.base_field_override.node.digital_form.title.yml b/config/sync/core.base_field_override.node.digital_form.title.yml new file mode 100644 index 0000000000..49e546e2e1 --- /dev/null +++ b/config/sync/core.base_field_override.node.digital_form.title.yml @@ -0,0 +1,18 @@ +uuid: 2449594d-1ce2-4f60-aab4-1da1b27f5864 +langcode: en +status: true +dependencies: + config: + - node.type.digital_form +id: node.digital_form.title +field_name: title +entity_type: node +bundle: digital_form +label: 'Form Name' +description: '' +required: true +translatable: true +default_value: { } +default_value_callback: '' +settings: { } +field_type: string diff --git a/config/sync/core.entity_form_display.node.digital_form.default.yml b/config/sync/core.entity_form_display.node.digital_form.default.yml new file mode 100644 index 0000000000..fcf31b638b --- /dev/null +++ b/config/sync/core.entity_form_display.node.digital_form.default.yml @@ -0,0 +1,96 @@ +uuid: 18ba1fa4-f0d9-45f4-9547-0c55f1868ba2 +langcode: en +status: true +dependencies: + config: + - field.field.node.digital_form.field_administration + - field.field.node.digital_form.field_last_saved_by_an_editor + - field.field.node.digital_form.field_meta_tags + - field.field.node.digital_form.field_omb_number + - field.field.node.digital_form.field_va_form_number + - node.type.digital_form + - workflows.workflow.editorial + module: + - content_moderation + - field_group + - path +third_party_settings: + field_group: + group_editorial_workflow: + children: + - moderation_state + - revision_log + label: 'Editorial Workflow' + region: content + parent_name: '' + weight: 6 + format_type: fieldset + format_settings: + classes: '' + show_empty_fields: false + id: '' + description: '' + required_fields: true + description_display: after +id: node.digital_form.default +targetEntityType: node +bundle: digital_form +mode: default +content: + field_administration: + type: options_select + weight: 1 + region: content + settings: { } + third_party_settings: { } + field_last_saved_by_an_editor: + type: datetime_timestamp + weight: 3 + region: content + settings: { } + third_party_settings: { } + field_omb_number: + type: string_textfield + weight: 5 + region: content + settings: + size: 9 + placeholder: XXXX-XXXX + third_party_settings: { } + field_va_form_number: + type: string_textfield + weight: 2 + region: content + settings: + size: 60 + placeholder: '' + third_party_settings: { } + moderation_state: + type: moderation_state_default + weight: 12 + region: content + settings: { } + third_party_settings: { } + path: + type: path + weight: 4 + region: content + settings: { } + third_party_settings: { } + title: + type: string_textfield + weight: 0 + region: content + settings: + size: 60 + placeholder: '' + third_party_settings: { } +hidden: + created: true + field_meta_tags: true + langcode: true + promote: true + status: true + sticky: true + uid: true + url_redirects: true diff --git a/config/sync/core.entity_view_display.node.digital_form.default.yml b/config/sync/core.entity_view_display.node.digital_form.default.yml new file mode 100644 index 0000000000..f708f87b1e --- /dev/null +++ b/config/sync/core.entity_view_display.node.digital_form.default.yml @@ -0,0 +1,43 @@ +uuid: 73414b44-8d43-4231-9695-b8092f02e821 +langcode: en +status: true +dependencies: + config: + - field.field.node.digital_form.field_administration + - field.field.node.digital_form.field_last_saved_by_an_editor + - field.field.node.digital_form.field_meta_tags + - field.field.node.digital_form.field_omb_number + - field.field.node.digital_form.field_va_form_number + - node.type.digital_form + module: + - user +id: node.digital_form.default +targetEntityType: node +bundle: digital_form +mode: default +content: + field_omb_number: + type: string + label: above + settings: + link_to_entity: false + third_party_settings: { } + weight: 1 + region: content + field_va_form_number: + type: string + label: above + settings: + link_to_entity: false + third_party_settings: { } + weight: 0 + region: content +hidden: + breadcrumbs: true + content_moderation_control: true + field_administration: true + field_last_saved_by_an_editor: true + field_meta_tags: true + langcode: true + links: true + search_api_excerpt: true diff --git a/config/sync/core.entity_view_display.node.digital_form.external_content.yml b/config/sync/core.entity_view_display.node.digital_form.external_content.yml new file mode 100644 index 0000000000..d9e14e74d5 --- /dev/null +++ b/config/sync/core.entity_view_display.node.digital_form.external_content.yml @@ -0,0 +1,57 @@ +uuid: bae3d4cd-0dd9-4a17-972b-ff3ef6bf7ba5 +langcode: en +status: true +dependencies: + config: + - core.entity_view_mode.node.external_content + - field.field.node.digital_form.field_administration + - field.field.node.digital_form.field_last_saved_by_an_editor + - field.field.node.digital_form.field_meta_tags + - field.field.node.digital_form.field_omb_number + - field.field.node.digital_form.field_va_form_number + - node.type.digital_form + module: + - link + - user +id: node.digital_form.external_content +targetEntityType: node +bundle: digital_form +mode: external_content +content: + breadcrumbs: + type: link + label: hidden + settings: + trim_length: 80 + url_only: false + url_plain: false + rel: '' + target: '' + third_party_settings: { } + weight: -5 + region: content + content_moderation_control: + settings: { } + third_party_settings: { } + weight: -20 + region: content + field_va_form_number: + type: string + label: above + settings: + link_to_entity: false + third_party_settings: { } + weight: 1 + region: content + links: + settings: { } + third_party_settings: { } + weight: 100 + region: content +hidden: + field_administration: true + field_last_saved_by_an_editor: true + field_meta_tags: true + field_omb_number: true + langcode: true + search_api_excerpt: true diff --git a/config/sync/core.entity_view_display.node.digital_form.teaser.yml b/config/sync/core.entity_view_display.node.digital_form.teaser.yml new file mode 100644 index 0000000000..6f048e721d --- /dev/null +++ b/config/sync/core.entity_view_display.node.digital_form.teaser.yml @@ -0,0 +1,50 @@ +uuid: acbd9ba8-c64b-4b82-a7dd-11f8fe57a9ff +langcode: en +status: true +dependencies: + config: + - core.entity_view_mode.node.teaser + - field.field.node.digital_form.field_administration + - field.field.node.digital_form.field_last_saved_by_an_editor + - field.field.node.digital_form.field_meta_tags + - field.field.node.digital_form.field_omb_number + - field.field.node.digital_form.field_va_form_number + - node.type.digital_form + module: + - link + - user +id: node.digital_form.teaser +targetEntityType: node +bundle: digital_form +mode: teaser +content: + breadcrumbs: + type: link + label: hidden + settings: + trim_length: 80 + url_only: false + url_plain: false + rel: '' + target: '' + third_party_settings: { } + weight: -5 + region: content + content_moderation_control: + settings: { } + third_party_settings: { } + weight: -20 + region: content + links: + settings: { } + third_party_settings: { } + weight: 100 + region: content +hidden: + field_administration: true + field_last_saved_by_an_editor: true + field_meta_tags: true + field_omb_number: true + field_va_form_number: true + langcode: true + search_api_excerpt: true diff --git a/config/sync/field.field.node.digital_form.field_administration.yml b/config/sync/field.field.node.digital_form.field_administration.yml new file mode 100644 index 0000000000..6e9bb5fbe0 --- /dev/null +++ b/config/sync/field.field.node.digital_form.field_administration.yml @@ -0,0 +1,39 @@ +uuid: d49d4508-3a4d-4b12-a8d9-51b44eb854ca +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_administration + - node.type.digital_form + - taxonomy.vocabulary.administration + module: + - entity_reference_validators + - tmgmt_content +third_party_settings: + entity_reference_validators: + circular_reference: false + circular_reference_deep: false + duplicate_reference: false + tmgmt_content: + excluded: false +id: node.digital_form.field_administration +field_name: field_administration +entity_type: node +bundle: digital_form +label: Section +description: '' +required: true +translatable: false +default_value: { } +default_value_callback: '' +settings: + handler: 'default:taxonomy_term' + handler_settings: + target_bundles: + administration: administration + sort: + field: name + direction: asc + auto_create: false + auto_create_bundle: '' +field_type: entity_reference diff --git a/config/sync/field.field.node.digital_form.field_last_saved_by_an_editor.yml b/config/sync/field.field.node.digital_form.field_last_saved_by_an_editor.yml new file mode 100644 index 0000000000..f9c9cdde26 --- /dev/null +++ b/config/sync/field.field.node.digital_form.field_last_saved_by_an_editor.yml @@ -0,0 +1,26 @@ +uuid: e173d8c9-2458-49d9-8406-7654da2c8882 +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_last_saved_by_an_editor + - node.type.digital_form + module: + - tmgmt_content +third_party_settings: + tmgmt_content: + excluded: false +id: node.digital_form.field_last_saved_by_an_editor +field_name: field_last_saved_by_an_editor +entity_type: node +bundle: digital_form +label: 'Last Saved by an Editor' +description: 'This is the last time an editor interacted with this content. This field is populated automatically when you click Save.' +required: false +translatable: false +default_value: + - + value: 1721337765 +default_value_callback: '' +settings: { } +field_type: timestamp diff --git a/config/sync/field.field.node.digital_form.field_meta_tags.yml b/config/sync/field.field.node.digital_form.field_meta_tags.yml new file mode 100644 index 0000000000..cf4e584858 --- /dev/null +++ b/config/sync/field.field.node.digital_form.field_meta_tags.yml @@ -0,0 +1,25 @@ +uuid: 065acdc6-1465-452e-8a8e-53c6ff7e37ca +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_meta_tags + - node.type.digital_form + module: + - metatag + - tmgmt_content +third_party_settings: + tmgmt_content: + excluded: false +id: node.digital_form.field_meta_tags +field_name: field_meta_tags +entity_type: node +bundle: digital_form +label: 'Meta tags' +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: { } +field_type: metatag diff --git a/config/sync/field.field.node.digital_form.field_omb_number.yml b/config/sync/field.field.node.digital_form.field_omb_number.yml new file mode 100644 index 0000000000..a15aa6e557 --- /dev/null +++ b/config/sync/field.field.node.digital_form.field_omb_number.yml @@ -0,0 +1,24 @@ +uuid: a74fa585-127b-49f9-9533-de900988e8b1 +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_omb_number + - node.type.digital_form + module: + - tmgmt_content +third_party_settings: + tmgmt_content: + excluded: false +id: node.digital_form.field_omb_number +field_name: field_omb_number +entity_type: node +bundle: digital_form +label: 'OMB Number' +description: 'Format: XXXX-XXXX' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: { } +field_type: string diff --git a/config/sync/field.field.node.digital_form.field_va_form_number.yml b/config/sync/field.field.node.digital_form.field_va_form_number.yml new file mode 100644 index 0000000000..aef7e36562 --- /dev/null +++ b/config/sync/field.field.node.digital_form.field_va_form_number.yml @@ -0,0 +1,24 @@ +uuid: fe73b81a-1e77-4f4b-83de-adad0de61a6d +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_va_form_number + - node.type.digital_form + module: + - tmgmt_content +third_party_settings: + tmgmt_content: + excluded: false +id: node.digital_form.field_va_form_number +field_name: field_va_form_number +entity_type: node +bundle: digital_form +label: 'Form number' +description: '' +required: true +translatable: false +default_value: { } +default_value_callback: '' +settings: { } +field_type: string diff --git a/config/sync/field.storage.node.field_omb_number.yml b/config/sync/field.storage.node.field_omb_number.yml new file mode 100644 index 0000000000..ec0823677a --- /dev/null +++ b/config/sync/field.storage.node.field_omb_number.yml @@ -0,0 +1,21 @@ +uuid: d58c3f28-790b-431a-aca4-bc19375656b5 +langcode: en +status: true +dependencies: + module: + - node +id: node.field_omb_number +field_name: field_omb_number +entity_type: node +type: string +settings: + max_length: 9 + case_sensitive: false + is_ascii: false +module: core +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/config/sync/language.content_settings.node.digital_form.yml b/config/sync/language.content_settings.node.digital_form.yml new file mode 100644 index 0000000000..371b1ba68c --- /dev/null +++ b/config/sync/language.content_settings.node.digital_form.yml @@ -0,0 +1,11 @@ +uuid: 86037389-4200-4677-ab95-7bdbe1df3d2b +langcode: en +status: true +dependencies: + config: + - node.type.digital_form +id: node.digital_form +target_entity_type_id: node +target_bundle: digital_form +default_langcode: site_default +language_alterable: false diff --git a/config/sync/node.type.digital_form.yml b/config/sync/node.type.digital_form.yml new file mode 100644 index 0000000000..8851740176 --- /dev/null +++ b/config/sync/node.type.digital_form.yml @@ -0,0 +1,30 @@ +uuid: 6f1de8af-5d0a-4775-9ca1-95a35c6ae032 +langcode: en +status: true +dependencies: + module: + - menu_force + - menu_ui + - node_revision_delete + - node_title_help_text +third_party_settings: + menu_ui: + available_menus: + - main + parent: 'main:' + node_title_help_text: + title_help: '' + menu_force: + menu_force: false + menu_force_parent: false + node_revision_delete: + minimum_revisions_to_keep: 50 + minimum_age_to_delete: 0 + when_to_delete: 0 +name: 'Digital Form' +type: digital_form +description: 'Configuration for an online form presented to Veterans.' +help: '' +new_revision: true +preview_mode: 0 +display_submitted: false diff --git a/config/sync/prometheus_exporter.settings.yml b/config/sync/prometheus_exporter.settings.yml index 0bf274533d..b81670bf1e 100644 --- a/config/sync/prometheus_exporter.settings.yml +++ b/config/sync/prometheus_exporter.settings.yml @@ -14,6 +14,7 @@ collectors: campaign_landing_page: campaign_landing_page centralized_content: centralized_content checklist: checklist + digital_form: digital_form documentation_page: documentation_page event: event event_listing: event_listing diff --git a/config/sync/workflows.workflow.editorial.yml b/config/sync/workflows.workflow.editorial.yml index 8f2215978c..ec9dacdbd8 100644 --- a/config/sync/workflows.workflow.editorial.yml +++ b/config/sync/workflows.workflow.editorial.yml @@ -13,6 +13,7 @@ dependencies: - node.type.campaign_landing_page - node.type.centralized_content - node.type.checklist + - node.type.digital_form - node.type.documentation_page - node.type.event - node.type.event_listing @@ -146,6 +147,7 @@ type_settings: - campaign_landing_page - centralized_content - checklist + - digital_form - documentation_page - event - event_listing diff --git a/docroot/modules/custom/va_gov_content_types/src/Entity/DigitalForm.php b/docroot/modules/custom/va_gov_content_types/src/Entity/DigitalForm.php new file mode 100644 index 0000000000..ded9b62280 --- /dev/null +++ b/docroot/modules/custom/va_gov_content_types/src/Entity/DigitalForm.php @@ -0,0 +1,10 @@ + DigitalForm::class, 'health_care_local_facility' => HealthCareLocalFacility::class, 'event' => Event::class, ]; diff --git a/tests/phpunit/va_gov_content_types/functional/Entity/DigitalFormTest.php b/tests/phpunit/va_gov_content_types/functional/Entity/DigitalFormTest.php new file mode 100644 index 0000000000..c4c3b4f7c5 --- /dev/null +++ b/tests/phpunit/va_gov_content_types/functional/Entity/DigitalFormTest.php @@ -0,0 +1,40 @@ + '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'] + ); + } + +}