-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Release/3.1.2
- Loading branch information
Showing
6 changed files
with
289 additions
and
127 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,7 @@ | |
background: #fff; | ||
padding-left: 1em; | ||
} | ||
|
||
.entity-moderation-form__item { | ||
width: 50% | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.