Skip to content

Commit

Permalink
Merge pull request #1852 from acquia/ACMS-4081-1
Browse files Browse the repository at this point in the history
ACMS-4081: Fixing schema for editors as per CKeditor5.
  • Loading branch information
vishalkhode1 authored Jul 17, 2024
2 parents f989bea + 4c65ec1 commit 8a3d3b1
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 22 deletions.
29 changes: 29 additions & 0 deletions modules/acquia_cms_common/acquia_cms_common.install
Original file line number Diff line number Diff line change
Expand Up @@ -319,3 +319,32 @@ function acquia_cms_common_update_9331() {
\Drupal::state()->delete('acquia_connector.telemetry.opted');
}
}

/**
* Implements hook_update_N().
*
* Update editor format filter.
*/
function acquia_cms_common_update_9332() {
$configs = [
'editor.editor.filtered_html',
'editor.editor.full_html',
];

$config_data = [
'settings.plugins.ckeditor5_list' => [
'properties' => [
'reversed' => FALSE,
'startIndex' => TRUE,
],
],
'image_upload' => [
'status' => FALSE,
],
];

// Iterate the configurations to update the key.
foreach ($configs as $config) {
_acquia_cms_common_update_page_configurations($config, $config_data);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@ settings:
- '<h5 id>'
- '<h6 id>'
ckeditor5_list:
reversed: false
startIndex: true
properties:
reversed: false
startIndex: true
ckeditor5_alignment:
enabled_alignments:
- left
Expand All @@ -66,9 +67,3 @@ settings:
allow_view_mode_override: false
image_upload:
status: false
scheme: public
directory: inline-images
max_size: ''
max_dimensions:
width: null
height: null
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ settings:
- '<h5 id>'
- '<h6 id>'
ckeditor5_list:
reversed: false
startIndex: true
properties:
reversed: false
startIndex: true
ckeditor5_alignment:
enabled_alignments:
- left
Expand All @@ -70,9 +71,3 @@ settings:
allow_view_mode_override: false
image_upload:
status: false
scheme: public
directory: inline-images
max_size: ''
max_dimensions:
width: null
height: null
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,6 @@ public function testAcquiaConfigSyncOverriddenPage() {
$assert_session->pageTextContains('Operations');

// Assert overridden configurations exists.
$assert_session->pageTextContains('editor.editor.filtered_html');
$assert_session->pageTextContains('editor.editor.full_html');
$assert_session->pageTextContains('taxonomy.vocabulary.tags');

// Assert that unchanged configuration does not appear on overridden tab.
Expand All @@ -138,8 +136,6 @@ public function testAcquiaConfigSyncOverriddenPage() {
$assert_session->pageTextContains('user.role.administrator');

// Assert that overridden configuration does not appear on unchanged tab.
$assert_session->pageTextNotContains('editor.editor.filtered_html');
$assert_session->pageTextNotContains('editor.editor.full_html');
$assert_session->pageTextNotContains('taxonomy.vocabulary.tags');
}

Expand Down
18 changes: 18 additions & 0 deletions modules/acquia_cms_site_studio/acquia_cms_site_studio.install
Original file line number Diff line number Diff line change
Expand Up @@ -449,3 +449,21 @@ function acquia_cms_site_studio_update_9000() {
// Set default node revision delete settings shipped by Acquia CMS.
$config_handler->processConfigSettings($default_settings);
}

/**
* Implements hook_update_N().
*
* Update site-studio editor format filter.
*/
function acquia_cms_site_studio_update_9001() {
$config_data = [
'settings.plugins.ckeditor5_list' => [
'properties' => [
'reversed' => TRUE,
'startIndex' => TRUE,
],
],
];

_acquia_cms_common_update_page_configurations('editor.editor.cohesion', $config_data);
}
Original file line number Diff line number Diff line change
Expand Up @@ -344,8 +344,9 @@ settings:
ckeditor5_sourceEditing:
allowed_tags: { }
ckeditor5_list:
reversed: true
startIndex: true
properties:
reversed: true
startIndex: true
ckeditor5_alignment:
enabled_alignments:
- left
Expand Down

0 comments on commit 8a3d3b1

Please sign in to comment.