Skip to content

Commit

Permalink
8.2.29
Browse files Browse the repository at this point in the history
- Updated dependencies Mar 3 2021
- HSD8-987 Added action to mark content to be ignored by the importers
- HSD8-911 Add print friendly module
- STN-650:  Views padding refinement (#816)
- STN-654:  Bug fix for hb-list-reset incorrect markers (#815)
- STN-656: Heading Links Utility Class to add Color (#804)
- chore: document the emoji/symbols used in the utility class tables (#809)
- HSD8-995 Fixed media images not saving the caption field
- Fixed the migrate process plugin that gets the field default value
  • Loading branch information
pookmish authored Mar 3, 2021
2 parents 9377ffa + 502e896 commit 342394a
Show file tree
Hide file tree
Showing 25 changed files with 415 additions and 131 deletions.
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@
"drupal/path_redirect_import": "^1.0@beta",
"drupal/pathauto": "~1.0",
"drupal/porterstemmer": "^1.0",
"drupal/printfriendly": "^3.5",
"drupal/publishcontent": "^1.1",
"drupal/rabbit_hole": "^1.0-beta4",
"drupal/real_aes": "^2.1",
Expand Down
264 changes: 153 additions & 111 deletions composer.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions config/default/core.extension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ module:
path: 0
path_alias: 0
path_redirect_import: 0
printfriendly: 0
publishcontent: 0
rabbit_hole: 0
react_paragraphs: 0
Expand Down
1 change: 1 addition & 0 deletions config/default/fontawesome.settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ external_shim_location: 'https://use.fontawesome.com/releases/v5.1.1/js/v4-shims
_core:
default_config_hash: i4D0yTbVf8LixxV0Laf9F7uWwICKJ6f2gqf6HKiu1eg
allow_pseudo_elements: true
load_assets: true
3 changes: 1 addition & 2 deletions config/default/media.type.image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,4 @@ queue_thumbnail_downloads: false
new_revision: true
source_configuration:
source_field: field_media_image
field_map:
caption: field_media_image_caption
field_map: { }
2 changes: 2 additions & 0 deletions config/default/migrate_plus.migration.hs_capx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ process:
entity_type: node
bundle: hs_person
field: field_hs_person_image
key: target_id
field_hs_person_links:
-
plugin: skip_on_empty
Expand Down Expand Up @@ -330,6 +331,7 @@ process:
entity_type: node
bundle: hs_person
field: field_hs_person_square_img
key: target_id
destination:
plugin: 'entity_reference_revisions:node'
new_revisions: true
Expand Down
24 changes: 24 additions & 0 deletions config/default/printfriendly.settings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
printfriendly_image: printfriendly-pdf-email-button-notext.png
db_version: 1
printfriendly_display:
hs_basic_page: 0
hs_course: 0
hs_event: 0
hs_event_series: 0
hs_news: 0
hs_person: 0
hs_private_page: 0
hs_publications: 0
hs_research: 0
teaser: 0
printfriendly_page_header: default_logo
printfriendly_page_custom_header: ''
printfriendly_tagline: ''
printfriendly_click_delete: '0'
printfriendly_images: '0'
printfriendly_image_style: right
printfriendly_email: '1'
printfriendly_pdf: '0'
printfriendly_print: '0'
printfriendly_custom_css: ''
custom_button_img_url: ''
11 changes: 6 additions & 5 deletions config/default/views.view.content.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ dependencies:
module:
- node
- user
- view_unpublished
- views_bulk_operations
_core:
default_config_hash: tS8PbpJX90aRFC3-UTgXzdqkq7_2frk2pz4TMijEebM
Expand Down Expand Up @@ -199,16 +198,18 @@ display:
selected_actions:
0:
action_id: node_clone_action
6:
1:
action_id: migration_ignore
2:
action_id: node_unpublish_action
8:
7:
action_id: node_publish_action
10:
12:
action_id: views_bulk_edit
preconfiguration:
label_override: 'Change Field Values'
get_bundles_from_results: 1
11:
13:
action_id: views_bulk_operations_delete_entity
plugin_id: views_bulk_operations_bulk_form
title:
Expand Down
6 changes: 3 additions & 3 deletions config/envs/local/config_ignore.settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ ignored_config_entities:
- '~block.block.su_humsci_theme_*'
- '~block.block.su_humsci_admin_*'
- '~block.block.seven_*'
- '~block.block.humsci_basic_global_message'
- '~block.block.humsci_colorful_global_message'
- '~block.block.humsci_traditional_global_message'
- ~block.block.humsci_basic_global_message
- ~block.block.humsci_colorful_global_message
- ~block.block.humsci_traditional_global_message
- system.site
- hs_capx.settings
- 'migrate_plus.migration.*:status'
Expand Down
26 changes: 26 additions & 0 deletions docroot/modules/humsci/hs_actions/hs_actions.module
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/

use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\views\ViewExecutable;

/**
* Implements hook_help().
Expand All @@ -22,3 +23,28 @@ function hs_actions_help($route_name, RouteMatchInterface $route_match) {
default:
}
}


/**
* Implements hook_views_pre_build().
*
* For users that don't have the permission to ignore content from the importer,
* remove the option from VBO views.
*/
function hs_actions_views_pre_build(ViewExecutable $view) {
$display = $view->getDisplay();

/** @var \Drupal\views_bulk_operations\Plugin\views\field\ViewsBulkOperationsBulkForm $vbo_handler */
if ($vbo_handler = $display->getHandler('field', 'views_bulk_operations_bulk_form')) {
$current_user = \Drupal::currentUser();
foreach ($vbo_handler->options['selected_actions'] as $key => $action) {
if ($current_user->hasPermission('ignore content from importer')) {
return;
}

if ($action['action_id'] == 'migration_ignore') {
unset($vbo_handler->options['selected_actions'][$key]);
}
}
}
}
3 changes: 3 additions & 0 deletions docroot/modules/humsci/hs_actions/hs_actions.permissions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ignore content from importer:
title: 'Flag Content to be ignored with importers'
description: 'Flag the content to be ignore. The flag does not work when an importer is set to "Force Update".'
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
<?php

namespace Drupal\hs_actions\Plugin\Action;

use Drupal\Core\Access\AccessResult;
use Drupal\Core\Database\Connection;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\Core\Session\AccountInterface;
use Drupal\migrate\Plugin\MigrateIdMapInterface;
use Drupal\migrate\Plugin\MigrationPluginManagerInterface;
use Drupal\node\NodeInterface;
use Drupal\views_bulk_operations\Action\ViewsBulkOperationsActionBase;
use Symfony\Component\DependencyInjection\ContainerInterface;

/**
* Clones a node.
*
* @Action(
* id = "migration_ignore",
* label = @Translation("Ignore from importing"),
* type = "node"
* )
*/
class MigrationIgnore extends ViewsBulkOperationsActionBase implements ContainerFactoryPluginInterface {

/**
* Database connection service.
*
* @var \Drupal\Core\Database\Connection
*/
protected $database;

/**
* Migration plugin manager service.
*
* @var \Drupal\migrate\Plugin\MigrationPluginManagerInterface
*/
protected $migrationPluginManager;

/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
return new static(
$configuration,
$plugin_id,
$plugin_definition,
$container->get('database'),
$container->get('plugin.manager.migration')
);
}

/**
* {@inheritdoc}
*/
public function __construct(array $configuration, $plugin_id, $plugin_definition, Connection $database, MigrationPluginManagerInterface $migration_plugin_manager) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->database = $database;
$this->migrationPluginManager = $migration_plugin_manager;
}


/**
* {@inheritdoc}
*/
public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE) {
if (!$account->hasPermission('ignore content from importer')) {
return $return_as_object ? AccessResult::forbidden() : FALSE;
}

/** @var \Drupal\node\NodeInterface $object */
$result = $object->access('update', $account, TRUE)
->andIf($object->access('create', $account, TRUE));

return $return_as_object ? $result : $result->isAllowed();
}

/**
* {@inheritdoc}
*/
public function execute($entity = NULL) {
if ($entity instanceof NodeInterface) {
foreach ($this->migrationPluginManager->getDefinitions() as $definition) {
$table = "migrate_map_{$definition['id']}";
if (
$this->database->schema()->tableExists($table) &&
$this->database->schema()->fieldExists($table, 'destid1') &&
$this->database->schema()->fieldExists($table, 'source_row_status')
) {
$this->database->update($table)
->fields(['source_row_status' => MigrateIdMapInterface::STATUS_IGNORED])
->condition('destid1', $entity->id())
->execute();
}
}
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -270,15 +270,15 @@ public function validateForm(array &$form, FormStateInterface $form_state) {
*/
protected function getFullUrl(array $choices) {
// All our extra form fields are stored in _other.
$type = $choices['type'] ?? '';
$val = $choices[$type] ?? '';
$type = $choices['type'] ?? NULL;
$val = $choices[$type] ?? null;
$extra = $choices['org_status'] ?? '';

// Valid Data. Create a url for the uri column.
if ($type == 'featured' || $type == 'today') {
return static::STANFORD_EVENTS_IMPORTER_XML . '?' . $type;
}
if ($type && $val) {
if (!is_null($type) && !is_null($val)) {
$url = static::STANFORD_EVENTS_IMPORTER_XML . '?' . $type . '=' . $val;
// Organizations have extra options.
if ($type == 'organization' && $extra) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ public function transform($value, MigrateExecutableInterface $migrate_executable
try {
$entity = $this->getEmptyEntity($entity_type, $bundle);
$value = $field->getDefaultValue($entity);

if (!empty($this->configuration['key'])) {
return $value[0][$this->configuration['key']] ?? NULL;
}

return $value[0] ?? $value;
}
catch (\Exception $e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: 'DO NOT INSTALL. This is for profile installation task only.'
core_version_requirement: '^8.8 || ^9'
hidden: true
type: module
version: 8.2.28
version: 8.2.29
default_content:
node:
- 287db095-35b1-4050-8d26-5d8332eeb6a6
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: 'Stanford HumSci'
type: profile
description: 'Installation profile for HumSci Drupal'
version: 8.2.28
version: 8.2.29
core_version_requirement: '^8.8 || ^9'
themes:
- material_admin
Expand Down
2 changes: 1 addition & 1 deletion docroot/themes/humsci/humsci_airy/css/humsci_airy.css

Large diffs are not rendered by default.

28 changes: 26 additions & 2 deletions docroot/themes/humsci/humsci_basic/docs/utility-classes.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,28 @@
* [Misc](#misc)
* [Dark Inversion for Patterns](/docroot/themes/humsci/humsci_basic/docs/dark-inversion.md#dark-variant-utility-class)

<table>
<thead>
<tr>
<th colspan="2">Emoji Key</th>
</tr>
<thead>
<tbody>
<tr>
<td align="center">✅</td>
<td>Built to work in views</td>
</tr>
<tr>
<td align="center">❗️</td>
<td>Doesn't work with views yet</td>
</tr>
<tr>
<td align="center">-</td>
<td>Isn't intended to work with views</td>
</tr>
</tbody>
</table>

### Field Utility Classes
Field Utility Classes are used to apply styles to a field in a view (Drupal Home / Administration / Structure / Views) or to a field within a block in layout builder.

Expand All @@ -21,6 +43,7 @@ Field Utility Classes are used to apply styles to a field in a view (Drupal Home
| hb-heading-4 | Applies heading 4 styles ||
| hb-heading-5 | Applies heading 5 styles ||
| hb-heading-6 | Applies heading 6 styles ||
| hb-heading-link-color | Applies link color styles to a linked heading. Do not use with dark color inversion toggle or hb-dark-pattern. ||
| hb-body-small | Applies the small body style ||
| hb-body-medium | Applies the medium body style ||
| hb-link | Applies the link style ||
Expand All @@ -40,7 +63,7 @@ Field Utility Classes are used to apply styles to a field in a view (Drupal Home
| hb-pill-list | Applies the pill style to any field with multiple items ||
| hb-pill-link-list | Applies the pill link style to any field with multiple items that are links ||
| hb-text-reset | Removes all text styles from an element |❗️|
| hb-list-reset | Removes all custom list styles from an element |❗️|
| hb-list-reset | Removes all custom list styles from an element | - |
<br>

### Group Block Utility Classes
Expand Down Expand Up @@ -145,7 +168,8 @@ _Note:_ Classes must be added to the field only. Any classes added to the field
| hb-raised-cards | Adds a drop shadow behind any Card UI pattern used in the view ||
| hb-stretch-vertical-linked-cards | Stretches all vertical linked cards on a page to be the same height and adjusts the height of all card titles to be the same height ||
| hb-display-more-link-text | Displays helper link text with more link styling ||
| hb-list-reset | Resets lists to display default browser styles |❗️|
| hb-heading-link-color | Applies link color styles to a linked heading. Do not use with dark color inversion toggle or hb-dark-pattern. ||
| hb-list-reset | Resets lists to display default browser styles | - |
| hb-blockquote-black-text | Two use cases: 1. Changes the text color in a blockquote from secondary to black. This is specific to when a block quote is used in the text area / WYSIWYG. 2. Changes the quote text color in a testimonial paragraph type from secondary to black.| - |
| hb-main-body-detail-image | Used specifically on node detail pages to float an image. | - |

Expand Down
1 change: 1 addition & 0 deletions docroot/themes/humsci/humsci_basic/src/scss/_main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@
'objects/layouts.row',
'objects/layouts.three_column_w_image',
'objects/layouts.three_column',
'objects/layouts.views',

// =====================================================================
// 6. Components
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
//These are styles for views blocks specifically added through Layout Builder.
.layout__region .block-views {
&:not(:last-child) {
margin-bottom: hb-spacing-width();
}

&.hb-dark-pattern {
//Allows hb-dark-pattern to be added with Layout Builder Attributes block class
padding: hb-spacing-width('xs');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,14 @@
ul:not([class]) {
list-style-type: disc;

ul {
list-style-type: circle;

ul {
list-style-type: square;
}
}

li {
overflow: visible;
padding-left: 0;
Expand Down
Loading

0 comments on commit 342394a

Please sign in to comment.