Skip to content

Commit

Permalink
Four Kitchens Release - Sprint 45 (#1470)
Browse files Browse the repository at this point in the history
* feat(shs-4945): remove tertiary-reversed-darken-10 from the color mapping files (#1467)
* feat(shs-4946): remove spotlight-lighten-8 from the color mapping files and update reference to spotlight (#1468)
* SHS-5498: Shortcut menu is not displaying in admin toolbar for site editors when they log in (#1465)
* feat(shs-5498): open shortcuts toolbar menu by default on user login
* feat(shs-5498): only open shortcuts if it's not already selected on login
* feat(shs-5497): respect reduced motion for nav caret animation (#1469)
* SHS-5504: Prevent JS error when link is absent in vertical linked cards (#1471)
* chore(shs-5504): add prettier config to match eslint
* SHS-5501: Add "Raised Cards" and "Uniform Height" options to Private Collection paragraph (#1466)
* feat(shs-5501): add Uniform Height and Raised Cards fields to private collection component
* feat(shs-5501): add template for private collection paragraphs
  • Loading branch information
cienvaras authored Mar 12, 2024
1 parent b8c4ce9 commit 3d5d350
Show file tree
Hide file tree
Showing 24 changed files with 237 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ dependencies:
config:
- field.field.paragraph.hs_priv_collection.field_hs_collection_items
- field.field.paragraph.hs_priv_collection.field_hs_collection_per_row
- field.field.paragraph.hs_priv_collection.field_hs_collection_uh
- field.field.paragraph.hs_priv_collection.field_paragraph_style
- field.field.paragraph.hs_priv_collection.field_raised_cards
- paragraphs.paragraphs_type.hs_priv_collection
module:
- paragraphs
Expand All @@ -16,7 +18,7 @@ mode: default
content:
field_hs_collection_items:
type: paragraphs
weight: 2
weight: 4
region: content
settings:
title: Paragraph
Expand All @@ -39,12 +41,44 @@ content:
region: content
settings: { }
third_party_settings: { }
field_hs_collection_uh:
type: boolean_checkbox
weight: 3
region: content
settings:
display_label: true
third_party_settings:
conditional_fields:
d755369a-3372-40fb-896b-2cfddbdaff67:
entity_type: paragraph
bundle: hs_collection
dependee: field_raised_cards
settings:
state: visible
reset: false
condition: checked
grouping: AND
values_set: 1
value: ''
values: { }
value_form:
value: false
effect: show
effect_options: { }
selector: ''
field_paragraph_style:
type: options_select
weight: 1
region: content
settings: { }
third_party_settings: { }
field_raised_cards:
type: boolean_checkbox
weight: 2
region: content
settings:
display_label: true
third_party_settings: { }
hidden:
created: true
status: true
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ dependencies:
config:
- field.field.paragraph.hs_priv_collection.field_hs_collection_items
- field.field.paragraph.hs_priv_collection.field_hs_collection_per_row
- field.field.paragraph.hs_priv_collection.field_hs_collection_uh
- field.field.paragraph.hs_priv_collection.field_paragraph_style
- field.field.paragraph.hs_priv_collection.field_raised_cards
- paragraphs.paragraphs_type.hs_priv_collection
module:
- entity_reference_revisions
Expand All @@ -25,5 +27,7 @@ content:
region: content
hidden:
field_hs_collection_per_row: true
field_hs_collection_uh: true
field_paragraph_style: true
field_raised_cards: true
search_api_excerpt: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
uuid: 728a7bac-e9b6-425d-91ce-26144938d1bb
langcode: en
status: true
dependencies:
config:
- field.storage.paragraph.field_hs_collection_uh
- paragraphs.paragraphs_type.hs_priv_collection
id: paragraph.hs_priv_collection.field_hs_collection_uh
field_name: field_hs_collection_uh
entity_type: paragraph
bundle: hs_priv_collection
label: 'Uniform Height'
description: 'Applies the uniform height styling to the raised cards. This option is decorative.'
required: false
translatable: false
default_value:
-
value: 1
default_value_callback: ''
settings:
on_label: 'On'
off_label: 'Off'
field_type: boolean
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
uuid: 67d1228e-1ec8-46de-b358-b3b37cff9607
langcode: en
status: true
dependencies:
config:
- field.storage.paragraph.field_raised_cards
- paragraphs.paragraphs_type.hs_priv_collection
id: paragraph.hs_priv_collection.field_raised_cards
field_name: field_raised_cards
entity_type: paragraph
bundle: hs_priv_collection
label: 'Raised Cards'
description: 'Applies the raised cards styling to views, cards, timelines and testimonials within a collection. This option is decorative. '
required: false
translatable: false
default_value:
-
value: 0
default_value_callback: ''
settings:
on_label: 'On'
off_label: 'Off'
field_type: boolean
19 changes: 19 additions & 0 deletions docroot/modules/humsci/hs_admin/assets/js/default_shortcuts.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Drupal.behaviors.defaultShortcuts = {
attach: function (context, settings) {
if (!settings.user.uid) {
// If the user is not logged in, clear the active toolbar tab ID.
window.localStorage.removeItem('Drupal.toolbar.activeTabID');
return;
}

// Get the toolbar shortcuts toolbar button. Only users with the
// 'access shortcuts' permission will have this button.
const shortcutsItem = context.querySelector('#toolbar-item-shortcuts');
if (!window.localStorage.getItem('Drupal.toolbar.activeTabID') && shortcutsItem) {
// If the tab ID is not set and the shortcuts toolbar button exists, click it.
window.addEventListener('load', () => {
shortcutsItem.click();
});
}
},
};
7 changes: 6 additions & 1 deletion docroot/modules/humsci/hs_admin/hs_admin.libraries.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
hs_admin:
version: VERSION
css:
base:
assets/css/hs_admin.css: {}
js:
assets/js/hs_admin.js: {}

default_shortcuts:
js:
assets/js/default_shortcuts.js: {}
dependencies:
- core/drupalSettings
4 changes: 4 additions & 0 deletions docroot/modules/humsci/hs_admin/hs_admin.module
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use Drupal\Core\Cache\RefinableCacheableDependencyInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Render\Markup;
use Drupal\user\Entity\User;
use Drupal\user\UserInterface;

/**
* Implements hook_preprocess_node_edit_form().
Expand All @@ -19,6 +20,9 @@ function hs_admin_page_attachments(&$variables) {
if ($logged_in) {
$variables['#attached']['library'][] = 'hs_admin/hs_admin';
}

// Show shortcuts toolbar when user is logged in.
$variables['#attached']['library'][] = 'hs_admin/default_shortcuts';
}

/**
Expand Down

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docroot/themes/humsci/humsci_airy/css/humsci_airy.css

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions docroot/themes/humsci/humsci_basic/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"trailingComma": "all",
"tabWidth": 2,
"semi": true,
"singleQuote": true
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@ function verticalLinkedCard() {
// Loop through each card
cards.forEach((card) => {
// Find the main link within each card
const mainLink = card.querySelector('.hb-vertical-linked-card__title__link');
const mainLink = card.querySelector(
'.hb-vertical-linked-card__title__link',
);

if (!mainLink) {
return;
}

// Add a click event listener to each card
function handleClick() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,14 @@
}
/* stylelint-enable max-nesting-depth */
}

.hs-full-width & {
bottom: 11rem;

@include grid-media-min('md') {
bottom: hb-calculate-rems(47px);
}
}
}

@include hb-traditional {
Expand All @@ -614,7 +622,15 @@
}

.hs-full-width & {
bottom: hb-calculate-rems(60px);
bottom: hb-calculate-rems(78px);

@include grid-media-min('md') {
bottom: hb-calculate-rems(54px);
}

@include grid-media-min('xl') {
bottom: hb-calculate-rems(78px);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
&--light,
&--light::before,
&--light::after {
@include hb-pairing-color('background-color', 'spotlight-lighten-8');
@include hb-pairing-color('background-color', 'spotlight');
}

&--light {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@

&__text {
@include hb-hero-text;
display: flex;
flex-direction: column;
max-width: hb-calculate-rems($hb-layout-XXL-width) !important; // override max page width set in hb-page-width mixin
padding-right: hb-calculate-rems(24px);

Expand All @@ -43,6 +45,7 @@
}

h2,
h3,
.field-hs-gradient-hero-body p {
@include hb-traditional {
margin-bottom: 0;
Expand All @@ -58,6 +61,11 @@
text-align: right;
}

h2,
h3 {
align-self: flex-end;
}

.field-hs-gradient-hero-body {
flex-direction: column;
align-items: flex-end;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,8 @@ $hc-colorful-pairings: (
"tertiary-highlight": #c2f7ff,
"tertiary-highlight-darken-10": darken(#c2f7ff, 10%),
"tertiary-reversed": #00d5f5,
"tertiary-reversed-darken-10": darken(#00d5f5, 10%),
"tertiary-darken-20": darken(#007c8f, 20%),
"spotlight": #e4f4ee,
"spotlight-lighten-8": #e3f4ed,
"spotlight": #e4f4ee
),
"mountain": (
"primary": #64305f,
Expand All @@ -38,10 +36,8 @@ $hc-colorful-pairings: (
"tertiary-highlight": #befde5,
"tertiary-highlight-darken-10": darken(#befde5, 10%),
"tertiary-reversed": #74fbc7,
"tertiary-reversed-darken-10": darken(#74fbc7, 10%),
"tertiary-darken-20": darken(#148762, 20%),
"spotlight": #e4f5ff,
"spotlight-lighten-8": #e3f5fe,
"spotlight": #e4f5ff
),
"cardinal": (
"primary": #600e0e,
Expand All @@ -56,10 +52,8 @@ $hc-colorful-pairings: (
"tertiary-highlight": #e8e9ea,
"tertiary-highlight-darken-10": darken(#e8e9ea, 10%),
"tertiary-reversed": #cecfd1,
"tertiary-reversed-darken-10": darken(#cecfd1, 10%),
"tertiary-darken-20": darken(#b1040e, 20%),
"spotlight": #e9e6e2,
"spotlight-lighten-8": #e6e3e0,
"spotlight": #e9e6e2
),
"lake": (
"primary": #005160,
Expand All @@ -74,10 +68,8 @@ $hc-colorful-pairings: (
"tertiary-highlight": #e3ddd1,
"tertiary-highlight-darken-10": darken(#c9c5bf, 10%),
"tertiary-reversed": #fdfcf2,
"tertiary-reversed-darken-10": darken(#dcdbd2, 10%),
"tertiary-darken-20": darken(#485045, 20%),
"spotlight": #e1eadd,
"spotlight-lighten-8": #dde8dc,
"spotlight": #e1eadd
),
"canyon": (
"primary": #005160,
Expand All @@ -92,10 +84,8 @@ $hc-colorful-pairings: (
"tertiary-highlight": #dbdbdb,
"tertiary-highlight-darken-10": darken(#cacaca, 10%),
"tertiary-reversed": #ebebeb,
"tertiary-reversed-darken-10": darken(#d1d1d1, 10%),
"tertiary-darken-20": darken(#006073, 20%),
"spotlight": #dfedef,
"spotlight-lighten-8": #dcebed,
"spotlight": #dfedef
),
"cliff": (
"primary": #8c1515,
Expand All @@ -110,10 +100,8 @@ $hc-colorful-pairings: (
"tertiary-highlight": #e8e9ea,
"tertiary-highlight-darken-10": darken(#dbdbdb, 10%),
"tertiary-reversed": #cecfd1,
"tertiary-reversed-darken-10": darken(#b3b4b5, 10%),
"tertiary-darken-20": darken(#620e0e, 20%),
"spotlight": #dfedef,
"spotlight-lighten-8": #dcebed,
"spotlight": #dfedef
),
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,8 @@ $ht-traditional-pairings: (
"tertiary-highlight": #f4f4f4,
"tertiary-highlight-darken-10": darken(#f4f4f4, 10%),
"tertiary-reversed": #dbdcde,
"tertiary-reversed-darken-10": darken(#dbdcde, 10%),
"tertiary-darken-20": darken(#b1040e, 20%),
"spotlight": #dde0e0,
"spotlight-lighten-8": #D9DEDE
"spotlight": #dde0e0
),
"bluejay": (
"primary": #600e0e,
Expand All @@ -38,10 +36,8 @@ $ht-traditional-pairings: (
"tertiary-highlight": #e9f5f6,
"tertiary-highlight-darken-10": darken(#e9f5f6, 10%),
"tertiary-reversed": #daebed,
"tertiary-reversed-darken-10": darken(#daebed, 10%),
"tertiary-darken-20": darken(#b1040e, 20%),
"spotlight": #e9f5f6,
"spotlight-lighten-8": #D0E7E1
"spotlight": #e9f5f6
),
"warbler": (
"primary": #003b45,
Expand All @@ -56,10 +52,8 @@ $ht-traditional-pairings: (
"tertiary-highlight": #faf8f7,
"tertiary-highlight-darken-10": #e0dfdc,
"tertiary-reversed": #dcd9d3,
"tertiary-reversed-darken-10": #9e9c97,
"tertiary-darken-20": #41473e,
"spotlight": #e1eadd,
"spotlight-lighten-8": #DDE8DC
"spotlight": #e1eadd
),
"firefinch": (
"primary": #A64C47,
Expand All @@ -74,10 +68,8 @@ $ht-traditional-pairings: (
"tertiary-highlight": #FEF6E2,
"tertiary-highlight-darken-10": darken(#FEF6E2, 10%),
"tertiary-reversed": #F4F4F4,
"tertiary-reversed-darken-10": darken(#F4F4F4, 10%),
"tertiary-darken-20": darken(#8C1515, 20%),
"spotlight": #E0E0D1,
"spotlight-lighten-8": #DCDED0
"spotlight": #E0E0D1
)
);

Expand Down
Loading

0 comments on commit 3d5d350

Please sign in to comment.