From 8a3434f44667a7b8bae514a5082f5a8f77ee1d54 Mon Sep 17 00:00:00 2001 From: Dave Pickett <51967950+davidmpickett@users.noreply.github.com> Date: Tue, 10 Dec 2024 15:12:57 -0600 Subject: [PATCH 1/4] VACMS-19512: Drupal UX for phone numbers (#19607) * Update staff profile & vamc b&i * VAMC facility mental health * fix truncated confirmation message * reverting previous change & removing empty fieldset * finish reverting SCSS change * SCSS updates to phone number paragraph * adding ids for specificity * what about twig * Rolling back CSS and Twig. Adding fieldset wrapping * VACMS-19512: Updates SCSS for clarity and DS alignment * VACMS-19512: Updates test for phone widget --------- Co-authored-by: Christian Burk <766573+omahane@users.noreply.github.com> --- ...ode.health_care_local_facility.default.yml | 46 ++++++------ ...rm_display.node.person_profile.default.yml | 70 +++++++++++-------- ....vamc_system_billing_insurance.default.yml | 62 ++++++++-------- ...cal_facility.field_mental_health_phone.yml | 2 +- ...th_care_local_facility.field_telephone.yml | 2 +- .../assets/scss/components/_fields.scss | 10 +++ .../content_type/person_profile.feature | 4 +- 7 files changed, 108 insertions(+), 88 deletions(-) diff --git a/config/sync/core.entity_form_display.node.health_care_local_facility.default.yml b/config/sync/core.entity_form_display.node.health_care_local_facility.default.yml index db9fb178fa..b09a71535b 100644 --- a/config/sync/core.entity_form_display.node.health_care_local_facility.default.yml +++ b/config/sync/core.entity_form_display.node.health_care_local_facility.default.yml @@ -159,7 +159,6 @@ third_party_settings: group_locations_and_contact_info: children: - group_facility_data_from_vast - - field_mental_health_phone label: 'Locations and contact information' region: content parent_name: '' @@ -219,6 +218,23 @@ third_party_settings: effect: none speed: fast required_fields: false + group_mental_health_phone_number: + children: + - field_mental_health_phone + - field_telephone + label: 'Mental health phone number' + region: content + parent_name: '' + weight: 2 + format_type: fieldset + format_settings: + classes: '' + show_empty_fields: true + id: '' + label_as_html: false + description: 'Enter the number Veterans should call to access mental health services at your facility. If your facility doesn''t offer these services, enter the most appropriate system number. This number will be displayed everywhere your facility appears across VA.gov. View guidelines for editing VAMC facilities (opens in a new tab)' + required_fields: true + description_display: after id: node.health_care_local_facility.default targetEntityType: node bundle: health_care_local_facility @@ -307,7 +323,7 @@ content: third_party_settings: { } field_main_location: type: boolean_checkbox - weight: 22 + weight: 21 region: content settings: display_label: true @@ -374,31 +390,17 @@ content: settings: { } third_party_settings: { } field_telephone: - type: paragraphs - weight: 1 + type: entity_reference_paragraphs + weight: 22 region: content settings: - title: Paragraph - title_plural: Paragraphs + title: 'phone number' + title_plural: 'phone number' edit_mode: open - closed_mode: summary - autocollapse: none - closed_mode_threshold: 0 - add_mode: dropdown + add_mode: button form_display_mode: default default_paragraph_type: phone_number - features: - add_above: '0' - collapse_edit_all: collapse_edit_all - convert: '0' - duplicate: duplicate - third_party_settings: - paragraphs_features: - add_in_between: false - add_in_between_link_count: 3 - delete_confirmation: false - show_drag_and_drop: true - show_collapse_all: true + third_party_settings: { } field_timezone: type: tzfield_default weight: 30 diff --git a/config/sync/core.entity_form_display.node.person_profile.default.yml b/config/sync/core.entity_form_display.node.person_profile.default.yml index a7215a2a60..1bc01b2277 100644 --- a/config/sync/core.entity_form_display.node.person_profile.default.yml +++ b/config/sync/core.entity_form_display.node.person_profile.default.yml @@ -40,7 +40,7 @@ third_party_settings: label: 'Section settings' region: content parent_name: '' - weight: 8 + weight: 9 format_type: details_sidebar format_settings: classes: '' @@ -71,7 +71,7 @@ third_party_settings: label: Name region: content parent_name: '' - weight: 2 + weight: 3 format_type: fieldset format_settings: classes: '' @@ -81,12 +81,11 @@ third_party_settings: group_contact_info: children: - field_email_address - - field_phone_number - - field_telephone + - group_phone_number label: 'Contact info' region: content parent_name: '' - weight: 3 + weight: 4 format_type: fieldset format_settings: classes: '' @@ -100,7 +99,7 @@ third_party_settings: label: Photo region: content parent_name: '' - weight: 4 + weight: 5 format_type: fieldset format_settings: classes: '' @@ -117,7 +116,7 @@ third_party_settings: label: Bio region: content parent_name: '' - weight: 5 + weight: 6 format_type: fieldset format_settings: classes: '' @@ -137,6 +136,23 @@ third_party_settings: id: '' description: '' required_fields: true + group_phone_number: + children: + - field_phone_number + - field_telephone + label: 'Phone number' + region: content + parent_name: group_contact_info + weight: 6 + format_type: fieldset + format_settings: + classes: '' + show_empty_fields: false + id: '' + label_as_html: false + description: '' + required_fields: true + description_display: after id: node.person_profile.default targetEntityType: node bundle: person_profile @@ -150,7 +166,7 @@ content: third_party_settings: { } field_body: type: text_textarea - weight: 13 + weight: 17 region: content settings: rows: 5 @@ -158,21 +174,21 @@ content: third_party_settings: { } field_complete_biography: type: file_generic - weight: 14 + weight: 18 region: content settings: progress_indicator: throbber third_party_settings: { } field_complete_biography_create: type: boolean_checkbox - weight: 11 + weight: 15 region: content settings: display_label: true third_party_settings: { } field_description: type: string_textfield - weight: 6 + weight: 7 region: content settings: size: 60 @@ -188,7 +204,7 @@ content: third_party_settings: { } field_intro_text: type: string_textarea_with_counter - weight: 12 + weight: 16 region: content settings: rows: 5 @@ -231,13 +247,13 @@ content: third_party_settings: { } field_office: type: options_select - weight: 1 + weight: 2 region: content settings: { } third_party_settings: { } field_phone_number: type: telephone_default - weight: 6 + weight: 7 region: content settings: placeholder: '' @@ -251,39 +267,33 @@ content: third_party_settings: { } field_suffix: type: string_textfield - weight: 5 + weight: 6 region: content settings: size: 60 placeholder: '' third_party_settings: { } field_telephone: - type: paragraphs - weight: 7 + type: entity_reference_paragraphs + weight: 8 region: content settings: - title: Paragraph - title_plural: Paragraphs + title: 'phone number' + title_plural: 'phone numbers' edit_mode: open - closed_mode: summary - autocollapse: none - closed_mode_threshold: 0 - add_mode: dropdown + add_mode: button form_display_mode: default - default_paragraph_type: '' - features: - collapse_edit_all: collapse_edit_all - duplicate: duplicate + default_paragraph_type: _none third_party_settings: { } moderation_state: type: moderation_state_default - weight: 13 + weight: 12 region: content settings: { } third_party_settings: { } path: type: path - weight: 6 + weight: 7 region: content settings: { } third_party_settings: { } @@ -296,7 +306,7 @@ content: placeholder: '' third_party_settings: { } url_redirects: - weight: 7 + weight: 8 region: content settings: { } third_party_settings: { } diff --git a/config/sync/core.entity_form_display.node.vamc_system_billing_insurance.default.yml b/config/sync/core.entity_form_display.node.vamc_system_billing_insurance.default.yml index 36c3a150ea..0d2243732e 100644 --- a/config/sync/core.entity_form_display.node.vamc_system_billing_insurance.default.yml +++ b/config/sync/core.entity_form_display.node.vamc_system_billing_insurance.default.yml @@ -90,7 +90,7 @@ third_party_settings: label: 'National top of page content' region: content parent_name: '' - weight: 6 + weight: 7 format_type: tooltip format_settings: show_label: '0' @@ -105,13 +105,12 @@ third_party_settings: attributes: '' group_inquiries_about_copay: children: - - field_phone_number - - field_telephone + - group_phone_number - field_office_hours label: 'For inquiries by phone about copay balance' region: content parent_name: '' - weight: 5 + weight: 6 format_type: details format_settings: classes: '' @@ -121,20 +120,6 @@ third_party_settings: description: '' required_fields: false formatter: closed - group_cashier_s_office: - children: { } - label: "Cashier's office" - region: content - parent_name: '' - weight: 7 - format_type: details - format_settings: - classes: '' - show_empty_fields: true - id: '' - open: true - description: '' - required_fields: false group_national_above_top_of_page: children: - field_cc_above_top_of_page @@ -154,6 +139,23 @@ third_party_settings: element: div label_element: h3 attributes: '' + group_phone_number: + children: + - field_phone_number + - field_telephone + label: 'Phone number' + region: content + parent_name: group_inquiries_about_copay + weight: 5 + format_type: fieldset + format_settings: + classes: '' + show_empty_fields: false + id: '' + label_as_html: false + description: '' + required_fields: true + description_display: after id: node.vamc_system_billing_insurance.default targetEntityType: node bundle: vamc_system_billing_insurance @@ -235,39 +237,33 @@ content: third_party_settings: { } field_office_hours: type: office_hours_default - weight: 10 + weight: 6 region: content settings: collapsed: false third_party_settings: { } field_phone_number: type: telephone_default - weight: 8 + weight: 10 region: content settings: placeholder: '' third_party_settings: { } field_telephone: - type: paragraphs - weight: 9 + type: entity_reference_paragraphs + weight: 11 region: content settings: - title: Paragraph - title_plural: Paragraphs + title: 'phone number' + title_plural: 'phone numbers' edit_mode: open - closed_mode: summary - autocollapse: none - closed_mode_threshold: 0 - add_mode: dropdown + add_mode: button form_display_mode: default - default_paragraph_type: '' - features: - collapse_edit_all: collapse_edit_all - duplicate: duplicate + default_paragraph_type: phone_number third_party_settings: { } moderation_state: type: moderation_state_default - weight: 7 + weight: 12 region: content settings: { } third_party_settings: { } diff --git a/config/sync/field.field.node.health_care_local_facility.field_mental_health_phone.yml b/config/sync/field.field.node.health_care_local_facility.field_mental_health_phone.yml index 4643e7ea8e..ff107baf8e 100644 --- a/config/sync/field.field.node.health_care_local_facility.field_mental_health_phone.yml +++ b/config/sync/field.field.node.health_care_local_facility.field_mental_health_phone.yml @@ -16,7 +16,7 @@ field_name: field_mental_health_phone entity_type: node bundle: health_care_local_facility label: 'Mental health phone number' -description: 'Enter the number Veterans should call to access mental health services at your facility, for example 202-555-1234, ext. 23. If your facility doesn''t offer these services, enter the most appropriate system number. This number will be displayed everywhere your facility appears across VA.gov. View guidelines for editing VAMC facilities (opens in a new tab)' +description: '' required: false translatable: false default_value: { } diff --git a/config/sync/field.field.node.health_care_local_facility.field_telephone.yml b/config/sync/field.field.node.health_care_local_facility.field_telephone.yml index b2853d4970..4d7d6a0a67 100644 --- a/config/sync/field.field.node.health_care_local_facility.field_telephone.yml +++ b/config/sync/field.field.node.health_care_local_facility.field_telephone.yml @@ -17,7 +17,7 @@ field_name: field_telephone entity_type: node bundle: health_care_local_facility label: 'Mental health phone number' -description: 'Enter the number Veterans should call to access mental health services at your facility. If your facility doesn''t offer these services, enter the most appropriate system number. This number will be displayed everywhere your facility appears across VA.gov. View guidelines for editing VAMC facilities (opens in a new tab)' +description: '' required: false translatable: false default_value: { } diff --git a/docroot/themes/custom/vagovclaro/assets/scss/components/_fields.scss b/docroot/themes/custom/vagovclaro/assets/scss/components/_fields.scss index 11dd8e5f66..882b306f24 100644 --- a/docroot/themes/custom/vagovclaro/assets/scss/components/_fields.scss +++ b/docroot/themes/custom/vagovclaro/assets/scss/components/_fields.scss @@ -1,3 +1,13 @@ +#edit-field-telephone-wrapper { + .paragraph-type-title { + font-weight: bold; + } + + em { + font-style: normal; + } +} + .field--name-field-phone-number { .form-type-textfield { float: left; diff --git a/tests/cypress/integration/features/content_type/person_profile.feature b/tests/cypress/integration/features/content_type/person_profile.feature index 3f06d39c31..fbab9a7b29 100644 --- a/tests/cypress/integration/features/content_type/person_profile.feature +++ b/tests/cypress/integration/features/content_type/person_profile.feature @@ -12,7 +12,9 @@ Scenario: Log in and create a Person Profile with attention to conditional field And I fill in "First name" with "James" And I fill in "Last name" with "Smith" - And I fill in field with selector "#edit-field-telephone-0-subform-field-phone-number-0-value" with value "402-867-5309" + And I click the "Add Phone number" button + And I wait "5" seconds + And I fill in field with selector "[data-drupal-selector='edit-field-telephone-0-subform-field-phone-number-0-value']" with value "402-867-5309" And I fill in field with selector "#edit-revision-log-0-value" with value "[Test Data] Revision log message." And I click the "Save" button Then I should see "Staff Profile James Smith has been created." From ed635cc9bc23c8cd2eb1ec5c4dbb3af45eb4e2a9 Mon Sep 17 00:00:00 2001 From: Ryan Koch <6863534+ryguyk@users.noreply.github.com> Date: Tue, 10 Dec 2024 17:31:39 -0600 Subject: [PATCH 2/4] VAGOV-TEAM-97904: Adds Form Builder Page Template (#20052) * VAGOV-TEAM-97904: - Adds Twig template for Form Builder pages. - Applies template to all Form Builder routes. * Adds unit test for va_gov_form_builder_theme_suggestions_page(). --- .../page--va-gov-form-builder.html.twig | 40 +++++++ .../va_gov_form_builder.module | 27 +++++ .../templates/FormBuilderPageTemplateTest.php | 66 ++++++++++++ .../va_gov_form_builder/unit/ModuleTest.php | 102 ++++++++++++++++++ 4 files changed, 235 insertions(+) create mode 100644 docroot/modules/custom/va_gov_form_builder/templates/page--va-gov-form-builder.html.twig create mode 100644 tests/phpunit/va_gov_form_builder/functional/templates/FormBuilderPageTemplateTest.php create mode 100644 tests/phpunit/va_gov_form_builder/unit/ModuleTest.php diff --git a/docroot/modules/custom/va_gov_form_builder/templates/page--va-gov-form-builder.html.twig b/docroot/modules/custom/va_gov_form_builder/templates/page--va-gov-form-builder.html.twig new file mode 100644 index 0000000000..86efcd7ae3 --- /dev/null +++ b/docroot/modules/custom/va_gov_form_builder/templates/page--va-gov-form-builder.html.twig @@ -0,0 +1,40 @@ +{# +/** + * @file + * VA.gov Form Builder's implementation of a single page. + * + * Nearly identical to VAgovClaro's implementation, except: + * - An outermost page container has been added. + * - The header includes additional content (navbar, eventually) + * - Breadcrumbs have been removed + * + * For more information: + * @see docroot/themes/custom/vagovclaro/templates/page/page.html.twig + */ +#} +