Skip to content

Commit

Permalink
fix(v1.10.0): multiple fixes
Browse files Browse the repository at this point in the history
v1.10.0: Multiple fixes
  • Loading branch information
dblanken-yale authored Nov 12, 2024
2 parents 8fc4adb + 7add2c8 commit 9120a73
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 9 deletions.
2 changes: 1 addition & 1 deletion patches/layout_builder_browser/3408935-and-3409153-9.patch
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ index 34310e2..fa855a6 100644
+ if ($config->get('group_reusable_blocks_together')) {
+
+ foreach ($block_links as $key => $block_link) {
+ $changed = date('m/d/Y - H:i', $block_link['#changed']);
+ $changed = date('m/d/Y - H:i', $block_link['link']['#changed']);
+ $block_links[$key]['link']['#title']['label']['#markup'] = "
+ <span class='underlined-title'>{$block_link['link']['#title']['label']['#markup']}</span>
+ <br>
Expand Down
4 changes: 2 additions & 2 deletions web/profiles/custom/yalesites_profile/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
"drupal/paragraphs_features": "2.0.0",
"drupal/pathauto": "1.13.0",
"drupal/publishcontent": "1.6",
"drupal/quick_node_clone": "1.18.0",
"drupal/quick_node_clone": "1.19.0",
"drupal/recaptcha": "3.4.0",
"drupal/recaptcha_v3": "2.0.3",
"drupal/redirect": "1.10.0",
Expand All @@ -112,7 +112,7 @@
"laminas/laminas-escaper": "2.13.0",
"northernco/ckeditor5-anchor-drupal": "0.4.0",
"yalesites-org/ai_engine": "1.2.5",
"yalesites-org/atomic": "1.39.0",
"yalesites-org/atomic": "1.39.1",
"yalesites-org/yale_cas": "v1.0.5"
},
"minimum-stability": "dev",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ public function formElement(

$formSelectors = $this->viewsBasicManager->getFormSelectors($formState, NULL, $entityValue);
$form['#form_selectors'] = $formSelectors;
$selectedEntityType = $formSelectors['entity_types'];

$element['group_params'] = [
'#type' => 'container',
Expand Down Expand Up @@ -227,14 +228,22 @@ public function formElement(
$fieldOptionValue = ($items[$delta]->params) ? $this->viewsBasicManager->getDefaultParamValue('field_options', $items[$delta]->params) : [];
$fieldOptionDefaultValue = $fieldOptionValue ?? ['show_thumbnail' => 'show_thumbnail'];
$isNewForm = str_contains($formState->getCompleteForm()['#id'], 'layout-builder-add-block');

// To be consistent in the output render, we name categories affiliation in
// the views form if they select profiles.
$showCategoriesLabel = $this->t("Show Categories");
if ($selectedEntityType === "profile") {
$showCategoriesLabel = $this->t("Show Affiliations");
}

// Set the default value for 'field_options' to 'show_thumbnail'
// when creating a new block.
$form['group_user_selection']['entity_and_view_mode']['field_options'] = [
'#type' => 'checkboxes',
'#options' => [
'show_categories' => $this->t('Show Categories'),
'show_categories' => $showCategoriesLabel,
'show_tags' => $this->t('Show Tags'),
'show_thumbnail' => $this->t('Show Thumbnail'),
'show_thumbnail' => $this->t('Show Teaser Image'),
],
'#title' => $this->t('Field Display Options'),
'#tree' => TRUE,
Expand All @@ -255,9 +264,9 @@ public function formElement(
$form['group_user_selection']['entity_and_view_mode']['exposed_filter_options'] = [
'#type' => 'checkboxes',
'#options' => [
'show_search_filter' => $this->t('Show Search Filter'),
'show_year_filter' => $this->t('Show Year Filter'),
'show_category_filter' => $this->t('Show Category Filter'),
'show_search_filter' => $this->t('Show Search'),
'show_year_filter' => $this->t('Show Year'),
'show_category_filter' => $this->t('Show Category'),
],
'#title' => $this->t('Exposed Filter Options'),
'#tree' => TRUE,
Expand All @@ -279,7 +288,7 @@ public function formElement(
],
];

$vocabulary_id = $formSelectors['entity_types'] === 'profile'
$vocabulary_id = $selectedEntityType === 'profile'
? 'affiliation'
: $formSelectors['entity_types'] . '_category';
$form['group_user_selection']['entity_and_view_mode']['category_included_terms'] = [
Expand Down Expand Up @@ -361,6 +370,10 @@ public function formElement(
'past' => $this->t('Past Events') . '<img src="/profiles/custom/yalesites_profile/modules/custom/ys_views_basic/assets/icons/event-time-past.svg" alt="Past Events icon showing a calendar with a past-pointing arrow to the left.">',
'all' => $this->t('All Events') . '<img src="/profiles/custom/yalesites_profile/modules/custom/ys_views_basic/assets/icons/event-time-all.svg" alt="All Events icon showing a calendar.">',
],
'#states' => [
'visible' => [$formSelectors['entity_types_ajax'] => ['value' => 'event']],
'invisible' => $calendarViewInvisibleState,
],
'#default_value' => ($items[$delta]->params) ? $this->viewsBasicManager->getDefaultParamValue('event_time_period', $items[$delta]->params) : 'future',
'#prefix' => '<div id="edit-event-time-period">',
'#suffix' => '</div>',
Expand Down

0 comments on commit 9120a73

Please sign in to comment.