Skip to content

Commit

Permalink
"8.x-2.x > 8.2.1 (#81)
Browse files Browse the repository at this point in the history
* 8.2.1
  • Loading branch information
imonroe authored May 20, 2020
1 parent 1baa0ec commit 79b76a6
Show file tree
Hide file tree
Showing 11 changed files with 13 additions and 158 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Stanford News

8.x-2.1
--------------------------------------------------------------------------------
_Release Date: 2020-05-20_

- D8CORE-000: Changed headline field to 180 characters. (#79) (739ecfe)
- D8CORE-2110: Removed news views paragraph type. (#78) (35a5525)

8.x-2.0
--------------------------------------------------------------------------------
_Release Date: 2020-05-15_
Expand Down
7 changes: 3 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,12 @@
"drupal/paragraphs": "^1.11",
"drupal/pathauto": "^1.8",
"drupal/rabbit_hole": "^1.0-beta6",
"drupal/taxonomy_menu": "dev-3.x",
"drupal/viewfield": "^3.0-beta5",
"drupal/taxonomy_menu": "dev-3.x#c0892fa9b428ceb784876554c9b80f49d72a246f",
"drupal/views_block_filter_block": "^1.0",
"drupal/views_infinite_scroll": "^1.6",
"drupal/views_taxonomy_term_name_depth": "^6.0",
"su-sws/jumpstart_ui": "^8.1.5",
"su-sws/stanford_text_editor": "^8.1.6"
"su-sws/jumpstart_ui": "~8.1.0",
"su-sws/stanford_text_editor": "~8.1.0"
},
"extra": {
"enable-patching": true,
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ field_name: su_news_headline
entity_type: node
bundle: stanford_news
label: Headline
description: 'Maximum 70 characters.'
description: 'Maximum 180 characters.'
required: true
translatable: false
default_value: { }
Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion config/install/field.storage.node.su_news_headline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ field_name: su_news_headline
entity_type: node
type: string
settings:
max_length: 70
max_length: 180
is_ascii: false
case_sensitive: false
module: core
Expand Down
20 changes: 0 additions & 20 deletions config/install/field.storage.paragraph.su_news_view_field.yml

This file was deleted.

11 changes: 0 additions & 11 deletions config/install/paragraphs.paragraphs_type.news_views.yml

This file was deleted.

4 changes: 1 addition & 3 deletions stanford_news.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ type: module
description: 'Stanford news items and views.'
core_version_requirement: ^8.8 || ^9
package: Stanford
version: 8.x-2.0
version: 8.x-2.1
dependencies:
- allowed_formats:allowed_formats
- auto_entitylabel:auto_entitylabel
Expand Down Expand Up @@ -40,11 +40,9 @@ dependencies:
- ui_patterns:ui_patterns_layouts
- ui_patterns:ui_patterns_library
- ui_patterns:ui_patterns_views
- viewfield:viewfield
- views_block_filter_block:views_block_filter_block
- views_infinite_scroll:views_infinite_scroll
- views_taxonomy_term_name_depth:views_taxonomy_term_name_depth

component-libraries:
news:
paths:
Expand Down
32 changes: 0 additions & 32 deletions stanford_news.module
Original file line number Diff line number Diff line change
Expand Up @@ -167,38 +167,6 @@ function stanford_news_field_widget_form_alter(&$element, FormStateInterface $fo
if ($field instanceof FieldConfigInterface && $field->id() == "node.stanford_news.su_news_topics") {
$element['#stanford_news_topics_add_more'] = t('Add another term');
}

// Remove unwanted view displays from view field options.
if ($element['#entity_type'] == "paragraph" && $element['#bundle'] == "news_views") {
unset($element['display_id']['#options']['topics_list']);
unset($element['display_id']['#options']['term_block']);
unset($element['display_id']['#options']['vertical_teaser_term_list']);
}
}

/**
* Implements hook_react_paragraphs_form_field_data_alter().
*/
function stanford_news_react_paragraphs_form_field_data_alter(array &$info, array $field_element, FieldConfigInterface $field_config) {

// Only alter data for the news_views view field.
if ($field_config->getName() !== "su_news_view_field") {
return;
}

// We want to remove a few displays from the options.
// See stanford_news_field_widget_form_alter for the same appraoch.
$deny_list = ['topics_list', 'term_block', 'vertical_teaser_term_list'];
$vals = array_column($info['displays']['stanford_news'], 'value');

// Loop through the options and trim some.
foreach ($deny_list as $display_name) {
$index = array_search($display_name, $vals);
if (is_int($index)) {
unset($info['displays']['stanford_news'][$index]);
}
}
sort($info['displays']['stanford_news']);
}

/**
Expand Down

0 comments on commit 79b76a6

Please sign in to comment.