Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ dependencies:
- 'drupal:field'
- 'drupal:language'
- 'drupal:text'
- 'drupal:views'
- 'entity_browser:entity_browser'
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,23 @@ settings:
- strikethrough
- superscript
- subscript
- numberedList
- bulletedList
- removeFormat
- '|'
- bulletedList
- numberedList
- indent
- outdent
- '|'
- link
- '|'
- insertTable
- '|'
- indent
- outdent
- '|'
- cgov_image_button
- cgov_infographic_button
- cgov_video_button
- cgov_featured_content_button
- insert_external_link_block
- insert_content_block_content
- cgov_featured_content_button
- '|'
- glossifier
- sourceEditing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ dependencies:
- entity_embed
- linkit
- media
- nci_ckeditor5_cleanup
- nci_definition
- token_filter
name: 'NCIDS Full HTML'
Expand Down Expand Up @@ -97,6 +96,7 @@ filters:
weight: -48
settings:
title: false
media_substitution: metadata
media_embed:
id: media_embed
provider: media
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
name: 'CGov Embvedded Block'
name: 'CGov Embedded Block'
type: module
package: 'CGov Digital Platform'
description: 'Embeddable block content support'
core_version_requirement: '^9.4 || ^10'
dependencies:
- 'cgov_content_block:cgov_content_block'
- 'cgov_core:cgov_core'
- 'drupal:block_content'
- 'drupal:views'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,22 @@ function _cgov_embedded_block_install_permissions(CgovCoreTools $siteHelper) {
$perms = [
'admin_ui' => [
'access block_content_browser entity browser pages',
'access content_block_raw_html_browser entity browser pages',
],
];

$siteHelper->addRolePermissions($perms);
}

/**
* The most recent update hook.
*/
function cgov_embedded_block_update_10001() {
// Get our helper.
$siteHelper = \Drupal::service('cgov_core.tools');
$perms = [
'admin_ui' => [
'access content_block_raw_html_browser entity browser pages',
],
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,13 @@ function cgov_embedded_block_theme_suggestions_block_content(array $variables) {
function cgov_embedded_block_views_query_alter(ViewExecutable $view, QueryPluginBase $query) {
// Check that we are altering the correct view.
if ($view->id() == 'block_content_browser') {
$excluded_values = ['cgov_image_carousel', 'cgov_video_carousel'];
if ($view->current_display == 'content_block_raw_html_browser') {
$excluded_values[] = 'cgov_external_link_block';
$excluded_values[] = 'ncids_mega_menu_content';
}
if ($query instanceof Sql) {
$field_name = 'block_content_field_data.type';
$excluded_values = ['cgov_image_carousel', 'cgov_video_carousel'];
$query->addWhere(0, $field_name, $excluded_values, 'NOT IN');
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
langcode: en
status: true
dependencies:
config:
- core.entity_view_mode.block_content.full
- entity_browser.browser.content_block_raw_html_browser
module:
- block_content
- entity_embed
label: 'Insert Content Block Content'
id: insert_content_block_content
type_id: entity
type_settings:
entity_type: block_content
bundles: { }
display_plugins:
- 'view_mode:block_content.full'
entity_browser: content_block_raw_html_browser
entity_browser_settings:
display_review: false
icon:
uri: 'module://cgov_embedded_block/assets/images/embed_block.svg'
icon_uuid: null
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
langcode: en
status: true
dependencies:
config:
- views.view.block_content_browser
module:
- views
name: content_block_raw_html_browser
label: 'Content Block Raw HTML Browser'
display: iframe
display_configuration:
width: 100%
height: '500'
link_text: 'Select entities'
auto_open: true
selection_display: no_display
selection_display_configuration: { }
widget_selector: tabs
widget_selector_configuration: { }
widgets:
97702a23-35e5-4310-ad78-6e976e722099:
settings:
submit_text: 'Select block'
auto_select: false
view: block_content_browser
view_display: content_block_raw_html_browser
uuid: 97702a23-35e5-4310-ad78-6e976e722099
weight: 1
label: Select
id: view
Loading