Skip to content

Commit

Permalink
Merge branch 'release/3.1.2'
Browse files Browse the repository at this point in the history
Release/3.1.2
  • Loading branch information
MdNadimHossain committed Feb 21, 2022
2 parents ccaca63 + 1aa32e6 commit 740a968
Show file tree
Hide file tree
Showing 6 changed files with 289 additions and 127 deletions.
8 changes: 3 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"drupal/admin_audit_trail": "^1.0",
"drupal/block_inactive_users": "^2.0",
"lesstif/php-jira-rest-client": "2.6.0",
"drupal/jira_rest": "4.x-dev@dev"
"drupal/jira_rest": "^4.0@beta"
},
"repositories": {
"drupal": {
Expand Down Expand Up @@ -217,7 +217,8 @@
"Make the DateTime input format and descriptive text consistent - https://www.drupal.org/project/drupal/issues/2791693#comment-13024583": "https://www.drupal.org/files/issues/2019-03-16/2791693-38.patch",
"Poor performance when using moderation state views filter - https://www.drupal.org/project/drupal/issues/3097303#comment-13559283": "https://www.drupal.org/files/issues/2020-04-17/3097303-9.patch",
"Refactor Xss::attributes() to allow filtering of style attribute values - https://www.drupal.org/project/drupal/issues/3109650#comment-14098404": "https://www.drupal.org/files/issues/2021-05-10/refactor_xss_attributes-3109650-33.patch",
"Empty breadcrumb at node/add and node/add/{content_type} when frontpage view is enabled - https://www.drupal.org/project/drupal/issues/3220437": "https://www.drupal.org/files/issues/2021-08-25/3220437-61.patch"
"Empty breadcrumb at node/add and node/add/{content_type} when frontpage view is enabled - https://www.drupal.org/project/drupal/issues/3220437": "https://www.drupal.org/files/issues/2021-08-25/3220437-61.patch",
"Sort menu list by menu title - https://www.drupal.org/project/drupal/issues/3070721#comment-13918119": "https://www.drupal.org/files/issues/2020-11-26/sort_menu_list-3070721-9.patch"
},
"drupal/entity_embed": {
"More defensive handling of data-entity-embed-display-settings - https://www.drupal.org/project/entity_embed/issues/3010942": "https://www.drupal.org/files/issues/2019-12-11/3077225-10.reduce-invalid-config-logs.patch"
Expand Down Expand Up @@ -252,9 +253,6 @@
"drupal/jquery_ui_touch_punch": {
"jQuery UI Touch Punch library - https://www.drupal.org/project/jquery_ui_touch_punch/issues/3159222#comment-14011939": "https://www.drupal.org/files/issues/2021-02-26/jquery_ui_touch_punch.patch"
},
"drupal/jira_rest": {
"Add a function to return the UserService object - https://www.drupal.org/project/jira_rest/issues/3252182": "https://www.drupal.org/files/issues/2021-12-02/jira_rest_userservice.patch"
},
"lesstif/php-jira-rest-client": {
"Supports email lookup" : "https://patch-diff.githubusercontent.com/raw/dpc-sdp/php-jira-rest-client/pull/1.diff"
}
Expand Down
4 changes: 4 additions & 0 deletions css/content_moderation.theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@
background: #fff;
padding-left: 1em;
}

.entity-moderation-form__item {
width: 50%
}
59 changes: 59 additions & 0 deletions js/node_revision_log.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/**
* @file
* Add custom function to node revision log message in node edit form and content moderation.
*/

(function ($, Drupal) {

'use strict';

/**
* Add revision log message required fields.
*
* @type {Drupal~behavior}
*
* @prop {Drupal~behaviorAttach} attach
* Attaches nodeRevisionLog behaviors.
*/
Drupal.behaviors.nodeRevisionLog = {
attach: function (context, settings) {
// Show red star after the lable if field is require.
var requiredLog = ['Needs Review', 'Archive pending'];

if (requiredLog.includes($('#edit-new-state option:selected').text())) {
$('.form-item-revision-log label').addClass('form-required');
}
$('select#edit-new-state').change(function(){
if (requiredLog.includes($('#edit-new-state option:selected').text())) {
$('.form-item-revision-log label').addClass('form-required');
}
else {
$('.form-item-revision-log label').removeClass('form-required');
}
});

if (requiredLog.includes($('#edit-moderation-state-0-state option:selected').text())) {
$('.form-item-comment-log-message label').addClass('form-required');
}
$('select#edit-moderation-state-0-state').change(function(){
if (requiredLog.includes($('#edit-moderation-state-0-state option:selected').text())) {
$('.form-item-comment-log-message label').addClass('form-required');
}
else {
$('.form-item-comment-log-message label').removeClass('form-required');
}
});

// Copy comment log message to revision log.
$('.form-item-comment-log-message textarea').blur(function(e){
$('.field--name-revision-log textarea').val(e.target.value);
});

$('.field--name-revision-log textarea').blur(function(e){
$('.form-item-comment-log-message textarea').val(e.target.value);
});

}
};

})(jQuery, Drupal);
185 changes: 74 additions & 111 deletions tests/behat/features/wysiwyg.toolbar.feature
Original file line number Diff line number Diff line change
@@ -1,123 +1,86 @@
@tide @skipped
@tide
Feature: WYSIWYG toolbar configuration

As an Approver or Editor, I want to to have access to all configured WYSIWYG buttons.

Background:
Given I define components:
| Toolbar | #cke_edit-body-0-value .cke_top |
| Bold | #cke_edit-body-0-value .cke_top .cke_button__bold |
| Italic | #cke_edit-body-0-value .cke_top .cke_button__italic |
| Strikethrough | #cke_edit-body-0-value .cke_top .cke_button__strike |
| Styles | #cke_edit-body-0-value .cke_top .cke_combo__styles |
| Superscript | #cke_edit-body-0-value .cke_top .cke_button__superscript |
| Subscript | #cke_edit-body-0-value .cke_top .cke_button__subscript |
| Remove format | #cke_edit-body-0-value .cke_top .cke_button__removeformat |
| Copy | #cke_edit-body-0-value .cke_top .cke_button__copy |
| Cut | #cke_edit-body-0-value .cke_top .cke_button__cut |
| Paste | #cke_edit-body-0-value .cke_top .cke_button__paste |
| Paste text | #cke_edit-body-0-value .cke_top .cke_button__pastetext |
| Link | #cke_edit-body-0-value .cke_top .cke_button__drupallink |
| Unlink | #cke_edit-body-0-value .cke_top .cke_button__drupalunlink |
| Bulleted list | #cke_edit-body-0-value .cke_top .cke_button__bulletedlist_icon |
| Numbered list | #cke_edit-body-0-value .cke_top .cke_button__numberedlist_icon |
| Blockquote | #cke_edit-body-0-value .cke_top .cke_button__blockquote |
| Table | #cke_edit-body-0-value .cke_top .cke_button__blockquote |
| Horizontal rule | #cke_edit-body-0-value .cke_top .cke_button__horizontalrule |
| Media browser | #cke_edit-body-0-value .cke_top .cke_button__media_browser |
| Justify left | #cke_edit-body-0-value .cke_top .cke_button__justifyleft |
| Justify center | #cke_edit-body-0-value .cke_top .cke_button__justifycenter |
| Justify right | #cke_edit-body-0-value .cke_top .cke_button__justifyright |
| Justify block | #cke_edit-body-0-value .cke_top .cke_button__justifyblock |
| Outdent | #cke_edit-body-0-value .cke_top .cke_button__outdent |
| Indent | #cke_edit-body-0-value .cke_top .cke_button__indent |
| Format | #cke_edit-body-0-value .cke_top .cke_combo__format |
| Undo | #cke_edit-body-0-value .cke_top .cke_button__undo |
| Redo | #cke_edit-body-0-value .cke_top .cke_button__redo |
| Show blocks | #cke_edit-body-0-value .cke_top .cke_button__showblocks |
| Source | #cke_edit-body-0-value .cke_top .cke_button__source |
| Templates | #cke_edit-body-0-value .cke_top .cke_button__templateselector |
| Google Map | #cke_edit-body-0-value .cke_top .cke_button__wenzgmap |
| Iframe | #cke_edit-body-0-value .cke_top .cke_button__iframe |
| Embed Image Gallery | #cke_edit-body-0-value .cke_top .cke_button__embed_image_gallery |

@api @javascript
Scenario: Plain Text format has no WYSIWYG buttons
Given I am logged in as a user with the "create test content" permissions
When I go to "node/add/test"
Then I don't see Toolbar

@api @javascript
@api @javascript @trait:VisibilityTrait
Scenario: Rich Text format has expected WYSIWYG buttons
Given I am logged in as a user with the "create test content, use text format rich_text" permissions
When I go to "node/add/test"
Then I see visible Toolbar
And I see Bold inside of Toolbar
And I see Italic inside of Toolbar
And I see Strikethrough inside of Toolbar
And I see Styles inside of Toolbar
And I see Superscript inside of Toolbar
And I see Subscript inside of Toolbar
And I see Remove format inside of Toolbar
And I see Copy inside of Toolbar
And I see Cut inside of Toolbar
And I see Paste inside of Toolbar
And I see Paste text inside of Toolbar
And I see Link inside of Toolbar
And I see Unlink inside of Toolbar
And I see Bulleted list inside of Toolbar
And I see Numbered list inside of Toolbar
And I see Blockquote inside of Toolbar
And I see Table inside of Toolbar
And I see Horizontal rule inside of Toolbar
And I see Justify left inside of Toolbar
And I see Justify center inside of Toolbar
And I see Justify right inside of Toolbar
And I see Justify block inside of Toolbar
And I see Outdent inside of Toolbar
And I see Indent inside of Toolbar
And I see Format inside of Toolbar
And I see Undo inside of Toolbar
And I see Redo inside of Toolbar
And I see Show blocks inside of Toolbar
And I see Source inside of Toolbar
And I see Templates inside of Toolbar
And I should not see a "#cke_edit-body-0-value .cke_top .cke_button__wenzgmap" element
Then I save screenshot
Then I should see a visible "#cke_edit-body-0-value" element
And I should see a visible "#cke_edit-body-0-value .cke_top .cke_button__bold" element
And I should see a visible "#cke_edit-body-0-value .cke_top .cke_button__italic" element
And I should see a visible "#cke_edit-body-0-value .cke_top .cke_button__strike" element
And I should see a visible "#cke_edit-body-0-value .cke_top .cke_combo__styles" element
And I should see a visible "#cke_edit-body-0-value .cke_top .cke_button__superscript" element
And I should see a visible "#cke_edit-body-0-value .cke_top .cke_button__subscript" element
And I should see a visible "#cke_edit-body-0-value .cke_top .cke_button__removeformat" element
And I should see a visible "#cke_edit-body-0-value .cke_top .cke_button__copy " element
And I should see a visible "#cke_edit-body-0-value .cke_top .cke_button__cut" element
And I should see a visible "#cke_edit-body-0-value .cke_top .cke_button__paste" element
And I should see a visible "#cke_edit-body-0-value .cke_top .cke_button__pastetext" element
And I should see a visible "#cke_edit-body-0-value .cke_top .cke_button__drupallink" element
And I should see a visible "#cke_edit-body-0-value .cke_top .cke_button__drupalunlink" element
And I should see a visible "#cke_edit-body-0-value .cke_top .cke_button__bulletedlist_icon" element
And I should see a visible "#cke_edit-body-0-value .cke_top .cke_button__numberedlist_icon" element
And I should see a visible "#cke_edit-body-0-value .cke_top .cke_button__blockquote" element
And I should see a visible "#cke_edit-body-0-value .cke_top .cke_button__horizontalrule" element
And I should see a visible "#cke_edit-body-0-value .cke_top .cke_button__justifyleft" element
And I should see a visible "#cke_edit-body-0-value .cke_top .cke_button__justifycenter" element
And I should see a visible "#cke_edit-body-0-value .cke_top .cke_button__justifyright" element
And I should see a visible "#cke_edit-body-0-value .cke_top .cke_button__justifyblock" element
And I should see a visible "#cke_edit-body-0-value .cke_top .cke_button__outdent" element
And I should see a visible "#cke_edit-body-0-value .cke_top .cke_button__indent" element
And I should see a visible "#cke_edit-body-0-value .cke_top .cke_combo__format" element
And I should see a visible "#cke_edit-body-0-value .cke_top .cke_button__undo" element
And I should see a visible "#cke_edit-body-0-value .cke_top .cke_button__redo" element
And I should see a visible "#cke_edit-body-0-value .cke_top .cke_button__showblocks" element
And I should see a visible "#cke_edit-body-0-value .cke_top .cke_button__source" element
And I should see a visible "#cke_edit-body-0-value .cke_top .cke_button__templateselector" element
And I should not see a visible "#cke_edit-body-0-value .cke_top .cke_button__wenzgmap" element

@api @javascript
Scenario: Admin Text format has expected WYSIWYG buttons
Given I am logged in as a user with the "create test content, use text format admin_text" permissions
When I go to "node/add/test"
Then I see visible Toolbar
And I see Bold inside of Toolbar
And I see Italic inside of Toolbar
And I see Strikethrough inside of Toolbar
And I see Styles inside of Toolbar
And I see Superscript inside of Toolbar
And I see Subscript inside of Toolbar
And I see Remove format inside of Toolbar
And I see Copy inside of Toolbar
And I see Cut inside of Toolbar
And I see Paste inside of Toolbar
And I see Paste text inside of Toolbar
And I see Link inside of Toolbar
And I see Unlink inside of Toolbar
And I see Bulleted list inside of Toolbar
And I see Numbered list inside of Toolbar
And I see Blockquote inside of Toolbar
And I see Table inside of Toolbar
And I see Horizontal rule inside of Toolbar
And I see Justify left inside of Toolbar
And I see Justify center inside of Toolbar
And I see Justify right inside of Toolbar
And I see Justify block inside of Toolbar
And I see Outdent inside of Toolbar
And I see Indent inside of Toolbar
And I see Format inside of Toolbar
And I see Undo inside of Toolbar
And I see Redo inside of Toolbar
And I see Show blocks inside of Toolbar
And I see Source inside of Toolbar
And I see Templates inside of Toolbar
And I see Google Map inside of Toolbar
And I see Iframe inside of Toolbar
Then I save screenshot
Then I should see a visible "#cke_edit-body-0-value" element
And I should see a visible "#cke_edit-body-0-value .cke_top .cke_button__bold" element
And I should see a visible "#cke_edit-body-0-value .cke_top .cke_button__italic" element
And I should see a visible "#cke_edit-body-0-value .cke_top .cke_button__strike" element
And I should see a visible "#cke_edit-body-0-value .cke_top .cke_combo__styles" element
And I should see a visible "#cke_edit-body-0-value .cke_top .cke_button__superscript" element
And I should see a visible "#cke_edit-body-0-value .cke_top .cke_button__subscript" element
And I should see a visible "#cke_edit-body-0-value .cke_top .cke_button__removeformat" element
And I should see a visible "#cke_edit-body-0-value .cke_top .cke_button__copy " element
And I should see a visible "#cke_edit-body-0-value .cke_top .cke_button__cut" element
And I should see a visible "#cke_edit-body-0-value .cke_top .cke_button__paste" element
And I should see a visible "#cke_edit-body-0-value .cke_top .cke_button__pastetext" element
And I should see a visible "#cke_edit-body-0-value .cke_top .cke_button__drupallink" element
And I should see a visible "#cke_edit-body-0-value .cke_top .cke_button__drupalunlink" element
And I should see a visible "#cke_edit-body-0-value .cke_top .cke_button__bulletedlist_icon" element
And I should see a visible "#cke_edit-body-0-value .cke_top .cke_button__numberedlist_icon" element
And I should see a visible "#cke_edit-body-0-value .cke_top .cke_button__blockquote" element
And I should see a visible "#cke_edit-body-0-value .cke_top .cke_button__horizontalrule" element
And I should see a visible "#cke_edit-body-0-value .cke_top .cke_button__justifyleft" element
And I should see a visible "#cke_edit-body-0-value .cke_top .cke_button__justifycenter" element
And I should see a visible "#cke_edit-body-0-value .cke_top .cke_button__justifyright" element
And I should see a visible "#cke_edit-body-0-value .cke_top .cke_button__justifyblock" element
And I should see a visible "#cke_edit-body-0-value .cke_top .cke_button__outdent" element
And I should see a visible "#cke_edit-body-0-value .cke_top .cke_button__indent" element
And I should see a visible "#cke_edit-body-0-value .cke_top .cke_combo__format" element
And I should see a visible "#cke_edit-body-0-value .cke_top .cke_button__undo" element
And I should see a visible "#cke_edit-body-0-value .cke_top .cke_button__redo" element
And I should see a visible "#cke_edit-body-0-value .cke_top .cke_button__showblocks" element
And I should see a visible "#cke_edit-body-0-value .cke_top .cke_button__source" element
And I should see a visible "#cke_edit-body-0-value .cke_top .cke_button__templateselector" element
And I should see a visible "#cke_edit-body-0-value .cke_top .cke_button__wenzgmap" element
And I should see a visible "#cke_edit-body-0-value .cke_top .cke_button__iframe" element

@api @javascript
Scenario: Plain Text format has no WYSIWYG buttons
Given I am logged in as a user with the "create test content" permissions
When I go to "node/add/test"
Then I save screenshot
And I should not see a visible "#cke_edit-body-0-value" element
6 changes: 6 additions & 0 deletions tide_core.libraries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,9 @@ sticky_node_form_sidebar:
css:
theme:
css/sticky_node_form_sidebar.css: {}
node_revision_log:
js:
js/node_revision_log.js: {}
dependencies:
- core/jquery
- core/drupal
Loading

0 comments on commit 740a968

Please sign in to comment.