From f805d177adeb56590e5e2b7d750450b92d97e0fa Mon Sep 17 00:00:00 2001 From: Joe Tower Date: Tue, 18 Jun 2024 16:53:37 -0500 Subject: [PATCH 01/35] fix(YSP-335): wip add new component inline-message --- .../block_content.type.inline_message.yml | 33 +++++++++ ...y.block_content.inline_message.default.yml | 69 +++++++++++++++++++ ...y.block_content.inline_message.default.yml | 31 +++++++++ ...k_content.inline_message.field_heading.yml | 24 +++++++ ...lock_content.inline_message.field_text.yml | 24 +++++++ ...t_builder_browser_block.inline_message.yml | 11 +++ 6 files changed, 192 insertions(+) create mode 100644 web/profiles/custom/yalesites_profile/config/sync/block_content.type.inline_message.yml create mode 100644 web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.inline_message.default.yml create mode 100644 web/profiles/custom/yalesites_profile/config/sync/core.entity_view_display.block_content.inline_message.default.yml create mode 100644 web/profiles/custom/yalesites_profile/config/sync/field.field.block_content.inline_message.field_heading.yml create mode 100644 web/profiles/custom/yalesites_profile/config/sync/field.field.block_content.inline_message.field_text.yml create mode 100644 web/profiles/custom/yalesites_profile/config/sync/layout_builder_browser.layout_builder_browser_block.inline_message.yml diff --git a/web/profiles/custom/yalesites_profile/config/sync/block_content.type.inline_message.yml b/web/profiles/custom/yalesites_profile/config/sync/block_content.type.inline_message.yml new file mode 100644 index 0000000000..11b11b63ec --- /dev/null +++ b/web/profiles/custom/yalesites_profile/config/sync/block_content.type.inline_message.yml @@ -0,0 +1,33 @@ +uuid: b692caf5-825e-4c39-b6d7-762778de4b6d +langcode: en +status: true +dependencies: + module: + - entity_redirect +third_party_settings: + entity_redirect: + redirect: + add: + active: 0 + destination: default + url: '' + external: '' + edit: + active: 0 + destination: default + url: '' + external: '' + delete: + active: 0 + destination: default + url: '' + external: '' + anonymous: + active: 0 + destination: default + url: '' + external: '' +id: inline_message +label: 'Inline Message' +revision: 0 +description: '' diff --git a/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.inline_message.default.yml b/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.inline_message.default.yml new file mode 100644 index 0000000000..6b22ef2ef1 --- /dev/null +++ b/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.inline_message.default.yml @@ -0,0 +1,69 @@ +uuid: d9afb06f-c30e-42f6-a92c-4a4978070a45 +langcode: en +status: true +dependencies: + config: + - block_content.type.inline_message + - field.field.block_content.inline_message.field_heading + - field.field.block_content.inline_message.field_text + module: + - allowed_formats + - hide_revision_field + - maxlength + - text +id: block_content.inline_message.default +targetEntityType: block_content +bundle: inline_message +mode: default +content: + field_heading: + type: text_textfield + weight: 2 + region: content + settings: + size: 60 + placeholder: '' + third_party_settings: + allowed_formats: + hide_help: '1' + hide_guidelines: '1' + maxlength: + maxlength_js: 50 + maxlength_js_label: 'Content recommended length set to @limit characters, remaining: @remaining' + maxlength_js_enforce: false + field_text: + type: text_textarea + weight: 4 + region: content + settings: + rows: 5 + placeholder: '' + third_party_settings: + allowed_formats: + hide_help: '1' + hide_guidelines: '1' + maxlength: + maxlength_js: 500 + maxlength_js_label: 'Content limited to @limit characters, remaining: @remaining' + maxlength_js_enforce: true + info: + type: string_textfield + weight: -5 + region: content + settings: + size: 60 + placeholder: '' + third_party_settings: { } + revision_log: + type: hide_revision_field_log_widget + weight: 80 + region: content + settings: + rows: 5 + placeholder: '' + show: true + default: '' + permission_based: false + allow_user_settings: true + third_party_settings: { } +hidden: { } diff --git a/web/profiles/custom/yalesites_profile/config/sync/core.entity_view_display.block_content.inline_message.default.yml b/web/profiles/custom/yalesites_profile/config/sync/core.entity_view_display.block_content.inline_message.default.yml new file mode 100644 index 0000000000..fda56da16a --- /dev/null +++ b/web/profiles/custom/yalesites_profile/config/sync/core.entity_view_display.block_content.inline_message.default.yml @@ -0,0 +1,31 @@ +uuid: 69ecb1b1-12f7-4a55-b10e-1cbd689243f2 +langcode: en +status: true +dependencies: + config: + - block_content.type.inline_message + - field.field.block_content.inline_message.field_heading + - field.field.block_content.inline_message.field_text + module: + - text +id: block_content.inline_message.default +targetEntityType: block_content +bundle: inline_message +mode: default +content: + field_heading: + type: text_default + label: hidden + settings: { } + third_party_settings: { } + weight: 0 + region: content + field_text: + type: text_default + label: hidden + settings: { } + third_party_settings: { } + weight: 3 + region: content +hidden: + search_api_excerpt: true diff --git a/web/profiles/custom/yalesites_profile/config/sync/field.field.block_content.inline_message.field_heading.yml b/web/profiles/custom/yalesites_profile/config/sync/field.field.block_content.inline_message.field_heading.yml new file mode 100644 index 0000000000..3f1a44af89 --- /dev/null +++ b/web/profiles/custom/yalesites_profile/config/sync/field.field.block_content.inline_message.field_heading.yml @@ -0,0 +1,24 @@ +uuid: e0182b01-e1be-4396-be2b-573e171a1c45 +langcode: en +status: true +dependencies: + config: + - block_content.type.inline_message + - field.storage.block_content.field_heading + - filter.format.heading_html + module: + - text +id: block_content.inline_message.field_heading +field_name: field_heading +entity_type: block_content +bundle: inline_message +label: Heading +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + allowed_formats: + - heading_html +field_type: text diff --git a/web/profiles/custom/yalesites_profile/config/sync/field.field.block_content.inline_message.field_text.yml b/web/profiles/custom/yalesites_profile/config/sync/field.field.block_content.inline_message.field_text.yml new file mode 100644 index 0000000000..4043e402dd --- /dev/null +++ b/web/profiles/custom/yalesites_profile/config/sync/field.field.block_content.inline_message.field_text.yml @@ -0,0 +1,24 @@ +uuid: cb7cf9de-7a14-40e0-8c67-9fc6d50cba49 +langcode: en +status: true +dependencies: + config: + - block_content.type.inline_message + - field.storage.block_content.field_text + - filter.format.basic_html + module: + - text +id: block_content.inline_message.field_text +field_name: field_text +entity_type: block_content +bundle: inline_message +label: Content +description: '' +required: true +translatable: false +default_value: { } +default_value_callback: '' +settings: + allowed_formats: + - basic_html +field_type: text_long diff --git a/web/profiles/custom/yalesites_profile/config/sync/layout_builder_browser.layout_builder_browser_block.inline_message.yml b/web/profiles/custom/yalesites_profile/config/sync/layout_builder_browser.layout_builder_browser_block.inline_message.yml new file mode 100644 index 0000000000..8eb6f91b2f --- /dev/null +++ b/web/profiles/custom/yalesites_profile/config/sync/layout_builder_browser.layout_builder_browser_block.inline_message.yml @@ -0,0 +1,11 @@ +uuid: dcf44ccb-684d-4ddc-8d24-60f2a3042b62 +langcode: en +status: true +dependencies: { } +id: inline_message +block_id: 'inline_block:inline_message' +category: advanced +label: 'Inline Message' +image_path: '' +image_alt: '' +weight: -100 From 84bf66a32d927fe39fa3e20c4bea2ec6bb38f36d Mon Sep 17 00:00:00 2001 From: Joe Tower Date: Tue, 18 Jun 2024 17:07:45 -0500 Subject: [PATCH 02/35] fix(YSP-335): wip wire theme options --- ...y.block_content.inline_message.default.yml | 7 +++++++ ...y.block_content.inline_message.default.yml | 9 ++++++++ ...ntent.inline_message.field_style_color.yml | 21 +++++++++++++++++++ 3 files changed, 37 insertions(+) create mode 100644 web/profiles/custom/yalesites_profile/config/sync/field.field.block_content.inline_message.field_style_color.yml diff --git a/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.inline_message.default.yml b/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.inline_message.default.yml index 6b22ef2ef1..d979e4d768 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.inline_message.default.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.inline_message.default.yml @@ -5,6 +5,7 @@ dependencies: config: - block_content.type.inline_message - field.field.block_content.inline_message.field_heading + - field.field.block_content.inline_message.field_style_color - field.field.block_content.inline_message.field_text module: - allowed_formats @@ -31,6 +32,12 @@ content: maxlength_js: 50 maxlength_js_label: 'Content recommended length set to @limit characters, remaining: @remaining' maxlength_js_enforce: false + field_style_color: + type: options_select + weight: 3 + region: content + settings: { } + third_party_settings: { } field_text: type: text_textarea weight: 4 diff --git a/web/profiles/custom/yalesites_profile/config/sync/core.entity_view_display.block_content.inline_message.default.yml b/web/profiles/custom/yalesites_profile/config/sync/core.entity_view_display.block_content.inline_message.default.yml index fda56da16a..dbcdd3f8c3 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/core.entity_view_display.block_content.inline_message.default.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/core.entity_view_display.block_content.inline_message.default.yml @@ -5,8 +5,10 @@ dependencies: config: - block_content.type.inline_message - field.field.block_content.inline_message.field_heading + - field.field.block_content.inline_message.field_style_color - field.field.block_content.inline_message.field_text module: + - options - text id: block_content.inline_message.default targetEntityType: block_content @@ -20,6 +22,13 @@ content: third_party_settings: { } weight: 0 region: content + field_style_color: + type: list_key + label: hidden + settings: { } + third_party_settings: { } + weight: 1 + region: content field_text: type: text_default label: hidden diff --git a/web/profiles/custom/yalesites_profile/config/sync/field.field.block_content.inline_message.field_style_color.yml b/web/profiles/custom/yalesites_profile/config/sync/field.field.block_content.inline_message.field_style_color.yml new file mode 100644 index 0000000000..e88c998ed0 --- /dev/null +++ b/web/profiles/custom/yalesites_profile/config/sync/field.field.block_content.inline_message.field_style_color.yml @@ -0,0 +1,21 @@ +uuid: 1ca64dda-9397-4c21-800a-4f3732021700 +langcode: en +status: true +dependencies: + config: + - block_content.type.inline_message + - field.storage.block_content.field_style_color + module: + - options +id: block_content.inline_message.field_style_color +field_name: field_style_color +entity_type: block_content +bundle: inline_message +label: Theme +description: '' +required: true +translatable: false +default_value: { } +default_value_callback: ys_themes_default_value_function +settings: { } +field_type: list_string From 4c8a0459c32f4f1ada62a2f3944d512d3beb01e4 Mon Sep 17 00:00:00 2001 From: Joe Tower Date: Tue, 18 Jun 2024 17:10:50 -0500 Subject: [PATCH 03/35] fix(YSP-335): wip wire theme options --- .../config/sync/ys_themes.component_overrides.yml | 7 +++++++ .../config/install/ys_themes.component_overrides.yml | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/web/profiles/custom/yalesites_profile/config/sync/ys_themes.component_overrides.yml b/web/profiles/custom/yalesites_profile/config/sync/ys_themes.component_overrides.yml index 53969f793b..9d8cd736fd 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/ys_themes.component_overrides.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/ys_themes.component_overrides.yml @@ -215,3 +215,10 @@ link_grid: two: Two three: Three default: one +inline_message: + field_style_color: + values: + one: One + two: Two + three: Three + default: one diff --git a/web/profiles/custom/yalesites_profile/modules/custom/ys_themes/config/install/ys_themes.component_overrides.yml b/web/profiles/custom/yalesites_profile/modules/custom/ys_themes/config/install/ys_themes.component_overrides.yml index 2b1d6014ae..352aa2ecf7 100644 --- a/web/profiles/custom/yalesites_profile/modules/custom/ys_themes/config/install/ys_themes.component_overrides.yml +++ b/web/profiles/custom/yalesites_profile/modules/custom/ys_themes/config/install/ys_themes.component_overrides.yml @@ -215,3 +215,10 @@ link_grid: two: 'Two' three: 'Three' default: one +inline_message: + field_style_color: + values: + one: One + two: Two + three: Three + default: one From 47cf1c9956d5609ea4a806a9d216c483c41f2783 Mon Sep 17 00:00:00 2001 From: Joe Tower Date: Tue, 25 Jun 2024 14:40:57 -0500 Subject: [PATCH 04/35] fix(YSP-335): add in-line message svg preview icon --- ...er.layout_builder_browser_block.inline_message.yml | 6 +++--- .../ys_core/images/preview-icons/in-line-message.svg | 11 +++++++++++ 2 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 web/profiles/custom/yalesites_profile/modules/custom/ys_core/images/preview-icons/in-line-message.svg diff --git a/web/profiles/custom/yalesites_profile/config/sync/layout_builder_browser.layout_builder_browser_block.inline_message.yml b/web/profiles/custom/yalesites_profile/config/sync/layout_builder_browser.layout_builder_browser_block.inline_message.yml index 8eb6f91b2f..24352f3d8b 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/layout_builder_browser.layout_builder_browser_block.inline_message.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/layout_builder_browser.layout_builder_browser_block.inline_message.yml @@ -1,11 +1,11 @@ uuid: dcf44ccb-684d-4ddc-8d24-60f2a3042b62 langcode: en status: true -dependencies: { } +dependencies: {} id: inline_message block_id: 'inline_block:inline_message' category: advanced -label: 'Inline Message' -image_path: '' +label: 'In-Line Message' +image_path: /profiles/custom/yalesites_profile/modules/custom/ys_core/images/preview-icons/in-line-message.svg image_alt: '' weight: -100 diff --git a/web/profiles/custom/yalesites_profile/modules/custom/ys_core/images/preview-icons/in-line-message.svg b/web/profiles/custom/yalesites_profile/modules/custom/ys_core/images/preview-icons/in-line-message.svg new file mode 100644 index 0000000000..1b7ac4b2ca --- /dev/null +++ b/web/profiles/custom/yalesites_profile/modules/custom/ys_core/images/preview-icons/in-line-message.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + From bef9ec8881ecd60b5fee8b58537debe32b5cbae3 Mon Sep 17 00:00:00 2001 From: Joe Tower Date: Tue, 25 Jun 2024 14:43:10 -0500 Subject: [PATCH 05/35] fix(YSP-335): add in-line message svg preview icon --- .../config/sync/block_content.type.inline_message.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/profiles/custom/yalesites_profile/config/sync/block_content.type.inline_message.yml b/web/profiles/custom/yalesites_profile/config/sync/block_content.type.inline_message.yml index 11b11b63ec..9d51d92c54 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/block_content.type.inline_message.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/block_content.type.inline_message.yml @@ -28,6 +28,6 @@ third_party_settings: url: '' external: '' id: inline_message -label: 'Inline Message' +label: 'In-Line Message' revision: 0 -description: '' +description: 'Add a non-dismissible message box in your content to draw attention to important information or warnings.' From 2db888423695341d0d9ab3f16e32098bf31aed9b Mon Sep 17 00:00:00 2001 From: Joe Tower Date: Fri, 28 Jun 2024 13:28:56 -0500 Subject: [PATCH 06/35] fix(YSP-335): add optional link --- ...y.block_content.inline_message.default.yml | 16 +++++++++++++ ...y.block_content.inline_message.default.yml | 14 +++++++++++ ...lock_content.inline_message.field_link.yml | 23 +++++++++++++++++++ ...t_builder_browser_block.inline_message.yml | 2 +- 4 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 web/profiles/custom/yalesites_profile/config/sync/field.field.block_content.inline_message.field_link.yml diff --git a/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.inline_message.default.yml b/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.inline_message.default.yml index d979e4d768..ab505fb61c 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.inline_message.default.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.inline_message.default.yml @@ -5,11 +5,13 @@ dependencies: config: - block_content.type.inline_message - field.field.block_content.inline_message.field_heading + - field.field.block_content.inline_message.field_link - field.field.block_content.inline_message.field_style_color - field.field.block_content.inline_message.field_text module: - allowed_formats - hide_revision_field + - linkit - maxlength - text id: block_content.inline_message.default @@ -32,6 +34,20 @@ content: maxlength_js: 50 maxlength_js_label: 'Content recommended length set to @limit characters, remaining: @remaining' maxlength_js_enforce: false + field_link: + type: linkit + weight: 6 + region: content + settings: + placeholder_url: '' + placeholder_title: '' + linkit_profile: default + linkit_auto_link_text: false + third_party_settings: + maxlength: + maxlength_js: null + maxlength_js_label: 'Content limited to @limit characters, remaining: @remaining' + maxlength_js_enforce: false field_style_color: type: options_select weight: 3 diff --git a/web/profiles/custom/yalesites_profile/config/sync/core.entity_view_display.block_content.inline_message.default.yml b/web/profiles/custom/yalesites_profile/config/sync/core.entity_view_display.block_content.inline_message.default.yml index dbcdd3f8c3..69b71c9c3b 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/core.entity_view_display.block_content.inline_message.default.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/core.entity_view_display.block_content.inline_message.default.yml @@ -5,9 +5,11 @@ dependencies: config: - block_content.type.inline_message - field.field.block_content.inline_message.field_heading + - field.field.block_content.inline_message.field_link - field.field.block_content.inline_message.field_style_color - field.field.block_content.inline_message.field_text module: + - link - options - text id: block_content.inline_message.default @@ -22,6 +24,18 @@ content: third_party_settings: { } weight: 0 region: content + field_link: + type: link_separate + label: hidden + settings: + trim_length: null + url_only: false + url_plain: false + rel: '0' + target: '0' + third_party_settings: { } + weight: 4 + region: content field_style_color: type: list_key label: hidden diff --git a/web/profiles/custom/yalesites_profile/config/sync/field.field.block_content.inline_message.field_link.yml b/web/profiles/custom/yalesites_profile/config/sync/field.field.block_content.inline_message.field_link.yml new file mode 100644 index 0000000000..90164fb419 --- /dev/null +++ b/web/profiles/custom/yalesites_profile/config/sync/field.field.block_content.inline_message.field_link.yml @@ -0,0 +1,23 @@ +uuid: 0512509f-d16a-4d0c-b210-583c4ef81115 +langcode: en +status: true +dependencies: + config: + - block_content.type.inline_message + - field.storage.block_content.field_link + module: + - link +id: block_content.inline_message.field_link +field_name: field_link +entity_type: block_content +bundle: inline_message +label: Link +description: 'For more information about linking content, view our resource Linking Content on YaleSites.' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + title: 2 + link_type: 17 +field_type: link diff --git a/web/profiles/custom/yalesites_profile/config/sync/layout_builder_browser.layout_builder_browser_block.inline_message.yml b/web/profiles/custom/yalesites_profile/config/sync/layout_builder_browser.layout_builder_browser_block.inline_message.yml index 24352f3d8b..7703f5f994 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/layout_builder_browser.layout_builder_browser_block.inline_message.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/layout_builder_browser.layout_builder_browser_block.inline_message.yml @@ -1,7 +1,7 @@ uuid: dcf44ccb-684d-4ddc-8d24-60f2a3042b62 langcode: en status: true -dependencies: {} +dependencies: { } id: inline_message block_id: 'inline_block:inline_message' category: advanced From 130e24d8e692a1f1d6c848606f8e6613882498c8 Mon Sep 17 00:00:00 2001 From: David Blankenship Date: Tue, 2 Jul 2024 11:08:10 -0400 Subject: [PATCH 07/35] fix(YSP-579): use reset over 0th date element For some reason, there are times when the dates array is not 0-based. So instead of relying on this, we reset to take the first item. --- .../modules/custom/ys_localist/src/MetaFieldsManager.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/web/profiles/custom/yalesites_profile/modules/custom/ys_localist/src/MetaFieldsManager.php b/web/profiles/custom/yalesites_profile/modules/custom/ys_localist/src/MetaFieldsManager.php index e2a4cf2389..f147057188 100644 --- a/web/profiles/custom/yalesites_profile/modules/custom/ys_localist/src/MetaFieldsManager.php +++ b/web/profiles/custom/yalesites_profile/modules/custom/ys_localist/src/MetaFieldsManager.php @@ -242,10 +242,12 @@ public function getEventData($node) { */ $icsUrl = $node->field_localist_ics_url->first() ? $node->field_localist_ics_url->first()->getValue()['uri'] : NULL; if (!$icsUrl && $dates) { + // Dates might not be 0-based. + $firstDate = reset($dates); $tz = new \DateTimeZone('America/New_York'); $date = new \DateTime(); - $start = $date->createFromFormat('U', $dates[0]['value'], $tz); - $end = $date->createFromFormat('U', $dates[0]['end_value'], $tz); + $start = $date->createFromFormat('U', $firstDate['value'], $tz); + $end = $date->createFromFormat('U', $firstDate['end_value'], $tz); /* Note one additional argument at the end of this function can create an * address in the ICS file. @@ -256,7 +258,7 @@ public function getEventData($node) { $node->getTitle(), $start, $end, - $dates[0]['is_all_day'], + $firstDate['is_all_day'], $node->toUrl()->setAbsolute()->toString() ); } From 73a9a742ca1f4a87571605fe17bdf4719b2fb1bf Mon Sep 17 00:00:00 2001 From: David Blankenship Date: Mon, 8 Jul 2024 15:30:56 -0400 Subject: [PATCH 08/35] fix(YSP-588): make event view mimic standard one While the standard view for the views block was using the proper sorter, the event specific one was not. This lets it use it to drive the sort operation. --- .../views.view.views_basic_scaffold_events.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/web/profiles/custom/yalesites_profile/config/sync/views.view.views_basic_scaffold_events.yml b/web/profiles/custom/yalesites_profile/config/sync/views.view.views_basic_scaffold_events.yml index 6836f144e3..4f9c2a13c2 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/views.view.views_basic_scaffold_events.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/views.view.views_basic_scaffold_events.yml @@ -143,20 +143,20 @@ display: format: basic_html tokenize: false sorts: - field_event_date_value: - id: field_event_date_value - table: node__field_event_date - field: field_event_date_value + views_basic_sort: + id: views_basic_sort + table: node_field_data + field: views_basic_sort relationship: none - group_type: min + group_type: group admin_label: '' - plugin_id: date + entity_type: node + plugin_id: views_basic_sort order: ASC expose: label: '' field_identifier: '' exposed: false - granularity: second arguments: type: id: type From d4c917ff56e39bb2505c657a739db664b3838b50 Mon Sep 17 00:00:00 2001 From: David Blankenship Date: Mon, 1 Jul 2024 13:00:17 -0400 Subject: [PATCH 09/35] fix(YSP-576): add permissions for new blocks While looking at another issue, we noticed that the permissions for the new blocks were not set. While this doesn't hinder users from using them due to relying on Layout Builder Restrictions, it is our convention to still enable them in case another module relies on these. This enables them to mimic other blocks in the past. --- .../config/sync/user.role.contributor.yml | 35 +++++++++++++++++++ .../config/sync/user.role.editor.yml | 35 +++++++++++++++++++ .../config/sync/user.role.platform_admin.yml | 35 +++++++++++++++++++ .../config/sync/user.role.site_admin.yml | 35 +++++++++++++++++++ 4 files changed, 140 insertions(+) diff --git a/web/profiles/custom/yalesites_profile/config/sync/user.role.contributor.yml b/web/profiles/custom/yalesites_profile/config/sync/user.role.contributor.yml index e9d652aade..fa3d05d599 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/user.role.contributor.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/user.role.contributor.yml @@ -14,15 +14,20 @@ dependencies: - block_content.type.divider - block_content.type.embed - block_content.type.event_list + - block_content.type.facts - block_content.type.gallery - block_content.type.grand_hero - block_content.type.image + - block_content.type.link_grid - block_content.type.media_grid - block_content.type.post_list - block_content.type.pull_quote - block_content.type.quick_links + - block_content.type.quote_callout + - block_content.type.reference_card - block_content.type.tabs - block_content.type.text + - block_content.type.tiles - block_content.type.video - block_content.type.view - block_content.type.webform @@ -111,10 +116,12 @@ permissions: - 'create embed media' - 'create event content' - 'create event_list block content' + - 'create facts block content' - 'create gallery block content' - 'create grand_hero block content' - 'create image block content' - 'create image media' + - 'create link_grid block content' - 'create media' - 'create media_grid block content' - 'create page content' @@ -123,6 +130,8 @@ permissions: - 'create profile content' - 'create pull_quote block content' - 'create quick_links block content' + - 'create quote_callout block content' + - 'create reference_card block content' - 'create reusable blocks' - 'create tabs block content' - 'create terms in affiliation' @@ -130,6 +139,7 @@ permissions: - 'create terms in post_category' - 'create terms in tags' - 'create text block content' + - 'create tiles block content' - 'create url aliases' - 'create video block content' - 'create video media' @@ -160,12 +170,16 @@ permissions: - 'delete any event content' - 'delete any event_list block content' - 'delete any event_list block content revisions' + - 'delete any facts block content' + - 'delete any facts block content revisions' - 'delete any gallery block content' - 'delete any gallery block content revisions' - 'delete any grand_hero block content' - 'delete any grand_hero block content revisions' - 'delete any image block content' - 'delete any image block content revisions' + - 'delete any link_grid block content' + - 'delete any link_grid block content revisions' - 'delete any media_grid block content' - 'delete any media_grid block content revisions' - 'delete any page content' @@ -177,10 +191,16 @@ permissions: - 'delete any pull_quote block content revisions' - 'delete any quick_links block content' - 'delete any quick_links block content revisions' + - 'delete any quote_callout block content' + - 'delete any quote_callout block content revisions' + - 'delete any reference_card block content' + - 'delete any reference_card block content revisions' - 'delete any tabs block content' - 'delete any tabs block content revisions' - 'delete any text block content' - 'delete any text block content revisions' + - 'delete any tiles block content' + - 'delete any tiles block content revisions' - 'delete any video block content' - 'delete any video block content revisions' - 'delete any view block content' @@ -213,10 +233,12 @@ permissions: - 'edit any embed media' - 'edit any event content' - 'edit any event_list block content' + - 'edit any facts block content' - 'edit any gallery block content' - 'edit any grand_hero block content' - 'edit any image block content' - 'edit any image media' + - 'edit any link_grid block content' - 'edit any media_grid block content' - 'edit any page content' - 'edit any post content' @@ -224,8 +246,11 @@ permissions: - 'edit any profile content' - 'edit any pull_quote block content' - 'edit any quick_links block content' + - 'edit any quote_callout block content' + - 'edit any reference_card block content' - 'edit any tabs block content' - 'edit any text block content' + - 'edit any tiles block content' - 'edit any video block content' - 'edit any video media' - 'edit any view block content' @@ -261,15 +286,20 @@ permissions: - 'revert any divider block content revisions' - 'revert any embed block content revisions' - 'revert any event_list block content revisions' + - 'revert any facts block content revisions' - 'revert any gallery block content revisions' - 'revert any grand_hero block content revisions' - 'revert any image block content revisions' + - 'revert any link_grid block content revisions' - 'revert any media_grid block content revisions' - 'revert any post_list block content revisions' - 'revert any pull_quote block content revisions' - 'revert any quick_links block content revisions' + - 'revert any quote_callout block content revisions' + - 'revert any reference_card block content revisions' - 'revert any tabs block content revisions' - 'revert any text block content revisions' + - 'revert any tiles block content revisions' - 'revert any video block content revisions' - 'revert any view block content revisions' - 'revert any webform block content revisions' @@ -296,15 +326,20 @@ permissions: - 'view any divider block content history' - 'view any embed block content history' - 'view any event_list block content history' + - 'view any facts block content history' - 'view any gallery block content history' - 'view any grand_hero block content history' - 'view any image block content history' + - 'view any link_grid block content history' - 'view any media_grid block content history' - 'view any post_list block content history' - 'view any pull_quote block content history' - 'view any quick_links block content history' + - 'view any quote_callout block content history' + - 'view any reference_card block content history' - 'view any tabs block content history' - 'view any text block content history' + - 'view any tiles block content history' - 'view any unpublished content' - 'view any video block content history' - 'view any view block content history' diff --git a/web/profiles/custom/yalesites_profile/config/sync/user.role.editor.yml b/web/profiles/custom/yalesites_profile/config/sync/user.role.editor.yml index 897f7c392e..4edab699f9 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/user.role.editor.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/user.role.editor.yml @@ -14,15 +14,20 @@ dependencies: - block_content.type.divider - block_content.type.embed - block_content.type.event_list + - block_content.type.facts - block_content.type.gallery - block_content.type.grand_hero - block_content.type.image + - block_content.type.link_grid - block_content.type.media_grid - block_content.type.post_list - block_content.type.pull_quote - block_content.type.quick_links + - block_content.type.quote_callout + - block_content.type.reference_card - block_content.type.tabs - block_content.type.text + - block_content.type.tiles - block_content.type.video - block_content.type.view - block_content.type.webform @@ -111,10 +116,12 @@ permissions: - 'create embed media' - 'create event content' - 'create event_list block content' + - 'create facts block content' - 'create gallery block content' - 'create grand_hero block content' - 'create image block content' - 'create image media' + - 'create link_grid block content' - 'create media' - 'create media_grid block content' - 'create page content' @@ -123,6 +130,8 @@ permissions: - 'create profile content' - 'create pull_quote block content' - 'create quick_links block content' + - 'create quote_callout block content' + - 'create reference_card block content' - 'create reusable blocks' - 'create tabs block content' - 'create terms in affiliation' @@ -130,6 +139,7 @@ permissions: - 'create terms in post_category' - 'create terms in tags' - 'create text block content' + - 'create tiles block content' - 'create url aliases' - 'create video block content' - 'create video media' @@ -162,6 +172,8 @@ permissions: - 'delete any event content' - 'delete any event_list block content' - 'delete any event_list block content revisions' + - 'delete any facts block content' + - 'delete any facts block content revisions' - 'delete any gallery block content' - 'delete any gallery block content revisions' - 'delete any grand_hero block content' @@ -169,6 +181,8 @@ permissions: - 'delete any image block content' - 'delete any image block content revisions' - 'delete any image media' + - 'delete any link_grid block content' + - 'delete any link_grid block content revisions' - 'delete any media' - 'delete any media_grid block content' - 'delete any media_grid block content revisions' @@ -181,10 +195,16 @@ permissions: - 'delete any pull_quote block content revisions' - 'delete any quick_links block content' - 'delete any quick_links block content revisions' + - 'delete any quote_callout block content' + - 'delete any quote_callout block content revisions' + - 'delete any reference_card block content' + - 'delete any reference_card block content revisions' - 'delete any tabs block content' - 'delete any tabs block content revisions' - 'delete any text block content' - 'delete any text block content revisions' + - 'delete any tiles block content' + - 'delete any tiles block content revisions' - 'delete any video block content' - 'delete any video block content revisions' - 'delete any video media' @@ -224,10 +244,12 @@ permissions: - 'edit any embed media' - 'edit any event content' - 'edit any event_list block content' + - 'edit any facts block content' - 'edit any gallery block content' - 'edit any grand_hero block content' - 'edit any image block content' - 'edit any image media' + - 'edit any link_grid block content' - 'edit any media_grid block content' - 'edit any page content' - 'edit any post content' @@ -235,8 +257,11 @@ permissions: - 'edit any profile content' - 'edit any pull_quote block content' - 'edit any quick_links block content' + - 'edit any quote_callout block content' + - 'edit any reference_card block content' - 'edit any tabs block content' - 'edit any text block content' + - 'edit any tiles block content' - 'edit any video block content' - 'edit any video media' - 'edit any view block content' @@ -272,15 +297,20 @@ permissions: - 'revert any divider block content revisions' - 'revert any embed block content revisions' - 'revert any event_list block content revisions' + - 'revert any facts block content revisions' - 'revert any gallery block content revisions' - 'revert any grand_hero block content revisions' - 'revert any image block content revisions' + - 'revert any link_grid block content revisions' - 'revert any media_grid block content revisions' - 'revert any post_list block content revisions' - 'revert any pull_quote block content revisions' - 'revert any quick_links block content revisions' + - 'revert any quote_callout block content revisions' + - 'revert any reference_card block content revisions' - 'revert any tabs block content revisions' - 'revert any text block content revisions' + - 'revert any tiles block content revisions' - 'revert any video block content revisions' - 'revert any view block content revisions' - 'revert any webform block content revisions' @@ -315,15 +345,20 @@ permissions: - 'view any divider block content history' - 'view any embed block content history' - 'view any event_list block content history' + - 'view any facts block content history' - 'view any gallery block content history' - 'view any grand_hero block content history' - 'view any image block content history' + - 'view any link_grid block content history' - 'view any media_grid block content history' - 'view any post_list block content history' - 'view any pull_quote block content history' - 'view any quick_links block content history' + - 'view any quote_callout block content history' + - 'view any reference_card block content history' - 'view any tabs block content history' - 'view any text block content history' + - 'view any tiles block content history' - 'view any unpublished content' - 'view any video block content history' - 'view any view block content history' diff --git a/web/profiles/custom/yalesites_profile/config/sync/user.role.platform_admin.yml b/web/profiles/custom/yalesites_profile/config/sync/user.role.platform_admin.yml index 6a603a47a0..4dbe13f071 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/user.role.platform_admin.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/user.role.platform_admin.yml @@ -14,15 +14,20 @@ dependencies: - block_content.type.divider - block_content.type.embed - block_content.type.event_list + - block_content.type.facts - block_content.type.gallery - block_content.type.grand_hero - block_content.type.image + - block_content.type.link_grid - block_content.type.media_grid - block_content.type.post_list - block_content.type.pull_quote - block_content.type.quick_links + - block_content.type.quote_callout + - block_content.type.reference_card - block_content.type.tabs - block_content.type.text + - block_content.type.tiles - block_content.type.video - block_content.type.view - block_content.type.webform @@ -122,10 +127,12 @@ permissions: - 'create embed media' - 'create event content' - 'create event_list block content' + - 'create facts block content' - 'create gallery block content' - 'create grand_hero block content' - 'create image block content' - 'create image media' + - 'create link_grid block content' - 'create media' - 'create media_grid block content' - 'create page content' @@ -134,6 +141,8 @@ permissions: - 'create profile content' - 'create pull_quote block content' - 'create quick_links block content' + - 'create quote_callout block content' + - 'create reference_card block content' - 'create reusable blocks' - 'create tabs block content' - 'create terms in affiliation' @@ -141,6 +150,7 @@ permissions: - 'create terms in post_category' - 'create terms in tags' - 'create text block content' + - 'create tiles block content' - 'create url aliases' - 'create video block content' - 'create video media' @@ -173,6 +183,8 @@ permissions: - 'delete any event content' - 'delete any event_list block content' - 'delete any event_list block content revisions' + - 'delete any facts block content' + - 'delete any facts block content revisions' - 'delete any gallery block content' - 'delete any gallery block content revisions' - 'delete any grand_hero block content' @@ -180,6 +192,8 @@ permissions: - 'delete any image block content' - 'delete any image block content revisions' - 'delete any image media' + - 'delete any link_grid block content' + - 'delete any link_grid block content revisions' - 'delete any media' - 'delete any media_grid block content' - 'delete any media_grid block content revisions' @@ -192,10 +206,16 @@ permissions: - 'delete any pull_quote block content revisions' - 'delete any quick_links block content' - 'delete any quick_links block content revisions' + - 'delete any quote_callout block content' + - 'delete any quote_callout block content revisions' + - 'delete any reference_card block content' + - 'delete any reference_card block content revisions' - 'delete any tabs block content' - 'delete any tabs block content revisions' - 'delete any text block content' - 'delete any text block content revisions' + - 'delete any tiles block content' + - 'delete any tiles block content revisions' - 'delete any video block content' - 'delete any video block content revisions' - 'delete any video media' @@ -236,10 +256,12 @@ permissions: - 'edit any embed media' - 'edit any event content' - 'edit any event_list block content' + - 'edit any facts block content' - 'edit any gallery block content' - 'edit any grand_hero block content' - 'edit any image block content' - 'edit any image media' + - 'edit any link_grid block content' - 'edit any media_grid block content' - 'edit any page content' - 'edit any post content' @@ -247,8 +269,11 @@ permissions: - 'edit any profile content' - 'edit any pull_quote block content' - 'edit any quick_links block content' + - 'edit any quote_callout block content' + - 'edit any reference_card block content' - 'edit any tabs block content' - 'edit any text block content' + - 'edit any tiles block content' - 'edit any video block content' - 'edit any video media' - 'edit any view block content' @@ -287,15 +312,20 @@ permissions: - 'revert any divider block content revisions' - 'revert any embed block content revisions' - 'revert any event_list block content revisions' + - 'revert any facts block content revisions' - 'revert any gallery block content revisions' - 'revert any grand_hero block content revisions' - 'revert any image block content revisions' + - 'revert any link_grid block content revisions' - 'revert any media_grid block content revisions' - 'revert any post_list block content revisions' - 'revert any pull_quote block content revisions' - 'revert any quick_links block content revisions' + - 'revert any quote_callout block content revisions' + - 'revert any reference_card block content revisions' - 'revert any tabs block content revisions' - 'revert any text block content revisions' + - 'revert any tiles block content revisions' - 'revert any video block content revisions' - 'revert any view block content revisions' - 'revert any webform block content revisions' @@ -330,15 +360,20 @@ permissions: - 'view any divider block content history' - 'view any embed block content history' - 'view any event_list block content history' + - 'view any facts block content history' - 'view any gallery block content history' - 'view any grand_hero block content history' - 'view any image block content history' + - 'view any link_grid block content history' - 'view any media_grid block content history' - 'view any post_list block content history' - 'view any pull_quote block content history' - 'view any quick_links block content history' + - 'view any quote_callout block content history' + - 'view any reference_card block content history' - 'view any tabs block content history' - 'view any text block content history' + - 'view any tiles block content history' - 'view any unpublished content' - 'view any video block content history' - 'view any view block content history' diff --git a/web/profiles/custom/yalesites_profile/config/sync/user.role.site_admin.yml b/web/profiles/custom/yalesites_profile/config/sync/user.role.site_admin.yml index 7e4f047363..39439b1399 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/user.role.site_admin.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/user.role.site_admin.yml @@ -14,15 +14,20 @@ dependencies: - block_content.type.divider - block_content.type.embed - block_content.type.event_list + - block_content.type.facts - block_content.type.gallery - block_content.type.grand_hero - block_content.type.image + - block_content.type.link_grid - block_content.type.media_grid - block_content.type.post_list - block_content.type.pull_quote - block_content.type.quick_links + - block_content.type.quote_callout + - block_content.type.reference_card - block_content.type.tabs - block_content.type.text + - block_content.type.tiles - block_content.type.video - block_content.type.view - block_content.type.webform @@ -115,10 +120,12 @@ permissions: - 'create embed media' - 'create event content' - 'create event_list block content' + - 'create facts block content' - 'create gallery block content' - 'create grand_hero block content' - 'create image block content' - 'create image media' + - 'create link_grid block content' - 'create media' - 'create media_grid block content' - 'create page content' @@ -127,6 +134,8 @@ permissions: - 'create profile content' - 'create pull_quote block content' - 'create quick_links block content' + - 'create quote_callout block content' + - 'create reference_card block content' - 'create reusable blocks' - 'create tabs block content' - 'create terms in affiliation' @@ -134,6 +143,7 @@ permissions: - 'create terms in post_category' - 'create terms in tags' - 'create text block content' + - 'create tiles block content' - 'create url aliases' - 'create video block content' - 'create video media' @@ -166,6 +176,8 @@ permissions: - 'delete any event content' - 'delete any event_list block content' - 'delete any event_list block content revisions' + - 'delete any facts block content' + - 'delete any facts block content revisions' - 'delete any gallery block content' - 'delete any gallery block content revisions' - 'delete any grand_hero block content' @@ -173,6 +185,8 @@ permissions: - 'delete any image block content' - 'delete any image block content revisions' - 'delete any image media' + - 'delete any link_grid block content' + - 'delete any link_grid block content revisions' - 'delete any media' - 'delete any media_grid block content' - 'delete any media_grid block content revisions' @@ -185,10 +199,16 @@ permissions: - 'delete any pull_quote block content revisions' - 'delete any quick_links block content' - 'delete any quick_links block content revisions' + - 'delete any quote_callout block content' + - 'delete any quote_callout block content revisions' + - 'delete any reference_card block content' + - 'delete any reference_card block content revisions' - 'delete any tabs block content' - 'delete any tabs block content revisions' - 'delete any text block content' - 'delete any text block content revisions' + - 'delete any tiles block content' + - 'delete any tiles block content revisions' - 'delete any video block content' - 'delete any video block content revisions' - 'delete any video media' @@ -229,10 +249,12 @@ permissions: - 'edit any embed media' - 'edit any event content' - 'edit any event_list block content' + - 'edit any facts block content' - 'edit any gallery block content' - 'edit any grand_hero block content' - 'edit any image block content' - 'edit any image media' + - 'edit any link_grid block content' - 'edit any media_grid block content' - 'edit any page content' - 'edit any post content' @@ -240,8 +262,11 @@ permissions: - 'edit any profile content' - 'edit any pull_quote block content' - 'edit any quick_links block content' + - 'edit any quote_callout block content' + - 'edit any reference_card block content' - 'edit any tabs block content' - 'edit any text block content' + - 'edit any tiles block content' - 'edit any video block content' - 'edit any video media' - 'edit any view block content' @@ -277,15 +302,20 @@ permissions: - 'revert any divider block content revisions' - 'revert any embed block content revisions' - 'revert any event_list block content revisions' + - 'revert any facts block content revisions' - 'revert any gallery block content revisions' - 'revert any grand_hero block content revisions' - 'revert any image block content revisions' + - 'revert any link_grid block content revisions' - 'revert any media_grid block content revisions' - 'revert any post_list block content revisions' - 'revert any pull_quote block content revisions' - 'revert any quick_links block content revisions' + - 'revert any quote_callout block content revisions' + - 'revert any reference_card block content revisions' - 'revert any tabs block content revisions' - 'revert any text block content revisions' + - 'revert any tiles block content revisions' - 'revert any video block content revisions' - 'revert any view block content revisions' - 'revert any webform block content revisions' @@ -320,15 +350,20 @@ permissions: - 'view any divider block content history' - 'view any embed block content history' - 'view any event_list block content history' + - 'view any facts block content history' - 'view any gallery block content history' - 'view any grand_hero block content history' - 'view any image block content history' + - 'view any link_grid block content history' - 'view any media_grid block content history' - 'view any post_list block content history' - 'view any pull_quote block content history' - 'view any quick_links block content history' + - 'view any quote_callout block content history' + - 'view any reference_card block content history' - 'view any tabs block content history' - 'view any text block content history' + - 'view any tiles block content history' - 'view any unpublished content' - 'view any video block content history' - 'view any view block content history' From 2db544c831aba1f61f7b276652ac8540c52882cd Mon Sep 17 00:00:00 2001 From: David Blankenship Date: Mon, 22 Jul 2024 14:39:27 -0400 Subject: [PATCH 10/35] feat(YSP-576): add inline message permissions --- .../config/sync/user.role.contributor.yml | 7 +++++++ .../yalesites_profile/config/sync/user.role.editor.yml | 7 +++++++ .../config/sync/user.role.platform_admin.yml | 7 +++++++ .../yalesites_profile/config/sync/user.role.site_admin.yml | 7 +++++++ 4 files changed, 28 insertions(+) diff --git a/web/profiles/custom/yalesites_profile/config/sync/user.role.contributor.yml b/web/profiles/custom/yalesites_profile/config/sync/user.role.contributor.yml index fa3d05d599..ab02369b96 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/user.role.contributor.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/user.role.contributor.yml @@ -18,6 +18,7 @@ dependencies: - block_content.type.gallery - block_content.type.grand_hero - block_content.type.image + - block_content.type.inline_message - block_content.type.link_grid - block_content.type.media_grid - block_content.type.post_list @@ -121,6 +122,7 @@ permissions: - 'create grand_hero block content' - 'create image block content' - 'create image media' + - 'create inline_message block content' - 'create link_grid block content' - 'create media' - 'create media_grid block content' @@ -178,6 +180,8 @@ permissions: - 'delete any grand_hero block content revisions' - 'delete any image block content' - 'delete any image block content revisions' + - 'delete any inline_message block content' + - 'delete any inline_message block content revisions' - 'delete any link_grid block content' - 'delete any link_grid block content revisions' - 'delete any media_grid block content' @@ -238,6 +242,7 @@ permissions: - 'edit any grand_hero block content' - 'edit any image block content' - 'edit any image media' + - 'edit any inline_message block content' - 'edit any link_grid block content' - 'edit any media_grid block content' - 'edit any page content' @@ -290,6 +295,7 @@ permissions: - 'revert any gallery block content revisions' - 'revert any grand_hero block content revisions' - 'revert any image block content revisions' + - 'revert any inline_message block content revisions' - 'revert any link_grid block content revisions' - 'revert any media_grid block content revisions' - 'revert any post_list block content revisions' @@ -330,6 +336,7 @@ permissions: - 'view any gallery block content history' - 'view any grand_hero block content history' - 'view any image block content history' + - 'view any inline_message block content history' - 'view any link_grid block content history' - 'view any media_grid block content history' - 'view any post_list block content history' diff --git a/web/profiles/custom/yalesites_profile/config/sync/user.role.editor.yml b/web/profiles/custom/yalesites_profile/config/sync/user.role.editor.yml index 4edab699f9..d1800d4f4d 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/user.role.editor.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/user.role.editor.yml @@ -18,6 +18,7 @@ dependencies: - block_content.type.gallery - block_content.type.grand_hero - block_content.type.image + - block_content.type.inline_message - block_content.type.link_grid - block_content.type.media_grid - block_content.type.post_list @@ -121,6 +122,7 @@ permissions: - 'create grand_hero block content' - 'create image block content' - 'create image media' + - 'create inline_message block content' - 'create link_grid block content' - 'create media' - 'create media_grid block content' @@ -181,6 +183,8 @@ permissions: - 'delete any image block content' - 'delete any image block content revisions' - 'delete any image media' + - 'delete any inline_message block content' + - 'delete any inline_message block content revisions' - 'delete any link_grid block content' - 'delete any link_grid block content revisions' - 'delete any media' @@ -249,6 +253,7 @@ permissions: - 'edit any grand_hero block content' - 'edit any image block content' - 'edit any image media' + - 'edit any inline_message block content' - 'edit any link_grid block content' - 'edit any media_grid block content' - 'edit any page content' @@ -301,6 +306,7 @@ permissions: - 'revert any gallery block content revisions' - 'revert any grand_hero block content revisions' - 'revert any image block content revisions' + - 'revert any inline_message block content revisions' - 'revert any link_grid block content revisions' - 'revert any media_grid block content revisions' - 'revert any post_list block content revisions' @@ -349,6 +355,7 @@ permissions: - 'view any gallery block content history' - 'view any grand_hero block content history' - 'view any image block content history' + - 'view any inline_message block content history' - 'view any link_grid block content history' - 'view any media_grid block content history' - 'view any post_list block content history' diff --git a/web/profiles/custom/yalesites_profile/config/sync/user.role.platform_admin.yml b/web/profiles/custom/yalesites_profile/config/sync/user.role.platform_admin.yml index 4dbe13f071..e99c42f8a9 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/user.role.platform_admin.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/user.role.platform_admin.yml @@ -18,6 +18,7 @@ dependencies: - block_content.type.gallery - block_content.type.grand_hero - block_content.type.image + - block_content.type.inline_message - block_content.type.link_grid - block_content.type.media_grid - block_content.type.post_list @@ -132,6 +133,7 @@ permissions: - 'create grand_hero block content' - 'create image block content' - 'create image media' + - 'create inline_message block content' - 'create link_grid block content' - 'create media' - 'create media_grid block content' @@ -192,6 +194,8 @@ permissions: - 'delete any image block content' - 'delete any image block content revisions' - 'delete any image media' + - 'delete any inline_message block content' + - 'delete any inline_message block content revisions' - 'delete any link_grid block content' - 'delete any link_grid block content revisions' - 'delete any media' @@ -261,6 +265,7 @@ permissions: - 'edit any grand_hero block content' - 'edit any image block content' - 'edit any image media' + - 'edit any inline_message block content' - 'edit any link_grid block content' - 'edit any media_grid block content' - 'edit any page content' @@ -316,6 +321,7 @@ permissions: - 'revert any gallery block content revisions' - 'revert any grand_hero block content revisions' - 'revert any image block content revisions' + - 'revert any inline_message block content revisions' - 'revert any link_grid block content revisions' - 'revert any media_grid block content revisions' - 'revert any post_list block content revisions' @@ -364,6 +370,7 @@ permissions: - 'view any gallery block content history' - 'view any grand_hero block content history' - 'view any image block content history' + - 'view any inline_message block content history' - 'view any link_grid block content history' - 'view any media_grid block content history' - 'view any post_list block content history' diff --git a/web/profiles/custom/yalesites_profile/config/sync/user.role.site_admin.yml b/web/profiles/custom/yalesites_profile/config/sync/user.role.site_admin.yml index 39439b1399..b6dcffa6a9 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/user.role.site_admin.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/user.role.site_admin.yml @@ -18,6 +18,7 @@ dependencies: - block_content.type.gallery - block_content.type.grand_hero - block_content.type.image + - block_content.type.inline_message - block_content.type.link_grid - block_content.type.media_grid - block_content.type.post_list @@ -125,6 +126,7 @@ permissions: - 'create grand_hero block content' - 'create image block content' - 'create image media' + - 'create inline_message block content' - 'create link_grid block content' - 'create media' - 'create media_grid block content' @@ -185,6 +187,8 @@ permissions: - 'delete any image block content' - 'delete any image block content revisions' - 'delete any image media' + - 'delete any inline_message block content' + - 'delete any inline_message block content revisions' - 'delete any link_grid block content' - 'delete any link_grid block content revisions' - 'delete any media' @@ -254,6 +258,7 @@ permissions: - 'edit any grand_hero block content' - 'edit any image block content' - 'edit any image media' + - 'edit any inline_message block content' - 'edit any link_grid block content' - 'edit any media_grid block content' - 'edit any page content' @@ -306,6 +311,7 @@ permissions: - 'revert any gallery block content revisions' - 'revert any grand_hero block content revisions' - 'revert any image block content revisions' + - 'revert any inline_message block content revisions' - 'revert any link_grid block content revisions' - 'revert any media_grid block content revisions' - 'revert any post_list block content revisions' @@ -354,6 +360,7 @@ permissions: - 'view any gallery block content history' - 'view any grand_hero block content history' - 'view any image block content history' + - 'view any inline_message block content history' - 'view any link_grid block content history' - 'view any media_grid block content history' - 'view any post_list block content history' From 299fc432eb1c7c8eb0f3a884e5bf2c0b66295464 Mon Sep 17 00:00:00 2001 From: David Blankenship Date: Mon, 22 Jul 2024 17:01:24 -0400 Subject: [PATCH 11/35] fix(YSP-551): fix reusable block errors It turns out cloned blocks were actually still the same block, but with a different revision. Because of this, when you set it up to be reusable, it would actually fail the save, making the block in an inconsistent state as we then try to create a new block to replace the now reusable (we thought) block. This attempts to save in the regular way, but in a failure, it assumes it's in this state and breaks off to duplicate itself as a new block so that it can become reusable. --- ...f91b1234979cf697a66a48e34eb116b441-1.patch | 585 ++++++++++++++++++ .../custom/yalesites_profile/composer.json | 2 +- 2 files changed, 586 insertions(+), 1 deletion(-) create mode 100644 patches/layout_builder/1330eff91b1234979cf697a66a48e34eb116b441-1.patch diff --git a/patches/layout_builder/1330eff91b1234979cf697a66a48e34eb116b441-1.patch b/patches/layout_builder/1330eff91b1234979cf697a66a48e34eb116b441-1.patch new file mode 100644 index 0000000000..8c0b52c269 --- /dev/null +++ b/patches/layout_builder/1330eff91b1234979cf697a66a48e34eb116b441-1.patch @@ -0,0 +1,585 @@ +From e8e088aa19f199d39524749725bf86fc77af07b0 Mon Sep 17 00:00:00 2001 +From: David Blankenship +Date: Mon, 22 Jul 2024 16:45:55 -0400 +Subject: [PATCH] Applied original patch with fix + +--- + .../layout_builder.permissions.yml | 3 + + .../layout_builder.services.yml | 3 + + .../src/Form/ConfigureBlockFormBase.php | 166 +++++++++++++++++- + .../src/Form/DefaultsEntityForm.php | 18 +- + .../src/Form/DiscardLayoutChangesForm.php | 19 +- + .../src/Form/OverridesEntityForm.php | 18 +- + .../src/LayoutReusableBlockDiscardChanges.php | 100 +++++++++++ + 7 files changed, 318 insertions(+), 9 deletions(-) + create mode 100644 core/modules/layout_builder/src/LayoutReusableBlockDiscardChanges.php + +diff --git a/core/modules/layout_builder/layout_builder.permissions.yml b/core/modules/layout_builder/layout_builder.permissions.yml +index 5799cb652b..4a356da83e 100644 +--- a/core/modules/layout_builder/layout_builder.permissions.yml ++++ b/core/modules/layout_builder/layout_builder.permissions.yml +@@ -4,6 +4,9 @@ configure any layout: + create and edit custom blocks: + title: 'Create and edit content blocks' + description: 'Manage the single-use blocks within the Layout Builder' ++create reusable blocks: ++ title: 'Create reusable blocks' ++ description: 'Create reusable blocks which can be used in different layouts' + + permission_callbacks: + - \Drupal\layout_builder\LayoutBuilderOverridesPermissions::permissions +diff --git a/core/modules/layout_builder/layout_builder.services.yml b/core/modules/layout_builder/layout_builder.services.yml +index 4e9fc3acda..90f76c93c9 100644 +--- a/core/modules/layout_builder/layout_builder.services.yml ++++ b/core/modules/layout_builder/layout_builder.services.yml +@@ -2,6 +2,9 @@ services: + layout_builder.tempstore_repository: + class: Drupal\layout_builder\LayoutTempstoreRepository + arguments: ['@tempstore.shared'] ++ layout_builder.reusable_block_discard_changes: ++ class: Drupal\layout_builder\LayoutReusableBlockDiscardChanges ++ arguments: ['@tempstore.shared', '@entity.repository'] + access_check.entity.layout_builder_access: + class: Drupal\layout_builder\Access\LayoutBuilderAccessCheck + tags: +diff --git a/core/modules/layout_builder/src/Form/ConfigureBlockFormBase.php b/core/modules/layout_builder/src/Form/ConfigureBlockFormBase.php +index 76f2526d04..a28fed47fe 100644 +--- a/core/modules/layout_builder/src/Form/ConfigureBlockFormBase.php ++++ b/core/modules/layout_builder/src/Form/ConfigureBlockFormBase.php +@@ -3,25 +3,32 @@ + namespace Drupal\layout_builder\Form; + + use Drupal\Component\Utility\Html; ++use Drupal\Component\Utility\NestedArray; + use Drupal\Component\Uuid\UuidInterface; + use Drupal\Core\Ajax\AjaxFormHelperTrait; + use Drupal\Core\Block\BlockManagerInterface; + use Drupal\Core\Block\BlockPluginInterface; ++use Drupal\Core\Entity\Entity\EntityFormDisplay; ++use Drupal\Core\Entity\EntityTypeManagerInterface; + use Drupal\Core\Form\BaseFormIdInterface; + use Drupal\Core\Form\FormBase; + use Drupal\Core\Form\FormStateInterface; + use Drupal\Core\Form\SubformState; ++use Drupal\Core\Form\SubformStateInterface; + use Drupal\Core\Plugin\Context\ContextRepositoryInterface; + use Drupal\Core\Plugin\ContextAwarePluginAssignmentTrait; + use Drupal\Core\Plugin\ContextAwarePluginInterface; + use Drupal\Core\Plugin\PluginFormFactoryInterface; + use Drupal\Core\Plugin\PluginWithFormsInterface; ++use Drupal\Core\Session\AccountInterface; + use Drupal\layout_builder\Context\LayoutBuilderContextTrait; + use Drupal\layout_builder\Controller\LayoutRebuildTrait; + use Drupal\layout_builder\LayoutTempstoreRepositoryInterface; + use Drupal\layout_builder\SectionComponent; + use Drupal\layout_builder\SectionStorageInterface; + use Symfony\Component\DependencyInjection\ContainerInterface; ++use Drupal\Core\TempStore\SharedTempStoreFactory; ++use Drupal\block_content\Entity\BlockContent; + + /** + * Provides a base form for configuring a block. +@@ -99,6 +106,27 @@ abstract class ConfigureBlockFormBase extends FormBase implements BaseFormIdInte + */ + protected $sectionStorage; + ++ /** ++ * The entity type manager service. ++ * ++ * @var \Drupal\Core\Entity\EntityTypeManagerInterface ++ */ ++ protected $entityTypeManager; ++ ++ /** ++ * The current user. ++ * ++ * @var \Drupal\Core\Session\AccountInterface ++ */ ++ protected $currentUser; ++ ++ /** ++ * The shared tempstore factory. ++ * ++ * @var \Drupal\Core\TempStore\SharedTempStoreFactory ++ */ ++ protected $tempStoreFactory; ++ + /** + * Constructs a new block form. + * +@@ -112,13 +140,22 @@ abstract class ConfigureBlockFormBase extends FormBase implements BaseFormIdInte + * The UUID generator. + * @param \Drupal\Core\Plugin\PluginFormFactoryInterface $plugin_form_manager + * The plugin form manager. ++ * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager ++ * The entity type manager service. ++ * @param \Drupal\Core\Session\AccountInterface $current_user ++ * The current user. ++ * @param \Drupal\Core\TempStore\SharedTempStoreFactory $temp_store_factory ++ * The shared tempstore factory. + */ +- public function __construct(LayoutTempstoreRepositoryInterface $layout_tempstore_repository, ContextRepositoryInterface $context_repository, BlockManagerInterface $block_manager, UuidInterface $uuid, PluginFormFactoryInterface $plugin_form_manager) { ++ public function __construct(LayoutTempstoreRepositoryInterface $layout_tempstore_repository, ContextRepositoryInterface $context_repository, BlockManagerInterface $block_manager, UuidInterface $uuid, PluginFormFactoryInterface $plugin_form_manager, EntityTypeManagerInterface $entity_type_manager, AccountInterface $current_user, SharedTempStoreFactory $temp_store_factory) { + $this->layoutTempstoreRepository = $layout_tempstore_repository; + $this->contextRepository = $context_repository; + $this->blockManager = $block_manager; + $this->uuidGenerator = $uuid; + $this->pluginFormFactory = $plugin_form_manager; ++ $this->entityTypeManager = $entity_type_manager; ++ $this->currentUser = $current_user; ++ $this->tempStoreFactory = $temp_store_factory; + } + + /** +@@ -130,7 +167,10 @@ public static function create(ContainerInterface $container) { + $container->get('context.repository'), + $container->get('plugin.manager.block'), + $container->get('uuid'), +- $container->get('plugin_form.factory') ++ $container->get('plugin_form.factory'), ++ $container->get('entity_type.manager'), ++ $container->get('current_user'), ++ $container->get('tempstore.shared') + ); + } + +@@ -171,6 +211,48 @@ public function doBuildForm(array $form, FormStateInterface $form_state, Section + $subform_state = SubformState::createForSubform($form['settings'], $form, $form_state); + $form['settings'] = $this->getPluginForm($this->block)->buildConfigurationForm($form['settings'], $subform_state); + ++ if ($this->block->getBaseId() === 'block_content') { ++ // Show the block content form here. ++ /** @var \Drupal\block_content\Plugin\Derivative\BlockContent[] $block_contents */ ++ $block_contents = $this->entityTypeManager->getStorage('block_content')->loadByProperties(['uuid' => $this->block->getDerivativeId()]); ++ if (count($block_contents) === 1) { ++ $form['messages'] = [ ++ '#theme' => 'status_messages', ++ '#message_list' => [ ++ 'warning' => [$this->t("This block is reusable! Any changes made will be applied globally.")], ++ ], ++ ]; ++ $form['block_form'] = [ ++ '#type' => 'container', ++ '#process' => [[static::class, 'processBlockContentForm']], ++ '#block' => reset($block_contents), ++ '#access' => $this->currentUser->hasPermission('create and edit custom blocks'), ++ ]; ++ } ++ } ++ elseif ($this->block->getBaseId() === 'inline_block') { ++ /** @var \Drupal\block_content\BlockContentInterface $block_content */ ++ $block_content = $form['settings']['block_form']['#block']; ++ $form['reusable'] = [ ++ '#type' => 'checkbox', ++ '#title' => $this->t('Reusable'), ++ '#description' => $this->t('Would you like to be able to reuse this block? This option can not be changed after saving.'), ++ '#default_value' => $block_content->isReusable(), ++ '#access' => $this->currentUser->hasPermission('create reusable blocks'), ++ ]; ++ $form['info'] = [ ++ '#type' => 'textfield', ++ '#title' => $this->t('Admin title'), ++ '#description' => $this->t('The title used to find and reuse this block later.'), ++ '#access' => $this->currentUser->hasPermission('create reusable blocks'), ++ '#states' => [ ++ 'visible' => [ ++ ':input[name="reusable"]' => ['checked' => TRUE], ++ ], ++ ], ++ ]; ++ } ++ + $form['actions']['submit'] = [ + '#type' => 'submit', + '#value' => $this->submitLabel(), +@@ -194,6 +276,26 @@ public function doBuildForm(array $form, FormStateInterface $form_state, Section + return $form; + } + ++ /** ++ * Process callback to insert a Custom Block form. ++ * ++ * @param array $element ++ * The containing element. ++ * @param \Drupal\Core\Form\FormStateInterface $form_state ++ * The form state. ++ * ++ * @return array ++ * The containing element, with the Custom Block form inserted. ++ */ ++ public static function processBlockContentForm(array $element, FormStateInterface $form_state) { ++ /** @var \Drupal\block_content\BlockContentInterface $block */ ++ $block = $element['#block']; ++ EntityFormDisplay::collectRenderDisplay($block, 'edit')->buildForm($block, $element, $form_state); ++ $element['revision_log']['#access'] = FALSE; ++ $element['info']['#access'] = FALSE; ++ return $element; ++ } ++ + /** + * Returns the label for the submit button. + * +@@ -208,6 +310,18 @@ abstract protected function submitLabel(); + public function validateForm(array &$form, FormStateInterface $form_state) { + $subform_state = SubformState::createForSubform($form['settings'], $form, $form_state); + $this->getPluginForm($this->block)->validateConfigurationForm($form['settings'], $subform_state); ++ ++ if ($this->block->getBaseId() === 'block_content') { ++ $block_form = $form['block_form']; ++ /** @var \Drupal\block_content\BlockContentInterface $block_content */ ++ $block_content = $block_form['#block']; ++ $form_display = EntityFormDisplay::collectRenderDisplay($block_content, 'edit'); ++ $complete_form_state = $form_state instanceof SubformStateInterface ? $form_state->getCompleteFormState() : $form_state; ++ $form_display->extractFormValues($block_content, $block_form, $complete_form_state); ++ $form_display->validateFormValues($block_content, $block_form, $complete_form_state); ++ // @todo Remove when https://www.drupal.org/project/drupal/issues/2948549 is closed. ++ $form_state->setTemporaryValue('block_form_parents', $block_form['#parents']); ++ } + } + + /** +@@ -224,7 +338,53 @@ public function submitForm(array &$form, FormStateInterface $form_state) { + } + + $configuration = $this->block->getConfiguration(); +- ++ if ($this->block->getBaseId() === 'block_content' && isset($form['block_form'])) { ++ // @todo Remove when https://www.drupal.org/project/drupal/issues/2948549 is closed. ++ $block_form = NestedArray::getValue($form, $form_state->getTemporaryValue('block_form_parents')); ++ /** @var \Drupal\block_content\BlockContentInterface $block_content */ ++ $block_content = $block_form['#block']; ++ // Add block to temp store. ++ $routeParams = $this->sectionStorage->getLayoutBuilderUrl()->getRouteParameters(); ++ $nid = $routeParams['node']; ++ $tempStore = $this->tempStoreFactory->get('inline_reusable_block'); ++ $tempBlock = BlockContent::load($block_content->id()); ++ $tempStore->set($tempBlock->bundle() . '--' . $tempBlock->uuid() . '--' . $nid, $tempBlock); ++ $form_display = EntityFormDisplay::collectRenderDisplay($block_content, 'edit'); ++ $complete_form_state = $form_state instanceof SubformStateInterface ? $form_state->getCompleteFormState() : $form_state; ++ $form_display->extractFormValues($block_content, $block_form, $complete_form_state); ++ $block_content->save(); ++ } ++ // If the block got marked as reusable, then convert the inline_block plugin ++ // to a block_content plugin. ++ elseif ($this->block->getBaseId() === 'inline_block' && $form_state->getValue('reusable')) { ++ $block_info = $form_state->getValue('info'); ++ if (empty($block_info)) { ++ $block_info = $form_state->getValue('settings')['label']; ++ } ++ /** @var \Drupal\block_content\BlockContentInterface $block_content */ ++ $block_content = $form['settings']['block_form']['#block']; ++ $block_content->setReusable(); ++ $block_content->setInfo($block_info); ++ $block_content->save(); ++ ++ // If it didn't save, it's probably because we're using the same cloned ++ // item somewhere else with different revisions. So, we'll create a new ++ // block_content item to make sure it's fresh and won't interfere. ++ if (!$saved) { ++ $block_content = $block_content->createDuplicate(); ++ $block_content->save(); ++ } ++ ++ $block_label_display = $form_state->getValue('settings')['label_display']; ++ $this->block = $this->blockManager->createInstance('block_content:' . $block_content->uuid(), [ ++ 'view_mode' => $configuration['view_mode'], ++ 'label' => $configuration['label'], ++ 'type' => $block_content->bundle(), ++ 'uuid' => $block_content->uuid(), ++ 'label_display' => $block_label_display, ++ ]); ++ $configuration = $this->block->getConfiguration(); ++ } + $section = $this->sectionStorage->getSection($this->delta); + $section->getComponent($this->uuid)->setConfiguration($configuration); + +diff --git a/core/modules/layout_builder/src/Form/DefaultsEntityForm.php b/core/modules/layout_builder/src/Form/DefaultsEntityForm.php +index b254e3424d..7e47eb71c1 100644 +--- a/core/modules/layout_builder/src/Form/DefaultsEntityForm.php ++++ b/core/modules/layout_builder/src/Form/DefaultsEntityForm.php +@@ -7,6 +7,7 @@ + use Drupal\Core\Form\FormStateInterface; + use Drupal\Core\Routing\RouteMatchInterface; + use Drupal\layout_builder\Entity\LayoutEntityDisplayInterface; ++use Drupal\layout_builder\LayoutReusableBlockDiscardChanges; + use Drupal\layout_builder\LayoutTempstoreRepositoryInterface; + use Drupal\layout_builder\SectionStorageInterface; + use Symfony\Component\DependencyInjection\ContainerInterface; +@@ -42,6 +43,13 @@ class DefaultsEntityForm extends EntityForm { + */ + protected $sectionStorage; + ++ /** ++ * The shared tempstore factory. ++ * ++ * @var \Drupal\layout_builder\LayoutReusableBlockDiscardChanges ++ */ ++ protected $layoutReusableBlockDiscardChanges; ++ + /** + * Constructs a new DefaultsEntityForm. + * +@@ -49,10 +57,13 @@ class DefaultsEntityForm extends EntityForm { + * The layout tempstore repository. + * @param \Drupal\Core\Entity\EntityTypeBundleInfoInterface $entity_type_bundle_info + * The entity type bundle info service. ++ * @param \Drupal\layout_builder\LayoutReusableBlockDiscardChanges $layout_reusable_block_discard_changes ++ * The layout reusable block discard change service. + */ +- public function __construct(LayoutTempstoreRepositoryInterface $layout_tempstore_repository, EntityTypeBundleInfoInterface $entity_type_bundle_info) { ++ public function __construct(LayoutTempstoreRepositoryInterface $layout_tempstore_repository, EntityTypeBundleInfoInterface $entity_type_bundle_info, LayoutReusableBlockDiscardChanges $layout_reusable_block_discard_changes) { + $this->layoutTempstoreRepository = $layout_tempstore_repository; + $this->entityTypeBundleInfo = $entity_type_bundle_info; ++ $this->layoutReusableBlockDiscardChanges = $layout_reusable_block_discard_changes; + } + + /** +@@ -61,7 +72,8 @@ public function __construct(LayoutTempstoreRepositoryInterface $layout_tempstore + public static function create(ContainerInterface $container) { + return new static( + $container->get('layout_builder.tempstore_repository'), +- $container->get('entity_type.bundle.info') ++ $container->get('entity_type.bundle.info'), ++ $container->get('layout_builder.reusable_block_discard_changes') + ); + } + +@@ -197,6 +209,8 @@ public function redirectOnSubmit(array $form, FormStateInterface $form_state) { + * {@inheritdoc} + */ + public function save(array $form, FormStateInterface $form_state) { ++ // Delete all reusable block tempStorage for this node. ++ $this->layoutReusableBlockDiscardChanges->deleteReusableBlockTemporaryStorage($this->sectionStorage); + $return = $this->sectionStorage->save(); + $this->layoutTempstoreRepository->delete($this->sectionStorage); + $this->messenger()->addMessage($this->t('The layout has been saved.')); +diff --git a/core/modules/layout_builder/src/Form/DiscardLayoutChangesForm.php b/core/modules/layout_builder/src/Form/DiscardLayoutChangesForm.php +index 5f49f298a8..71cb00b201 100644 +--- a/core/modules/layout_builder/src/Form/DiscardLayoutChangesForm.php ++++ b/core/modules/layout_builder/src/Form/DiscardLayoutChangesForm.php +@@ -8,6 +8,7 @@ + use Drupal\layout_builder\LayoutTempstoreRepositoryInterface; + use Drupal\layout_builder\SectionStorageInterface; + use Symfony\Component\DependencyInjection\ContainerInterface; ++use Drupal\layout_builder\LayoutReusableBlockDiscardChanges; + + /** + * Discards any pending changes to the layout. +@@ -38,6 +39,13 @@ class DiscardLayoutChangesForm extends ConfirmFormBase { + */ + protected $sectionStorage; + ++ /** ++ * The shared tempstore factory. ++ * ++ * @var \Drupal\layout_builder\LayoutReusableBlockDiscardChanges ++ */ ++ protected $layoutReusableBlockDiscardChanges; ++ + /** + * Constructs a new DiscardLayoutChangesForm. + * +@@ -45,10 +53,13 @@ class DiscardLayoutChangesForm extends ConfirmFormBase { + * The layout tempstore repository. + * @param \Drupal\Core\Messenger\MessengerInterface $messenger + * The messenger service. ++ * @param \Drupal\layout_builder\LayoutReusableBlockDiscardChanges $layout_reusable_block_discard_changes ++ * The layout reusable block discard change service. + */ +- public function __construct(LayoutTempstoreRepositoryInterface $layout_tempstore_repository, MessengerInterface $messenger) { ++ public function __construct(LayoutTempstoreRepositoryInterface $layout_tempstore_repository, MessengerInterface $messenger, LayoutReusableBlockDiscardChanges $layout_reusable_block_discard_changes) { + $this->layoutTempstoreRepository = $layout_tempstore_repository; + $this->messenger = $messenger; ++ $this->layoutReusableBlockDiscardChanges = $layout_reusable_block_discard_changes; + } + + /** +@@ -57,7 +68,8 @@ public function __construct(LayoutTempstoreRepositoryInterface $layout_tempstore + public static function create(ContainerInterface $container) { + return new static( + $container->get('layout_builder.tempstore_repository'), +- $container->get('messenger') ++ $container->get('messenger'), ++ $container->get('layout_builder.reusable_block_discard_changes') + ); + } + +@@ -96,6 +108,9 @@ public function buildForm(array $form, FormStateInterface $form_state, SectionSt + * {@inheritdoc} + */ + public function submitForm(array &$form, FormStateInterface $form_state) { ++ // Revert reusable block to previously stored if discarded. ++ $this->layoutReusableBlockDiscardChanges->revertReusableBlock($this->sectionStorage); ++ + $this->layoutTempstoreRepository->delete($this->sectionStorage); + + $this->messenger->addMessage($this->t('The changes to the layout have been discarded.')); +diff --git a/core/modules/layout_builder/src/Form/OverridesEntityForm.php b/core/modules/layout_builder/src/Form/OverridesEntityForm.php +index 789778fc8f..3bcac44b8a 100644 +--- a/core/modules/layout_builder/src/Form/OverridesEntityForm.php ++++ b/core/modules/layout_builder/src/Form/OverridesEntityForm.php +@@ -14,6 +14,7 @@ + use Drupal\layout_builder\Plugin\SectionStorage\OverridesSectionStorage; + use Drupal\layout_builder\SectionStorageInterface; + use Symfony\Component\DependencyInjection\ContainerInterface; ++use Drupal\layout_builder\LayoutReusableBlockDiscardChanges; + + /** + * Provides a form containing the Layout Builder UI for overrides. +@@ -39,6 +40,13 @@ class OverridesEntityForm extends ContentEntityForm { + */ + protected $sectionStorage; + ++ /** ++ * The shared tempstore factory. ++ * ++ * @var \Drupal\layout_builder\LayoutReusableBlockDiscardChanges ++ */ ++ protected $layoutReusableBlockDiscardChanges; ++ + /** + * Constructs a new OverridesEntityForm. + * +@@ -50,10 +58,13 @@ class OverridesEntityForm extends ContentEntityForm { + * The time service. + * @param \Drupal\layout_builder\LayoutTempstoreRepositoryInterface $layout_tempstore_repository + * The layout tempstore repository. ++ * @param \Drupal\layout_builder\LayoutReusableBlockDiscardChanges $layout_reusable_block_discard_changes ++ * The layout The layout reusable block discard change service. + */ +- public function __construct(EntityRepositoryInterface $entity_repository, EntityTypeBundleInfoInterface $entity_type_bundle_info, TimeInterface $time, LayoutTempstoreRepositoryInterface $layout_tempstore_repository) { ++ public function __construct(EntityRepositoryInterface $entity_repository, EntityTypeBundleInfoInterface $entity_type_bundle_info, TimeInterface $time, LayoutTempstoreRepositoryInterface $layout_tempstore_repository, LayoutReusableBlockDiscardChanges $layout_reusable_block_discard_changes) { + parent::__construct($entity_repository, $entity_type_bundle_info, $time); + $this->layoutTempstoreRepository = $layout_tempstore_repository; ++ $this->layoutReusableBlockDiscardChanges = $layout_reusable_block_discard_changes; + } + + /** +@@ -64,7 +75,8 @@ public static function create(ContainerInterface $container) { + $container->get('entity.repository'), + $container->get('entity_type.bundle.info'), + $container->get('datetime.time'), +- $container->get('layout_builder.tempstore_repository') ++ $container->get('layout_builder.tempstore_repository'), ++ $container->get('layout_builder.reusable_block_discard_changes') + ); + } + +@@ -176,6 +188,8 @@ protected function buildMessage(EntityInterface $entity, OverridesSectionStorage + public function save(array $form, FormStateInterface $form_state) { + $return = parent::save($form, $form_state); + ++ // Delete all reusable block tempStorage for this node. ++ $this->layoutReusableBlockDiscardChanges->deleteReusableBlockTemporaryStorage($this->sectionStorage); + $this->layoutTempstoreRepository->delete($this->sectionStorage); + $this->messenger()->addStatus($this->t('The layout override has been saved.')); + $form_state->setRedirectUrl($this->sectionStorage->getRedirectUrl()); +diff --git a/core/modules/layout_builder/src/LayoutReusableBlockDiscardChanges.php b/core/modules/layout_builder/src/LayoutReusableBlockDiscardChanges.php +new file mode 100644 +index 0000000000..a567c0fa9b +--- /dev/null ++++ b/core/modules/layout_builder/src/LayoutReusableBlockDiscardChanges.php +@@ -0,0 +1,100 @@ ++tempStoreFactory = $temp_store_factory; ++ $this->entityRepository = $entity_repository; ++ } ++ ++ /** ++ * Revert reusable block on discard changes to ++ * previously stored version. ++ */ ++ public function revertReusableBlock(SectionStorageInterface $section_storage) { ++ $tempStore = $this->tempStoreFactory->get('inline_reusable_block'); ++ $routeParams = $section_storage->getLayoutBuilderUrl()->getRouteParameters(); ++ if (isset($routeParams['node'])) { ++ $nid = $routeParams['node']; ++ } ++ else { ++ return; ++ } ++ foreach ($section_storage->getSections() as $section) { ++ foreach ($section->getComponents() as $component) { ++ if ($component->getPlugin() ++ ->getPluginDefinition()['id'] === 'block_content') { ++ $explode = explode(':', $component->getPlugin() ++ ->getPluginDefinition()['config_dependencies']['content'][0]); ++ $block_content = $this->entityRepository->loadEntityByUuid('block_content', $explode[2]); ++ $newBlock = $tempStore->get($block_content->bundle() . '--' . $block_content->uuid() . '--' . $nid); ++ if ($newBlock) { ++ $newBlock->setNewRevision(); ++ $newBlock->save(); ++ $tempStore->delete($block_content->bundle() . '--' . $block_content->uuid() . '--' . $nid); ++ } ++ } ++ ++ } ++ } ++ } ++ ++ /** ++ * Revert reusable block on discard changes to ++ * previously stored version. ++ */ ++ public function deleteReusableBlockTemporaryStorage(SectionStorageInterface $section_storage) { ++ $tempStore = $this->tempStoreFactory->get('inline_reusable_block'); ++ $routeParams = $section_storage->getLayoutBuilderUrl()->getRouteParameters(); ++ if (isset($routeParams['node'])) { ++ $nid = $routeParams['node']; ++ } ++ else { ++ return; ++ } ++ foreach ($section_storage->getSections() as $section) { ++ foreach ($section->getComponents() as $component) { ++ if ($component->getPlugin() ++ ->getPluginDefinition()['id'] === 'block_content') { ++ $explode = explode(':', $component->getPlugin() ++ ->getPluginDefinition()['config_dependencies']['content'][0]); ++ $block_content = $this->entityRepository->loadEntityByUuid('block_content', $explode[2]); ++ // Delete temp storage. ++ $tempStore->delete($block_content->bundle() . '--' . $block_content->uuid() . '--' . $nid); ++ } ++ ++ } ++ } ++ } ++ ++} +-- +2.45.2 + diff --git a/web/profiles/custom/yalesites_profile/composer.json b/web/profiles/custom/yalesites_profile/composer.json index b73d6c8c48..3db5eccbd8 100644 --- a/web/profiles/custom/yalesites_profile/composer.json +++ b/web/profiles/custom/yalesites_profile/composer.json @@ -126,7 +126,7 @@ }, "drupal/core": { "plural results summary https://www.drupal.org/project/drupal/issues/2888320": "https://www.drupal.org/files/issues/2021-12-15/2888320-78.patch", - "Add reusable option to inline block creation https://www.drupal.org/project/drupal/issues/2999491": "https://git.drupalcode.org/issue/drupal-2999491/-/commit/1330eff91b1234979cf697a66a48e34eb116b441.patch", + "Add reusable option to inline block creation https://www.drupal.org/project/drupal/issues/2999491": "patches/layout_builder/1330eff91b1234979cf697a66a48e34eb116b441-1.patch", "Prevent empty block_content info fields from causing php deprecation notices": "https://www.drupal.org/files/issues/2023-07-21/3340159-empty-block-label_0.patch" }, "drupal/entity_redirect": { From 6fa32f1a3144af8cd5e1f7e382869787f52e46c0 Mon Sep 17 00:00:00 2001 From: David Blankenship Date: Tue, 25 Jun 2024 09:02:21 -0400 Subject: [PATCH 12/35] fix(YSP-570): change limit behavior on display change The original functionality that was not working was that when display changes, the following should happen: 1. Limit input should not show when 'all' display selected 2. Limit input label should be 'Items' when 'limit' display selected 3. Limit input label should be 'Items Per Page' when 'pager' display selected Try as I might, there seems to be issues when you have two elements, one with a #states set for visibility, and another set to a callback that changes the other element with the #states array. As such, I decided to move this logic to javascript since we already had a JS file associated and it now takes care of this very quickly. --- .../ys_views_basic/assets/js/views-basic.js | 35 ++++++++++++++++++- .../FieldWidget/ViewsBasicDefaultWidget.php | 26 +++++--------- 2 files changed, 43 insertions(+), 18 deletions(-) diff --git a/web/profiles/custom/yalesites_profile/modules/custom/ys_views_basic/assets/js/views-basic.js b/web/profiles/custom/yalesites_profile/modules/custom/ys_views_basic/assets/js/views-basic.js index 95e8bb60b1..c6a8580b13 100644 --- a/web/profiles/custom/yalesites_profile/modules/custom/ys_views_basic/assets/js/views-basic.js +++ b/web/profiles/custom/yalesites_profile/modules/custom/ys_views_basic/assets/js/views-basic.js @@ -1,6 +1,6 @@ ((Drupal) => { Drupal.behaviors.ysViewsBasic = { - attach: function() { // eslint-disable-line + attach: function () { // eslint-disable-line // Function to handle radio input checked behavior based on radio element selection. function handleRadioInputs(radioGroup) { // Get references to the radio input elements within the specified group @@ -42,6 +42,39 @@ radioGroups.forEach((group) => { handleRadioInputs(group); }); + + // Handle limit display + const editLimitWrapperElement = document.querySelector('#edit-limit'); + const displayElement = document.querySelector('select[name="settings[block_form][group_user_selection][options][display]"'); + + // If they're ever gone from the form, don't deal with this. + if (editLimitWrapperElement && displayElement) { + const limitLabel = editLimitWrapperElement.querySelector('label'); + + const updateLimitElement = () => { + const value = displayElement.value; + + // First evaluate whether to hide/show the limit + const newLimitDisplayValue = value === 'all' ? 'display: none' : ''; + editLimitWrapperElement.setAttribute('style', newLimitDisplayValue); + + // Change the title + switch (value) { + case 'all': + break; + case 'limit': + limitLabel.textContent = 'Items'; + break; + case 'pager': + limitLabel.textContent = 'Items Per Page'; + default: + break; + } + } + + displayElement.addEventListener('change', updateLimitElement); + updateLimitElement(); + } }, }; })(Drupal); diff --git a/web/profiles/custom/yalesites_profile/modules/custom/ys_views_basic/src/Plugin/Field/FieldWidget/ViewsBasicDefaultWidget.php b/web/profiles/custom/yalesites_profile/modules/custom/ys_views_basic/src/Plugin/Field/FieldWidget/ViewsBasicDefaultWidget.php index 19d242574a..c733284af3 100644 --- a/web/profiles/custom/yalesites_profile/modules/custom/ys_views_basic/src/Plugin/Field/FieldWidget/ViewsBasicDefaultWidget.php +++ b/web/profiles/custom/yalesites_profile/modules/custom/ys_views_basic/src/Plugin/Field/FieldWidget/ViewsBasicDefaultWidget.php @@ -291,11 +291,13 @@ public function formElement( ], ]; + $displayValue = ($items[$delta]->params) ? $this->viewsBasicManager->getDefaultParamValue('display', $items[$delta]->params) : 'all'; + $form['group_user_selection']['options']['display'] = [ '#type' => 'select', '#title' => $this ->t('Number of Items to Display'), - '#default_value' => ($items[$delta]->params) ? $this->viewsBasicManager->getDefaultParamValue('display', $items[$delta]->params) : 'all', + '#default_value' => $displayValue, '#options' => [ 'all' => $this->t('Display all items'), 'limit' => $this->t('Limit to'), @@ -303,32 +305,22 @@ public function formElement( ], ]; - // This section calculates the title for the limit field based on display. - $numItemsValue = $formState->getValue( - ['group_user_selection', 'options', 'display'] - ); - $limitTitle = $this->t('Items'); - if ($numItemsValue) { - if ($numItemsValue == 'pager') { - $limitTitle = $this->t('Items per Page'); - } + if ($displayValue && $displayValue == 'pager') { + $limitTitle = $this->t('Items per Page'); } + /* + * Dynamic changes to this is handled in javascript due to issues with + * callbacks and #states. + */ $form['group_user_selection']['options']['limit'] = [ '#title' => $limitTitle, '#type' => 'number', '#default_value' => ($items[$delta]->params) ? $this->viewsBasicManager->getDefaultParamValue('limit', $items[$delta]->params) : 10, '#min' => 1, '#required' => TRUE, - '#states' => [ - 'invisible' => [ - $formSelectors['display_ajax'] => [ - 'value' => 'all', - ], - ], - ], '#prefix' => '
', '#suffix' => '
', ]; From 55b2f8f746941df5b378147896e848c5d61d47f0 Mon Sep 17 00:00:00 2001 From: Vincent Massaro Date: Fri, 26 Jul 2024 15:58:32 -0400 Subject: [PATCH 13/35] chore(YSP-570): add d.o patch back and apply our local patch separately --- ...f91b1234979cf697a66a48e34eb116b441-1.patch | 580 +----------------- .../custom/yalesites_profile/composer.json | 3 +- 2 files changed, 9 insertions(+), 574 deletions(-) diff --git a/patches/layout_builder/1330eff91b1234979cf697a66a48e34eb116b441-1.patch b/patches/layout_builder/1330eff91b1234979cf697a66a48e34eb116b441-1.patch index 8c0b52c269..6c73d6c158 100644 --- a/patches/layout_builder/1330eff91b1234979cf697a66a48e34eb116b441-1.patch +++ b/patches/layout_builder/1330eff91b1234979cf697a66a48e34eb116b441-1.patch @@ -1,277 +1,11 @@ -From e8e088aa19f199d39524749725bf86fc77af07b0 Mon Sep 17 00:00:00 2001 -From: David Blankenship -Date: Mon, 22 Jul 2024 16:45:55 -0400 -Subject: [PATCH] Applied original patch with fix - ---- - .../layout_builder.permissions.yml | 3 + - .../layout_builder.services.yml | 3 + - .../src/Form/ConfigureBlockFormBase.php | 166 +++++++++++++++++- - .../src/Form/DefaultsEntityForm.php | 18 +- - .../src/Form/DiscardLayoutChangesForm.php | 19 +- - .../src/Form/OverridesEntityForm.php | 18 +- - .../src/LayoutReusableBlockDiscardChanges.php | 100 +++++++++++ - 7 files changed, 318 insertions(+), 9 deletions(-) - create mode 100644 core/modules/layout_builder/src/LayoutReusableBlockDiscardChanges.php - -diff --git a/core/modules/layout_builder/layout_builder.permissions.yml b/core/modules/layout_builder/layout_builder.permissions.yml -index 5799cb652b..4a356da83e 100644 ---- a/core/modules/layout_builder/layout_builder.permissions.yml -+++ b/core/modules/layout_builder/layout_builder.permissions.yml -@@ -4,6 +4,9 @@ configure any layout: - create and edit custom blocks: - title: 'Create and edit content blocks' - description: 'Manage the single-use blocks within the Layout Builder' -+create reusable blocks: -+ title: 'Create reusable blocks' -+ description: 'Create reusable blocks which can be used in different layouts' - - permission_callbacks: - - \Drupal\layout_builder\LayoutBuilderOverridesPermissions::permissions -diff --git a/core/modules/layout_builder/layout_builder.services.yml b/core/modules/layout_builder/layout_builder.services.yml -index 4e9fc3acda..90f76c93c9 100644 ---- a/core/modules/layout_builder/layout_builder.services.yml -+++ b/core/modules/layout_builder/layout_builder.services.yml -@@ -2,6 +2,9 @@ services: - layout_builder.tempstore_repository: - class: Drupal\layout_builder\LayoutTempstoreRepository - arguments: ['@tempstore.shared'] -+ layout_builder.reusable_block_discard_changes: -+ class: Drupal\layout_builder\LayoutReusableBlockDiscardChanges -+ arguments: ['@tempstore.shared', '@entity.repository'] - access_check.entity.layout_builder_access: - class: Drupal\layout_builder\Access\LayoutBuilderAccessCheck - tags: diff --git a/core/modules/layout_builder/src/Form/ConfigureBlockFormBase.php b/core/modules/layout_builder/src/Form/ConfigureBlockFormBase.php -index 76f2526d04..a28fed47fe 100644 +index 8dd633326..a28fed47f 100644 --- a/core/modules/layout_builder/src/Form/ConfigureBlockFormBase.php +++ b/core/modules/layout_builder/src/Form/ConfigureBlockFormBase.php -@@ -3,25 +3,32 @@ - namespace Drupal\layout_builder\Form; - - use Drupal\Component\Utility\Html; -+use Drupal\Component\Utility\NestedArray; - use Drupal\Component\Uuid\UuidInterface; - use Drupal\Core\Ajax\AjaxFormHelperTrait; - use Drupal\Core\Block\BlockManagerInterface; - use Drupal\Core\Block\BlockPluginInterface; -+use Drupal\Core\Entity\Entity\EntityFormDisplay; -+use Drupal\Core\Entity\EntityTypeManagerInterface; - use Drupal\Core\Form\BaseFormIdInterface; - use Drupal\Core\Form\FormBase; - use Drupal\Core\Form\FormStateInterface; - use Drupal\Core\Form\SubformState; -+use Drupal\Core\Form\SubformStateInterface; - use Drupal\Core\Plugin\Context\ContextRepositoryInterface; - use Drupal\Core\Plugin\ContextAwarePluginAssignmentTrait; - use Drupal\Core\Plugin\ContextAwarePluginInterface; - use Drupal\Core\Plugin\PluginFormFactoryInterface; - use Drupal\Core\Plugin\PluginWithFormsInterface; -+use Drupal\Core\Session\AccountInterface; - use Drupal\layout_builder\Context\LayoutBuilderContextTrait; - use Drupal\layout_builder\Controller\LayoutRebuildTrait; - use Drupal\layout_builder\LayoutTempstoreRepositoryInterface; - use Drupal\layout_builder\SectionComponent; - use Drupal\layout_builder\SectionStorageInterface; - use Symfony\Component\DependencyInjection\ContainerInterface; -+use Drupal\Core\TempStore\SharedTempStoreFactory; -+use Drupal\block_content\Entity\BlockContent; - - /** - * Provides a base form for configuring a block. -@@ -99,6 +106,27 @@ abstract class ConfigureBlockFormBase extends FormBase implements BaseFormIdInte - */ - protected $sectionStorage; - -+ /** -+ * The entity type manager service. -+ * -+ * @var \Drupal\Core\Entity\EntityTypeManagerInterface -+ */ -+ protected $entityTypeManager; -+ -+ /** -+ * The current user. -+ * -+ * @var \Drupal\Core\Session\AccountInterface -+ */ -+ protected $currentUser; -+ -+ /** -+ * The shared tempstore factory. -+ * -+ * @var \Drupal\Core\TempStore\SharedTempStoreFactory -+ */ -+ protected $tempStoreFactory; -+ - /** - * Constructs a new block form. - * -@@ -112,13 +140,22 @@ abstract class ConfigureBlockFormBase extends FormBase implements BaseFormIdInte - * The UUID generator. - * @param \Drupal\Core\Plugin\PluginFormFactoryInterface $plugin_form_manager - * The plugin form manager. -+ * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager -+ * The entity type manager service. -+ * @param \Drupal\Core\Session\AccountInterface $current_user -+ * The current user. -+ * @param \Drupal\Core\TempStore\SharedTempStoreFactory $temp_store_factory -+ * The shared tempstore factory. - */ -- public function __construct(LayoutTempstoreRepositoryInterface $layout_tempstore_repository, ContextRepositoryInterface $context_repository, BlockManagerInterface $block_manager, UuidInterface $uuid, PluginFormFactoryInterface $plugin_form_manager) { -+ public function __construct(LayoutTempstoreRepositoryInterface $layout_tempstore_repository, ContextRepositoryInterface $context_repository, BlockManagerInterface $block_manager, UuidInterface $uuid, PluginFormFactoryInterface $plugin_form_manager, EntityTypeManagerInterface $entity_type_manager, AccountInterface $current_user, SharedTempStoreFactory $temp_store_factory) { - $this->layoutTempstoreRepository = $layout_tempstore_repository; - $this->contextRepository = $context_repository; - $this->blockManager = $block_manager; - $this->uuidGenerator = $uuid; - $this->pluginFormFactory = $plugin_form_manager; -+ $this->entityTypeManager = $entity_type_manager; -+ $this->currentUser = $current_user; -+ $this->tempStoreFactory = $temp_store_factory; - } +@@ -367,6 +367,14 @@ public function submitForm(array &$form, FormStateInterface $form_state) { + $block_content->setInfo($block_info); + $block_content->save(); - /** -@@ -130,7 +167,10 @@ public static function create(ContainerInterface $container) { - $container->get('context.repository'), - $container->get('plugin.manager.block'), - $container->get('uuid'), -- $container->get('plugin_form.factory') -+ $container->get('plugin_form.factory'), -+ $container->get('entity_type.manager'), -+ $container->get('current_user'), -+ $container->get('tempstore.shared') - ); - } - -@@ -171,6 +211,48 @@ public function doBuildForm(array $form, FormStateInterface $form_state, Section - $subform_state = SubformState::createForSubform($form['settings'], $form, $form_state); - $form['settings'] = $this->getPluginForm($this->block)->buildConfigurationForm($form['settings'], $subform_state); - -+ if ($this->block->getBaseId() === 'block_content') { -+ // Show the block content form here. -+ /** @var \Drupal\block_content\Plugin\Derivative\BlockContent[] $block_contents */ -+ $block_contents = $this->entityTypeManager->getStorage('block_content')->loadByProperties(['uuid' => $this->block->getDerivativeId()]); -+ if (count($block_contents) === 1) { -+ $form['messages'] = [ -+ '#theme' => 'status_messages', -+ '#message_list' => [ -+ 'warning' => [$this->t("This block is reusable! Any changes made will be applied globally.")], -+ ], -+ ]; -+ $form['block_form'] = [ -+ '#type' => 'container', -+ '#process' => [[static::class, 'processBlockContentForm']], -+ '#block' => reset($block_contents), -+ '#access' => $this->currentUser->hasPermission('create and edit custom blocks'), -+ ]; -+ } -+ } -+ elseif ($this->block->getBaseId() === 'inline_block') { -+ /** @var \Drupal\block_content\BlockContentInterface $block_content */ -+ $block_content = $form['settings']['block_form']['#block']; -+ $form['reusable'] = [ -+ '#type' => 'checkbox', -+ '#title' => $this->t('Reusable'), -+ '#description' => $this->t('Would you like to be able to reuse this block? This option can not be changed after saving.'), -+ '#default_value' => $block_content->isReusable(), -+ '#access' => $this->currentUser->hasPermission('create reusable blocks'), -+ ]; -+ $form['info'] = [ -+ '#type' => 'textfield', -+ '#title' => $this->t('Admin title'), -+ '#description' => $this->t('The title used to find and reuse this block later.'), -+ '#access' => $this->currentUser->hasPermission('create reusable blocks'), -+ '#states' => [ -+ 'visible' => [ -+ ':input[name="reusable"]' => ['checked' => TRUE], -+ ], -+ ], -+ ]; -+ } -+ - $form['actions']['submit'] = [ - '#type' => 'submit', - '#value' => $this->submitLabel(), -@@ -194,6 +276,26 @@ public function doBuildForm(array $form, FormStateInterface $form_state, Section - return $form; - } - -+ /** -+ * Process callback to insert a Custom Block form. -+ * -+ * @param array $element -+ * The containing element. -+ * @param \Drupal\Core\Form\FormStateInterface $form_state -+ * The form state. -+ * -+ * @return array -+ * The containing element, with the Custom Block form inserted. -+ */ -+ public static function processBlockContentForm(array $element, FormStateInterface $form_state) { -+ /** @var \Drupal\block_content\BlockContentInterface $block */ -+ $block = $element['#block']; -+ EntityFormDisplay::collectRenderDisplay($block, 'edit')->buildForm($block, $element, $form_state); -+ $element['revision_log']['#access'] = FALSE; -+ $element['info']['#access'] = FALSE; -+ return $element; -+ } -+ - /** - * Returns the label for the submit button. - * -@@ -208,6 +310,18 @@ abstract protected function submitLabel(); - public function validateForm(array &$form, FormStateInterface $form_state) { - $subform_state = SubformState::createForSubform($form['settings'], $form, $form_state); - $this->getPluginForm($this->block)->validateConfigurationForm($form['settings'], $subform_state); -+ -+ if ($this->block->getBaseId() === 'block_content') { -+ $block_form = $form['block_form']; -+ /** @var \Drupal\block_content\BlockContentInterface $block_content */ -+ $block_content = $block_form['#block']; -+ $form_display = EntityFormDisplay::collectRenderDisplay($block_content, 'edit'); -+ $complete_form_state = $form_state instanceof SubformStateInterface ? $form_state->getCompleteFormState() : $form_state; -+ $form_display->extractFormValues($block_content, $block_form, $complete_form_state); -+ $form_display->validateFormValues($block_content, $block_form, $complete_form_state); -+ // @todo Remove when https://www.drupal.org/project/drupal/issues/2948549 is closed. -+ $form_state->setTemporaryValue('block_form_parents', $block_form['#parents']); -+ } - } - - /** -@@ -224,7 +338,53 @@ public function submitForm(array &$form, FormStateInterface $form_state) { - } - - $configuration = $this->block->getConfiguration(); -- -+ if ($this->block->getBaseId() === 'block_content' && isset($form['block_form'])) { -+ // @todo Remove when https://www.drupal.org/project/drupal/issues/2948549 is closed. -+ $block_form = NestedArray::getValue($form, $form_state->getTemporaryValue('block_form_parents')); -+ /** @var \Drupal\block_content\BlockContentInterface $block_content */ -+ $block_content = $block_form['#block']; -+ // Add block to temp store. -+ $routeParams = $this->sectionStorage->getLayoutBuilderUrl()->getRouteParameters(); -+ $nid = $routeParams['node']; -+ $tempStore = $this->tempStoreFactory->get('inline_reusable_block'); -+ $tempBlock = BlockContent::load($block_content->id()); -+ $tempStore->set($tempBlock->bundle() . '--' . $tempBlock->uuid() . '--' . $nid, $tempBlock); -+ $form_display = EntityFormDisplay::collectRenderDisplay($block_content, 'edit'); -+ $complete_form_state = $form_state instanceof SubformStateInterface ? $form_state->getCompleteFormState() : $form_state; -+ $form_display->extractFormValues($block_content, $block_form, $complete_form_state); -+ $block_content->save(); -+ } -+ // If the block got marked as reusable, then convert the inline_block plugin -+ // to a block_content plugin. -+ elseif ($this->block->getBaseId() === 'inline_block' && $form_state->getValue('reusable')) { -+ $block_info = $form_state->getValue('info'); -+ if (empty($block_info)) { -+ $block_info = $form_state->getValue('settings')['label']; -+ } -+ /** @var \Drupal\block_content\BlockContentInterface $block_content */ -+ $block_content = $form['settings']['block_form']['#block']; -+ $block_content->setReusable(); -+ $block_content->setInfo($block_info); -+ $block_content->save(); -+ + // If it didn't save, it's probably because we're using the same cloned + // item somewhere else with different revisions. So, we'll create a new + // block_content item to make sure it's fresh and won't interfere. @@ -280,306 +14,6 @@ index 76f2526d04..a28fed47fe 100644 + $block_content->save(); + } + -+ $block_label_display = $form_state->getValue('settings')['label_display']; -+ $this->block = $this->blockManager->createInstance('block_content:' . $block_content->uuid(), [ -+ 'view_mode' => $configuration['view_mode'], -+ 'label' => $configuration['label'], -+ 'type' => $block_content->bundle(), -+ 'uuid' => $block_content->uuid(), -+ 'label_display' => $block_label_display, -+ ]); -+ $configuration = $this->block->getConfiguration(); -+ } - $section = $this->sectionStorage->getSection($this->delta); - $section->getComponent($this->uuid)->setConfiguration($configuration); - -diff --git a/core/modules/layout_builder/src/Form/DefaultsEntityForm.php b/core/modules/layout_builder/src/Form/DefaultsEntityForm.php -index b254e3424d..7e47eb71c1 100644 ---- a/core/modules/layout_builder/src/Form/DefaultsEntityForm.php -+++ b/core/modules/layout_builder/src/Form/DefaultsEntityForm.php -@@ -7,6 +7,7 @@ - use Drupal\Core\Form\FormStateInterface; - use Drupal\Core\Routing\RouteMatchInterface; - use Drupal\layout_builder\Entity\LayoutEntityDisplayInterface; -+use Drupal\layout_builder\LayoutReusableBlockDiscardChanges; - use Drupal\layout_builder\LayoutTempstoreRepositoryInterface; - use Drupal\layout_builder\SectionStorageInterface; - use Symfony\Component\DependencyInjection\ContainerInterface; -@@ -42,6 +43,13 @@ class DefaultsEntityForm extends EntityForm { - */ - protected $sectionStorage; - -+ /** -+ * The shared tempstore factory. -+ * -+ * @var \Drupal\layout_builder\LayoutReusableBlockDiscardChanges -+ */ -+ protected $layoutReusableBlockDiscardChanges; -+ - /** - * Constructs a new DefaultsEntityForm. - * -@@ -49,10 +57,13 @@ class DefaultsEntityForm extends EntityForm { - * The layout tempstore repository. - * @param \Drupal\Core\Entity\EntityTypeBundleInfoInterface $entity_type_bundle_info - * The entity type bundle info service. -+ * @param \Drupal\layout_builder\LayoutReusableBlockDiscardChanges $layout_reusable_block_discard_changes -+ * The layout reusable block discard change service. - */ -- public function __construct(LayoutTempstoreRepositoryInterface $layout_tempstore_repository, EntityTypeBundleInfoInterface $entity_type_bundle_info) { -+ public function __construct(LayoutTempstoreRepositoryInterface $layout_tempstore_repository, EntityTypeBundleInfoInterface $entity_type_bundle_info, LayoutReusableBlockDiscardChanges $layout_reusable_block_discard_changes) { - $this->layoutTempstoreRepository = $layout_tempstore_repository; - $this->entityTypeBundleInfo = $entity_type_bundle_info; -+ $this->layoutReusableBlockDiscardChanges = $layout_reusable_block_discard_changes; - } - - /** -@@ -61,7 +72,8 @@ public function __construct(LayoutTempstoreRepositoryInterface $layout_tempstore - public static function create(ContainerInterface $container) { - return new static( - $container->get('layout_builder.tempstore_repository'), -- $container->get('entity_type.bundle.info') -+ $container->get('entity_type.bundle.info'), -+ $container->get('layout_builder.reusable_block_discard_changes') - ); - } - -@@ -197,6 +209,8 @@ public function redirectOnSubmit(array $form, FormStateInterface $form_state) { - * {@inheritdoc} - */ - public function save(array $form, FormStateInterface $form_state) { -+ // Delete all reusable block tempStorage for this node. -+ $this->layoutReusableBlockDiscardChanges->deleteReusableBlockTemporaryStorage($this->sectionStorage); - $return = $this->sectionStorage->save(); - $this->layoutTempstoreRepository->delete($this->sectionStorage); - $this->messenger()->addMessage($this->t('The layout has been saved.')); -diff --git a/core/modules/layout_builder/src/Form/DiscardLayoutChangesForm.php b/core/modules/layout_builder/src/Form/DiscardLayoutChangesForm.php -index 5f49f298a8..71cb00b201 100644 ---- a/core/modules/layout_builder/src/Form/DiscardLayoutChangesForm.php -+++ b/core/modules/layout_builder/src/Form/DiscardLayoutChangesForm.php -@@ -8,6 +8,7 @@ - use Drupal\layout_builder\LayoutTempstoreRepositoryInterface; - use Drupal\layout_builder\SectionStorageInterface; - use Symfony\Component\DependencyInjection\ContainerInterface; -+use Drupal\layout_builder\LayoutReusableBlockDiscardChanges; - - /** - * Discards any pending changes to the layout. -@@ -38,6 +39,13 @@ class DiscardLayoutChangesForm extends ConfirmFormBase { - */ - protected $sectionStorage; - -+ /** -+ * The shared tempstore factory. -+ * -+ * @var \Drupal\layout_builder\LayoutReusableBlockDiscardChanges -+ */ -+ protected $layoutReusableBlockDiscardChanges; -+ - /** - * Constructs a new DiscardLayoutChangesForm. - * -@@ -45,10 +53,13 @@ class DiscardLayoutChangesForm extends ConfirmFormBase { - * The layout tempstore repository. - * @param \Drupal\Core\Messenger\MessengerInterface $messenger - * The messenger service. -+ * @param \Drupal\layout_builder\LayoutReusableBlockDiscardChanges $layout_reusable_block_discard_changes -+ * The layout reusable block discard change service. - */ -- public function __construct(LayoutTempstoreRepositoryInterface $layout_tempstore_repository, MessengerInterface $messenger) { -+ public function __construct(LayoutTempstoreRepositoryInterface $layout_tempstore_repository, MessengerInterface $messenger, LayoutReusableBlockDiscardChanges $layout_reusable_block_discard_changes) { - $this->layoutTempstoreRepository = $layout_tempstore_repository; - $this->messenger = $messenger; -+ $this->layoutReusableBlockDiscardChanges = $layout_reusable_block_discard_changes; - } - - /** -@@ -57,7 +68,8 @@ public function __construct(LayoutTempstoreRepositoryInterface $layout_tempstore - public static function create(ContainerInterface $container) { - return new static( - $container->get('layout_builder.tempstore_repository'), -- $container->get('messenger') -+ $container->get('messenger'), -+ $container->get('layout_builder.reusable_block_discard_changes') - ); - } - -@@ -96,6 +108,9 @@ public function buildForm(array $form, FormStateInterface $form_state, SectionSt - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { -+ // Revert reusable block to previously stored if discarded. -+ $this->layoutReusableBlockDiscardChanges->revertReusableBlock($this->sectionStorage); -+ - $this->layoutTempstoreRepository->delete($this->sectionStorage); - - $this->messenger->addMessage($this->t('The changes to the layout have been discarded.')); -diff --git a/core/modules/layout_builder/src/Form/OverridesEntityForm.php b/core/modules/layout_builder/src/Form/OverridesEntityForm.php -index 789778fc8f..3bcac44b8a 100644 ---- a/core/modules/layout_builder/src/Form/OverridesEntityForm.php -+++ b/core/modules/layout_builder/src/Form/OverridesEntityForm.php -@@ -14,6 +14,7 @@ - use Drupal\layout_builder\Plugin\SectionStorage\OverridesSectionStorage; - use Drupal\layout_builder\SectionStorageInterface; - use Symfony\Component\DependencyInjection\ContainerInterface; -+use Drupal\layout_builder\LayoutReusableBlockDiscardChanges; - - /** - * Provides a form containing the Layout Builder UI for overrides. -@@ -39,6 +40,13 @@ class OverridesEntityForm extends ContentEntityForm { - */ - protected $sectionStorage; - -+ /** -+ * The shared tempstore factory. -+ * -+ * @var \Drupal\layout_builder\LayoutReusableBlockDiscardChanges -+ */ -+ protected $layoutReusableBlockDiscardChanges; -+ - /** - * Constructs a new OverridesEntityForm. - * -@@ -50,10 +58,13 @@ class OverridesEntityForm extends ContentEntityForm { - * The time service. - * @param \Drupal\layout_builder\LayoutTempstoreRepositoryInterface $layout_tempstore_repository - * The layout tempstore repository. -+ * @param \Drupal\layout_builder\LayoutReusableBlockDiscardChanges $layout_reusable_block_discard_changes -+ * The layout The layout reusable block discard change service. - */ -- public function __construct(EntityRepositoryInterface $entity_repository, EntityTypeBundleInfoInterface $entity_type_bundle_info, TimeInterface $time, LayoutTempstoreRepositoryInterface $layout_tempstore_repository) { -+ public function __construct(EntityRepositoryInterface $entity_repository, EntityTypeBundleInfoInterface $entity_type_bundle_info, TimeInterface $time, LayoutTempstoreRepositoryInterface $layout_tempstore_repository, LayoutReusableBlockDiscardChanges $layout_reusable_block_discard_changes) { - parent::__construct($entity_repository, $entity_type_bundle_info, $time); - $this->layoutTempstoreRepository = $layout_tempstore_repository; -+ $this->layoutReusableBlockDiscardChanges = $layout_reusable_block_discard_changes; - } - - /** -@@ -64,7 +75,8 @@ public static function create(ContainerInterface $container) { - $container->get('entity.repository'), - $container->get('entity_type.bundle.info'), - $container->get('datetime.time'), -- $container->get('layout_builder.tempstore_repository') -+ $container->get('layout_builder.tempstore_repository'), -+ $container->get('layout_builder.reusable_block_discard_changes') - ); - } - -@@ -176,6 +188,8 @@ protected function buildMessage(EntityInterface $entity, OverridesSectionStorage - public function save(array $form, FormStateInterface $form_state) { - $return = parent::save($form, $form_state); - -+ // Delete all reusable block tempStorage for this node. -+ $this->layoutReusableBlockDiscardChanges->deleteReusableBlockTemporaryStorage($this->sectionStorage); - $this->layoutTempstoreRepository->delete($this->sectionStorage); - $this->messenger()->addStatus($this->t('The layout override has been saved.')); - $form_state->setRedirectUrl($this->sectionStorage->getRedirectUrl()); -diff --git a/core/modules/layout_builder/src/LayoutReusableBlockDiscardChanges.php b/core/modules/layout_builder/src/LayoutReusableBlockDiscardChanges.php -new file mode 100644 -index 0000000000..a567c0fa9b ---- /dev/null -+++ b/core/modules/layout_builder/src/LayoutReusableBlockDiscardChanges.php -@@ -0,0 +1,100 @@ -+tempStoreFactory = $temp_store_factory; -+ $this->entityRepository = $entity_repository; -+ } -+ -+ /** -+ * Revert reusable block on discard changes to -+ * previously stored version. -+ */ -+ public function revertReusableBlock(SectionStorageInterface $section_storage) { -+ $tempStore = $this->tempStoreFactory->get('inline_reusable_block'); -+ $routeParams = $section_storage->getLayoutBuilderUrl()->getRouteParameters(); -+ if (isset($routeParams['node'])) { -+ $nid = $routeParams['node']; -+ } -+ else { -+ return; -+ } -+ foreach ($section_storage->getSections() as $section) { -+ foreach ($section->getComponents() as $component) { -+ if ($component->getPlugin() -+ ->getPluginDefinition()['id'] === 'block_content') { -+ $explode = explode(':', $component->getPlugin() -+ ->getPluginDefinition()['config_dependencies']['content'][0]); -+ $block_content = $this->entityRepository->loadEntityByUuid('block_content', $explode[2]); -+ $newBlock = $tempStore->get($block_content->bundle() . '--' . $block_content->uuid() . '--' . $nid); -+ if ($newBlock) { -+ $newBlock->setNewRevision(); -+ $newBlock->save(); -+ $tempStore->delete($block_content->bundle() . '--' . $block_content->uuid() . '--' . $nid); -+ } -+ } -+ -+ } -+ } -+ } -+ -+ /** -+ * Revert reusable block on discard changes to -+ * previously stored version. -+ */ -+ public function deleteReusableBlockTemporaryStorage(SectionStorageInterface $section_storage) { -+ $tempStore = $this->tempStoreFactory->get('inline_reusable_block'); -+ $routeParams = $section_storage->getLayoutBuilderUrl()->getRouteParameters(); -+ if (isset($routeParams['node'])) { -+ $nid = $routeParams['node']; -+ } -+ else { -+ return; -+ } -+ foreach ($section_storage->getSections() as $section) { -+ foreach ($section->getComponents() as $component) { -+ if ($component->getPlugin() -+ ->getPluginDefinition()['id'] === 'block_content') { -+ $explode = explode(':', $component->getPlugin() -+ ->getPluginDefinition()['config_dependencies']['content'][0]); -+ $block_content = $this->entityRepository->loadEntityByUuid('block_content', $explode[2]); -+ // Delete temp storage. -+ $tempStore->delete($block_content->bundle() . '--' . $block_content->uuid() . '--' . $nid); -+ } -+ -+ } -+ } -+ } -+ -+} --- -2.45.2 - + $block_label_display = $form_state->getValue('settings')['label_display']; + $this->block = $this->blockManager->createInstance('block_content:' . $block_content->uuid(), [ + 'view_mode' => $configuration['view_mode'], diff --git a/web/profiles/custom/yalesites_profile/composer.json b/web/profiles/custom/yalesites_profile/composer.json index 3db5eccbd8..5f42ddb08c 100644 --- a/web/profiles/custom/yalesites_profile/composer.json +++ b/web/profiles/custom/yalesites_profile/composer.json @@ -126,7 +126,8 @@ }, "drupal/core": { "plural results summary https://www.drupal.org/project/drupal/issues/2888320": "https://www.drupal.org/files/issues/2021-12-15/2888320-78.patch", - "Add reusable option to inline block creation https://www.drupal.org/project/drupal/issues/2999491": "patches/layout_builder/1330eff91b1234979cf697a66a48e34eb116b441-1.patch", + "Add reusable option to inline block creation https://www.drupal.org/project/drupal/issues/2999491": "https://git.drupalcode.org/issue/drupal-2999491/-/commit/1330eff91b1234979cf697a66a48e34eb116b441.patch", + "Update \"Add reusable option to inline block creation\" patch with local changes to save block if it didn't save": "patches/layout_builder/1330eff91b1234979cf697a66a48e34eb116b441-1.patch", "Prevent empty block_content info fields from causing php deprecation notices": "https://www.drupal.org/files/issues/2023-07-21/3340159-empty-block-label_0.patch" }, "drupal/entity_redirect": { From dcbc58fd27688a7e9cbdc5a44c158f70909668ca Mon Sep 17 00:00:00 2001 From: David Blankenship Date: Mon, 29 Jul 2024 09:34:15 -0400 Subject: [PATCH 14/35] feat(YSP-613): bump ai_engine to 1.2.3 --- web/profiles/custom/yalesites_profile/composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/profiles/custom/yalesites_profile/composer.json b/web/profiles/custom/yalesites_profile/composer.json index b73d6c8c48..36d2f86926 100644 --- a/web/profiles/custom/yalesites_profile/composer.json +++ b/web/profiles/custom/yalesites_profile/composer.json @@ -105,7 +105,7 @@ "jjj/chosen": "2.2.1", "laminas/laminas-escaper": "2.12", "northernco/ckeditor5-anchor-drupal": "0.4.0", - "yalesites-org/ai_engine": "1.2.2", + "yalesites-org/ai_engine": "1.2.3", "yalesites-org/atomic": "1.33.0", "yalesites-org/yale_cas": "1.0.4" }, From 6ce7f1bde3f50cec23c6f27e1acf4462de8a5822 Mon Sep 17 00:00:00 2001 From: David Blankenship <128765777+dblanken-yale@users.noreply.github.com> Date: Mon, 29 Jul 2024 10:18:31 -0400 Subject: [PATCH 15/35] YSP-611: Localist: Views errors after localist enable (#704) * fix(YSP-611): default unknown taxonomies to empty string --- .../modules/custom/ys_localist/src/MetaFieldsManager.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/web/profiles/custom/yalesites_profile/modules/custom/ys_localist/src/MetaFieldsManager.php b/web/profiles/custom/yalesites_profile/modules/custom/ys_localist/src/MetaFieldsManager.php index e2a4cf2389..b514bd1fea 100644 --- a/web/profiles/custom/yalesites_profile/modules/custom/ys_localist/src/MetaFieldsManager.php +++ b/web/profiles/custom/yalesites_profile/modules/custom/ys_localist/src/MetaFieldsManager.php @@ -124,9 +124,14 @@ private function getFilterValues($node, $filterField) { foreach ($values as $value) { /** @var \Drupal\taxonomy\Entity\Term $typeInfo */ $typeInfo = $this->entityTypeManager->getStorage('taxonomy_term')->load($value['target_id']); + $name = $url = ""; + if ($typeInfo) { + $name = $typeInfo->getName(); + $url = $typeInfo->toUrl()->toString(); + } $filterValues[] = [ - 'name' => $typeInfo->getName(), - 'url' => $typeInfo->toUrl()->toString(), + 'name' => $name, + 'url' => $url, ]; } } From 103e3e3f780ad10697a201c251dcdc82764f3958 Mon Sep 17 00:00:00 2001 From: David Blankenship Date: Mon, 29 Jul 2024 11:16:09 -0400 Subject: [PATCH 16/35] fix(YSP-551): add $saved variable --- ...f91b1234979cf697a66a48e34eb116b441-1.patch | 26 ++++++++++++++----- 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/patches/layout_builder/1330eff91b1234979cf697a66a48e34eb116b441-1.patch b/patches/layout_builder/1330eff91b1234979cf697a66a48e34eb116b441-1.patch index 6c73d6c158..df0636c9e9 100644 --- a/patches/layout_builder/1330eff91b1234979cf697a66a48e34eb116b441-1.patch +++ b/patches/layout_builder/1330eff91b1234979cf697a66a48e34eb116b441-1.patch @@ -1,11 +1,23 @@ +From f046b109bdaa308f3063980026c0b63227469012 Mon Sep 17 00:00:00 2001 +From: David Blankenship +Date: Mon, 29 Jul 2024 11:15:16 -0400 +Subject: [PATCH] apply saved + +--- + .../layout_builder/src/Form/ConfigureBlockFormBase.php | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + diff --git a/core/modules/layout_builder/src/Form/ConfigureBlockFormBase.php b/core/modules/layout_builder/src/Form/ConfigureBlockFormBase.php -index 8dd633326..a28fed47f 100644 +index 8dd6333269..16b0a8cd70 100644 --- a/core/modules/layout_builder/src/Form/ConfigureBlockFormBase.php +++ b/core/modules/layout_builder/src/Form/ConfigureBlockFormBase.php -@@ -367,6 +367,14 @@ public function submitForm(array &$form, FormStateInterface $form_state) { +@@ -365,7 +365,15 @@ public function submitForm(array &$form, FormStateInterface $form_state) { + $block_content = $form['settings']['block_form']['#block']; + $block_content->setReusable(); $block_content->setInfo($block_info); - $block_content->save(); - +- $block_content->save(); ++ $saved = $block_content->save(); ++ + // If it didn't save, it's probably because we're using the same cloned + // item somewhere else with different revisions. So, we'll create a new + // block_content item to make sure it's fresh and won't interfere. @@ -13,7 +25,9 @@ index 8dd633326..a28fed47f 100644 + $block_content = $block_content->createDuplicate(); + $block_content->save(); + } -+ + $block_label_display = $form_state->getValue('settings')['label_display']; $this->block = $this->blockManager->createInstance('block_content:' . $block_content->uuid(), [ - 'view_mode' => $configuration['view_mode'], +-- +2.45.2 + From dc0901812c0617b1972b33ff128c16fa809f707f Mon Sep 17 00:00:00 2001 From: David Blankenship Date: Tue, 30 Jul 2024 13:19:44 -0400 Subject: [PATCH 17/35] feat(YSP-534): add sup/sub to Basic HTML --- .../yalesites_profile/config/sync/editor.editor.basic_html.yml | 2 ++ .../yalesites_profile/config/sync/filter.format.basic_html.yml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/web/profiles/custom/yalesites_profile/config/sync/editor.editor.basic_html.yml b/web/profiles/custom/yalesites_profile/config/sync/editor.editor.basic_html.yml index 05ab7bea82..9a0f065017 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/editor.editor.basic_html.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/editor.editor.basic_html.yml @@ -17,6 +17,8 @@ settings: - heading - '|' - link + - subscript + - superscript - '|' - anchor - '|' diff --git a/web/profiles/custom/yalesites_profile/config/sync/filter.format.basic_html.yml b/web/profiles/custom/yalesites_profile/config/sync/filter.format.basic_html.yml index c9ade20f9b..a17a58af6a 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/filter.format.basic_html.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/filter.format.basic_html.yml @@ -17,7 +17,7 @@ filters: status: true weight: -10 settings: - allowed_html: '