Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
"drupal/pantheon_advanced_page_cache": "^2.2",
"drupal/paragraphs": "^1.17",
"drupal/paragraphs_edit": "^3.0",
"drupal/paragraphs_ee": "^10.0",
"drupal/password_policy": "^4.0",
"drupal/pathauto": "^1.12",
"drupal/permissions_filter": "^1.3",
Expand Down
121 changes: 120 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 27 additions & 5 deletions config/sync/core.entity_form_display.node.landing_page.default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@ dependencies:
- field.field.node.landing_page.field_is_title_hidden
- field.field.node.landing_page.field_paragraphs
- node.type.landing_page
- workflows.workflow.default
module:
- content_moderation
- paragraphs
- paragraphs_ee
- paragraphs_features
- path
id: node.landing_page.default
targetEntityType: node
Expand Down Expand Up @@ -35,24 +39,42 @@ content:
title: Paragraph
title_plural: Paragraphs
edit_mode: closed
closed_mode: summary
closed_mode: preview
autocollapse: none
closed_mode_threshold: 0
add_mode: dropdown
closed_mode_threshold: 3
add_mode: modal
form_display_mode: default
default_paragraph_type: _none
features:
add_above: '0'
add_above: add_above
collapse_edit_all: collapse_edit_all
convert: '0'
duplicate: duplicate
third_party_settings: { }
third_party_settings:
paragraphs_ee:
paragraphs_ee:
dialog_off_canvas: false
dialog_style: tiles
drag_drop: true
paragraphs_features:
add_in_between: false
add_in_between_link_count: 3
delete_confirmation: true
show_drag_and_drop: true
show_collapse_all: true
langcode:
type: language_select
weight: 2
region: content
settings:
include_locked: false
third_party_settings: { }
moderation_state:
type: moderation_state_default
weight: 100
region: content
settings: { }
third_party_settings: { }
path:
type: path
weight: 6
Expand Down
2 changes: 2 additions & 0 deletions config/sync/core.extension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ module:
page_cache: 0
pantheon_advanced_page_cache: 0
paragraphs_edit: 0
paragraphs_features: 0
password_policy_blacklist: 0
password_policy_character_types: 0
password_policy_length: 0
Expand Down Expand Up @@ -102,6 +103,7 @@ module:
server_general: 10
views: 10
paragraphs: 11
paragraphs_ee: 15
server: 1000
theme:
stable: 0
Expand Down
3 changes: 3 additions & 0 deletions config/sync/paragraphs_features.settings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
_core:
default_config_hash: lQErqdedK_5v01xVINKpMQnPQNpp4vS6oMsdNYbPfTI
dropdown_to_button: false
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,46 @@ public function testHomeFeaturedContent() {
$web_assert->elementTextContains('css', '.paragraph--type--related-content .carousel-slide.slick-current', 'Pandemic Moves Education Online');
}

/**
* Test the permissions and available paragraphs.
*/
public function testAddParagraph() {
$assert = $this->assertSession();
// Login as a content editor.
$user = $this->createUser();
$user->addRole('administrator');
$user->save();
$this->drupalLogin($user);
$this->drupalGet("/node/add/landing_page");

/** @var \Drupal\FunctionalJavascriptTests\JSWebAssert $web_assert */
$web_assert = $this->assertSession();

$add_pagraph_button = $assert->elementExists('css', '.paragraph-type-add-modal-button');
$this->assertNotNull($add_pagraph_button);
$add_pagraph_button->click();

$paragraph_types = [
'Accordion',
'Call to action',
'Documents',
'Form',
'Hero image',
'Info cards',
'News teasers',
'People teasers',
'Quick links',
'Quote',
'Related content',
'Search',
'Text',
];
// Wait half sec for the JS and animation.
$paragraphs = $web_assert->waitForElement('css', '.paragraphs-ee-add-dialog');
$paragraphs_items = $paragraphs->findAll('css', '.paragraphs-label');
foreach ($paragraphs_items as $label) {
$this->assertContains($label->getText(), $paragraph_types);
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -33,35 +33,6 @@ public function getOptionalFields(): array {
];
}

/**
* Test the permissions and available paragraphs.
*
* @throws \Behat\Mink\Exception\ElementNotFoundException
* @throws \Drupal\Core\Entity\EntityStorageException
*/
public function testGeneral() {
$paragraph_types = [
'Hero image',
'Related content',
'Search',
'Text',
'News teasers',
];

$assert = $this->assertSession();
// Login as a content editor.
$user = $this->createUser();
$user->addRole('administrator');
$user->save();
$this->drupalLogin($user);
$this->drupalGet("/node/add/landing_page");
// Paragraph wrapper exists.
$assert->elementExists('css', '.field--name-field-paragraphs');
foreach ($paragraph_types as $type) {
$assert->buttonExists("Add {$type}");
}
}

/**
* Test locked Homepage can't be deleted.
*/
Expand Down