diff --git a/composer.json b/composer.json index 374389c5c..d71382b80 100644 --- a/composer.json +++ b/composer.json @@ -14,10 +14,10 @@ "drupal/clamav": "2.0.2-rc1", "drupal/config_ignore": "^2.4", "drupal/config_perms": "2.x-dev@dev", - "drupal/config_split": "^1.9", + "drupal/config_split": "^2.0", "drupal/config_update": "^2.0@alpha", - "drupal/core": "10.1.4", - "drupal/core-recommended": "10.1.4", + "drupal/core": "10.1.7", + "drupal/core-recommended": "10.1.7", "drupal/ckeditor_templates": "dev-feature/d10-compatible-with-ck5-support", "drupal/ctools": "^3.14", "drupal/diff": "^1.1", @@ -76,7 +76,7 @@ "lesstif/php-jira-rest-client": "2.6.0", "drupal/jira_rest": "^4.0@beta", "drupal/ckeditor5_embedded_content": "1.0.1", - "respect/validation": "dev-master", + "respect/validation": "2.3.1", "giggsey/libphonenumber-for-php": "^8.13", "drupal/site_alert": "^1.3", "lcobucci/clock": "3.0.0" @@ -252,7 +252,8 @@ "Dropbutton RHS highlight covers adjacent text - https://www.drupal.org/project/paragraphs/issues/3350747#comment-14986371": "https://www.drupal.org/files/issues/2023-03-28/paragraph-dropdown-button-obscure-text-2.patch" }, "drupal/content_lock": { - "Altering timeout message - https://www.drupal.org/project/content_lock/issues/3214877#comment-14108752": "https://www.drupal.org/files/issues/2021-05-20/content_lock_3214877_3.patch" + "Altering timeout message - https://www.drupal.org/project/content_lock/issues/3214877#comment-14108752": "https://www.drupal.org/files/issues/2021-05-20/content_lock_3214877_3.patch", + "Fix PHP 8.2+ deprecation notices - https://www.drupal.org/project/content_lock/issues/3343964#comment-15061454": "https://www.drupal.org/files/issues/2023-05-22/3343964-5.patch" }, "lesstif/php-jira-rest-client": { "Supports email lookup": "https://patch-diff.githubusercontent.com/raw/dpc-sdp/php-jira-rest-client/pull/1.diff" diff --git a/config/install/core.entity_form_display.paragraph.accordion.default.yml b/config/install/core.entity_form_display.paragraph.accordion.default.yml index cf5b07694..00740543a 100644 --- a/config/install/core.entity_form_display.paragraph.accordion.default.yml +++ b/config/install/core.entity_form_display.paragraph.accordion.default.yml @@ -4,11 +4,12 @@ dependencies: config: - field.field.paragraph.accordion.field_paragraph_accordion - field.field.paragraph.accordion.field_paragraph_accordion_style + - field.field.paragraph.accordion.field_paragraph_body - field.field.paragraph.accordion.field_paragraph_title - paragraphs.paragraphs_type.accordion module: - - content_moderation - paragraphs + - text id: paragraph.accordion.default targetEntityType: paragraph bundle: accordion @@ -17,36 +18,49 @@ content: field_paragraph_accordion: type: paragraphs weight: 3 + region: content settings: title: 'Accordion items' title_plural: 'Accordion content' edit_mode: closed closed_mode: preview autocollapse: all + closed_mode_threshold: 0 add_mode: button form_display_mode: default default_paragraph_type: accordion_content + default_paragraph_count: 1 + features: + collapse_edit_all: collapse_edit_all + duplicate: duplicate third_party_settings: { } - region: content field_paragraph_accordion_style: + type: options_buttons weight: 2 + region: content settings: { } third_party_settings: { } - type: options_buttons - region: content - field_paragraph_title: + field_paragraph_body: + type: text_textarea weight: 1 + region: content settings: - size: 60 + rows: 5 placeholder: '' third_party_settings: { } + field_paragraph_title: type: string_textfield + weight: 0 region: content + settings: + size: 60 + placeholder: '' + third_party_settings: { } moderation_state: type: moderation_state_default weight: 0 - settings: { } region: content + settings: { } third_party_settings: { } hidden: created: true diff --git a/config/install/core.entity_view_display.paragraph.accordion.default.yml b/config/install/core.entity_view_display.paragraph.accordion.default.yml index 1431a294b..4613cfe08 100644 --- a/config/install/core.entity_view_display.paragraph.accordion.default.yml +++ b/config/install/core.entity_view_display.paragraph.accordion.default.yml @@ -4,10 +4,12 @@ dependencies: config: - field.field.paragraph.accordion.field_paragraph_accordion - field.field.paragraph.accordion.field_paragraph_accordion_style + - field.field.paragraph.accordion.field_paragraph_body - field.field.paragraph.accordion.field_paragraph_title - paragraphs.paragraphs_type.accordion module: - entity_reference_revisions + - text id: paragraph.accordion.default targetEntityType: paragraph bundle: accordion @@ -15,20 +17,27 @@ mode: default content: field_paragraph_accordion: type: entity_reference_revisions_entity_view - weight: 1 label: hidden settings: view_mode: default link: '' third_party_settings: { } + weight: 1 + region: content + field_paragraph_body: + type: text_default + label: above + settings: { } + third_party_settings: { } + weight: 2 region: content field_paragraph_title: - weight: 0 + type: string label: hidden settings: link_to_entity: false third_party_settings: { } - type: string + weight: 0 region: content hidden: field_paragraph_accordion_style: true diff --git a/config/install/core.entity_view_display.paragraph.accordion.preview.yml b/config/install/core.entity_view_display.paragraph.accordion.preview.yml index ede1c4007..84e9bdee0 100644 --- a/config/install/core.entity_view_display.paragraph.accordion.preview.yml +++ b/config/install/core.entity_view_display.paragraph.accordion.preview.yml @@ -5,6 +5,7 @@ dependencies: - core.entity_view_mode.paragraph.preview - field.field.paragraph.accordion.field_paragraph_accordion - field.field.paragraph.accordion.field_paragraph_accordion_style + - field.field.paragraph.accordion.field_paragraph_body - field.field.paragraph.accordion.field_paragraph_title - paragraphs.paragraphs_type.accordion module: @@ -17,24 +18,25 @@ mode: preview content: field_paragraph_accordion: type: paragraph_summary - weight: 2 label: inline settings: { } third_party_settings: { } + weight: 2 region: content field_paragraph_accordion_style: type: list_default - weight: 1 - region: content label: inline settings: { } third_party_settings: { } + weight: 1 + region: content field_paragraph_title: type: string - weight: 0 - region: content label: hidden settings: link_to_entity: false third_party_settings: { } -hidden: { } + weight: 0 + region: content +hidden: + field_paragraph_body: true diff --git a/config/install/field.field.paragraph.accordion.field_paragraph_body.yml b/config/install/field.field.paragraph.accordion.field_paragraph_body.yml new file mode 100644 index 000000000..e6d72fc6f --- /dev/null +++ b/config/install/field.field.paragraph.accordion.field_paragraph_body.yml @@ -0,0 +1,25 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.paragraph.field_paragraph_body + - paragraphs.paragraphs_type.accordion + module: + - allowed_formats + - text +third_party_settings: + allowed_formats: + allowed_formats: { } +id: paragraph.accordion.field_paragraph_body +field_name: field_paragraph_body +entity_type: paragraph +bundle: accordion +label: 'Accordion description' +description: 'Add accordion description to display below accordion title.' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + allowed_formats: { } +field_type: text_long diff --git a/tests/behat/features/access.feature b/tests/behat/features/access.feature index d5a2e9766..0f91767e1 100644 --- a/tests/behat/features/access.feature +++ b/tests/behat/features/access.feature @@ -69,3 +69,9 @@ Feature: Access permissions Given I am logged in as a user with the "Site Auditor" role When I go to "/admin/reports/audit-trail" Then I should get a 200 HTTP response + + @api + Scenario: Approver role should not have access to redirects. + Given I am logged in as a user with the "approver" role + When I go to "admin/structure/taxonomy/add" + Then I should get a 404 HTTP response diff --git a/tide_core.install b/tide_core.install index b7a72bcc1..02e9e4fb4 100644 --- a/tide_core.install +++ b/tide_core.install @@ -92,3 +92,53 @@ function tide_core_update_10002() { $approver->grantPermission('tide node bulk update'); $approver->save(); } + +/** + * Add description field to accordion. + */ +function tide_core_update_10003() { + module_load_include('inc', 'tide_core', 'includes/helpers'); + $configs = [ + 'field.field.paragraph.accordion.field_paragraph_body' => 'field_config', + ]; + $config_location = [\Drupal::service('extension.list.module')->getPath('tide_core') . '/config/install']; + // Check if field already exported to config/sync. + foreach ($configs as $config => $type) { + $config_read = _tide_read_config($config, $config_location, TRUE); + $storage = \Drupal::entityTypeManager()->getStorage($type); + $id = substr($config, strrpos($config, '.') + 1); + if ($storage->load($id) == NULL) { + $config_entity = $storage->createFromStorageRecord($config_read); + $config_entity->save(); + } + } + + $form_configs = [ + 'core.entity_form_display.paragraph.accordion.default', + 'core.entity_view_display.paragraph.accordion.default', + 'core.entity_view_display.paragraph.accordion.preview', + ]; + foreach ($form_configs as $form_config) { + $config = \Drupal::configFactory()->getEditable($form_config); + $config_read = _tide_read_config($form_config, $config_location, FALSE); + $config->set('dependencies', $config_read['dependencies']); + $config->set('content', $config_read['content']); + $config->set('hidden', $config_read['hidden']); + $config->save(); + } +} + +/** + * Approver should not have access to administer taxonomy. + */ +function tide_core_update_10004() { + $role = 'approver'; + $permissions = [ + 'administer taxonomy', + 'edit terms in topic', + 'delete terms in topic', + ]; + if ($role) { + user_role_revoke_permissions($role, $permissions); + } +}