From 0462081eafd8f1501bb6476b4b1e6fc8b5eea987 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20D=C3=ADaz=20Soto?= Date: Mon, 29 Jul 2024 10:11:55 -0600 Subject: [PATCH] Four Kitchens Release - Sprint 55 (#1584) * SHS-5661: Remove legacy fields (#1577) * feat(SHS-5661): Remove paragraph field Overlay Color on banner image with text box * feat(SHS-5661): Remove other references to the overlay field * feat(SHS-5661): Add update hook to remove legacy field * fix(SHS-5661): Fix linting error * fix(shs-5661): remove hero-text-overlay variants and update viewmode config * SHS-4929: Hide caption/credits on images in default views (#1578) * feat(shs-4929): add new media view mode and update news default views * feat(shs-4929): update people default views * feat(shs-4929): update publications default views * SHS-5675: Helping users avoid 'Table cell missing context (e.g. headings) A11y warning (#1579) * feat(SHS-5675): Add default table header rows to new tables in CKEditor * fix(SHS-5675): Fix linting error * docs(SHS-5675): Add comments describing change and source of change. * feat(SHS-5675): Update table heading color in CKEditor * fix(shs-5675): change color variable for table headings * fix(shs-5696): make normal the font style of blockquotes in wysiwyg (#1582) * SHS-5693: Implementation: New Vertical Card option (#1581) * feat(shs-5693): add view mode and and pattern for vertical button card * feat(shs-5693): configure the Style field to use the new view mode with the right label. * feat(shs-5693): add pattern into module preprocess function and update twig file * feat(shs-5693): more implementations in vertical button card * feat(shs-5693): implementations in vertical button card for colorful * feat(shs-5693): update box shadow * feat(shs-5693): update image position for colorful * feat(shs-5953): use secondary button styles in traditional and fix space in colorful when there's no image * fix(shs-5693): fix incorrect background color --- ...isplay.paragraph.hs_hero_image.default.yml | 9 -- ...ew_display.media.image.responsive_lazy.yml | 51 ++++++++ ...isplay.paragraph.hs_hero_image.default.yml | 2 - ...agraph.hs_hero_image.hero_with_overlay.yml | 11 +- ...aragraph.hs_hero_image.slideshow_slide.yml | 2 - ...graph.hs_postcard.vertical_button_card.yml | 102 +++++++++++++++ ...entity_view_mode.media.responsive_lazy.yml | 11 ++ ...ew_mode.paragraph.vertical_button_card.yml | 11 ++ ...hero_image.field_hs_hero_overlay_color.yml | 25 ---- ....hs_postcard.field_hs_postcard_display.yml | 2 +- ....paragraph.field_hs_hero_overlay_color.yml | 24 ---- ...ge.paragraph.field_hs_postcard_display.yml | 3 + config/default/user.role.anonymous.yml | 2 - config/default/user.role.authenticated.yml | 2 - config/default/views.view.hs_default_news.yml | 10 +- .../default/views.view.hs_default_people.yml | 19 +-- .../views.view.hs_default_publications.yml | 13 +- .../humsci/hs_layouts/hs_layouts.module | 1 + .../hero-text-overlay.html.twig | 5 - .../hero-text-overlay.ui_patterns.yml | 16 --- .../vertical-button-card.html.twig | 31 +++++ .../vertical-button-card.ui_patterns.yml | 21 ++++ .../hs_paragraph_types.install | 8 ++ .../3a0fcda7-c346-40e3-af09-f16ad1a3467c.yml | 12 -- .../su_humsci_profile.profile | 25 +++- .../humsci/humsci_basic/src/scss/_main.scss | 1 + .../src/scss/ckeditor/imports.scss | 2 + .../components/_vertical-button-card.scss | 116 ++++++++++++++++++ .../src/scss/utilities/_raised-cards.scss | 12 ++ 29 files changed, 411 insertions(+), 138 deletions(-) create mode 100644 config/default/core.entity_view_display.media.image.responsive_lazy.yml create mode 100644 config/default/core.entity_view_display.paragraph.hs_postcard.vertical_button_card.yml create mode 100644 config/default/core.entity_view_mode.media.responsive_lazy.yml create mode 100644 config/default/core.entity_view_mode.paragraph.vertical_button_card.yml delete mode 100644 config/default/field.field.paragraph.hs_hero_image.field_hs_hero_overlay_color.yml delete mode 100644 config/default/field.storage.paragraph.field_hs_hero_overlay_color.yml create mode 100644 docroot/modules/humsci/hs_layouts/patterns/vertical-button-card/vertical-button-card.html.twig create mode 100644 docroot/modules/humsci/hs_layouts/patterns/vertical-button-card/vertical-button-card.ui_patterns.yml create mode 100644 docroot/themes/humsci/humsci_basic/src/scss/components/_vertical-button-card.scss diff --git a/config/default/core.entity_form_display.paragraph.hs_hero_image.default.yml b/config/default/core.entity_form_display.paragraph.hs_hero_image.default.yml index 68a4c7540d..42413c0597 100644 --- a/config/default/core.entity_form_display.paragraph.hs_hero_image.default.yml +++ b/config/default/core.entity_form_display.paragraph.hs_hero_image.default.yml @@ -6,12 +6,10 @@ dependencies: - field.field.paragraph.hs_hero_image.field_hs_hero_body - field.field.paragraph.hs_hero_image.field_hs_hero_image - field.field.paragraph.hs_hero_image.field_hs_hero_link - - field.field.paragraph.hs_hero_image.field_hs_hero_overlay_color - field.field.paragraph.hs_hero_image.field_hs_hero_title - paragraphs.paragraphs_type.hs_hero_image module: - allowed_formats - - color_field - linkit - maxlength - media_library @@ -54,13 +52,6 @@ content: linkit_profile: default linkit_auto_link_text: false third_party_settings: { } - field_hs_hero_overlay_color: - type: color_field_widget_box - weight: 5 - region: content - settings: - default_colors: '#00505C,#53284F,#175E54,#4D4F53,#5E3032' - third_party_settings: { } field_hs_hero_title: type: string_textfield weight: 2 diff --git a/config/default/core.entity_view_display.media.image.responsive_lazy.yml b/config/default/core.entity_view_display.media.image.responsive_lazy.yml new file mode 100644 index 0000000000..de68a8c7fc --- /dev/null +++ b/config/default/core.entity_view_display.media.image.responsive_lazy.yml @@ -0,0 +1,51 @@ +uuid: b7b180a8-5e6f-4479-98d1-6a6e6982eb68 +langcode: en +status: true +dependencies: + config: + - core.entity_view_mode.media.responsive_lazy + - field.field.media.image.field_media_image + - field.field.media.image.field_media_image_caption + - media.type.image + - responsive_image.styles.full_responsive + module: + - empty_fields + - field_formatter_class + - hs_field_helpers + - layout_builder + - responsive_image +third_party_settings: + layout_builder: + enabled: false + allow_custom: false +_core: + default_config_hash: UHOBG3TcAwserLclcHcEOGnkPaJlP9n_tSpy7TmELFQ +id: media.image.responsive_lazy +targetEntityType: media +bundle: image +mode: responsive_lazy +content: + field_media_image: + type: responsive_image + label: hidden + settings: + responsive_image_style: full_responsive + image_link: '' + image_loading: + attribute: lazy + third_party_settings: + empty_fields: + handler: '' + field_formatter_class: + class: '' + hs_field_helpers: + inline_contents: 0 + weight: 0 + region: content +hidden: + created: true + field_media_image_caption: true + name: true + search_api_excerpt: true + thumbnail: true + uid: true diff --git a/config/default/core.entity_view_display.paragraph.hs_hero_image.default.yml b/config/default/core.entity_view_display.paragraph.hs_hero_image.default.yml index 5584a5f6e0..1b57fd7f6b 100644 --- a/config/default/core.entity_view_display.paragraph.hs_hero_image.default.yml +++ b/config/default/core.entity_view_display.paragraph.hs_hero_image.default.yml @@ -6,7 +6,6 @@ dependencies: - field.field.paragraph.hs_hero_image.field_hs_hero_body - field.field.paragraph.hs_hero_image.field_hs_hero_image - field.field.paragraph.hs_hero_image.field_hs_hero_link - - field.field.paragraph.hs_hero_image.field_hs_hero_overlay_color - field.field.paragraph.hs_hero_image.field_hs_hero_title - paragraphs.paragraphs_type.hs_hero_image module: @@ -41,6 +40,5 @@ content: hidden: field_hs_hero_body: true field_hs_hero_link: true - field_hs_hero_overlay_color: true field_hs_hero_title: true search_api_excerpt: true diff --git a/config/default/core.entity_view_display.paragraph.hs_hero_image.hero_with_overlay.yml b/config/default/core.entity_view_display.paragraph.hs_hero_image.hero_with_overlay.yml index 333e77da16..feb0739cae 100644 --- a/config/default/core.entity_view_display.paragraph.hs_hero_image.hero_with_overlay.yml +++ b/config/default/core.entity_view_display.paragraph.hs_hero_image.hero_with_overlay.yml @@ -7,7 +7,6 @@ dependencies: - field.field.paragraph.hs_hero_image.field_hs_hero_body - field.field.paragraph.hs_hero_image.field_hs_hero_image - field.field.paragraph.hs_hero_image.field_hs_hero_link - - field.field.paragraph.hs_hero_image.field_hs_hero_overlay_color - field.field.paragraph.hs_hero_image.field_hs_hero_title - paragraphs.paragraphs_type.hs_hero_image module: @@ -32,14 +31,7 @@ third_party_settings: settings: pattern: field_templates: default - variant: _field - variant_field: field_hs_hero_overlay_color - variant_field_values: - default: 00505c - purple: 53284f - paloalto: '175e54' - coolgrey: 4d4f53 - brown: '5e3032' + variant_field: field_hs_hero_body regions: image: - field_hs_hero_image @@ -123,5 +115,4 @@ content: weight: 1 region: overlay_text hidden: - field_hs_hero_overlay_color: true search_api_excerpt: true diff --git a/config/default/core.entity_view_display.paragraph.hs_hero_image.slideshow_slide.yml b/config/default/core.entity_view_display.paragraph.hs_hero_image.slideshow_slide.yml index 89e6344e3d..4aeb15ac31 100644 --- a/config/default/core.entity_view_display.paragraph.hs_hero_image.slideshow_slide.yml +++ b/config/default/core.entity_view_display.paragraph.hs_hero_image.slideshow_slide.yml @@ -7,7 +7,6 @@ dependencies: - field.field.paragraph.hs_hero_image.field_hs_hero_body - field.field.paragraph.hs_hero_image.field_hs_hero_image - field.field.paragraph.hs_hero_image.field_hs_hero_link - - field.field.paragraph.hs_hero_image.field_hs_hero_overlay_color - field.field.paragraph.hs_hero_image.field_hs_hero_title - paragraphs.paragraphs_type.hs_hero_image module: @@ -47,6 +46,5 @@ content: hidden: field_hs_hero_body: true field_hs_hero_link: true - field_hs_hero_overlay_color: true field_hs_hero_title: true search_api_excerpt: true diff --git a/config/default/core.entity_view_display.paragraph.hs_postcard.vertical_button_card.yml b/config/default/core.entity_view_display.paragraph.hs_postcard.vertical_button_card.yml new file mode 100644 index 0000000000..b6244a0a3c --- /dev/null +++ b/config/default/core.entity_view_display.paragraph.hs_postcard.vertical_button_card.yml @@ -0,0 +1,102 @@ +uuid: 344ca5c0-4913-4495-bbbf-1b043b86d9b2 +langcode: en +status: true +dependencies: + config: + - core.entity_view_mode.paragraph.vertical_button_card + - field.field.paragraph.hs_postcard.field_hs_postcard_body + - field.field.paragraph.hs_postcard.field_hs_postcard_display + - field.field.paragraph.hs_postcard.field_hs_postcard_image + - field.field.paragraph.hs_postcard.field_hs_postcard_link + - field.field.paragraph.hs_postcard.field_hs_postcard_title + - paragraphs.paragraphs_type.hs_postcard + module: + - ds + - empty_fields + - field_formatter_class + - hs_field_helpers + - linkit + - stanford_media + - text +third_party_settings: + ds: + layout: + id: pattern_vertical_button_card + library: null + disable_css: false + entity_classes: all_classes + settings: + pattern: + field_templates: default + variant_field: field_hs_postcard_body + regions: + title: + - field_hs_postcard_title + image: + - field_hs_postcard_image + description: + - field_hs_postcard_body + button: + - field_hs_postcard_link + layout_builder: + enabled: false + allow_custom: false +_core: + default_config_hash: pD2JUVXvQBSgYIl6eg5c8YEnrxvftUnux2cz-3A-P9Y +id: paragraph.hs_postcard.vertical_button_card +targetEntityType: paragraph +bundle: hs_postcard +mode: vertical_button_card +content: + field_hs_postcard_body: + type: text_default + label: hidden + settings: { } + third_party_settings: { } + weight: 2 + region: description + field_hs_postcard_image: + type: media_responsive_image_formatter + label: hidden + settings: + view_mode: caption_credit + link: false + image_style: postcard_vertical + remove_alt: 0 + third_party_settings: + empty_fields: + handler: '' + field_formatter_class: + class: '' + hs_field_helpers: + inline_contents: 0 + weight: 1 + region: image + field_hs_postcard_link: + type: linkit + label: hidden + settings: + trim_length: 80 + url_only: false + url_plain: false + rel: '0' + target: '0' + linkit_profile: default + third_party_settings: + field_formatter_class: + class: decanter-button + hs_field_helpers: + inline_contents: 0 + weight: 3 + region: button + field_hs_postcard_title: + type: string + label: hidden + settings: + link_to_entity: false + third_party_settings: { } + weight: 0 + region: title +hidden: + field_hs_postcard_display: true + search_api_excerpt: true diff --git a/config/default/core.entity_view_mode.media.responsive_lazy.yml b/config/default/core.entity_view_mode.media.responsive_lazy.yml new file mode 100644 index 0000000000..3c2fb1e8b6 --- /dev/null +++ b/config/default/core.entity_view_mode.media.responsive_lazy.yml @@ -0,0 +1,11 @@ +uuid: 7f2edd8a-e200-49ed-96f8-fae0fd3e6886 +langcode: en +status: true +dependencies: + module: + - media +id: media.responsive_lazy +label: 'Responsive Lazy' +description: '' +targetEntityType: media +cache: true diff --git a/config/default/core.entity_view_mode.paragraph.vertical_button_card.yml b/config/default/core.entity_view_mode.paragraph.vertical_button_card.yml new file mode 100644 index 0000000000..8fc1cc4b98 --- /dev/null +++ b/config/default/core.entity_view_mode.paragraph.vertical_button_card.yml @@ -0,0 +1,11 @@ +uuid: dd04cc00-b6ff-4ec0-96a6-c7e40a680be1 +langcode: en +status: true +dependencies: + module: + - paragraphs +id: paragraph.vertical_button_card +label: 'Vertical Button Card' +description: '' +targetEntityType: paragraph +cache: true diff --git a/config/default/field.field.paragraph.hs_hero_image.field_hs_hero_overlay_color.yml b/config/default/field.field.paragraph.hs_hero_image.field_hs_hero_overlay_color.yml deleted file mode 100644 index 239286aba3..0000000000 --- a/config/default/field.field.paragraph.hs_hero_image.field_hs_hero_overlay_color.yml +++ /dev/null @@ -1,25 +0,0 @@ -uuid: a7643518-bc3d-4c85-add9-e99a0adfdf91 -langcode: en -status: true -dependencies: - config: - - field.storage.paragraph.field_hs_hero_overlay_color - - paragraphs.paragraphs_type.hs_hero_image - module: - - color_field -id: paragraph.hs_hero_image.field_hs_hero_overlay_color -field_name: field_hs_hero_overlay_color -entity_type: paragraph -bundle: hs_hero_image -label: 'Overlay Color' -description: '' -required: true -translatable: false -default_value: - - - color: '#00505C' - opacity: null -default_value_callback: '' -settings: - opacity: 0 -field_type: color_field_type diff --git a/config/default/field.field.paragraph.hs_postcard.field_hs_postcard_display.yml b/config/default/field.field.paragraph.hs_postcard.field_hs_postcard_display.yml index 31a9af74d7..8d77a2e57b 100644 --- a/config/default/field.field.paragraph.hs_postcard.field_hs_postcard_display.yml +++ b/config/default/field.field.paragraph.hs_postcard.field_hs_postcard_display.yml @@ -14,7 +14,7 @@ field_name: field_hs_postcard_display entity_type: paragraph bundle: hs_postcard label: Style -description: 'Vertical: image above text; Vertical linked: image above text with linked overlay; Horizontal: image to left of text' +description: 'Vertical: image above text; Vertical linked: image above text with linked overlay; Horizontal: image to left of text; Vertical Button Card: image above text.' required: true translatable: false default_value: diff --git a/config/default/field.storage.paragraph.field_hs_hero_overlay_color.yml b/config/default/field.storage.paragraph.field_hs_hero_overlay_color.yml deleted file mode 100644 index 0189c68ea7..0000000000 --- a/config/default/field.storage.paragraph.field_hs_hero_overlay_color.yml +++ /dev/null @@ -1,24 +0,0 @@ -uuid: b1393f01-63e8-4bc6-9dae-6ab572b39387 -langcode: en -status: true -dependencies: - module: - - color_field - - field_permissions - - paragraphs -third_party_settings: - field_permissions: - permission_type: custom -id: paragraph.field_hs_hero_overlay_color -field_name: field_hs_hero_overlay_color -entity_type: paragraph -type: color_field_type -settings: - format: hexhex -module: color_field -locked: false -cardinality: 1 -translatable: true -indexes: { } -persist_with_no_fields: false -custom_storage: false diff --git a/config/default/field.storage.paragraph.field_hs_postcard_display.yml b/config/default/field.storage.paragraph.field_hs_postcard_display.yml index 77435b72f3..ae1f80795f 100644 --- a/config/default/field.storage.paragraph.field_hs_postcard_display.yml +++ b/config/default/field.storage.paragraph.field_hs_postcard_display.yml @@ -22,6 +22,9 @@ settings: - value: token label: 'Vertical Linked Card' + - + value: vertical_button_card + label: 'Vertical Button Card' allowed_values_function: '' module: hs_field_helpers locked: false diff --git a/config/default/user.role.anonymous.yml b/config/default/user.role.anonymous.yml index 373bce90e7..b5cc10c224 100644 --- a/config/default/user.role.anonymous.yml +++ b/config/default/user.role.anonymous.yml @@ -18,13 +18,11 @@ permissions: - 'access content' - 'download media' - 'view field_hs_accordion_views' - - 'view field_hs_hero_overlay_color' - 'view field_hs_text_area_bg_color' - 'view field_media_embeddable_code' - 'view field_paragraph_style' - 'view humsci entity' - 'view media' - 'view own field_hs_accordion_views' - - 'view own field_hs_hero_overlay_color' - 'view own field_media_embeddable_code' - 'view the administration theme' diff --git a/config/default/user.role.authenticated.yml b/config/default/user.role.authenticated.yml index 05481dc40d..92ceeff2ae 100644 --- a/config/default/user.role.authenticated.yml +++ b/config/default/user.role.authenticated.yml @@ -30,13 +30,11 @@ permissions: - 'use text format basic_html_without_media' - 'use text format webform_default' - 'view field_hs_accordion_views' - - 'view field_hs_hero_overlay_color' - 'view field_hs_text_area_bg_color' - 'view field_media_embeddable_code' - 'view field_paragraph_style' - 'view humsci entity' - 'view media' - 'view own field_hs_accordion_views' - - 'view own field_hs_hero_overlay_color' - 'view own field_media_embeddable_code' - 'view the administration theme' diff --git a/config/default/views.view.hs_default_news.yml b/config/default/views.view.hs_default_news.yml index 9d74100634..40e97acf51 100644 --- a/config/default/views.view.hs_default_news.yml +++ b/config/default/views.view.hs_default_news.yml @@ -657,7 +657,7 @@ display: click_sort_column: target_id type: media_responsive_image_formatter settings: - view_mode: caption_credit + view_mode: responsive_lazy link: true image_style: hp_3_across_events remove_alt: 0 @@ -1192,7 +1192,7 @@ display: click_sort_column: target_id type: media_responsive_image_formatter settings: - view_mode: caption_credit + view_mode: responsive_lazy link: true image_style: hp_3_down_events remove_alt: 0 @@ -1710,7 +1710,7 @@ display: click_sort_column: target_id type: media_responsive_image_formatter settings: - view_mode: caption_credit + view_mode: responsive_lazy link: true image_style: hp_4_across remove_alt: 0 @@ -2064,7 +2064,7 @@ display: click_sort_column: target_id type: media_responsive_image_formatter settings: - view_mode: caption_credit + view_mode: responsive_lazy link: true image_style: hp_3_down_events remove_alt: 0 @@ -3020,7 +3020,7 @@ display: click_sort_column: target_id type: media_responsive_image_formatter settings: - view_mode: caption_credit + view_mode: responsive_lazy link: true image_style: full_responsive remove_alt: 0 diff --git a/config/default/views.view.hs_default_people.yml b/config/default/views.view.hs_default_people.yml index a34d5156fa..699378e2c8 100644 --- a/config/default/views.view.hs_default_people.yml +++ b/config/default/views.view.hs_default_people.yml @@ -545,8 +545,6 @@ display: - 'config:field.storage.node.field_hs_person_email' - 'config:field.storage.node.field_hs_person_image' - 'config:field.storage.node.field_hs_person_title' - - entity_field_info - - views_data grid: id: grid display_title: 'People grid' @@ -606,7 +604,7 @@ display: click_sort_column: target_id type: media_responsive_image_formatter settings: - view_mode: caption_credit + view_mode: responsive_lazy link: true image_style: people_grid_square remove_alt: 0 @@ -1075,8 +1073,6 @@ display: - 'config:field.storage.node.field_hs_person_email' - 'config:field.storage.node.field_hs_person_square_img' - 'config:field.storage.node.field_hs_person_title' - - entity_field_info - - views_data list_link: id: list_link display_title: 'People list link' @@ -1136,7 +1132,7 @@ display: click_sort_column: target_id type: media_responsive_image_formatter settings: - view_mode: caption_credit + view_mode: responsive_lazy link: true image_style: people_grid_list remove_alt: 0 @@ -2144,8 +2140,6 @@ display: - 'config:field.storage.node.field_hs_person_square_img' - 'config:field.storage.node.field_hs_person_telephone' - 'config:field.storage.node.field_hs_person_title' - - entity_field_info - - views_data list_link_grouped: id: list_link_grouped display_title: 'People list link (grouped)' @@ -2205,7 +2199,7 @@ display: click_sort_column: target_id type: media_responsive_image_formatter settings: - view_mode: caption_credit + view_mode: responsive_lazy link: true image_style: people_grid_list remove_alt: 0 @@ -3282,8 +3276,6 @@ display: - 'config:field.storage.node.field_hs_person_square_img' - 'config:field.storage.node.field_hs_person_telephone' - 'config:field.storage.node.field_hs_person_title' - - entity_field_info - - views_data research_area_grid: id: research_area_grid display_title: 'Research Area People Grid' @@ -3343,9 +3335,10 @@ display: click_sort_column: target_id type: media_image_formatter settings: - view_mode: caption_credit + view_mode: responsive_lazy link: true image_style: hs_small_square_200x200 + remove_alt: false group_column: target_id group_columns: { } group_rows: true @@ -4000,5 +3993,3 @@ display: - 'config:field.storage.node.field_hs_person_square_img' - 'config:field.storage.node.field_hs_person_telephone' - 'config:field.storage.node.field_hs_person_title' - - entity_field_info - - views_data diff --git a/config/default/views.view.hs_default_publications.yml b/config/default/views.view.hs_default_publications.yml index a4add0cfb4..56651366e7 100644 --- a/config/default/views.view.hs_default_publications.yml +++ b/config/default/views.view.hs_default_publications.yml @@ -15,8 +15,8 @@ dependencies: - taxonomy.vocabulary.hs_publication_type module: - datetime - - eck - file + - hs_entities - hs_views_helper - link - media @@ -768,9 +768,10 @@ display: click_sort_column: target_id type: media_image_formatter settings: - view_mode: caption_credit + view_mode: responsive_lazy link: true image_style: hs_large_scaled_480px + remove_alt: false group_column: target_id group_columns: { } group_rows: true @@ -1477,7 +1478,7 @@ display: click_sort_column: target_id type: media_responsive_image_formatter settings: - view_mode: caption_credit + view_mode: responsive_lazy link: true image_style: publications_doc remove_alt: 0 @@ -1985,7 +1986,7 @@ display: click_sort_column: target_id type: media_responsive_image_formatter settings: - view_mode: caption_credit + view_mode: responsive_lazy link: true image_style: publications_grid remove_alt: 0 @@ -2477,7 +2478,7 @@ display: click_sort_column: target_id type: media_responsive_image_formatter settings: - view_mode: caption_credit + view_mode: responsive_lazy link: true image_style: publications_grid remove_alt: 0 @@ -3119,7 +3120,7 @@ display: click_sort_column: target_id type: media_responsive_image_formatter settings: - view_mode: caption_credit + view_mode: responsive_lazy link: true image_style: responsive_scaled remove_alt: 0 diff --git a/docroot/modules/humsci/hs_layouts/hs_layouts.module b/docroot/modules/humsci/hs_layouts/hs_layouts.module index 98e7a19595..2ffe4bd5b4 100644 --- a/docroot/modules/humsci/hs_layouts/hs_layouts.module +++ b/docroot/modules/humsci/hs_layouts/hs_layouts.module @@ -44,6 +44,7 @@ function hs_layouts_preprocess(&$variables, $hook) { 'pattern_horizontal_card', 'pattern_vertical_card', 'pattern_vertical_link_card', + 'pattern_vertical_button_card', 'pattern_spotlight', 'pattern_timeline', 'pattern_hero_text_overlay', diff --git a/docroot/modules/humsci/hs_layouts/patterns/hero-text-overlay/hero-text-overlay.html.twig b/docroot/modules/humsci/hs_layouts/patterns/hero-text-overlay/hero-text-overlay.html.twig index 99a9a4e881..3f60d3b5a5 100644 --- a/docroot/modules/humsci/hs_layouts/patterns/hero-text-overlay/hero-text-overlay.html.twig +++ b/docroot/modules/humsci/hs_layouts/patterns/hero-text-overlay/hero-text-overlay.html.twig @@ -1,10 +1,5 @@ {%- set attributes = attributes.addClass('hb-hero-overlay') -%} -{% if variant %} - {% set variant_class = "hb-hero-overlay--color-#{variant}" %} - {% set attributes = attributes.addClass(variant_class) %} -{% endif %} - {% set text_content = overlay_text %} {% if overlay_text['field_hs_hero_title'] is defined and overlay_text['field_hs_hero_title'][0] is defined %} {% set text_content %} diff --git a/docroot/modules/humsci/hs_layouts/patterns/hero-text-overlay/hero-text-overlay.ui_patterns.yml b/docroot/modules/humsci/hs_layouts/patterns/hero-text-overlay/hero-text-overlay.ui_patterns.yml index accd8fb43e..e0aa924891 100644 --- a/docroot/modules/humsci/hs_layouts/patterns/hero-text-overlay/hero-text-overlay.ui_patterns.yml +++ b/docroot/modules/humsci/hs_layouts/patterns/hero-text-overlay/hero-text-overlay.ui_patterns.yml @@ -1,22 +1,6 @@ hero_text_overlay: label: "Hero Text Overlay" description: "" - variants: - default: - label: Lagunita - description: Lagunita Gradient - purple: - label: Purple - description: Purple Gradient - paloalto: - label: Palo Alto - description: Palo Alto Gradient - coolgrey: - label: Cool Grey - description: Cool Grey Gradient - brown: - label: Brown - description: Brown Gradient fields: image: label: "Image" diff --git a/docroot/modules/humsci/hs_layouts/patterns/vertical-button-card/vertical-button-card.html.twig b/docroot/modules/humsci/hs_layouts/patterns/vertical-button-card/vertical-button-card.html.twig new file mode 100644 index 0000000000..36b9377b93 --- /dev/null +++ b/docroot/modules/humsci/hs_layouts/patterns/vertical-button-card/vertical-button-card.html.twig @@ -0,0 +1,31 @@ +
+
+ {% if image %} +
+
+ {{ image }} +
+
+ {% endif %} +
+ {% if title %} +
+ {% if title|render matches '/<\\/h\\d>/' %} + {{ title }} + {% else %} + <{{ heading_tag }}>{{ title }} + {% endif %} +
+ {% endif %} + + {% if description %} +
{{ description }}
+ {% endif %} +
+ + {% if button %} + {% set link = button.field_hs_postcard_link[0] %} + {{ link['#title'] }} + {% endif %} +
+
diff --git a/docroot/modules/humsci/hs_layouts/patterns/vertical-button-card/vertical-button-card.ui_patterns.yml b/docroot/modules/humsci/hs_layouts/patterns/vertical-button-card/vertical-button-card.ui_patterns.yml new file mode 100644 index 0000000000..f04c6766c1 --- /dev/null +++ b/docroot/modules/humsci/hs_layouts/patterns/vertical-button-card/vertical-button-card.ui_patterns.yml @@ -0,0 +1,21 @@ +vertical_button_card: + label: "Vertical Button Card" + fields: + title: + label: "Title" + preview: "Vertical Button Card Title" + type: text + image: + label: "Image" + preview: + theme: image + uri: "http://via.placeholder.com/200x200" + type: image + description: + label: "Description" + preview: "Optional wysiwyg lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam fermentum aliquet iaculis. Cras faucibus turpis non facilisis laoreet." + type: text + button: + label: "Button" + preview: 'Optional Button' + use: "@hs_layouts/vertical-button-card/vertical-button-card.html.twig" diff --git a/docroot/modules/humsci/hs_paragraph_types/hs_paragraph_types.install b/docroot/modules/humsci/hs_paragraph_types/hs_paragraph_types.install index 8d31d58a28..8908811a2b 100644 --- a/docroot/modules/humsci/hs_paragraph_types/hs_paragraph_types.install +++ b/docroot/modules/humsci/hs_paragraph_types/hs_paragraph_types.install @@ -217,3 +217,11 @@ function hs_paragraph_types_update_10004(&$sandbox) { } $sandbox['#finished'] = count($sandbox['ids']) ? 1 - count($sandbox['ids']) / $sandbox['total'] : 1; } + +/** + * Removes legacy fields from paragraphs. + */ +function hs_paragraph_types_update_10005() { + // SHS-5661 - remove legacy Banner image(s) with text box Overlay Color field. + FieldConfig::loadByName('paragraph', 'hs_hero_image', 'field_hs_hero_overlay_color')->delete(); +} diff --git a/docroot/profiles/humsci/su_humsci_profile/modules/humsci_default_content/content/node/3a0fcda7-c346-40e3-af09-f16ad1a3467c.yml b/docroot/profiles/humsci/su_humsci_profile/modules/humsci_default_content/content/node/3a0fcda7-c346-40e3-af09-f16ad1a3467c.yml index b62cd2c9d5..b0edeaff76 100644 --- a/docroot/profiles/humsci/su_humsci_profile/modules/humsci_default_content/content/node/3a0fcda7-c346-40e3-af09-f16ad1a3467c.yml +++ b/docroot/profiles/humsci/su_humsci_profile/modules/humsci_default_content/content/node/3a0fcda7-c346-40e3-af09-f16ad1a3467c.yml @@ -1258,10 +1258,6 @@ default: target_uuid: 287db095-35b1-4050-8d26-5d8332eeb6a6 title: 'Link to The Homepage' options: { } - field_hs_hero_overlay_color: - - - color: 00505c - opacity: !!float 0 field_hs_hero_title: - value: 'Hero (Layered) - Slider title text' @@ -1293,10 +1289,6 @@ default: field_hs_hero_image: - entity: 941470f3-b916-4e5f-b53d-e2386277d01c - field_hs_hero_overlay_color: - - - color: 00505c - opacity: !!float 0 field_hs_hero_title: - value: 'Hero (Layered) - Slider title text 2' @@ -1333,10 +1325,6 @@ default: target_uuid: 287db095-35b1-4050-8d26-5d8332eeb6a6 title: 'Learn more' options: { } - field_hs_hero_overlay_color: - - - color: 00505c - opacity: !!float 0 field_hs_hero_title: - value: 'Hero (Overlay) component section' diff --git a/docroot/profiles/humsci/su_humsci_profile/su_humsci_profile.profile b/docroot/profiles/humsci/su_humsci_profile/su_humsci_profile.profile index 4f310c3240..4fc0b40601 100644 --- a/docroot/profiles/humsci/su_humsci_profile/su_humsci_profile.profile +++ b/docroot/profiles/humsci/su_humsci_profile/su_humsci_profile.profile @@ -5,6 +5,8 @@ * su_humsci_profile.profile */ +use Drupal\ckeditor5\Plugin\CKEditor5PluginDefinition; +use Drupal\config_pages\ConfigPagesInterface; use Drupal\Core\Access\AccessResult; use Drupal\Core\Block\BlockPluginInterface; use Drupal\Core\Cache\Cache; @@ -12,19 +14,18 @@ use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Field\FieldDefinitionInterface; use Drupal\Core\Field\FieldItemListInterface; use Drupal\Core\Form\FormStateInterface; +use Drupal\Core\Routing\RouteMatchInterface; use Drupal\Core\Session\AccountInterface; use Drupal\Core\Url; -use Drupal\config_pages\ConfigPagesInterface; use Drupal\menu_link_content\MenuLinkContentInterface; use Drupal\menu_position\Entity\MenuPositionRule; use Drupal\node\NodeInterface; +use Drupal\paragraphs\Plugin\Field\FieldWidget\ParagraphsWidget; use Drupal\pathauto\PathautoPatternInterface; use Drupal\su_humsci_profile\HumsciCleanup; use Drupal\user\Entity\Role; use Drupal\user\RoleInterface; use Drupal\user\UserInterface; -use Drupal\Core\Routing\RouteMatchInterface; -use Drupal\paragraphs\Plugin\Field\FieldWidget\ParagraphsWidget; /** * Implements hook_ENTITY_TYPE_insert(). @@ -891,3 +892,21 @@ function su_humsci_profile_preprocess_form_element(&$variables) { $variables['#attached']['library'][] = 'su_humsci_profile/select-preact'; } } + +/** + * Implements hook_ckeditor5_plugin_info_alter(). + */ +function su_humsci_profile_ckeditor5_plugin_info_alter(array &$plugin_definitions) { + /* + * Adds default header row to CKEditor tables. + * @see https://www.drupal.org/forum/support/post-installation/2023-10-19/how-can-i-configure-defaultheadings-in-ckeditor-tables + * */ + if (isset($plugin_definitions['ckeditor5_table'])) { + $tableDefinition = $plugin_definitions['ckeditor5_table']->toArray(); + $tableDefinition['ckeditor5']['config']['table']['defaultHeadings'] = [ + 'rows' => 1, + 'columns' => 0, + ]; + $plugin_definitions['ckeditor5_table'] = new CKEditor5PluginDefinition($tableDefinition); + } +} diff --git a/docroot/themes/humsci/humsci_basic/src/scss/_main.scss b/docroot/themes/humsci/humsci_basic/src/scss/_main.scss index b7bfab82cf..7d73f3ffec 100644 --- a/docroot/themes/humsci/humsci_basic/src/scss/_main.scss +++ b/docroot/themes/humsci/humsci_basic/src/scss/_main.scss @@ -168,6 +168,7 @@ $fa-font-path: "../../humsci_basic/node_modules/@fortawesome/fontawesome-free/we 'components/postcard', 'components/linked-cards', 'components/vertical-linked-card', + 'components/vertical-button-card', 'components/block-layout', 'components/pattern.table-pattern', 'components/pattern.table-row', diff --git a/docroot/themes/humsci/humsci_basic/src/scss/ckeditor/imports.scss b/docroot/themes/humsci/humsci_basic/src/scss/ckeditor/imports.scss index 5068a75062..283dcccbba 100644 --- a/docroot/themes/humsci/humsci_basic/src/scss/ckeditor/imports.scss +++ b/docroot/themes/humsci/humsci_basic/src/scss/ckeditor/imports.scss @@ -256,6 +256,7 @@ $px-only: true; thead th { @include table-heading; + color: var(--palette--white); } thead tr { @@ -271,6 +272,7 @@ $px-only: true; @include hb-blockquote; overflow: visible; font-size: 24px; + font-style: normal; @include grid-media-min('lg') { font-size: 28px; diff --git a/docroot/themes/humsci/humsci_basic/src/scss/components/_vertical-button-card.scss b/docroot/themes/humsci/humsci_basic/src/scss/components/_vertical-button-card.scss new file mode 100644 index 0000000000..e61f16898f --- /dev/null +++ b/docroot/themes/humsci/humsci_basic/src/scss/components/_vertical-button-card.scss @@ -0,0 +1,116 @@ +.hb-vertical-button-card { + position: relative; + + .hb-card__graphics { + margin-bottom: 0; + + img { + width: 100%; + } + } + + .hs-button { + width: 100%; + font-size: hb-calculate-rems(18px); + + &:hover, + &:focus, + &.is-focused { + background-color: var(--palette--primary-dark); + border-color: var(--palette--primary-dark); + } + } + + @include hb-traditional { + border: 2px solid var(--palette--secondary); + background-color: var(--palette--white); + + .hb-card__graphics { + padding: hb-spacing-width('xs') hb-spacing-width('sm') 0; + } + + .hb-card__content { + padding: hb-spacing-width('sm'); + margin-bottom: hb-spacing-width('sm'); + } + + .hs-button { + @include hb-secondary-button; + + position: absolute; + bottom: 0; + left: 0; + right: 0; + border-width: 0; + border-top-width: 2px; + } + } + + @include hb-colorful { + .hb-card__graphics { + position: absolute; + top: 0; + left: 0; + right: 0; + padding: 0 hb-calculate-rems(36px); + } + + .hb-card__title { + margin-bottom: hb-calculate-rems(18px); + color: var(--palette--secondary); + } + + .hb-card__content-wrapper { + padding: hb-spacing-width('sm') hb-calculate-rems(36px); + border: 2px solid var(--palette--tertiary-highlight); + box-shadow: hb-calculate-rems(1px) hb-calculate-rems(7.5px) hb-calculate-rems(35px) color-mix(in srgb, var(--palette--black) 10%, transparent); + + @include hb-themes(('airy', 'colorful')) { + background-color: var(--palette--white); + } + + .hb-raised-cards--uniform-height & { + height: 100%; + display: flex; + flex-direction: column; + justify-content: space-between; + } + + .hb-card__content { + padding: 0; + } + } + + &:has(.hb-card__graphics) { + padding-top: 40%; + + .paragraph--type--hs-collection .item-per-row--2 &, + .paragraph--type--hs-collection .item-per-row--3 &, + .paragraph--type--hs-collection .item-per-row--4 & { + padding-top: 30%; + } + + .hb-card__title { + margin-top: hb-calculate-rems(28px); + } + + .hb-card__content-wrapper { + padding-top: 25%; + + .paragraph--type--hs-collection .item-per-row--2 & { + padding-top: 30%; + } + + .paragraph--type--hs-collection .item-per-row--4 & { + padding-top: 15%; + } + } + } + + .hs-button { + border-radius: 0; + background-color: var(--palette--primary); + border-color: var(--palette--primary); + } + } +} diff --git a/docroot/themes/humsci/humsci_basic/src/scss/utilities/_raised-cards.scss b/docroot/themes/humsci/humsci_basic/src/scss/utilities/_raised-cards.scss index 3f2dad2d67..a7ef2af048 100644 --- a/docroot/themes/humsci/humsci_basic/src/scss/utilities/_raised-cards.scss +++ b/docroot/themes/humsci/humsci_basic/src/scss/utilities/_raised-cards.scss @@ -121,6 +121,18 @@ margin-top: 0; } + .hb-vertical-button-card { + box-shadow: none; + + @include hb-traditional { + padding: 0; + } + + @include hb-themes(('airy', 'colorful')) { + background-color: transparent; + } + } + .hs-paragraph-style--well, .hs-paragraph-style--well-full-width { .hb-testimonial__wrapper::before {