Skip to content
This repository has been archived by the owner on Jul 27, 2022. It is now read-only.

Commit

Permalink
Merge pull request #1247 from ec-europa/ISAICP-4560
Browse files Browse the repository at this point in the history
ISAICP-4560: Strip links from tiles abstracts
  • Loading branch information
pfrenssen authored Jul 26, 2018
2 parents 6257ee6 + 816ad35 commit f08875d
Show file tree
Hide file tree
Showing 18 changed files with 83 additions and 39 deletions.
46 changes: 34 additions & 12 deletions tests/features/collection/collection_content.feature
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
@api @terms
Feature: Given I am visiting the collection homepage
I want to see the content tabs with the proper singular/plural labels.
Feature: Collection content
As a user of the website
I want to access the content of a collection
So that I can find the information I'm looking for.

Background:
Given the following collection:
Expand All @@ -11,25 +13,25 @@ Feature: Given I am visiting the collection homepage
| collection | Turin Egyptian Collection |
| state | validated |
And discussion content:
| title | state | collection |
| Bigger than Egyptian Museum of Cairo? | validated | Turin Egyptian Collection |
| title | body | state | collection |
| Bigger than Egyptian Museum of Cairo? | value: <p><a href="#link">Link to the museum</a> web<strong>site</strong>.</p> - format: content_editor | validated | Turin Egyptian Collection |
And document content:
| title | state | collection |
| Upper Floor Map | validated | Turin Egyptian Collection |
| title | body | state | collection |
| Upper Floor Map | value: <p>A sample <a href="#link">map</a> example.</p> - format: content_editor | validated | Turin Egyptian Collection |
And event content:
| title | state | collection |
| Opening of the Hellenistic Period Section | validated | Turin Egyptian Collection |
And news content:
| title | state | collection |
| Turin Egyptian Museum Reopened | validated | Turin Egyptian Collection |
| title | body | state | collection |
| Turin Egyptian Museum Reopened | value: <p>After <em>more than</em> <a href="#link">two years</a>.</p> - format: content_editor | validated | Turin Egyptian Collection |
And newsletter content:
| title | state | collection |
| Stay informed about this year events and exhibitions | validated | Turin Egyptian Collection |
| title | body | state | collection |
| Stay informed about this year events and exhibitions | value: <p><a href="#link">Subscribe to the newsletter</a> to stay <strong>up-to-date!</strong>.</p> - format: content_editor | validated | Turin Egyptian Collection |
And video content:
| title | state | collection |
| Watch the mummy conservation technique | validated | Turin Egyptian Collection |

Scenario: Test that publishing new solutions result in counters being properly updated.
Scenario: Publishing new solutions should result in counters being properly updated.
Given owner:
| name | type |
| Particle sweeper | Private Individual(s) |
Expand Down Expand Up @@ -78,7 +80,7 @@ Feature: Given I am visiting the collection homepage
Then I delete the "Solution from draft to validated" solution
And I delete the "Costas Papazoglou" contact information

Scenario: Test label variant based on the content count of each category.
Scenario: Content type facet labels should show the plural form when multiple results are available.
Given I go to the homepage of the "Turin Egyptian Collection" collection
Then the "Discussion" content tab is displayed
And the "Document" content tab is displayed
Expand Down Expand Up @@ -124,3 +126,23 @@ Feature: Given I am visiting the collection homepage
And I should see the link "Newsletters (2)"
And I should see the link "Solutions (2)"
And I should see the link "Videos (2)"

Scenario: Links and markup should be stripped from tiles abstract.
Given I go to the homepage of the "Turin Egyptian Collection" collection
# Check the discussion tile.
Then I should see the "Bigger than Egyptian Museum of Cairo?" tile
# Check into the HTML so that we assert that actually the HTML has been stripped.
And the page should contain the html text "Link to the museum web site ."
And I should not see the link "Link to the museum"
# Check the document tile.
And I should see the "Upper Floor Map" tile
And the page should contain the html text "A sample map example."
And I should not see the link "map"
# Check the news tile.
And I should see the "Turin Egyptian Museum Reopened" tile
And the page should contain the html text "After more than two years ."
And I should not see the link "two years"
# Check the newsletter tile.
And I should see the "Stay informed about this year events and exhibitions" tile
And the page should contain the html text "Subscribe to the newsletter to stay up-to-date! ."
And I should not see the link "Subscribe to the newsletter"
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ bundle: discussion
mode: moderation
content:
body:
weight: 2
weight: 1
label: hidden
settings:
trim_length: 600
Expand All @@ -38,6 +38,8 @@ content:
trim_options:
text: false
more_class: more-link
wrap_output: false
wrap_class: trimmed
third_party_settings:
ds:
ft:
Expand All @@ -51,7 +53,7 @@ content:
type: smart_trim
region: content
field_state:
weight: 1
weight: 0
label: inline
settings: { }
third_party_settings: { }
Expand All @@ -66,6 +68,7 @@ hidden:
field_site_featured: true
field_site_pinned: true
field_visit_count: true
flag_subscribe_discussions: true
invite_link: true
langcode: true
links: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ content:
trim_options:
text: false
more_class: more-link
wrap_output: false
wrap_class: trimmed
third_party_settings:
ds:
ft:
Expand Down Expand Up @@ -93,6 +95,7 @@ hidden:
field_site_pinned: true
field_state: true
field_visit_count: true
flag_subscribe_discussions: true
invite_link: true
langcode: true
links: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,15 @@ content:
trim_length: 200
trim_type: chars
trim_suffix:
more_link: false
wrap_class: trimmed
more_text: More
more_class: more-link
summary_handler: trim
trim_options:
text: false
more_class: more-link
text: true
trim_zero: false
wrap_output: false
more_link: false
third_party_settings:
ds:
ft:
Expand Down Expand Up @@ -93,6 +96,7 @@ hidden:
field_site_pinned: true
field_state: true
field_visit_count: true
flag_subscribe_discussions: true
invite_link: true
langcode: true
links: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,15 @@ content:
trim_length: 200
trim_type: chars
trim_suffix:
more_link: false
wrap_class: trimmed
more_text: More
more_class: more-link
summary_handler: trim
trim_options:
text: false
more_class: more-link
text: true
trim_zero: false
wrap_output: false
more_link: false
third_party_settings:
ds:
ft:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,14 @@ content:
trim_length: 200
trim_type: chars
trim_suffix:
more_link: false
wrap_class: trimmed
more_text: More
trim_options:
text: false
more_class: more-link
trim_options:
text: true
trim_zero: false
wrap_output: false
more_link: false
summary_handler: full
third_party_settings:
ds:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,15 @@ content:
trim_length: 200
trim_type: chars
trim_suffix:
more_link: false
wrap_class: trimmed
more_text: More
more_class: more-link
summary_handler: trim
trim_options:
text: false
more_class: more-link
text: true
trim_zero: false
wrap_output: false
more_link: false
third_party_settings:
ds:
ft:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,15 @@ content:
trim_length: 200
trim_type: chars
trim_suffix:
more_link: false
wrap_class: trimmed
more_text: More
more_class: more-link
summary_handler: trim
trim_options:
text: false
more_class: more-link
text: true
trim_zero: false
wrap_output: false
more_link: false
third_party_settings:
ds:
ft:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
{{ title_suffix }}
</div>
<div class="listing__field">
<p class="listing__teaser">{{ content.body|render|striptags('<a>')|raw }}</p>
<p class="listing__teaser">{{ content.body }}</p>
</div>
</div>
{% if content.field_keywords|render %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
<h5 class="listing__subtitle listing__type">{{ content.field_type }}</h5>
</div>
<div class="listing__field">
<p class="listing__teaser">{{ content.body|render|striptags('<a>')|raw }}</p>
<p class="listing__teaser">{{ content.body }}</p>
</div>
</div>
{% if content.field_keywords|render %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
</div>
{% if view_mode == 'view_mode_featured' %}
<div class="listing__field">
<p class="listing__teaser">{{ content.body|render|striptags('<a>')|raw }}</p>
<p class="listing__teaser">{{ content.body|render|striptags|raw }}</p>
</div>
{% endif %}
<div class="listing__field listing__stats mdl-card__actions">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
<h5 class="listing__subtitle listing__date">{{ created }}</h5>
</div>
<div class="listing__field">
<p class="listing__teaser">{{ content.body|render|striptags('<a>')|raw }}</p>
<p class="listing__teaser">{{ content.body }}</p>
</div>
</div>
{% if content.field_keywords|render %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
<h2 class="listing__title"><a href="{{ url }}">{{ label }}</a></h2>
</div>
<div class="listing__field">
<p class="listing__teaser">{{ content.body|render|striptags('<a>')|raw }}</p>
<p class="listing__teaser">{{ content.body }}</p>
</div>
</div>
<div class="listing__field listing__stats mdl-card__actions">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
<h5 class="listing__subtitle listing__date">{{ "Last update"|t }}: {{ last_update }}</h5>
</div>
<div class="listing__field">
<p class="listing__teaser">{{ content.body|render|striptags('<a>')|raw }}</p>
<p class="listing__teaser">{{ content.body }}</p>
</div>
<div class="listing__field listing__stats mdl-card__actions">
<div class="listing__stat">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
</div>
{% if view_mode == 'view_mode_featured' %}
<div class="listing__field">
<p class="listing__teaser">{{ content.body|render|striptags('<a>')|raw }}</p>
<p class="listing__teaser">{{ content.body|render|striptags|raw }}</p>
</div>
{% endif %}
<div class="listing__field listing__stats mdl-card__actions">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
</div>
{% if view_mode == 'view_mode_featured' %}
<div class="listing__field">
<p class="listing__teaser">{{ content.field_ar_abstract|render|striptags('<a>')|raw }}</p>
<p class="listing__teaser">{{ content.field_ar_abstract|render|striptags|raw }}</p>
</div>
{% endif %}
<div class="listing__field listing__stats mdl-card__actions">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<h2 class="listing__title">{{ label }}</h2>
</div>
<div class="listing__field">
<p class="listing__teaser">{{ content.field_licence_description|render|striptags('<a>')|raw }}</p>
<p class="listing__teaser">{{ content.field_licence_description }}</p>
</div>
</div>
<div class="listing__field listing__stats mdl-card__actions">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
</div>
{% if view_mode == 'view_mode_featured' %}
<div class="listing__field">
<p class="listing__teaser">{{ content.field_is_description|render|striptags('<a>')|raw }}</p>
<p class="listing__teaser">{{ content.field_is_description|render|striptags|raw }}</p>
</div>
{% endif %}
<div class="listing__field listing__stats mdl-card__actions">
Expand Down

0 comments on commit f08875d

Please sign in to comment.