From c8e2dbd4145db55dbe0cc9ef2effa63e265e4aff Mon Sep 17 00:00:00 2001 From: Aaron Zinck Date: Fri, 23 Dec 2022 14:28:40 -0500 Subject: [PATCH 01/82] EPAD8-1981 initial work to get Layout Paragraphs working more smoothly with our custom code --- services/drupal/composer.json | 1 + services/drupal/composer.lock | 62 ++++++++++++++++++- .../modules/custom/epa_core/epa_core.module | 5 +- .../templates/epa-column-layout.twig | 36 +++++------ 4 files changed, 81 insertions(+), 23 deletions(-) diff --git a/services/drupal/composer.json b/services/drupal/composer.json index 59fd7ebf97..435c96f42d 100644 --- a/services/drupal/composer.json +++ b/services/drupal/composer.json @@ -271,6 +271,7 @@ "drupal/layout_builder_iframe_modal": "^1.0", "drupal/layout_builder_modal": "^1.0", "drupal/layout_builder_restrictions": "^2.7", + "drupal/layout_paragraphs": "^2.0", "drupal/linked_field": "^1.3", "drupal/linkit": "^5.0-beta12", "drupal/linkit_telephone": "^1.0@dev", diff --git a/services/drupal/composer.lock b/services/drupal/composer.lock index 5cbaeee220..f96e15fb77 100644 --- a/services/drupal/composer.lock +++ b/services/drupal/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "d523272b018cd704338b943ace6d2b8f", + "content-hash": "d540aa33400e35faa70c877d332f2324", "packages": [ { "name": "algolia/places", @@ -6686,6 +6686,64 @@ "source": "https://git.drupalcode.org/project/layout_builder_restrictions" } }, + { + "name": "drupal/layout_paragraphs", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://git.drupalcode.org/project/layout_paragraphs.git", + "reference": "2.0.2" + }, + "dist": { + "type": "zip", + "url": "https://ftp.drupal.org/files/projects/layout_paragraphs-2.0.2.zip", + "reference": "2.0.2", + "shasum": "5157a05120d81f0978093ddbdf92c3ead2e11010" + }, + "require": { + "drupal/core": "^9.1 || ^10", + "drupal/paragraphs": "^1.6" + }, + "require-dev": { + "drupal/block_field": "~1.0", + "drupal/entity_usage": "2.x-dev", + "drupal/paragraphs-paragraphs_library": "*" + }, + "type": "drupal-module", + "extra": { + "drupal": { + "version": "2.0.2", + "datestamp": "1671393681", + "security-coverage": { + "status": "covered", + "message": "Covered by Drupal's security advisory policy" + } + } + }, + "notification-url": "https://packages.drupal.org/8/downloads", + "license": [ + "GPL-2.0+" + ], + "authors": [ + { + "name": "itamair", + "homepage": "https://www.drupal.org/user/1179076" + }, + { + "name": "justin2pin", + "homepage": "https://www.drupal.org/user/278450" + } + ], + "description": "Layout Paragraphs", + "homepage": "https://www.drupal.org/project/layout_paragraphs", + "keywords": [ + "Drupal" + ], + "support": { + "source": "http://cgit.drupalcode.org/layout_paragraphs", + "issues": "https://www.drupal.org/project/issues/layout_paragraphs" + } + }, { "name": "drupal/linked_field", "version": "1.3.0", @@ -20829,5 +20887,5 @@ "ext-pdo": "1.0.0", "php": "8.0" }, - "plugin-api-version": "2.2.0" + "plugin-api-version": "2.3.0" } diff --git a/services/drupal/web/modules/custom/epa_core/epa_core.module b/services/drupal/web/modules/custom/epa_core/epa_core.module index 2739361708..df5d1ab2a7 100644 --- a/services/drupal/web/modules/custom/epa_core/epa_core.module +++ b/services/drupal/web/modules/custom/epa_core/epa_core.module @@ -98,7 +98,10 @@ function epa_core_form_node_form_alter(&$form, FormStateInterface $form_state, $ $submit_copy = $form['actions']['submit']; $submit_copy['#group'] = 'revision_information'; $submit_copy['#weight'] = 100; - $form['revision_information']['submit_copy'] = $submit_copy; + $form['revision_information']['actions'] = [ + '#type' => "actions", + 'submit' => $submit_copy, + ]; } switch ($form_id) { diff --git a/services/drupal/web/modules/custom/epa_layouts/templates/epa-column-layout.twig b/services/drupal/web/modules/custom/epa_layouts/templates/epa-column-layout.twig index 849cd62b98..b3e9695d51 100644 --- a/services/drupal/web/modules/custom/epa_layouts/templates/epa-column-layout.twig +++ b/services/drupal/web/modules/custom/epa_layouts/templates/epa-column-layout.twig @@ -1,22 +1,18 @@ {% set columns = 0 %} -{% set content_first = content.first|render %} -{% set content_second = content.second|render %} -{% set content_third = content.third|render %} -{% set content_fourth = content.fourth|render %} -{% if content_first %} +{% if content.first %} {% set columns = columns + 1 %} {% endif %} -{% if content_second %} +{% if content.second %} {% set columns = columns + 1 %} {% endif %} -{% if content_third %} +{% if content.third %} {% set columns = columns + 1 %} {% endif %} -{% if content_fourth %} +{% if content.fourth %} {% set columns = columns + 1 %} {% endif %} @@ -29,25 +25,25 @@ ] %} - {% if content_first %} - {{ content_first }} + {% if content.first %} + {{ content.first }} {% endif %} - {% if content_second %} - {{ content_second }} + {% if content.second %} + {{ content.second }} {% endif %} - {% if content_third %} - {{ content_third }} + {% if content.third %} + {{ content.third }} {% endif %} - {% if content_fourth %} - {{ content_fourth }} + {% if content.fourth %} + {{ content.fourth }} {% endif %} {% else %} - {{ content_first }} - {{ content_second }} - {{ content_third }} - {{ content_fourth }} + {{ content.first }} + {{ content.second }} + {{ content.third }} + {{ content.fourth }} {% endif %} From 2842760a16427fb0995d354015cec8d4f94e6a5e Mon Sep 17 00:00:00 2001 From: Aaron Zinck Date: Fri, 23 Dec 2022 15:48:51 -0500 Subject: [PATCH 02/82] EPAD8-1981 initial configuration of section paragraph and new wide content field --- ...ity_form_display.node.web_area.default.yml | 38 ++++-- ...ity_view_display.node.web_area.default.yml | 27 ++++ ...entity_view_display.node.web_area.full.yml | 2 + ...entity_view_display.node.web_area.link.yml | 2 + ...iew_display.node.web_area.search_index.yml | 2 + ...tity_view_display.node.web_area.teaser.yml | 2 + ...ntity_view_display.node.web_area.token.yml | 2 + .../drupal/config/sync/core.extension.yml | 1 + ...field.node.web_area.field_wide_content.yml | 117 ++++++++++++++++++ .../field.storage.node.field_wide_content.yml | 21 ++++ .../sync/layout_paragraphs.modal_settings.yml | 5 + .../sync/layout_paragraphs.settings.yml | 7 ++ .../paragraphs.paragraphs_type.section.yml | 16 +++ .../sync/search_api.index.news_releases.yml | 2 +- .../sync/search_api.index.perspectives.yml | 2 +- services/drupal/config/sync/system.mail.yml | 1 + .../epa_layouts/epa_layouts.layouts.yml | 10 ++ .../epa_layouts/layouts/epa-section.html.twig | 25 ++++ 18 files changed, 267 insertions(+), 15 deletions(-) create mode 100644 services/drupal/config/sync/field.field.node.web_area.field_wide_content.yml create mode 100644 services/drupal/config/sync/field.storage.node.field_wide_content.yml create mode 100644 services/drupal/config/sync/layout_paragraphs.modal_settings.yml create mode 100644 services/drupal/config/sync/layout_paragraphs.settings.yml create mode 100644 services/drupal/config/sync/paragraphs.paragraphs_type.section.yml create mode 100644 services/drupal/web/modules/custom/epa_layouts/layouts/epa-section.html.twig diff --git a/services/drupal/config/sync/core.entity_form_display.node.web_area.default.yml b/services/drupal/config/sync/core.entity_form_display.node.web_area.default.yml index e493dbdb12..03d6ef91cf 100644 --- a/services/drupal/config/sync/core.entity_form_display.node.web_area.default.yml +++ b/services/drupal/config/sync/core.entity_form_display.node.web_area.default.yml @@ -20,6 +20,7 @@ dependencies: - field.field.node.web_area.field_scheduled_transition - field.field.node.web_area.field_search_text - field.field.node.web_area.field_type + - field.field.node.web_area.field_wide_content - field.field.node.web_area.layout_builder__layout - node.type.web_area - workflows.workflow.epa_default @@ -28,6 +29,7 @@ dependencies: - datetime - entitygroupfield - field_group + - layout_paragraphs - paragraphs - shs third_party_settings: @@ -89,7 +91,7 @@ third_party_settings: label: 'Additional Fields' region: content parent_name: '' - weight: 5 + weight: 6 format_type: tabs format_settings: classes: '' @@ -102,7 +104,7 @@ mode: default content: created: type: datetime_timestamp - weight: 7 + weight: 8 region: content settings: { } third_party_settings: { } @@ -130,7 +132,7 @@ content: third_party_settings: { } field_channel: type: options_buttons - weight: 13 + weight: 14 region: content settings: { } third_party_settings: { } @@ -149,7 +151,7 @@ content: maxlength_js_truncate_html: false field_env_laws_regs_and_treaties: type: options_shs - weight: 15 + weight: 16 region: content settings: display_node_count: false @@ -165,7 +167,7 @@ content: third_party_settings: { } field_geographic_locations: type: options_shs - weight: 14 + weight: 15 region: content settings: display_node_count: false @@ -175,7 +177,7 @@ content: third_party_settings: { } field_keywords: type: entity_reference_autocomplete_tags - weight: 11 + weight: 12 region: content settings: match_operator: CONTAINS @@ -228,10 +230,20 @@ content: third_party_settings: { } field_type: type: options_select - weight: 12 + weight: 13 region: content settings: { } third_party_settings: { } + field_wide_content: + type: layout_paragraphs + weight: 5 + region: content + settings: + preview_view_mode: default + nesting_depth: 0 + require_layouts: 1 + empty_message: '' + third_party_settings: { } langcode: type: language_select weight: 3 @@ -241,27 +253,27 @@ content: third_party_settings: { } moderation_state: type: moderation_state_default - weight: 11 + weight: 12 region: content settings: { } third_party_settings: { } promote: type: boolean_checkbox - weight: 8 + weight: 9 region: content settings: display_label: true third_party_settings: { } status: type: boolean_checkbox - weight: 10 + weight: 11 region: content settings: display_label: true third_party_settings: { } sticky: type: boolean_checkbox - weight: 9 + weight: 10 region: content settings: display_label: true @@ -276,7 +288,7 @@ content: third_party_settings: { } uid: type: entity_reference_autocomplete - weight: 6 + weight: 7 region: content settings: match_operator: CONTAINS @@ -285,7 +297,7 @@ content: placeholder: '' third_party_settings: { } url_redirects: - weight: 12 + weight: 13 region: content settings: { } third_party_settings: { } diff --git a/services/drupal/config/sync/core.entity_view_display.node.web_area.default.yml b/services/drupal/config/sync/core.entity_view_display.node.web_area.default.yml index 40fe5d61fa..4f306bd8ec 100644 --- a/services/drupal/config/sync/core.entity_view_display.node.web_area.default.yml +++ b/services/drupal/config/sync/core.entity_view_display.node.web_area.default.yml @@ -20,6 +20,7 @@ dependencies: - field.field.node.web_area.field_scheduled_transition - field.field.node.web_area.field_search_text - field.field.node.web_area.field_type + - field.field.node.web_area.field_wide_content - field.field.node.web_area.layout_builder__layout - node.type.web_area module: @@ -75,6 +76,23 @@ third_party_settings: token: '' weight: 0 additional: { } + 476e0f5c-5396-47dd-9ee0-e7703afbd437: + uuid: 476e0f5c-5396-47dd-9ee0-e7703afbd437 + region: main + configuration: + id: 'field_block:node:web_area:field_wide_content' + label_display: '0' + context_mapping: + entity: layout_builder.entity + formatter: + type: entity_reference_revisions_entity_view + label: above + settings: + view_mode: default + link: '' + third_party_settings: { } + weight: 1 + additional: { } third_party_settings: { } layout_builder_restrictions: allowed_block_categories: @@ -261,6 +279,15 @@ content: third_party_settings: { } weight: 106 region: content + field_wide_content: + type: entity_reference_revisions_entity_view + label: above + settings: + view_mode: default + link: '' + third_party_settings: { } + weight: 136 + region: main links: settings: { } third_party_settings: { } diff --git a/services/drupal/config/sync/core.entity_view_display.node.web_area.full.yml b/services/drupal/config/sync/core.entity_view_display.node.web_area.full.yml index 449474fcac..ca605a9dcd 100644 --- a/services/drupal/config/sync/core.entity_view_display.node.web_area.full.yml +++ b/services/drupal/config/sync/core.entity_view_display.node.web_area.full.yml @@ -21,6 +21,7 @@ dependencies: - field.field.node.web_area.field_scheduled_transition - field.field.node.web_area.field_search_text - field.field.node.web_area.field_type + - field.field.node.web_area.field_wide_content - field.field.node.web_area.layout_builder__layout - node.type.web_area module: @@ -211,6 +212,7 @@ hidden: field_banner: true field_last_published: true field_search_text: true + field_wide_content: true langcode: true layout_builder__layout: true search_api_excerpt: true diff --git a/services/drupal/config/sync/core.entity_view_display.node.web_area.link.yml b/services/drupal/config/sync/core.entity_view_display.node.web_area.link.yml index 6e92992234..e872ee379f 100644 --- a/services/drupal/config/sync/core.entity_view_display.node.web_area.link.yml +++ b/services/drupal/config/sync/core.entity_view_display.node.web_area.link.yml @@ -21,6 +21,7 @@ dependencies: - field.field.node.web_area.field_scheduled_transition - field.field.node.web_area.field_search_text - field.field.node.web_area.field_type + - field.field.node.web_area.field_wide_content - field.field.node.web_area.layout_builder__layout - node.type.web_area module: @@ -94,6 +95,7 @@ hidden: field_scheduled_transition: true field_search_text: true field_type: true + field_wide_content: true langcode: true layout_builder__layout: true links: true diff --git a/services/drupal/config/sync/core.entity_view_display.node.web_area.search_index.yml b/services/drupal/config/sync/core.entity_view_display.node.web_area.search_index.yml index 6646e3bb04..2fcb92d73a 100644 --- a/services/drupal/config/sync/core.entity_view_display.node.web_area.search_index.yml +++ b/services/drupal/config/sync/core.entity_view_display.node.web_area.search_index.yml @@ -21,6 +21,7 @@ dependencies: - field.field.node.web_area.field_scheduled_transition - field.field.node.web_area.field_search_text - field.field.node.web_area.field_type + - field.field.node.web_area.field_wide_content - field.field.node.web_area.layout_builder__layout - node.type.web_area module: @@ -111,6 +112,7 @@ hidden: field_scheduled_transition: true field_search_text: true field_type: true + field_wide_content: true langcode: true layout_builder__layout: true links: true diff --git a/services/drupal/config/sync/core.entity_view_display.node.web_area.teaser.yml b/services/drupal/config/sync/core.entity_view_display.node.web_area.teaser.yml index bf6e3c7b34..628bb345fe 100644 --- a/services/drupal/config/sync/core.entity_view_display.node.web_area.teaser.yml +++ b/services/drupal/config/sync/core.entity_view_display.node.web_area.teaser.yml @@ -21,6 +21,7 @@ dependencies: - field.field.node.web_area.field_scheduled_transition - field.field.node.web_area.field_search_text - field.field.node.web_area.field_type + - field.field.node.web_area.field_wide_content - field.field.node.web_area.layout_builder__layout - node.type.web_area module: @@ -58,6 +59,7 @@ hidden: field_scheduled_transition: true field_search_text: true field_type: true + field_wide_content: true langcode: true layout_builder__layout: true links: true diff --git a/services/drupal/config/sync/core.entity_view_display.node.web_area.token.yml b/services/drupal/config/sync/core.entity_view_display.node.web_area.token.yml index e771bad929..512cdf9b7a 100644 --- a/services/drupal/config/sync/core.entity_view_display.node.web_area.token.yml +++ b/services/drupal/config/sync/core.entity_view_display.node.web_area.token.yml @@ -21,6 +21,7 @@ dependencies: - field.field.node.web_area.field_scheduled_transition - field.field.node.web_area.field_search_text - field.field.node.web_area.field_type + - field.field.node.web_area.field_wide_content - field.field.node.web_area.layout_builder__layout - node.type.web_area module: @@ -199,5 +200,6 @@ hidden: content_moderation_control: true entitygroupfield: true field_search_text: true + field_wide_content: true layout_builder__layout: true search_api_excerpt: true diff --git a/services/drupal/config/sync/core.extension.yml b/services/drupal/config/sync/core.extension.yml index 1b66a6ff44..f16b9b6812 100644 --- a/services/drupal/config/sync/core.extension.yml +++ b/services/drupal/config/sync/core.extension.yml @@ -116,6 +116,7 @@ module: layout_builder_iframe_modal: 0 layout_builder_restrictions: 0 layout_discovery: 0 + layout_paragraphs: 0 link: 0 linkit: 0 linkit_telephone: 0 diff --git a/services/drupal/config/sync/field.field.node.web_area.field_wide_content.yml b/services/drupal/config/sync/field.field.node.web_area.field_wide_content.yml new file mode 100644 index 0000000000..ea69ceff97 --- /dev/null +++ b/services/drupal/config/sync/field.field.node.web_area.field_wide_content.yml @@ -0,0 +1,117 @@ +uuid: c01f5dfe-8338-4caf-b506-5331a504dc7a +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_wide_content + - node.type.web_area + - paragraphs.paragraphs_type.before_after_swipe_component + - paragraphs.paragraphs_type.box + - paragraphs.paragraphs_type.card_group + - paragraphs.paragraphs_type.dynamic_list + - paragraphs.paragraphs_type.from_library + - paragraphs.paragraphs_type.header + - paragraphs.paragraphs_type.html + - paragraphs.paragraphs_type.link_list + - paragraphs.paragraphs_type.section + - paragraphs.paragraphs_type.slideshow + module: + - custom_add_another + - entity_reference_revisions +third_party_settings: + custom_add_another: + custom_add_another: '' + custom_remove: '' +id: node.web_area.field_wide_content +field_name: field_wide_content +entity_type: node +bundle: web_area +label: 'Wide Content' +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + handler: 'default:paragraph' + handler_settings: + target_bundles: + before_after_swipe_component: before_after_swipe_component + box: box + card_group: card_group + dynamic_list: dynamic_list + from_library: from_library + header: header + html: html + link_list: link_list + section: section + slideshow: slideshow + negate: 0 + target_bundles_drag_drop: + applicants_or_respondents: + weight: 22 + enabled: false + author: + weight: 23 + enabled: false + banner: + weight: 24 + enabled: false + banner_slide: + weight: 25 + enabled: false + before_after_swipe_component: + weight: 26 + enabled: true + box: + weight: 27 + enabled: true + card: + weight: 28 + enabled: false + card_group: + weight: 29 + enabled: true + cfr: + weight: 30 + enabled: false + docket: + weight: 31 + enabled: false + dynamic_list: + weight: 32 + enabled: true + frc: + weight: 33 + enabled: false + from_library: + weight: 34 + enabled: true + header: + weight: 35 + enabled: true + html: + weight: 36 + enabled: true + legal_authorities: + weight: 37 + enabled: false + link_list: + weight: 38 + enabled: true + locations_of_prop_actions: + weight: 39 + enabled: false + press_officers: + weight: 40 + enabled: false + section: + weight: 42 + enabled: true + slide: + weight: 41 + enabled: false + slideshow: + weight: 42 + enabled: true +field_type: entity_reference_revisions diff --git a/services/drupal/config/sync/field.storage.node.field_wide_content.yml b/services/drupal/config/sync/field.storage.node.field_wide_content.yml new file mode 100644 index 0000000000..21ed24cd92 --- /dev/null +++ b/services/drupal/config/sync/field.storage.node.field_wide_content.yml @@ -0,0 +1,21 @@ +uuid: d9cb3ee8-a106-4c7e-8589-a1263d58fd6e +langcode: en +status: true +dependencies: + module: + - entity_reference_revisions + - node + - paragraphs +id: node.field_wide_content +field_name: field_wide_content +entity_type: node +type: entity_reference_revisions +settings: + target_type: paragraph +module: entity_reference_revisions +locked: false +cardinality: -1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/services/drupal/config/sync/layout_paragraphs.modal_settings.yml b/services/drupal/config/sync/layout_paragraphs.modal_settings.yml new file mode 100644 index 0000000000..a249e02acc --- /dev/null +++ b/services/drupal/config/sync/layout_paragraphs.modal_settings.yml @@ -0,0 +1,5 @@ +_core: + default_config_hash: z9zmTNfo1bY0sbqYp1OAvqSynu_DXDRdJoZhi7oiS0I +width: 90% +height: auto +autoresize: true diff --git a/services/drupal/config/sync/layout_paragraphs.settings.yml b/services/drupal/config/sync/layout_paragraphs.settings.yml new file mode 100644 index 0000000000..e5ac1baf07 --- /dev/null +++ b/services/drupal/config/sync/layout_paragraphs.settings.yml @@ -0,0 +1,7 @@ +_core: + default_config_hash: HBy2Jf-2HHsgvIjldhAl07r9vuy879dsx6Cm_LpbPrw +show_paragraph_labels: 0 +show_layout_labels: 0 +paragraph_behaviors_label: Behaviors +paragraph_behaviors_position: -99 +empty_message: 'No components to add.' diff --git a/services/drupal/config/sync/paragraphs.paragraphs_type.section.yml b/services/drupal/config/sync/paragraphs.paragraphs_type.section.yml new file mode 100644 index 0000000000..929aed380b --- /dev/null +++ b/services/drupal/config/sync/paragraphs.paragraphs_type.section.yml @@ -0,0 +1,16 @@ +uuid: 3b1e88a6-82fb-433d-81b9-65b691eb3165 +langcode: en +status: true +dependencies: + module: + - layout_paragraphs +id: section +label: Section +icon_uuid: null +icon_default: null +description: '' +behavior_plugins: + layout_paragraphs: + enabled: true + available_layouts: + layout_onecol: 'One column' diff --git a/services/drupal/config/sync/search_api.index.news_releases.yml b/services/drupal/config/sync/search_api.index.news_releases.yml index 8934da2fce..d03b0d3664 100644 --- a/services/drupal/config/sync/search_api.index.news_releases.yml +++ b/services/drupal/config/sync/search_api.index.news_releases.yml @@ -93,7 +93,7 @@ field_settings: type: text configuration: roles: - anonymous: anonymous + - anonymous view_mode: 'entity:node': news_release: search_index diff --git a/services/drupal/config/sync/search_api.index.perspectives.yml b/services/drupal/config/sync/search_api.index.perspectives.yml index 9ed81c080b..425e1057f7 100644 --- a/services/drupal/config/sync/search_api.index.perspectives.yml +++ b/services/drupal/config/sync/search_api.index.perspectives.yml @@ -88,7 +88,7 @@ field_settings: type: text configuration: roles: - anonymous: anonymous + - anonymous view_mode: 'entity:node': perspective: search_index diff --git a/services/drupal/config/sync/system.mail.yml b/services/drupal/config/sync/system.mail.yml index ca57f8ee65..68e9719d92 100644 --- a/services/drupal/config/sync/system.mail.yml +++ b/services/drupal/config/sync/system.mail.yml @@ -2,3 +2,4 @@ _core: default_config_hash: rYgt7uhPafP2ngaN_ZUPFuyI4KdE0zU868zLNSlzKoE interface: default: SMTPMailSystem + webform: webform_php_mail diff --git a/services/drupal/web/modules/custom/epa_layouts/epa_layouts.layouts.yml b/services/drupal/web/modules/custom/epa_layouts/epa_layouts.layouts.yml index 6847f98953..7ff4163a37 100644 --- a/services/drupal/web/modules/custom/epa_layouts/epa_layouts.layouts.yml +++ b/services/drupal/web/modules/custom/epa_layouts/epa_layouts.layouts.yml @@ -1,3 +1,13 @@ +epa_section: + label: 'Section' + category: 'EPA' + template: layouts/epa-section + default_region: main + regions: + main: + label: Section + icon_map: + - [main] epa_one_column: label: 'One column' category: 'EPA' diff --git a/services/drupal/web/modules/custom/epa_layouts/layouts/epa-section.html.twig b/services/drupal/web/modules/custom/epa_layouts/layouts/epa-section.html.twig new file mode 100644 index 0000000000..f36a53bcc2 --- /dev/null +++ b/services/drupal/web/modules/custom/epa_layouts/layouts/epa-section.html.twig @@ -0,0 +1,25 @@ +{# +/** + * @file + * Default theme implementation to display a one-column layout. + * + * Available variables: + * - content: The content for this layout. + * - attributes: HTML attributes for the layout
. + * + * @ingroup themeable + */ +#} +{% + set classes = [ + 'layout', + 'layout--onecol', +] +%} +{% if content %} + +
+ {{ content.content }} +
+
+{% endif %} From 02cada33082da96d9912969aeee9f83fa4d43de4 Mon Sep 17 00:00:00 2001 From: Aaron Zinck Date: Fri, 23 Dec 2022 16:07:08 -0500 Subject: [PATCH 03/82] EPAD8-1981 add configurable classes to section layout and ensure new field is output in layout builder --- services/drupal/composer.json | 1 + services/drupal/composer.lock | 54 ++++++++++++++++++- ...ity_view_display.node.web_area.default.yml | 22 ++++++-- .../drupal/config/sync/core.extension.yml | 1 + .../paragraphs.paragraphs_type.section.yml | 2 +- .../custom/epa_layouts/epa_layouts.info.yml | 1 + .../epa_layouts/epa_layouts.layouts.yml | 9 ++++ .../epa_layouts/layouts/epa-section.html.twig | 20 ++++--- 8 files changed, 94 insertions(+), 16 deletions(-) diff --git a/services/drupal/composer.json b/services/drupal/composer.json index 435c96f42d..feb54029dc 100644 --- a/services/drupal/composer.json +++ b/services/drupal/composer.json @@ -272,6 +272,7 @@ "drupal/layout_builder_modal": "^1.0", "drupal/layout_builder_restrictions": "^2.7", "drupal/layout_paragraphs": "^2.0", + "drupal/layout_section_classes": "^1.3", "drupal/linked_field": "^1.3", "drupal/linkit": "^5.0-beta12", "drupal/linkit_telephone": "^1.0@dev", diff --git a/services/drupal/composer.lock b/services/drupal/composer.lock index f96e15fb77..dff771ae35 100644 --- a/services/drupal/composer.lock +++ b/services/drupal/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "d540aa33400e35faa70c877d332f2324", + "content-hash": "e61602be38d8f2c82cf84dd8df4eacf2", "packages": [ { "name": "algolia/places", @@ -6744,6 +6744,58 @@ "issues": "https://www.drupal.org/project/issues/layout_paragraphs" } }, + { + "name": "drupal/layout_section_classes", + "version": "1.3.0", + "source": { + "type": "git", + "url": "https://git.drupalcode.org/project/layout_section_classes.git", + "reference": "8.x-1.3" + }, + "dist": { + "type": "zip", + "url": "https://ftp.drupal.org/files/projects/layout_section_classes-8.x-1.3.zip", + "reference": "8.x-1.3", + "shasum": "77d7f09eb3f73fb84dd607c487fa8722fd400060" + }, + "require": { + "drupal/core": "^8.8 || ^9 || ^10" + }, + "type": "drupal-module", + "extra": { + "drupal": { + "version": "8.x-1.3", + "datestamp": "1668742882", + "security-coverage": { + "status": "covered", + "message": "Covered by Drupal's security advisory policy" + } + } + }, + "notification-url": "https://packages.drupal.org/8/downloads", + "license": [ + "GPL-2.0-or-later" + ], + "authors": [ + { + "name": "larowlan", + "homepage": "https://www.drupal.org/user/395439" + }, + { + "name": "rikki_iki", + "homepage": "https://www.drupal.org/user/1068918" + }, + { + "name": "Sam152", + "homepage": "https://www.drupal.org/user/1485048" + } + ], + "description": "Allow you to add classes to layout builder sections.", + "homepage": "https://www.drupal.org/project/layout_section_classes", + "support": { + "source": "https://git.drupalcode.org/project/layout_section_classes" + } + }, { "name": "drupal/linked_field", "version": "1.3.0", diff --git a/services/drupal/config/sync/core.entity_view_display.node.web_area.default.yml b/services/drupal/config/sync/core.entity_view_display.node.web_area.default.yml index 4f306bd8ec..3d3819e783 100644 --- a/services/drupal/config/sync/core.entity_view_display.node.web_area.default.yml +++ b/services/drupal/config/sync/core.entity_view_display.node.web_area.default.yml @@ -81,16 +81,31 @@ third_party_settings: region: main configuration: id: 'field_block:node:web_area:field_wide_content' + label: 'Wide Content' label_display: '0' + provider: layout_builder context_mapping: entity: layout_builder.entity + view_mode: view_mode formatter: type: entity_reference_revisions_entity_view - label: above + label: hidden settings: view_mode: default - link: '' - third_party_settings: { } + third_party_settings: + linked_field: + linked: 0 + type: field + destination: + field: '' + custom: '' + advanced: + title: '' + target: '' + class: '' + rel: '' + text: '' + token: '' weight: 1 additional: { } third_party_settings: { } @@ -127,6 +142,7 @@ third_party_settings: 'Chaos Tools': { } 'Content fields': - 'field_block:node:web_area:field_paragraphs' + - 'field_block:node:web_area:field_wide_content' 'Custom block types': { } 'Custom blocks': { } 'EPA Alerts': { } diff --git a/services/drupal/config/sync/core.extension.yml b/services/drupal/config/sync/core.extension.yml index f16b9b6812..2779fa4160 100644 --- a/services/drupal/config/sync/core.extension.yml +++ b/services/drupal/config/sync/core.extension.yml @@ -117,6 +117,7 @@ module: layout_builder_restrictions: 0 layout_discovery: 0 layout_paragraphs: 0 + layout_section_classes: 0 link: 0 linkit: 0 linkit_telephone: 0 diff --git a/services/drupal/config/sync/paragraphs.paragraphs_type.section.yml b/services/drupal/config/sync/paragraphs.paragraphs_type.section.yml index 929aed380b..f541dd4611 100644 --- a/services/drupal/config/sync/paragraphs.paragraphs_type.section.yml +++ b/services/drupal/config/sync/paragraphs.paragraphs_type.section.yml @@ -13,4 +13,4 @@ behavior_plugins: layout_paragraphs: enabled: true available_layouts: - layout_onecol: 'One column' + epa_section: Section diff --git a/services/drupal/web/modules/custom/epa_layouts/epa_layouts.info.yml b/services/drupal/web/modules/custom/epa_layouts/epa_layouts.info.yml index 6251f5736b..75ccdd0a9f 100644 --- a/services/drupal/web/modules/custom/epa_layouts/epa_layouts.info.yml +++ b/services/drupal/web/modules/custom/epa_layouts/epa_layouts.info.yml @@ -6,3 +6,4 @@ package: EPA dependencies: - drupal:layout_builder - drupal:layout_discovery + - layout_section_classes:layout_section_classes diff --git a/services/drupal/web/modules/custom/epa_layouts/epa_layouts.layouts.yml b/services/drupal/web/modules/custom/epa_layouts/epa_layouts.layouts.yml index 7ff4163a37..981c1d3812 100644 --- a/services/drupal/web/modules/custom/epa_layouts/epa_layouts.layouts.yml +++ b/services/drupal/web/modules/custom/epa_layouts/epa_layouts.layouts.yml @@ -2,6 +2,15 @@ epa_section: label: 'Section' category: 'EPA' template: layouts/epa-section + classes: + color: + label: 'Color' + multiple: false + required: true + options: + 'default': 'Default (white)' + 'light': 'Light (gray)' + 'dark': 'Dark (blue)' default_region: main regions: main: diff --git a/services/drupal/web/modules/custom/epa_layouts/layouts/epa-section.html.twig b/services/drupal/web/modules/custom/epa_layouts/layouts/epa-section.html.twig index f36a53bcc2..d82caf6671 100644 --- a/services/drupal/web/modules/custom/epa_layouts/layouts/epa-section.html.twig +++ b/services/drupal/web/modules/custom/epa_layouts/layouts/epa-section.html.twig @@ -1,25 +1,23 @@ {# /** * @file - * Default theme implementation to display a one-column layout. - * - * Available variables: - * - content: The content for this layout. - * - attributes: HTML attributes for the layout
. - * - * @ingroup themeable + * Template for a generic layout. */ #} {% set classes = [ 'layout', - 'layout--onecol', + 'layout--' ~ layout.id|clean_class, ] %} {% if content %} -
- {{ content.content }} -
+ {% for region in layout.getRegionNames %} + {% if content[region] %} +
+ {{ content[region] }} +
+ {% endif %} + {% endfor %}
{% endif %} From 903a8c81fe37e93b3954e2563ff857ac0e2aa321 Mon Sep 17 00:00:00 2001 From: Sarah Proper Date: Thu, 23 Feb 2023 13:28:23 -0700 Subject: [PATCH 04/82] before / after swipe with touch --- .../before-after-swipe/_before-after-swipe.scss | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/services/drupal/web/themes/epa_theme/source/_patterns/05-components/before-after-swipe/_before-after-swipe.scss b/services/drupal/web/themes/epa_theme/source/_patterns/05-components/before-after-swipe/_before-after-swipe.scss index fe0bac3507..01a463f1f2 100644 --- a/services/drupal/web/themes/epa_theme/source/_patterns/05-components/before-after-swipe/_before-after-swipe.scss +++ b/services/drupal/web/themes/epa_theme/source/_patterns/05-components/before-after-swipe/_before-after-swipe.scss @@ -58,11 +58,11 @@ $before-after-swipe-button-size: rem(44px); .before-after-swipe__slider { align-items: center; - appearance: none; background: transparent; display: none; justify-content: center; margin: 0; + opacity: 0; outline: none; transition: all 0.2s; z-index: 3; @@ -82,6 +82,14 @@ $before-after-swipe-button-size: rem(44px); &::-webkit-slider-thumb { @include before-after-swipe__slider-thumb(); } + + &::-moz-range-track { + min-height: 45px; + } + + &::-webkit-slider-runnable-track { + min-height: 45px; + } } .before-after-swipe__slider-button { From f1ebf93e503ffb96220719393cf042b9f1b23613 Mon Sep 17 00:00:00 2001 From: Dan Mouyard Date: Mon, 27 Feb 2023 13:55:21 -0500 Subject: [PATCH 05/82] EPAD8-1978: Update to use button size variable --- .../05-components/before-after-swipe/_before-after-swipe.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/drupal/web/themes/epa_theme/source/_patterns/05-components/before-after-swipe/_before-after-swipe.scss b/services/drupal/web/themes/epa_theme/source/_patterns/05-components/before-after-swipe/_before-after-swipe.scss index 01a463f1f2..e07330548d 100644 --- a/services/drupal/web/themes/epa_theme/source/_patterns/05-components/before-after-swipe/_before-after-swipe.scss +++ b/services/drupal/web/themes/epa_theme/source/_patterns/05-components/before-after-swipe/_before-after-swipe.scss @@ -84,11 +84,11 @@ $before-after-swipe-button-size: rem(44px); } &::-moz-range-track { - min-height: 45px; + min-height: $before-after-swipe-button-size; } &::-webkit-slider-runnable-track { - min-height: 45px; + min-height: $before-after-swipe-button-size; } } From cbbb3f678c0fd2766692afe21b3699159625604e Mon Sep 17 00:00:00 2001 From: Sarah Proper Date: Thu, 2 Mar 2023 20:39:27 -0700 Subject: [PATCH 06/82] epd8-2015 add restricted class --- .../_patterns/02-base/02-html-elements/26-media/_img.scss | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/drupal/web/themes/epa_theme/source/_patterns/02-base/02-html-elements/26-media/_img.scss b/services/drupal/web/themes/epa_theme/source/_patterns/02-base/02-html-elements/26-media/_img.scss index 84a7a0e3ac..ae914cb58f 100644 --- a/services/drupal/web/themes/epa_theme/source/_patterns/02-base/02-html-elements/26-media/_img.scss +++ b/services/drupal/web/themes/epa_theme/source/_patterns/02-base/02-html-elements/26-media/_img.scss @@ -12,4 +12,8 @@ img { max-width: 100% !important; page-break-inside: avoid; } + + &.restricted-img { + pointer-events: none; + } } From 744a086c01d7fb47a0f2794f9da1489aeaad1d88 Mon Sep 17 00:00:00 2001 From: Sarah Proper Date: Mon, 6 Mar 2023 09:21:45 -0700 Subject: [PATCH 07/82] EPAD8-1978 give slider thumb a defined width & height --- .../05-components/before-after-swipe/_before-after-swipe.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/drupal/web/themes/epa_theme/source/_patterns/05-components/before-after-swipe/_before-after-swipe.scss b/services/drupal/web/themes/epa_theme/source/_patterns/05-components/before-after-swipe/_before-after-swipe.scss index e07330548d..c568f86e21 100644 --- a/services/drupal/web/themes/epa_theme/source/_patterns/05-components/before-after-swipe/_before-after-swipe.scss +++ b/services/drupal/web/themes/epa_theme/source/_patterns/05-components/before-after-swipe/_before-after-swipe.scss @@ -51,9 +51,9 @@ $before-after-swipe-button-size: rem(44px); background: transparent; border: 0; cursor: pointer; - height: 100%; + height: $before-after-swipe-button-size; outline: 0; - width: $before-after-swipe-border-size; + width: $before-after-swipe-button-size; } .before-after-swipe__slider { From 7a1a80d14b6a1a5ddf90ab00ad5049cf30e9ab9f Mon Sep 17 00:00:00 2001 From: Aaron Zinck Date: Mon, 6 Mar 2023 12:55:12 -0500 Subject: [PATCH 08/82] EPAD8-2015 add the restricted-img class to image tags --- .../web/themes/epa_theme/includes/media.inc | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/services/drupal/web/themes/epa_theme/includes/media.inc b/services/drupal/web/themes/epa_theme/includes/media.inc index 8aa21e301c..0d93ad970c 100644 --- a/services/drupal/web/themes/epa_theme/includes/media.inc +++ b/services/drupal/web/themes/epa_theme/includes/media.inc @@ -57,6 +57,23 @@ function epa_theme_preprocess_responsive_image(&$vars) { if ($vars['responsive_image_style_id'] == 'responsive_box_image') { $vars['img_element']['#attributes']['class'][] = 'box__image'; } + + // Load file by filename + // array. + if ($file = \Drupal::entityTypeManager() + ->getStorage('file') + ->loadByProperties(['uri' => $vars['uri']])) { + $fid = array_shift($file)->fid->value; + + if ($media = \Drupal::entityTypeManager() + ->getStorage('media') + ->loadByProperties(['field_media_image' => $fid])) { + $media = array_shift($media); + if ($media->field_banner_image_restricted->value == 'restricted') { + $vars['img_element']['#attributes']['class'][] = 'restricted-img'; + } + } + } } /** From 375cf5a4f81ef2c13fd92ee565c7b70da39f3ece Mon Sep 17 00:00:00 2001 From: Robbie Edwards Date: Mon, 13 Mar 2023 15:56:18 -0700 Subject: [PATCH 09/82] EPAD8-1824: Change header & menu color,rename mobile menu button --- .../epa_theme/source/_patterns/04-layouts/header/_header.scss | 3 +++ .../epa_theme/source/_patterns/04-layouts/header/header.twig | 2 +- .../_patterns/05-components/menu/menu--main/_menu--main.scss | 2 +- .../source/_patterns/05-components/nav/nav--epa/_nav--epa.scss | 2 +- .../source/_patterns/05-components/site-logo/_site-logo.scss | 2 +- 5 files changed, 7 insertions(+), 4 deletions(-) diff --git a/services/drupal/web/themes/epa_theme/source/_patterns/04-layouts/header/_header.scss b/services/drupal/web/themes/epa_theme/source/_patterns/04-layouts/header/_header.scss index 500b2b4be5..1022b17472 100644 --- a/services/drupal/web/themes/epa_theme/source/_patterns/04-layouts/header/_header.scss +++ b/services/drupal/web/themes/epa_theme/source/_patterns/04-layouts/header/_header.scss @@ -4,6 +4,7 @@ @use '../../00-config' as *; .l-header { + background: gesso-brand(blue, base); position: relative; z-index: 2; } @@ -24,6 +25,8 @@ .l-header__menu-button { margin-right: 0 !important; + padding-bottom: 0 !important; + padding-top: 0 !important; width: auto !important; @include at-media($theme-header-min-width) { diff --git a/services/drupal/web/themes/epa_theme/source/_patterns/04-layouts/header/header.twig b/services/drupal/web/themes/epa_theme/source/_patterns/04-layouts/header/header.twig index 3512966840..789497df66 100644 --- a/services/drupal/web/themes/epa_theme/source/_patterns/04-layouts/header/header.twig +++ b/services/drupal/web/themes/epa_theme/source/_patterns/04-layouts/header/header.twig @@ -8,7 +8,7 @@ 'content': 'Logo', } %} {% endblock %} - + + {% include '@layouts/section/section.twig' with { + modifier_classes: classes, + content: section_content, + has_constrain: true, + } %} {% endif %} From e66fbe80c3cf7f11b35b9f9191ce385cd3c1f708 Mon Sep 17 00:00:00 2001 From: Dan Mouyard Date: Wed, 22 Mar 2023 12:46:49 -0400 Subject: [PATCH 43/82] EPAD8-2082: Update mobile menu button to match USWDS --- .../source/_patterns/04-layouts/header/_header.scss | 9 --------- .../source/_patterns/04-layouts/header/header.twig | 2 +- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/services/drupal/web/themes/epa_theme/source/_patterns/04-layouts/header/_header.scss b/services/drupal/web/themes/epa_theme/source/_patterns/04-layouts/header/_header.scss index 500b2b4be5..6757d2c357 100644 --- a/services/drupal/web/themes/epa_theme/source/_patterns/04-layouts/header/_header.scss +++ b/services/drupal/web/themes/epa_theme/source/_patterns/04-layouts/header/_header.scss @@ -21,12 +21,3 @@ display: flex; justify-content: space-between; } - -.l-header__menu-button { - margin-right: 0 !important; - width: auto !important; - - @include at-media($theme-header-min-width) { - display: none !important; - } -} diff --git a/services/drupal/web/themes/epa_theme/source/_patterns/04-layouts/header/header.twig b/services/drupal/web/themes/epa_theme/source/_patterns/04-layouts/header/header.twig index 3512966840..b4d7bb7c7b 100644 --- a/services/drupal/web/themes/epa_theme/source/_patterns/04-layouts/header/header.twig +++ b/services/drupal/web/themes/epa_theme/source/_patterns/04-layouts/header/header.twig @@ -8,7 +8,7 @@ 'content': 'Logo', } %} {% endblock %} - +