diff --git a/tests/features/collection/collection_content.feature b/tests/features/collection/collection_content.feature index 111334c4b0..8cb1d347d6 100644 --- a/tests/features/collection/collection_content.feature +++ b/tests/features/collection/collection_content.feature @@ -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: @@ -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) | @@ -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 @@ -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" diff --git a/web/modules/custom/joinup_discussion/config/install/core.entity_view_display.node.discussion.moderation.yml b/web/modules/custom/joinup_discussion/config/install/core.entity_view_display.node.discussion.moderation.yml index 7e26764c34..dd9ac54279 100644 --- a/web/modules/custom/joinup_discussion/config/install/core.entity_view_display.node.discussion.moderation.yml +++ b/web/modules/custom/joinup_discussion/config/install/core.entity_view_display.node.discussion.moderation.yml @@ -26,7 +26,7 @@ bundle: discussion mode: moderation content: body: - weight: 2 + weight: 1 label: hidden settings: trim_length: 600 @@ -38,6 +38,8 @@ content: trim_options: text: false more_class: more-link + wrap_output: false + wrap_class: trimmed third_party_settings: ds: ft: @@ -51,7 +53,7 @@ content: type: smart_trim region: content field_state: - weight: 1 + weight: 0 label: inline settings: { } third_party_settings: { } @@ -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 diff --git a/web/modules/custom/joinup_discussion/config/install/core.entity_view_display.node.discussion.view_mode_featured.yml b/web/modules/custom/joinup_discussion/config/install/core.entity_view_display.node.discussion.view_mode_featured.yml index aa75025c6c..f08b733f65 100644 --- a/web/modules/custom/joinup_discussion/config/install/core.entity_view_display.node.discussion.view_mode_featured.yml +++ b/web/modules/custom/joinup_discussion/config/install/core.entity_view_display.node.discussion.view_mode_featured.yml @@ -37,6 +37,8 @@ content: trim_options: text: false more_class: more-link + wrap_output: false + wrap_class: trimmed third_party_settings: ds: ft: @@ -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 diff --git a/web/modules/custom/joinup_discussion/config/install/core.entity_view_display.node.discussion.view_mode_tile.yml b/web/modules/custom/joinup_discussion/config/install/core.entity_view_display.node.discussion.view_mode_tile.yml index 972674e9ac..e6347338ae 100644 --- a/web/modules/custom/joinup_discussion/config/install/core.entity_view_display.node.discussion.view_mode_tile.yml +++ b/web/modules/custom/joinup_discussion/config/install/core.entity_view_display.node.discussion.view_mode_tile.yml @@ -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: @@ -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 diff --git a/web/modules/custom/joinup_document/config/install/core.entity_view_display.node.document.view_mode_tile.yml b/web/modules/custom/joinup_document/config/install/core.entity_view_display.node.document.view_mode_tile.yml index 952c2710ab..dc0554a13a 100644 --- a/web/modules/custom/joinup_document/config/install/core.entity_view_display.node.document.view_mode_tile.yml +++ b/web/modules/custom/joinup_document/config/install/core.entity_view_display.node.document.view_mode_tile.yml @@ -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: diff --git a/web/modules/custom/joinup_licence/config/install/core.entity_view_display.rdf_entity.licence.view_mode_tile.yml b/web/modules/custom/joinup_licence/config/install/core.entity_view_display.rdf_entity.licence.view_mode_tile.yml index e311e626d5..3daf73ace5 100644 --- a/web/modules/custom/joinup_licence/config/install/core.entity_view_display.rdf_entity.licence.view_mode_tile.yml +++ b/web/modules/custom/joinup_licence/config/install/core.entity_view_display.rdf_entity.licence.view_mode_tile.yml @@ -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: diff --git a/web/modules/custom/joinup_news/config/install/core.entity_view_display.node.news.view_mode_tile.yml b/web/modules/custom/joinup_news/config/install/core.entity_view_display.node.news.view_mode_tile.yml index 200120fe29..909bb6599a 100644 --- a/web/modules/custom/joinup_news/config/install/core.entity_view_display.node.news.view_mode_tile.yml +++ b/web/modules/custom/joinup_news/config/install/core.entity_view_display.node.news.view_mode_tile.yml @@ -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: diff --git a/web/modules/custom/joinup_newsletter/config/install/core.entity_view_display.node.newsletter.view_mode_tile.yml b/web/modules/custom/joinup_newsletter/config/install/core.entity_view_display.node.newsletter.view_mode_tile.yml index 4370142767..3babe1c31b 100644 --- a/web/modules/custom/joinup_newsletter/config/install/core.entity_view_display.node.newsletter.view_mode_tile.yml +++ b/web/modules/custom/joinup_newsletter/config/install/core.entity_view_display.node.newsletter.view_mode_tile.yml @@ -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: diff --git a/web/themes/joinup/templates/content/node--discussion--listing-item.html.twig b/web/themes/joinup/templates/content/node--discussion--listing-item.html.twig index 8111ff5cc1..ea9e8a08a8 100644 --- a/web/themes/joinup/templates/content/node--discussion--listing-item.html.twig +++ b/web/themes/joinup/templates/content/node--discussion--listing-item.html.twig @@ -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 %} diff --git a/web/themes/joinup/templates/content/node--document--listing-item.html.twig b/web/themes/joinup/templates/content/node--document--listing-item.html.twig index 6d5a99907a..18ae298f95 100644 --- a/web/themes/joinup/templates/content/node--document--listing-item.html.twig +++ b/web/themes/joinup/templates/content/node--document--listing-item.html.twig @@ -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 %} diff --git a/web/themes/joinup/templates/content/node--event--listing-item.html.twig b/web/themes/joinup/templates/content/node--event--listing-item.html.twig index f8da920e95..7a2f98f5e3 100644 --- a/web/themes/joinup/templates/content/node--event--listing-item.html.twig +++ b/web/themes/joinup/templates/content/node--event--listing-item.html.twig @@ -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"> diff --git a/web/themes/joinup/templates/content/node--news--listing-item.html.twig b/web/themes/joinup/templates/content/node--news--listing-item.html.twig index 0541fef8f5..acb298a595 100644 --- a/web/themes/joinup/templates/content/node--news--listing-item.html.twig +++ b/web/themes/joinup/templates/content/node--news--listing-item.html.twig @@ -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 %} diff --git a/web/themes/joinup/templates/content/node--newsletter--listing-item.html.twig b/web/themes/joinup/templates/content/node--newsletter--listing-item.html.twig index 366f01674f..de8c9d7112 100644 --- a/web/themes/joinup/templates/content/node--newsletter--listing-item.html.twig +++ b/web/themes/joinup/templates/content/node--newsletter--listing-item.html.twig @@ -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"> diff --git a/web/themes/joinup/templates/content/node--tallinn-report--listing-item.html.twig b/web/themes/joinup/templates/content/node--tallinn-report--listing-item.html.twig index 42d737cc31..6ee378cb99 100644 --- a/web/themes/joinup/templates/content/node--tallinn-report--listing-item.html.twig +++ b/web/themes/joinup/templates/content/node--tallinn-report--listing-item.html.twig @@ -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"> diff --git a/web/themes/joinup/templates/content/node--video--listing-item.html.twig b/web/themes/joinup/templates/content/node--video--listing-item.html.twig index cbfde67338..9a5954a9f4 100644 --- a/web/themes/joinup/templates/content/node--video--listing-item.html.twig +++ b/web/themes/joinup/templates/content/node--video--listing-item.html.twig @@ -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"> diff --git a/web/themes/joinup/templates/rdf_entity/rdf-entity--collection--listing-item.html.twig b/web/themes/joinup/templates/rdf_entity/rdf-entity--collection--listing-item.html.twig index b8b53cb462..3aeaeff1fe 100644 --- a/web/themes/joinup/templates/rdf_entity/rdf-entity--collection--listing-item.html.twig +++ b/web/themes/joinup/templates/rdf_entity/rdf-entity--collection--listing-item.html.twig @@ -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"> diff --git a/web/themes/joinup/templates/rdf_entity/rdf-entity--licence--listing-item.html.twig b/web/themes/joinup/templates/rdf_entity/rdf-entity--licence--listing-item.html.twig index a7ec3ba6bd..6675ceee83 100644 --- a/web/themes/joinup/templates/rdf_entity/rdf-entity--licence--listing-item.html.twig +++ b/web/themes/joinup/templates/rdf_entity/rdf-entity--licence--listing-item.html.twig @@ -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"> diff --git a/web/themes/joinup/templates/rdf_entity/rdf-entity--solution--listing-item.html.twig b/web/themes/joinup/templates/rdf_entity/rdf-entity--solution--listing-item.html.twig index 06a5f0febd..ec3a49effb 100644 --- a/web/themes/joinup/templates/rdf_entity/rdf-entity--solution--listing-item.html.twig +++ b/web/themes/joinup/templates/rdf_entity/rdf-entity--solution--listing-item.html.twig @@ -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">