Skip to content

Commit

Permalink
Merge pull request #80 from openeuropa/OPENEUROPA-2473
Browse files Browse the repository at this point in the history
OPENEUROPA-2473: Add Social media follow paragraph to Content row paragraph
  • Loading branch information
ademarco authored Nov 27, 2019
2 parents 2186ea7 + fe3d15a commit e414706
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,32 +33,39 @@ settings:
oe_list_item_block: oe_list_item_block
oe_quote: oe_quote
oe_rich_text: oe_rich_text
oe_social_media_follow: oe_social_media_follow
target_bundles_drag_drop:
oe_rich_text:
enabled: true
weight: -22
oe_list_item_block:
enabled: true
weight: -21
oe_links_block:
enabled: true
weight: -20
oe_quote:
enabled: true
weight: -19
block_reference:
enabled: true
weight: -18
oe_social_media_follow:
enabled: true
weight: -17
oe_contextual_navigation:
enabled: true
weight: -16
oe_accordion:
enabled: true
weight: 9
weight: -15
oe_accordion_item:
weight: 10
weight: -14
enabled: false
oe_content_row:
weight: 11
weight: -13
enabled: false
oe_links_block:
enabled: true
weight: 12
oe_contextual_navigation:
enabled: true
weight: 13
oe_list_item:
weight: 13
weight: -12
enabled: false
oe_list_item_block:
enabled: true
weight: 14
oe_quote:
enabled: true
weight: 15
oe_rich_text:
enabled: true
weight: 16
field_type: entity_reference_revisions
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ entity_type: paragraph
bundle: oe_social_media_follow
label: Variant
description: ''
required: false
required: true
translatable: false
default_value:
-
Expand Down
9 changes: 9 additions & 0 deletions oe_paragraphs.post_update.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,12 @@ function oe_paragraphs_post_update_10002(array &$sandbox): void {
$entity->save();
}
}

/**
* Set Variant field required for Social media follow paragraph.
*/
function oe_paragraphs_post_update_10003(array &$sandbox): void {
$field = FieldConfig::load('paragraph.oe_social_media_follow.field_oe_social_media_variant');
$field->setRequired(TRUE);
$field->save();
}
13 changes: 7 additions & 6 deletions tests/features/content-row.feature
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@ Feature: Content row paragraph.
# Verify the fields displayed in the "default" variant.
And the following field should not be present "Navigation title"
And the "Paragraphs" field in the 1st "Content row" paragraph can reference:
| Accordion |
| Contextual navigation |
| Links block |
| Listing item block |
| Quote |
| Rich text |
| Accordion |
| Contextual navigation |
| Social media follow |
| Links block |
| Listing item block |
| Quote |
| Rich text |

When I select "Inpage navigation" from "Variant" in the 1st "Content row" paragraph
And I press "Change variant"
Expand Down
3 changes: 3 additions & 0 deletions tests/features/social-media-follow.feature
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ Feature: Social media follow paragraph.
And I fill in "Title" with "Social media follow paragraph test page"
And I press "Add Social media follow"
Then the following fields should be present "Title, URL, Link text, Link type"
And the available options in the Variant select should be:
| Horizontal |
| Vertical |
When I press "Save"
Then I should see the following error messages:
| error messages |
Expand Down

0 comments on commit e414706

Please sign in to comment.