diff --git a/web/profiles/custom/yalesites_profile/composer.json b/web/profiles/custom/yalesites_profile/composer.json index 9b0e4931e2..b52970ec51 100644 --- a/web/profiles/custom/yalesites_profile/composer.json +++ b/web/profiles/custom/yalesites_profile/composer.json @@ -13,6 +13,7 @@ "drupal/allowed_formats": "^2.0", "drupal/autosave_form": "^1.3", "drupal/better_exposed_filters": "^6.0", + "drupal/block_content_permissions": "^1.11", "drupal/bugherd": "1.0", "drupal/calendar_link": "^3.0", "drupal/captcha": "^1.8", @@ -80,7 +81,7 @@ "drupal/upgrade_status": "^3.18", "drupal/webform": "^6.2@beta", "drupal/wingsuit_companion": "^2.0@RC", - "yalesites-org/atomic": "1.16.0", + "yalesites-org/atomic": "1.16.1", "yalesites-org/yale_cas": "^1.0" }, "minimum-stability": "dev", diff --git a/web/profiles/custom/yalesites_profile/config/sync/block.block.ys_admin_theme_local_tasks.yml b/web/profiles/custom/yalesites_profile/config/sync/block.block.ys_admin_theme_local_tasks.yml index 6c850842f0..2c11dd307b 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/block.block.ys_admin_theme_local_tasks.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/block.block.ys_admin_theme_local_tasks.yml @@ -2,6 +2,8 @@ uuid: e03d9a42-6814-4262-aec2-1914178b1d69 langcode: en status: true dependencies: + module: + - system theme: - ys_admin_theme _core: @@ -19,4 +21,8 @@ settings: provider: core primary: true secondary: false -visibility: { } +visibility: + request_path: + id: request_path + negate: true + pages: '/node/*' diff --git a/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.custom_cards.default.yml b/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.custom_cards.default.yml index c37aef0577..d57aab67f5 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.custom_cards.default.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.custom_cards.default.yml @@ -30,7 +30,7 @@ content: closed_mode: summary autocollapse: all closed_mode_threshold: 0 - add_mode: dropdown + add_mode: button form_display_mode: default default_paragraph_type: custom_card features: diff --git a/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.gallery.default.yml b/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.gallery.default.yml index ae02d4ba85..88b58d4b7c 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.gallery.default.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/core.entity_form_display.block_content.gallery.default.yml @@ -30,7 +30,7 @@ content: closed_mode: summary autocollapse: all closed_mode_threshold: 0 - add_mode: dropdown + add_mode: button form_display_mode: default default_paragraph_type: gallery_item features: diff --git a/web/profiles/custom/yalesites_profile/config/sync/core.entity_view_display.block_content.button_link.default.yml b/web/profiles/custom/yalesites_profile/config/sync/core.entity_view_display.block_content.button_link.default.yml index 9bf0dc8093..4d2b13124d 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/core.entity_view_display.block_content.button_link.default.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/core.entity_view_display.block_content.button_link.default.yml @@ -16,11 +16,11 @@ content: type: link_separate label: hidden settings: - trim_length: 80 + trim_length: null url_only: false url_plain: false - rel: '' - target: '' + rel: '0' + target: '0' third_party_settings: { } weight: 1 region: content diff --git a/web/profiles/custom/yalesites_profile/config/sync/core.entity_view_display.block_content.content_spotlight.default.yml b/web/profiles/custom/yalesites_profile/config/sync/core.entity_view_display.block_content.content_spotlight.default.yml index f122f6a47d..6d29480904 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/core.entity_view_display.block_content.content_spotlight.default.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/core.entity_view_display.block_content.content_spotlight.default.yml @@ -33,11 +33,11 @@ content: type: link_separate label: hidden settings: - trim_length: 80 + trim_length: null url_only: false url_plain: false - rel: '' - target: '' + rel: '0' + target: '0' third_party_settings: { } weight: 4 region: content diff --git a/web/profiles/custom/yalesites_profile/config/sync/core.entity_view_display.block_content.cta_banner.default.yml b/web/profiles/custom/yalesites_profile/config/sync/core.entity_view_display.block_content.cta_banner.default.yml index 617a30c881..5958d59316 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/core.entity_view_display.block_content.cta_banner.default.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/core.entity_view_display.block_content.cta_banner.default.yml @@ -31,11 +31,11 @@ content: type: link_separate label: hidden settings: - trim_length: 80 + trim_length: null url_only: false url_plain: false - rel: '' - target: '' + rel: '0' + target: '0' third_party_settings: { } weight: 3 region: content diff --git a/web/profiles/custom/yalesites_profile/config/sync/core.entity_view_display.block_content.grand_hero.default.yml b/web/profiles/custom/yalesites_profile/config/sync/core.entity_view_display.block_content.grand_hero.default.yml index aa3df4f8be..e67117b3fa 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/core.entity_view_display.block_content.grand_hero.default.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/core.entity_view_display.block_content.grand_hero.default.yml @@ -31,11 +31,11 @@ content: type: link_separate label: hidden settings: - trim_length: 80 + trim_length: null url_only: false url_plain: false - rel: '' - target: '' + rel: '0' + target: '0' third_party_settings: { } weight: 3 region: content diff --git a/web/profiles/custom/yalesites_profile/config/sync/core.entity_view_display.block_content.quick_links.default.yml b/web/profiles/custom/yalesites_profile/config/sync/core.entity_view_display.block_content.quick_links.default.yml index 4e3730f057..3b8b55325c 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/core.entity_view_display.block_content.quick_links.default.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/core.entity_view_display.block_content.quick_links.default.yml @@ -28,11 +28,11 @@ content: type: link_separate label: hidden settings: - trim_length: 80 + trim_length: null url_only: false url_plain: false - rel: '' - target: '' + rel: '0' + target: '0' third_party_settings: { } weight: 1 region: content diff --git a/web/profiles/custom/yalesites_profile/config/sync/core.entity_view_display.paragraph.callout_item.default.yml b/web/profiles/custom/yalesites_profile/config/sync/core.entity_view_display.paragraph.callout_item.default.yml index 7482a4e139..95e122abfd 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/core.entity_view_display.paragraph.callout_item.default.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/core.entity_view_display.paragraph.callout_item.default.yml @@ -26,7 +26,7 @@ content: type: link_separate label: hidden settings: - trim_length: 80 + trim_length: null url_only: false url_plain: false rel: '0' diff --git a/web/profiles/custom/yalesites_profile/config/sync/core.entity_view_display.paragraph.custom_card.default.yml b/web/profiles/custom/yalesites_profile/config/sync/core.entity_view_display.paragraph.custom_card.default.yml index 8c0a1781eb..ae77d3bead 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/core.entity_view_display.paragraph.custom_card.default.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/core.entity_view_display.paragraph.custom_card.default.yml @@ -36,11 +36,11 @@ content: type: link_separate label: hidden settings: - trim_length: 80 + trim_length: null url_only: false url_plain: false - rel: '' - target: '' + rel: '0' + target: '0' third_party_settings: { } weight: 3 region: content diff --git a/web/profiles/custom/yalesites_profile/config/sync/core.extension.yml b/web/profiles/custom/yalesites_profile/config/sync/core.extension.yml index 957d05ca75..1a1e63656c 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/core.extension.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/core.extension.yml @@ -8,6 +8,7 @@ module: better_exposed_filters: 0 block: 0 block_content: 0 + block_content_permissions: 0 breakpoint: 0 bugherd: 0 calendar_link: 0 diff --git a/web/profiles/custom/yalesites_profile/config/sync/field.field.media.background_video.field_media_video_file.yml b/web/profiles/custom/yalesites_profile/config/sync/field.field.media.background_video.field_media_video_file.yml index 9772bccaef..ebdb7bc0a2 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/field.field.media.background_video.field_media_video_file.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/field.field.media.background_video.field_media_video_file.yml @@ -22,6 +22,6 @@ settings: handler_settings: { } file_directory: '[date:custom:Y]-[date:custom:m]' file_extensions: mp4 - max_filesize: '5 MB' + max_filesize: '12 MB' description_field: false field_type: file diff --git a/web/profiles/custom/yalesites_profile/config/sync/filter.format.heading_html.yml b/web/profiles/custom/yalesites_profile/config/sync/filter.format.heading_html.yml index d29075de77..221315497e 100644 --- a/web/profiles/custom/yalesites_profile/config/sync/filter.format.heading_html.yml +++ b/web/profiles/custom/yalesites_profile/config/sync/filter.format.heading_html.yml @@ -14,7 +14,7 @@ filters: status: true weight: -10 settings: - allowed_html: ' ' + allowed_html: '

' filter_html_help: false filter_html_nofollow: false improve_line_breaks_filter: 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 6859b50315..acf5d0e657 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 @@ -19,6 +19,7 @@ dependencies: - taxonomy.vocabulary.tags module: - block + - block_content_permissions - contextual - editoria11y - file @@ -64,30 +65,74 @@ permissions: - 'configure editable event node layout overrides' - 'configure editable page node layout overrides' - 'configure editable post node layout overrides' + - 'create accordion block content' - 'create and edit custom blocks' - 'create background_video media' + - 'create button_link block content' + - 'create callout block content' + - 'create content_spotlight block content' + - 'create cta_banner block content' + - 'create custom_cards block content' + - 'create divider block content' - 'create document media' + - 'create embed block content' - 'create embed media' - 'create event content' + - 'create event_list block content' + - 'create gallery block content' + - 'create grand_hero block content' + - 'create image block content' - 'create image media' - 'create media' + - 'create media_grid block content' - 'create page content' - 'create post content' + - 'create post_list block content' + - 'create pull_quote block content' + - 'create quick_links block content' + - 'create tabs block content' - 'create terms in event_category' - 'create terms in post_category' - 'create terms in tags' + - 'create text block content' - 'create url aliases' + - 'create video block content' - 'create video media' + - 'create view block content' + - 'create webform block content' + - 'create wrapped_image block content' + - 'delete any accordion block content' - 'delete any background_video media' + - 'delete any button_link block content' + - 'delete any callout block content' + - 'delete any content_spotlight block content' + - 'delete any cta_banner block content' + - 'delete any custom_cards block content' + - 'delete any divider block content' - 'delete any document media' + - 'delete any embed block content' - 'delete any embed media' - 'delete any event content' + - 'delete any event_list block content' + - 'delete any gallery block content' + - 'delete any grand_hero block content' + - 'delete any image block content' - 'delete any image media' - 'delete any media' + - 'delete any media_grid block content' - 'delete any page content' - 'delete any post content' + - 'delete any post_list block content' + - 'delete any pull_quote block content' + - 'delete any quick_links block content' + - 'delete any tabs block content' + - 'delete any text block content' + - 'delete any video block content' - 'delete any video media' + - 'delete any view block content' + - 'delete any webform block content' - 'delete any webform submission' + - 'delete any wrapped_image block content' - 'delete media' - 'delete own background_video media' - 'delete own document media' @@ -135,7 +180,29 @@ permissions: - 'revert post revisions' - 'unpublish any content' - 'unpublish editable content' + - 'update any accordion block content' + - 'update any button_link block content' + - 'update any callout block content' + - 'update any content_spotlight block content' + - 'update any cta_banner block content' + - 'update any custom_cards block content' + - 'update any divider block content' + - 'update any embed block content' + - 'update any event_list block content' + - 'update any gallery block content' + - 'update any grand_hero block content' + - 'update any image block content' - 'update any media' + - 'update any media_grid block content' + - 'update any post_list block content' + - 'update any pull_quote block content' + - 'update any quick_links block content' + - 'update any tabs block content' + - 'update any text block content' + - 'update any video block content' + - 'update any view block content' + - 'update any webform block content' + - 'update any wrapped_image block content' - 'update media' - 'view all media revisions' - 'view all revisions' 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 fe6c602010..1efaa6d73b 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: - taxonomy.vocabulary.post_category - taxonomy.vocabulary.tags module: + - block_content_permissions - contextual - editoria11y - file @@ -61,30 +62,74 @@ permissions: - 'configure editable event node layout overrides' - 'configure editable page node layout overrides' - 'configure editable post node layout overrides' + - 'create accordion block content' - 'create and edit custom blocks' - 'create background_video media' + - 'create button_link block content' + - 'create callout block content' + - 'create content_spotlight block content' + - 'create cta_banner block content' + - 'create custom_cards block content' + - 'create divider block content' - 'create document media' + - 'create embed block content' - 'create embed media' - 'create event content' + - 'create event_list block content' + - 'create gallery block content' + - 'create grand_hero block content' + - 'create image block content' - 'create image media' - 'create media' + - 'create media_grid block content' - 'create page content' - 'create post content' + - 'create post_list block content' + - 'create pull_quote block content' + - 'create quick_links block content' + - 'create tabs block content' - 'create terms in event_category' - 'create terms in post_category' - 'create terms in tags' + - 'create text block content' - 'create url aliases' + - 'create video block content' - 'create video media' + - 'create view block content' + - 'create webform block content' + - 'create wrapped_image block content' + - 'delete any accordion block content' - 'delete any background_video media' + - 'delete any button_link block content' + - 'delete any callout block content' + - 'delete any content_spotlight block content' + - 'delete any cta_banner block content' + - 'delete any custom_cards block content' + - 'delete any divider block content' - 'delete any document media' + - 'delete any embed block content' - 'delete any embed media' - 'delete any event content' + - 'delete any event_list block content' + - 'delete any gallery block content' + - 'delete any grand_hero block content' + - 'delete any image block content' - 'delete any image media' - 'delete any media' + - 'delete any media_grid block content' - 'delete any page content' - 'delete any post content' + - 'delete any post_list block content' + - 'delete any pull_quote block content' + - 'delete any quick_links block content' + - 'delete any tabs block content' + - 'delete any text block content' + - 'delete any video block content' - 'delete any video media' + - 'delete any view block content' + - 'delete any webform block content' - 'delete any webform submission' + - 'delete any wrapped_image block content' - 'delete media' - 'delete own background_video media' - 'delete own document media' @@ -129,7 +174,29 @@ permissions: - 'revert post revisions' - 'unpublish any content' - 'unpublish editable content' + - 'update any accordion block content' + - 'update any button_link block content' + - 'update any callout block content' + - 'update any content_spotlight block content' + - 'update any cta_banner block content' + - 'update any custom_cards block content' + - 'update any divider block content' + - 'update any embed block content' + - 'update any event_list block content' + - 'update any gallery block content' + - 'update any grand_hero block content' + - 'update any image block content' - 'update any media' + - 'update any media_grid block content' + - 'update any post_list block content' + - 'update any pull_quote block content' + - 'update any quick_links block content' + - 'update any tabs block content' + - 'update any text block content' + - 'update any video block content' + - 'update any view block content' + - 'update any webform block content' + - 'update any wrapped_image block content' - 'update media' - 'view all media revisions' - 'view all revisions' diff --git a/web/profiles/custom/yalesites_profile/modules/custom/ys_core/src/Form/SiteSettingsForm.php b/web/profiles/custom/yalesites_profile/modules/custom/ys_core/src/Form/SiteSettingsForm.php index 00a01d21b8..a90a07f380 100644 --- a/web/profiles/custom/yalesites_profile/modules/custom/ys_core/src/Form/SiteSettingsForm.php +++ b/web/profiles/custom/yalesites_profile/modules/custom/ys_core/src/Form/SiteSettingsForm.php @@ -111,11 +111,15 @@ public function buildForm(array $form, FormStateInterface $form_state) { ]; $form['site_page_front'] = [ - '#type' => 'textfield', - '#description' => $this->t("Specify a relative URL to display as the front page."), + '#type' => 'linkit', '#title' => $this->t('Front page'), + '#description' => $this->t("Specify a relative URL to display as the front page. Typically this points to a page in Drupal and is referenced by a node id. Use this autocomplete field to select the correct node."), + '#autocomplete_route_name' => 'linkit.autocomplete', '#default_value' => $siteConfig->get('page')['front'], '#required' => TRUE, + '#autocomplete_route_parameters' => [ + 'linkit_profile_id' => 'default', + ], ]; $form['site_page_posts'] = [ diff --git a/web/profiles/custom/yalesites_profile/modules/custom/ys_toolbar/src/ToolbarItemsService.php b/web/profiles/custom/yalesites_profile/modules/custom/ys_toolbar/src/ToolbarItemsService.php index d600159787..df7240cb99 100644 --- a/web/profiles/custom/yalesites_profile/modules/custom/ys_toolbar/src/ToolbarItemsService.php +++ b/web/profiles/custom/yalesites_profile/modules/custom/ys_toolbar/src/ToolbarItemsService.php @@ -118,7 +118,7 @@ public function addItems(): array { if ($this->showEditButton()) { $this->toolbarItems['toolbar_edit_link'] = $this->buildButton( 'entity.node.edit_form', - 'Setup' + 'Manage Settings' ); } @@ -126,7 +126,7 @@ public function addItems(): array { // ensure this link only appears on entities with layout overrides enabled. $this->toolbarItems['toolbar_layout_link'] = $this->buildButton( 'layout_builder.overrides.node.view', - 'Layout Builder' + 'Edit Layout And Content' ); // Add a publish button to the toolbar when viewing an unpublished node. @@ -137,6 +137,14 @@ public function addItems(): array { ); } + // Add an unpublish button to the toolbar when viewing a published node. + if ($this->showUnpublishButton()) { + $this->toolbarItems['toolbar_unpublish_link'] = $this->buildButton( + 'entity.node.publish', + 'Unpublish' + ); + } + $this->toolbarItems['toolbar_theme_settings_link'] = $this->buildOffCanvasButton( 'ys_themes.theme_settings', 'Theme Settings' @@ -187,16 +195,27 @@ protected function showEditButton(): bool { } /** - * Chech if the dedicated 'publish' button should appear on the current route. + * Chech if a dedicated 'publish' button should appear on the current route. * * @return bool - * True if the publish button should appear on the toolbar. + * True if the button should appear on the toolbar. */ protected function showPublishButton(): bool { - // Show the edit button on all node routes except the edit form. + // Show the button if viewing an unpublished node. return !$this->currentNode->isPublished() && $this->isViewRoute(); } + /** + * Chech if a dedicated 'unpublish' button should appear on the current route. + * + * @return bool + * True if the button should appear on the toolbar. + */ + protected function showUnpublishButton(): bool { + // Show the button if viewing a published node. + return $this->currentNode->isPublished() && $this->isViewRoute(); + } + /** * Get node parameters for creating a route. * diff --git a/web/profiles/custom/yalesites_profile/modules/custom/ys_toolbar/ys_toolbar.module b/web/profiles/custom/yalesites_profile/modules/custom/ys_toolbar/ys_toolbar.module index 3116794579..19441ae798 100644 --- a/web/profiles/custom/yalesites_profile/modules/custom/ys_toolbar/ys_toolbar.module +++ b/web/profiles/custom/yalesites_profile/modules/custom/ys_toolbar/ys_toolbar.module @@ -14,7 +14,7 @@ function ys_toolbar_toolbar_alter(&$items) { // all nodes. Change to "Manage this Page" to make it easier to understand. if (\Drupal::service('ys_toolbar.items')->isCurrentRouteNode()) { if (!empty($items['admin_toolbar_local_tasks']['tab']['#title'])) { - $items['admin_toolbar_local_tasks']['tab']['#title'] = 'Toolset'; + $items['admin_toolbar_local_tasks']['tab']['#title'] = 'More Actions'; } }