Skip to content

Commit

Permalink
[SD-197] Enable reusable paragraph type (#519)
Browse files Browse the repository at this point in the history
Updates

1. add configMergeDeep function to TideEntityUpdateHelper
2. add icon to reusable paragraph
3. update to display sites and departments to reusable paragraph
4. add reusable paragraph to landing_page , publication and publication page content type

Update

1. update dependencies
2. restructures update hooks.

updates

1. move basic_text paragraph type to tide_core
2. update paragraphs_libraries to only have accordion and basic_text options
3. update permissions.
  • Loading branch information
vincent-gao authored Oct 10, 2024
1 parent 39b0070 commit 7aa5c30
Show file tree
Hide file tree
Showing 31 changed files with 2,767 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
langcode: en
status: true
dependencies:
config:
- field.storage.paragraphs_library_item.field_department
- taxonomy.vocabulary.department
module:
- paragraphs_library
id: paragraphs_library_item.paragraphs_library_item.field_department
field_name: field_department
entity_type: paragraphs_library_item
bundle: paragraphs_library_item
label: Department
description: ''
required: false
translatable: false
default_value: { }
default_value_callback: ''
settings:
handler: 'default:taxonomy_term'
handler_settings:
target_bundles:
department: department
sort:
field: name
direction: asc
auto_create: false
auto_create_bundle: ''
field_type: entity_reference
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
langcode: en
status: true
dependencies:
config:
- field.storage.paragraphs_library_item.field_site
- taxonomy.vocabulary.sites
module:
- paragraphs_library
id: paragraphs_library_item.paragraphs_library_item.field_site
field_name: field_site
entity_type: paragraphs_library_item
bundle: paragraphs_library_item
label: Site
description: ''
required: false
translatable: false
default_value: { }
default_value_callback: ''
settings:
handler: 'default:taxonomy_term'
handler_settings:
target_bundles:
sites: sites
sort:
field: name
direction: asc
auto_create: false
auto_create_bundle: ''
field_type: entity_reference
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
langcode: en
status: true
dependencies:
module:
- paragraphs_library
- taxonomy
id: paragraphs_library_item.field_department
field_name: field_department
entity_type: paragraphs_library_item
type: entity_reference
settings:
target_type: taxonomy_term
module: core
locked: false
cardinality: 1
translatable: true
indexes: { }
persist_with_no_fields: false
custom_storage: false
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
langcode: en
status: true
dependencies:
module:
- paragraphs_library
- taxonomy
id: paragraphs_library_item.field_site
field_name: field_site
entity_type: paragraphs_library_item
type: entity_reference
settings:
target_type: taxonomy_term
module: core
locked: false
cardinality: 1
translatable: true
indexes: { }
persist_with_no_fields: false
custom_storage: false
6 changes: 6 additions & 0 deletions config/install/user.role.approver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,23 @@ langcode: en
status: true
dependencies:
config:
- entity_browser.browser.paragraphs_library_items
- filter.format.admin_text
- filter.format.rich_text
- filter.format.summary_text
module:
- block
- content_lock
- content_moderation
- entity_browser
- filter
- media
- node
- path
- redirect
- scheduled_transitions
- system
- paragraphs_library
- tide_core
- toolbar
id: approver
Expand All @@ -26,6 +29,7 @@ permissions:
- 'access administration pages'
- 'access content overview'
- 'access media overview'
- 'access paragraphs_library_items entity browser pages'
- 'access toolbar'
- 'administer blocks'
- 'addrow tablefield'
Expand All @@ -37,6 +41,8 @@ permissions:
- 'create file media'
- 'create image media'
- 'create url aliases'
- 'create paragraph library item'
- 'edit paragraph library item'
- 'delete all revisions'
- 'delete media'
- 'edit any audio media'
Expand Down
7 changes: 7 additions & 0 deletions config/install/user.role.contributor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ langcode: en
status: true
dependencies:
config:
- entity_browser.browser.paragraphs_library_items
- filter.format.rich_text
- filter.format.summary_text
- media.type.audio
Expand All @@ -14,9 +15,11 @@ dependencies:
- content_moderation
- filter
- media
- entity_browser
- node
- override_node_options
- system
- paragraphs_library
- tablefield
- tide_core
- toolbar
Expand All @@ -27,6 +30,7 @@ is_admin: null
permissions:
- 'access administration pages'
- 'access content overview'
- 'access paragraphs_library_items entity browser pages'
- 'access media overview'
- 'access toolbar'
- 'addrow tablefield'
Expand All @@ -36,6 +40,9 @@ permissions:
- 'create document media'
- 'create file media'
- 'create image media'
- 'create paragraph library item'
- 'edit paragraph library item'
- 'create media'
- 'create url aliases'
- 'edit any audio media'
- 'edit any document media'
Expand Down
7 changes: 7 additions & 0 deletions config/install/user.role.editor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ langcode: en
status: true
dependencies:
config:
- entity_browser.browser.paragraphs_library_items
- filter.format.rich_text
- filter.format.summary_text
- media.type.audio
Expand All @@ -12,9 +13,11 @@ dependencies:
- workflows.workflow.editorial
module:
- block
- paragraphs_library
- content_moderation
- filter
- media
- entity_browser
- node
- path
- system
Expand All @@ -26,6 +29,8 @@ weight: 4
is_admin: null
permissions:
- 'access administration pages'
- 'access paragraphs_library_items entity browser pages'
- 'edit paragraph library item'
- 'access content overview'
- 'access media overview'
- 'access toolbar'
Expand All @@ -36,6 +41,8 @@ permissions:
- 'create document media'
- 'create file media'
- 'create image media'
- 'create paragraph library item'
- 'create media'
- 'create url aliases'
- 'edit any audio media'
- 'edit any document media'
Expand Down
6 changes: 6 additions & 0 deletions config/install/user.role.site_admin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ langcode: en
status: true
dependencies:
config:
- entity_browser.browser.paragraphs_library_items
- filter.format.admin_text
- filter.format.rich_text
- filter.format.summary_text
Expand All @@ -20,6 +21,8 @@ dependencies:
- admin_audit_trail
- block
- content_moderation
- entity_browser
- paragraphs_library
- file
- filter
- media
Expand All @@ -40,8 +43,11 @@ permissions:
- 'access admin audit trail'
- 'access administration pages'
- 'access content overview'
- 'access paragraphs_library_items entity browser pages'
- 'access files overview'
- 'create paragraph library item'
- 'access media overview'
- 'edit paragraph library item'
- 'access taxonomy overview'
- 'access toolbar'
- 'administer blocks'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
langcode: en
status: true
dependencies:
config:
- field.field.paragraphs_library_item.paragraphs_library_item.field_department
- field.field.paragraphs_library_item.paragraphs_library_item.field_site
module:
- paragraphs
- paragraphs_library
id: paragraphs_library_item.paragraphs_library_item.default
targetEntityType: paragraphs_library_item
bundle: paragraphs_library_item
mode: default
content:
field_department:
type: entity_reference_autocomplete
weight: 2
region: content
settings:
match_operator: CONTAINS
match_limit: 10
size: 60
placeholder: ''
third_party_settings: { }
field_site:
type: entity_reference_autocomplete
weight: 3
region: content
settings:
match_operator: CONTAINS
match_limit: 10
size: 60
placeholder: ''
third_party_settings: { }
label:
type: string_textfield
weight: 0
region: content
settings:
size: 60
placeholder: ''
third_party_settings: { }
paragraphs:
type: paragraphs
weight: 1
region: content
settings:
title: Paragraph
title_plural: Paragraphs
edit_mode: open
closed_mode: summary
autocollapse: none
closed_mode_threshold: 0
add_mode: dropdown
form_display_mode: default
default_paragraph_type: ''
default_paragraph_count: 1
features:
collapse_edit_all: collapse_edit_all
duplicate: duplicate
third_party_settings: { }
status:
type: boolean_checkbox
weight: 4
region: content
settings:
display_label: true
third_party_settings: { }
hidden:
created: true
uid: true
17 changes: 17 additions & 0 deletions config/optional/paragraphs.paragraphs_type.from_library.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
uuid: 65901f51-c5e6-44eb-b4ad-56191dce90cc
langcode: en
status: true
dependencies:
content:
- 'file:file:b6a014c0-da0b-43ae-b2f9-19c6cf5a9902'
enforced:
module:
- paragraphs_library
_core:
default_config_hash: RGSkW7xbQQkzNrGunBWMSKS6lacu7KsgZjVWGVUF0xY
id: from_library
label: 'Reusable content item'
icon_uuid: b6a014c0-da0b-43ae-b2f9-19c6cf5a9902
icon_default: 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNjgiIGhlaWdodD0iNzciIHZpZXdCb3g9IjAgMCA2OCA3NyIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgY2xpcC1wYXRoPSJ1cmwoI2NsaXAwXzE0MzdfNjc5KSI+CjxyZWN0IHdpZHRoPSI2OCIgaGVpZ2h0PSI3NyIgZmlsbD0id2hpdGUiLz4KPHJlY3QgeD0i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