Skip to content

Commit

Permalink
Four Kitchens Release - Sprint 56 (#1597)
Browse files Browse the repository at this point in the history
* SHS-5692: Implementation: New Spotlight design for Colorful and Traditional (#1589)
* SHS-5772: Regression: External Links on Postcards are wrong color (#1591)
* SHS-5629: Editors can more easily edit a caption (#1580)
* SHS-5661: Remove legacy fields (#1577)
* SHS-4929: Hide caption/credits on images in default views (#1578)
* SHS-5675: Helping users avoid 'Table cell missing context (e.g. headings) A11y warning (#1579)
  • Loading branch information
cienvaras authored Aug 13, 2024
1 parent e28b037 commit 29f076f
Show file tree
Hide file tree
Showing 12 changed files with 243 additions and 44 deletions.
4 changes: 3 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,9 @@
"https://www.drupal.org/project/drupal/issues/3306916": "https://www.drupal.org/files/issues/2023-12-19/3306916-18.patch",
"views form null fix": "patches/core-views.patch",
"CKEditor 5 headings plugin paragraph label change": "patches/ckeditor5-paragraph-rename.patch",
"Allow hs group blocks in layout_builder": "patches/layout_builder-allow-hs-blocks.patch"
"Allow hs group blocks in layout_builder": "patches/layout_builder-allow-hs-blocks.patch",
"Allow media items to be edited in a modal when using the field widget https://www.drupal.org/project/drupal/issues/2985168": "https://www.drupal.org/files/issues/2023-12-18/2985168-172.patch",
"Cannot read properties of undefined (reading 'settings') with dialog.position.js https://www.drupal.org/project/drupal/issues/3356667": "https://www.drupal.org/files/issues/2024-08-09/3356667-undefined-settings-dialog-position-51.patch"
},
"drupal/entity_reference_exposed_filters": {
"https://www.drupal.org/project/entity_reference_exposed_filters/issues/3189025": "https://www.drupal.org/files/issues/2023-10-17/entity_reference_exposed_filters-empty_target-3189025-4.patch"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ dependencies:
- field.field.paragraph.hs_spotlight.field_hs_spotlight_image_align
- field.field.paragraph.hs_spotlight.field_hs_spotlight_link
- field.field.paragraph.hs_spotlight.field_hs_spotlight_title
- field.field.paragraph.hs_spotlight.field_spotlight_style
- paragraphs.paragraphs_type.hs_spotlight
module:
- allowed_formats
Expand Down Expand Up @@ -81,6 +82,12 @@ content:
size: 60
placeholder: ''
third_party_settings: { }
field_spotlight_style:
type: options_select
weight: 7
region: content
settings: { }
third_party_settings: { }
hidden:
created: true
status: true
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ dependencies:
- field.field.paragraph.hs_spotlight.field_hs_spotlight_image_align
- field.field.paragraph.hs_spotlight.field_hs_spotlight_link
- field.field.paragraph.hs_spotlight.field_hs_spotlight_title
- field.field.paragraph.hs_spotlight.field_spotlight_style
- paragraphs.paragraphs_type.hs_spotlight
module:
- ds
Expand Down Expand Up @@ -123,4 +124,5 @@ hidden:
field_hs_spotlight_bg: true
field_hs_spotlight_height: true
field_hs_spotlight_image_align: true
field_spotlight_style: true
search_api_excerpt: true
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ dependencies:
- field.field.paragraph.hs_spotlight.field_hs_spotlight_image_align
- field.field.paragraph.hs_spotlight.field_hs_spotlight_link
- field.field.paragraph.hs_spotlight.field_hs_spotlight_title
- field.field.paragraph.hs_spotlight.field_spotlight_style
- paragraphs.paragraphs_type.hs_spotlight
module:
- ds
Expand Down Expand Up @@ -129,4 +130,5 @@ hidden:
field_hs_spotlight_bg: true
field_hs_spotlight_height: true
field_hs_spotlight_image_align: true
field_spotlight_style: true
search_api_excerpt: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
uuid: 7bd01afb-289b-4103-a7e7-acbabc87189e
langcode: en
status: true
dependencies:
config:
- field.storage.paragraph.field_spotlight_style
- paragraphs.paragraphs_type.hs_spotlight
module:
- options
id: paragraph.hs_spotlight.field_spotlight_style
field_name: field_spotlight_style
entity_type: paragraph
bundle: hs_spotlight
label: 'Spotlight Style'
description: ''
required: false
translatable: false
default_value: { }
default_value_callback: ''
settings: { }
field_type: list_string
24 changes: 24 additions & 0 deletions config/default/field.storage.paragraph.field_spotlight_style.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
uuid: bcc6ce07-7895-4a5c-810a-f2d17534ce3e
langcode: en
status: true
dependencies:
module:
- options
- paragraphs
id: paragraph.field_spotlight_style
field_name: field_spotlight_style
entity_type: paragraph
type: list_string
settings:
allowed_values:
-
value: expanded
label: Expanded
allowed_values_function: ''
module: options
locked: false
cardinality: 1
translatable: true
indexes: { }
persist_with_no_fields: false
custom_storage: false
7 changes: 7 additions & 0 deletions docroot/modules/humsci/hs_layouts/hs_layouts.module
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,13 @@ function hs_layouts_preprocess_pattern_spotlight(&$variables) {
$bgValue = $paragraph->get('field_hs_spotlight_bg')->getString();
$variables['attributes']->addClass(Html::cleanCssIdentifier($bgValue));
}
if (
$paragraph instanceof ParagraphInterface &&
$paragraph->hasField('field_spotlight_style')
) {
$className = $paragraph->get('field_spotlight_style')->isEmpty() ? 'classic' : $paragraph->get('field_spotlight_style')->getString();
$variables['attributes']->addClass(Html::cleanCssIdentifier('hb-spotlight--' . $className));
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,4 +147,8 @@ function hs_paragraph_types_field_widget_complete_options_select_form_alter(arra
if (isset($context['items']) && $context['items']->getName() == 'field_accordion_style') {
$field_widget_form['widget']['#options']['_none'] = t('Default');
}
// Change the default option label for field_spotlight_style.
if (isset($context['items']) && $context['items']->getName() == 'field_spotlight_style') {
$field_widget_form['widget']['#options']['_none'] = t('Classic');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,21 @@ const restrictHeight = () => {
}

// If the textBoxes are spotlight textBoxes, then give them the same height on all screen sizes
textBoxes.forEach(
(textBox) => isSpotlightTextBox(textBox) && setMinHeight(textBox, maxBoxHeight),
);
textBoxes.forEach((textBox) => {
const classicSpotlight = slide.querySelector('.hb-spotlight--classic');
if (isSpotlightTextBox(textBox) && classicSpotlight) {
setMinHeight(textBox, maxBoxHeight);
}
});

// Find all spotlights texBoxes wrappers to give them the same height on all screen sizes
const expandedSpotlights = slide.querySelectorAll('.hb-spotlight--expanded');
if (expandedSpotlights) {
expandedSpotlights.forEach((expandedSpotlight) => {
const expandedSpotlightWrapper = expandedSpotlight.querySelector('.hb-spotlight__wrapper');
setMinHeight(expandedSpotlightWrapper, maxBoxHeight);
});
}

// Find images inside each slider.
const imageWrapper = slide.querySelector('.hb-spotlight__image-wrapper');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,8 @@
}

a {
@include hb-link;

// Warbler color pairing override.
@include hb-traditional {
.ht-pairing-warbler & {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.hb-vertical-card,
.hb-card--date-stacked {
// Needed to make the styles work when the anchor is the wrapper.
.hb-card__title a:not([class]),
.hb-card__title a,
.hb-card__title a > div > * {
@include hb-link;
}
Expand All @@ -25,9 +25,8 @@
transform: scale($hb-image-hover-scale);
}

.hb-card__title a,
// Needed to make the styles work when the anchor is the wrapper.
.hb-card__title a:not([class]),
.hb-card__title a,
.hb-card__title a > div > * {
color: var(--palette--black);

Expand All @@ -36,7 +35,7 @@
transition-delay: 0s, 0s;
box-shadow: inset 0 hb-calculate-rems(-14px) 0 var(--palette--tertiary-highlight);
}

@include hb-traditional {
color: var(--palette--black);
background-image: none;
Expand Down
Loading

0 comments on commit 29f076f

Please sign in to comment.