diff --git a/config/sync/core.entity_view_display.rdf_entity.solution.tile_two.yml b/config/sync/core.entity_view_display.rdf_entity.solution.tile_two.yml index 58eba9831f4b471df160d8ca8ae0b39b9c0e8311..dd365750738d6e0c763305e9a96119f2dc4ee63e 100644 --- a/config/sync/core.entity_view_display.rdf_entity.solution.tile_two.yml +++ b/config/sync/core.entity_view_display.rdf_entity.solution.tile_two.yml @@ -46,9 +46,11 @@ dependencies: - field.field.rdf_entity.solution.field_status - field.field.rdf_entity.solution.field_topic - rdf_entity.rdfentity.solution + - responsive_image.styles.teaser module: - field_group - layout_builder + - responsive_image - search_api_field - smart_trim - template_suggestion @@ -62,7 +64,7 @@ third_party_settings: label: 'Abstract wrapper' parent_name: '' region: content - weight: 2 + weight: 1 format_type: html_element format_settings: classes: '' @@ -83,10 +85,10 @@ mode: tile_two content: field_is_content: type: search_api_field - label: above + label: hidden settings: { } third_party_settings: { } - weight: 3 + weight: 2 region: content field_is_description: type: smart_trim @@ -109,26 +111,45 @@ content: template_suggestion: p_wrapper weight: 37 region: content + field_is_logo: + type: responsive_image + label: hidden + settings: + responsive_image_style: teaser + image_link: '' + third_party_settings: + template_suggestion: + template_suggestion: bare + weight: 6 + region: content field_is_shared_in: type: entity_reference_entity_view - label: above + label: hidden settings: view_mode: view_mode_tile link: false third_party_settings: template_suggestion: template_suggestion: entity_reference__listing_tile - weight: 6 + weight: 5 + region: content + label: + type: string + label: hidden + settings: + link_to_entity: false + third_party_settings: { } + weight: 7 region: content rdf_entity_solution_field_is_content_inline_facets: settings: { } third_party_settings: { } - weight: 4 + weight: 3 region: content rdf_entity_solution_field_is_content_top: settings: { } third_party_settings: { } - weight: 1 + weight: 0 region: content read_more: settings: { } @@ -138,7 +159,7 @@ content: related_solutions: settings: { } third_party_settings: { } - weight: 5 + weight: 4 region: content hidden: changed: true @@ -162,7 +183,6 @@ hidden: field_is_issue_tracker: true field_is_landing_page: true field_is_language: true - field_is_logo: true field_is_metrics_page: true field_is_moderation: true field_is_owner: true @@ -186,7 +206,6 @@ hidden: field_status: true field_topic: true flag_like_rdf_entity: true - label: true langcode: true og_group: true pinned_in: true diff --git a/config/sync/og.og_role.rdf_entity-collection-facilitator.yml b/config/sync/og.og_role.rdf_entity-collection-facilitator.yml index 7ff8cc01078f6feae344d8fb99dc9c240109f152..f7ebcfe8b7a2ad77b1d28914b7c6435091a28698 100644 --- a/config/sync/og.og_role.rdf_entity-collection-facilitator.yml +++ b/config/sync/og.og_role.rdf_entity-collection-facilitator.yml @@ -33,6 +33,7 @@ permissions: - 'create paragraph content 2_column_layout' - 'create paragraph content 3_column_layout' - 'create paragraph content call_to_action' + - 'create paragraph content github_feed' - 'create paragraph content json_map' - 'create paragraph content row' - 'create rdf entity news' @@ -50,6 +51,7 @@ permissions: - 'delete paragraph content 2_column_layout' - 'delete paragraph content 3_column_layout' - 'delete paragraph content call_to_action' + - 'delete paragraph content github_feed' - 'delete paragraph content json_map' - 'delete paragraph content row' - 'edit any custom_page content' @@ -225,6 +227,7 @@ permissions: - 'update paragraph content 2_column_layout' - 'update paragraph content 3_column_layout' - 'update paragraph content call_to_action' + - 'update paragraph content github_feed' - 'update paragraph content json_map' - 'update paragraph content row' - 'view all revisions' diff --git a/config/sync/og.og_role.rdf_entity-solution-facilitator.yml b/config/sync/og.og_role.rdf_entity-solution-facilitator.yml index 93aeb0b84985517afa5e59210a46896c14f81ef7..197c2b2ff0304517a51e2ec8edb368fb82b9245f 100644 --- a/config/sync/og.og_role.rdf_entity-solution-facilitator.yml +++ b/config/sync/og.og_role.rdf_entity-solution-facilitator.yml @@ -24,6 +24,7 @@ permissions: - 'create event content' - 'create glossary content' - 'create news content' + - 'create paragraph content github_feed' - 'delete any asset_distribution rdf_entity' - 'delete any custom_page content' - 'delete any discussion content' @@ -33,6 +34,7 @@ permissions: - 'delete any news content' - 'delete asset_distribution rdf entity' - 'delete contact_information rdf entity' + - 'delete paragraph content github_feed' - 'edit any custom_page content' - 'edit any discussion content' - 'edit any document content' @@ -201,6 +203,7 @@ permissions: - 'update group' - 'update own asset_distribution rdf_entity' - 'update own asset_release rdf_entity' + - 'update paragraph content github_feed' - 'view all revisions' - 'view any unpublished content' - 'view rdf entity' diff --git a/config/sync/user.role.moderator.yml b/config/sync/user.role.moderator.yml index d70fefb2ff4f3a9c7ce710b4888782572e2e4f0b..e8289f2af16db8b56e613936f9f0445b4aeb01bc 100644 --- a/config/sync/user.role.moderator.yml +++ b/config/sync/user.role.moderator.yml @@ -403,7 +403,6 @@ permissions: - 'view licence overview page' - 'view own field_is_eif_category' - 'view own field_is_eif_recommendation' - - 'view paragraph content github_feed' - 'view rdf entity overview' - 'view rdf_entity draft graph' - 'view unpublished rdf entity' diff --git a/phpmd.xml b/phpmd.xml new file mode 100644 index 0000000000000000000000000000000000000000..975bd79619db94d14ca601fb46aabc9be7c53da7 --- /dev/null +++ b/phpmd.xml @@ -0,0 +1,8 @@ +<?xml version="1.0"?> +<ruleset name="Toolkit PHPMD rule set" + xmlns="http://pmd.sf.net/ruleset/1.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd" + xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd"> + <!-- Joinup in not doing PHPMD checks as this tool is messy. --> +</ruleset> diff --git a/tests/features/custom_page/community_content_listing.feature b/tests/features/custom_page/community_content_listing.feature index 092b857e322ca237fd0868d99d23d50ee56ceae2..ee9df81b4e46ce41190b695ec91995c00aa235ce 100644 --- a/tests/features/custom_page/community_content_listing.feature +++ b/tests/features/custom_page/community_content_listing.feature @@ -151,7 +151,7 @@ Feature: # The "List additional actions" is the button arrow that shows the full list of paragraphs to add. Given I press "List additional actions" - Then I press "Add Content listing" in the "Custom page body" paragraphs field + Then I click "Add Content listing" in the "Custom page body" paragraphs field And I uncheck "Show related content" When the following fields should not be visible "Global search, Allow shared content" And I check "Show related content" @@ -483,14 +483,14 @@ Feature: # Paragraph #1. When I press "List additional actions" - And I press "Add Content listing" in the "Custom page body" paragraphs field + And I click "Add Content listing" in the "Custom page body" paragraphs field And I press "Add and configure filter" And I fill in "Solution" with "Save the Planet" # Paragraph #2. When I press "List additional actions" - And I press "Add Content listing" in the "Custom page body" paragraphs field + And I click "Add Content listing" in the "Custom page body" paragraphs field And I press latest "Add and configure filter" And I fill in the latest "Solution" field with "Fight Global Warming" @@ -522,7 +522,7 @@ Feature: # Paragraph #1. When I press "List additional actions" - And I press "Add Content listing" in the "Custom page body" paragraphs field + And I click "Add Content listing" in the "Custom page body" paragraphs field And I press "Add and configure filter" And I fill in "Solution" with "Save gasoline" @@ -535,7 +535,7 @@ Feature: # Paragraph #2. When I press "List additional actions" - And I press "Add Content listing" in the "Custom page body" paragraphs field + And I click "Add Content listing" in the "Custom page body" paragraphs field And I press latest "Add and configure filter" And I fill in the latest "Solution" field with "Black Noise" diff --git a/tests/features/joinup_core/manage_content.feature b/tests/features/joinup_core/manage_content.feature index af6bb8905d1311f7088492e9504ea6737c22b90a..c0a95f67aede2ec5d22d5d35c336a888ada71f7e 100644 --- a/tests/features/joinup_core/manage_content.feature +++ b/tests/features/joinup_core/manage_content.feature @@ -198,3 +198,24 @@ Feature: Then I should see the link "Looking for Support?" in the "Navigation menu" region When I click "Looking for Support?" in the "Navigation menu" region Then I should not see the "Looking for Support?" tile + + @javascript + Scenario: Able to select all items on the content management UI + Given the following collections: + | title | state | + | Vintage Art | validated | + And event content: + | title | collection | state | + | The Panama Papers Party | Vintage Art | validated | + | The Area 51 Party | Vintage Art | validated | + + When I am logged in as a moderator + And I go to the "Vintage Art" collection + And I open the header local tasks menu + And I click "Manage content" in the "Entity actions" region + Then the "The Panama Papers Party" checkbox should not be checked + And the "The Area 51 Party" checkbox should not be checked + + When I select the "Title" row + Then the "The Panama Papers Party" checkbox should be checked + And the "The Area 51 Party" checkbox should be checked diff --git a/tests/features/joinup_subscription/collection.content.subscription.feature b/tests/features/joinup_subscription/collection.content.subscription.feature index c4fce924b6aa6ddfd4d86c88676e2d41526e1905..3441562ffbb0e75a0af995ba4d1b8448ef1b4358 100644 --- a/tests/features/joinup_subscription/collection.content.subscription.feature +++ b/tests/features/joinup_subscription/collection.content.subscription.feature @@ -154,6 +154,11 @@ Feature: Subscribing to community content in collections And the monthly group content subscription digest for kalin should not contain the following message: | Ruse | When the workflow state of the "Ruse" content is changed to "validated" + Then the weekly group content subscription digest for bisera should not contain the following message: + | Ruse | + And the monthly group content subscription digest for kalin should not contain the following message: + | Ruse | + When the workflow state of the "Ruse" content is changed to "archived" Then the weekly group content subscription digest for bisera should not contain the following message: | Ruse | And the monthly group content subscription digest for kalin should not contain the following message: diff --git a/tests/features/joinup_subscription/community.content.subscriptions.feature b/tests/features/joinup_subscription/community.content.subscriptions.feature index c691ab4b36922fbd90c57f2d326702ddbb4b41d5..0cba8c52a84841f40f13c44104385155fca4cb38 100644 --- a/tests/features/joinup_subscription/community.content.subscriptions.feature +++ b/tests/features/joinup_subscription/community.content.subscriptions.feature @@ -37,7 +37,7 @@ Feature: Subscribing to community content in collections and solutions Given discussion content: | title | body | collection | solution | state | author | | Active galactic nuclei | A thin relativistic accretion disk | Black hole imaging | | validated | junfukue | - | Light diffusion | Photons emitted at constant radius | | Null geodesics | validated | junfukue | + | Light diffusion | Photons emitted at constant radius | | Null geodesics | archived | junfukue | And document content: | title | body | collection | solution | state | author | | Doppler effect | Caused by disk rotation | Black hole imaging | | validated | junfukue | @@ -49,7 +49,7 @@ Feature: Subscribing to community content in collections and solutions And news content: | title | body | collection | solution | state | author | | The periastron | Jacobian elliptic integral | Black hole imaging | | validated | bisera | - | Newtonian context | Projecting ellipses | | Bolometric appearance | validated | hristo | + | Newtonian context | Projecting ellipses | | Bolometric appearance | archived | hristo | # The group content digest should contain the content posted in the # collection and the solution. @@ -58,10 +58,8 @@ Feature: Subscribing to community content in collections and solutions | Doppler effect | | Effective potential | | The periastron | - | Light diffusion | | Distant observers | | Deflected rays | - | Newtonian context | # Check that the message is formatted correctly. It should contain the # groups in alphabetical order, underneath which the group content is shown, @@ -76,7 +74,5 @@ Feature: Subscribing to community content in collections and solutions | The periastron | | Bolometric appearance | | Distant observers | - | Newtonian context | | Null geodesics | | Deflected rays | - | Light diffusion | diff --git a/tests/features/paragraphs/custom_page.paragraphs.feature b/tests/features/paragraphs/custom_page.paragraphs.feature index 41c445ee8b8b16bbc03df6c28129a7c37d5c2cf9..e2511ff92b70386921c188def853fed04ee3c2f6 100644 --- a/tests/features/paragraphs/custom_page.paragraphs.feature +++ b/tests/features/paragraphs/custom_page.paragraphs.feature @@ -24,14 +24,14 @@ Feature: # The first paragraphs item is open by default. Then there should be 1 paragraph in the "Custom page body" field Then I should see the "Remove" button in the "Custom page body" field for paragraph 1 - Given I press "Remove" in the "Custom page body" field for paragraph 1 + Given I click "Remove" in the "Custom page body" field for paragraph 1 Then the page should contain no paragraphs - Given I press "Add Simple paragraph" in the "Custom page body" paragraphs field + Given I click "Add Simple paragraph" in the "Custom page body" paragraphs field Then there should be 1 paragraph in the "Custom page body" field - Given I press "Add Simple paragraph" in the "Custom page body" paragraphs field + Given I click "Add Simple paragraph" in the "Custom page body" paragraphs field Then there should be 2 paragraphs in the "Custom page body" field When I enter "AAAAAAAAAA" in the "Body" wysiwyg editor in the "Custom page body" field for paragraph 1 @@ -106,12 +106,12 @@ Feature: And I open the plus button menu And I click "Add custom page" And I fill in "Title" with "Paragraphs accordion page" - Given I press "Remove" in the "Custom page body" field for paragraph 1 + Given I click "Remove" in the "Custom page body" field for paragraph 1 Then the page should contain no paragraphs # The "List additional actions" is the button arrow that shows the full list of paragraphs to add. Given I press "List additional actions" - Then I press "Add Accordion" in the "Custom page body" paragraphs field + Then I click "Add Accordion" in the "Custom page body" paragraphs field # 3 paragraphs are the default number when adding an accordion. # 1. the accordion wrapper, 2. accordion item and 3. the simple paragraph contained in the item. diff --git a/tests/features/paragraphs/github_feed.feature b/tests/features/paragraphs/github_feed.feature index 50b0221d620d14bae86b4bb4464e4bc45a066db0..8c27f66ef93e185efc2d0954f099d9aaa0927748 100644 --- a/tests/features/paragraphs/github_feed.feature +++ b/tests/features/paragraphs/github_feed.feature @@ -3,17 +3,16 @@ Feature: Github feed paragraph tests. The scenarios are split into 4 tests because re-saving the entity would invalidate the file cache and the tests would require connecting to Github. - Scenario: Test the Github feed paragraph. - Given the following collection: - | title | Paragraphs collection | - | state | validated | + Scenario Outline: Test the Github feed paragraph. + Given the following <group>: + | title | Paragraphs <group> | + | state | validated | And custom_page content: - | title | collection | state | - | Catalogue of paragraphs | Paragraphs collection | published | + | title | <group> | state | + | Catalogue of paragraphs | Paragraphs <group> | published | When I am logged in as a moderator - And I go to the "Catalogue of paragraphs" custom page - And I click "Edit" - And I press "Add Github feed" + And I go to the edit form of the "Catalogue of paragraphs" "custom page" + And I click "Add Github feed" in the "Custom page body" paragraphs field And I fill in the following: | Repository | https://github.com/openeuropa/oe_bootstrap_theme.git | @@ -40,7 +39,7 @@ Feature: Github feed paragraph tests. And I should see the heading "Issues (5)" And I should not see the heading "Comments (5)" - When I click "Edit" + And I go to the edit form of the "Catalogue of paragraphs" "custom page" And I fill in the following: | Type | issue | | Number of items | 5 | @@ -51,15 +50,52 @@ Feature: Github feed paragraph tests. And I should see the heading "Comments (1)" # Test the error message when the repository is invalid. - When I click "Edit" + And I go to the edit form of the "Catalogue of paragraphs" "custom page" And I fill in the following: | Repository | https://some_invalid_repository.com/nothing | And I press "Update" Then I should see the text "The repository must be a valid GitHub repository." # Test a repository that is not found and ensure that the page does not break. - When I click "Edit" + And I go to the edit form of the "Catalogue of paragraphs" "custom page" And I fill in the following: | Repository | https://github.com/some/repository | And I press "Update" Then I should see the heading "Catalogue of paragraphs" + + Examples: + | group | + | collection | + | solution | + + @javascript + Scenario Outline: Facilitators can also access paragraphs. + Given the following <group>: + | title | Paragraphs <group> | + | state | validated | + And custom_page content: + | title | <group> | state | + | Catalogue of paragraphs | Paragraphs <group> | published | + When I am logged in as a facilitator of the "Paragraphs <group>" <group> + And I go to the edit form of the "Catalogue of paragraphs" "custom page" + And I click "Add Github feed" in the "Custom page body" paragraphs field + And I fill in the following: + | Repository | https://github.com/openeuropa/oe_bootstrap_theme.git | + + When I fill in the following: + | Type | pull_request | + | Number of items | 5 | + And I press "Update" + And I should see the heading "Pull requests (5)" + And I go to the edit form of the "Catalogue of paragraphs" "custom page" + + # There should be a single paragraph with the Collapse button available. + And I press "Collapse" + # The only edit button in the main region is the one for the paragraph. + And I should see the button "Edit" in the "Content" region + And I should see the button "Remove" in the "Content" region + + Examples: + | group | + | collection | + | solution | diff --git a/tests/src/Context/JoinupParagraphsContext.php b/tests/src/Context/JoinupParagraphsContext.php index 7c3ddaeb247f9594606b29ff3cbbc77247bd1c8a..661072a0a59416b719d521364ee938dfb350a6b8 100644 --- a/tests/src/Context/JoinupParagraphsContext.php +++ b/tests/src/Context/JoinupParagraphsContext.php @@ -5,6 +5,7 @@ namespace Drupal\joinup\Context; use Behat\Gherkin\Node\TableNode; +use Behat\Mink\Driver\Selenium2Driver; use Behat\Mink\Element\TraversableElement; use Behat\Mink\Exception\ElementNotFoundException; use Drupal\DrupalExtension\Context\RawDrupalContext; @@ -168,10 +169,10 @@ public function assertButtonInParagraphsItem(string $button, string $field, int } /** - * Clicks the remove button in the given paragraphs item. + * Clicks a link in the given paragraphs item. * * @param string $label - * The button label. + * The link label. * @param string $field * The field identifier. One of the keys in the * \JoinupParagraphsSubContext::fieldMapping array. @@ -180,30 +181,35 @@ public function assertButtonInParagraphsItem(string $button, string $field, int * readability. If left empty, the button will be searched in the entire * field. * - * @Given I press :label in the :field field for paragraph :delta - * @Given I press :label in the :field paragraphs field + * @Given I click :label in the :field field for paragraph :delta + * @Given I click :label in the :field paragraphs field */ - public function clickButtonInParagraphsField(string $label, string $field, ?int $delta = NULL): void { - if ($delta === NULL) { - // This is a field button, not linked to any paragraph item, such as the - // button that adds a new paragraph item. - $this->getParagraphsElement($field)->findButton($label)->press(); - return; - } - - $paragraph_item = $this->getParagraphsElementItem($field, --$delta); + public function clickLinkInParagraphsField(string $label, string $field, ?int $delta = NULL): void { + $paragraph_item = ($delta === NULL) ? $this->getParagraphsElement($field) : $this->getParagraphsElementItem($field, --$delta); $this->scrollElementIntoView($paragraph_item); - if (!$button = $paragraph_item->findButton($label)) { + if (!$link = $paragraph_item->findButton($label)) { throw new ElementNotFoundException($this->getSession()->getDriver(), 'button', 'label'); } - // It might be a button beneath the three dots dropdown. - if (!$button->isVisible()) { - $dropdown = $paragraph_item->find('css', 'button.paragraphs-dropdown-toggle'); - $dropdown->click(); + // It might be a button beneath the three dots dropdown. Check for the + // driver as well, because only Selenium2Driver supports isVisible(). + if (($this->getSession()->getDriver() instanceof Selenium2Driver) && !$link->isVisible()) { + // Check first if the button is in the 3-dots dropdown which has the class + // "paragraphs-dropdown-actions". + $xpath = "//div[contains(concat(' ', @class, ' '), ' paragraphs-dropdown-actions ')]"; + if ($paragraph_item->find('xpath', $xpath)?->findButton($label)) { + // Expand the dropdown. + $dropdown = $paragraph_item->find('css', 'button.paragraphs-dropdown-toggle'); + $dropdown->click(); + } + // Else, expand the 'add paragraph' dropdown in case the button is one of + // the 'add paragraph' buttons. + elseif ($dropdown = $paragraph_item->find('css', 'button.dropdown-toggle')) { + $dropdown->click(); + } } - $button->click(); + $link->click(); } /** diff --git a/web/modules/custom/joinup_core/joinup_core.deploy.php b/web/modules/custom/joinup_core/joinup_core.deploy.php index 1c5bdddef9dbc9ad844c235d59b603ae1d47423e..d23968e7228443fda98e0ee39020ff58a89ecadd 100644 --- a/web/modules/custom/joinup_core/joinup_core.deploy.php +++ b/web/modules/custom/joinup_core/joinup_core.deploy.php @@ -13,29 +13,3 @@ */ declare(strict_types = 1); - -/** - * Change 'culture' to 'culture and environment'. - */ -function joinup_core_deploy_109400(): string { - // Update the references. - $vocab_manager = \Drupal::getContainer()->get('topic.vocabulary_manager'); - $vocab_manager->updateDbReference('http://joinup.eu/ontology/topic#culture', 'http://joinup.eu/ontology/topic#culture-and-education'); - return 'Updated the topic vocabulary.'; -} - -/** - * Clean up cached_computed_field_expired_fields queue. - */ -function joinup_core_deploy_109401(): void { - \Drupal::queue('cached_computed_field_expired_fields')->deleteQueue(); -} - -/** - * Fix the forward revision. - */ -function joinup_core_deploy_109402(): void { - $revision = \Drupal::entityTypeManager()->getStorage('node')->loadRevision(60588); - $revision->isDefaultRevision(TRUE); - $revision->save(); -} diff --git a/web/modules/custom/joinup_subscription/src/EventSubscriber/GroupContentSubscriptionSubscriber.php b/web/modules/custom/joinup_subscription/src/EventSubscriber/GroupContentSubscriptionSubscriber.php index 74221df75a6009941dc9322992d392e17ea367a1..4226655268e4f04b7063fc5439f2363c71a17e9f 100644 --- a/web/modules/custom/joinup_subscription/src/EventSubscriber/GroupContentSubscriptionSubscriber.php +++ b/web/modules/custom/joinup_subscription/src/EventSubscriber/GroupContentSubscriptionSubscriber.php @@ -15,6 +15,7 @@ use Drupal\joinup_notification\NotificationEvents; use Drupal\joinup_subscription\Entity\GroupContentSubscriptionMessage; use Drupal\joinup_subscription\JoinupSubscriptionsHelper; +use Drupal\joinup_workflow\ArchivableEntityInterface; use Drupal\og\OgMembershipInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface; @@ -86,6 +87,11 @@ public function notifyOnCommunityContentCreation(NotificationEvent $event): void return; } + // Ignore archived content. + if ($entity instanceof ArchivableEntityInterface && $entity->isArchived()) { + return; + } + $this->sendMessage($entity); } @@ -104,6 +110,11 @@ public function notifyOnCommunityContentPublication(NotificationEvent $event): v return; } + // Ignore archived content. + if ($entity instanceof ArchivableEntityInterface && $entity->isArchived()) { + return; + } + $this->sendMessage($entity); } @@ -132,6 +143,11 @@ public function notifyOnRdfEntityCrudOperation(NotificationEvent $event) { return; } + // Ignore archived content. + if ($entity instanceof ArchivableEntityInterface && $entity->isArchived()) { + return; + } + // We only want to include content in the digest on initial publication, not // when existing or previously published content is updated or re-published. // Only keep content that is newly created or is not yet published. diff --git a/web/modules/custom/search_api_field/search_api_field.module b/web/modules/custom/search_api_field/search_api_field.module index 8da13ac3b75a94d0d2f2b14d39177587c94a26ea..5468dd1e11b55e62df7f513983d8ec07ae686aa7 100644 --- a/web/modules/custom/search_api_field/search_api_field.module +++ b/web/modules/custom/search_api_field/search_api_field.module @@ -88,7 +88,7 @@ function search_api_field_entity_view(array &$build, EntityInterface $entity, En } // Check number of archived items. - $archived_items = array_key_exists($field_name, $build) ? $build[$field_name]['#archived_items'] : 0; + $archived_items = $build[$field_name]['#archived_items'] ?? 0; // The facets available for the facet source offered by this field have been // organized into pseudo fields. Loop over the configuration to render them diff --git a/web/themes/ventuno/assets/css/tile.min.css b/web/themes/ventuno/assets/css/tile.min.css index 5cbecb73000d6ae5903cb377c97cf629230577a1..16b91f65badf62e08974326e8b76cd8f694277f4 100644 --- a/web/themes/ventuno/assets/css/tile.min.css +++ b/web/themes/ventuno/assets/css/tile.min.css @@ -1,2 +1,2 @@ -.tile{flex-direction:column;height:100%;position:relative}.tile__link{z-index:2}.tile__action{position:relative;z-index:3}.tile__figure{aspect-ratio:16/9;overflow:hidden}.tile__figure picture{align-items:center;display:flex;height:100%;justify-content:center}.tile__figure picture img{margin-bottom:0;max-height:100%}.tile__body{padding:1rem}.tile__standout-info{font-size:.875rem;right:.5rem;top:-1rem}.tile__info-icon,.tile__standout-info-icon{font-size:.75rem}.tile__info-icon{flex-shrink:0}.tile__info-text{-webkit-box-orient:vertical;-webkit-line-clamp:1;display:-webkit-box;overflow:hidden}.tile__default-img:after{background-color:#fff;border-radius:50rem;content:"";display:block;height:6rem;position:absolute;width:6rem}.tile__default-icon{color:#a2a8ab;height:3rem;width:3rem;z-index:1}.tile__body{flex:1 1 auto;padding:1rem 1rem 0}.tile__title{-webkit-line-clamp:2}.tile__text,.tile__title{-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.tile__text{-webkit-line-clamp:4}.tile__bundle-icon{background-color:#fae8cd;height:1.5rem;width:1.5rem}.tile .mark{align-items:center;background-color:#1073de;border-radius:50rem;display:flex;height:1.75rem;justify-content:center;position:absolute;right:.5rem;top:.5rem;width:1.75rem;z-index:1}.tile .mark.star:before{-webkit-mask-image:url(../icons/star.svg);mask-image:url(../icons/star.svg)}.tile .mark.pin:before,.tile .mark.star:before{background-color:#fff;content:"";display:inline-block;height:1em;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain;vertical-align:-.125em;width:1em}.tile .mark.pin:before{-webkit-mask-image:url(../icons/pin.svg);mask-image:url(../icons/pin.svg)}.tile__footer .flag__link{border-radius:50rem;padding:.25rem}.tile__footer .flag__link:hover{background-color:#e7f1fb;text-decoration:none}.tile--horizontal{width:100%}@media (min-width:768px){.tile--horizontal{flex-direction:row;flex-wrap:wrap;height:auto}.tile--horizontal .tile__figure{aspect-ratio:1/1;padding:1rem 0 0 1rem;width:180px}.tile--horizontal .tile__figure picture{align-items:start}.tile--horizontal .tile__body{flex:1 1 calc(100% - 180px);max-width:calc(100% - 180px);overflow-wrap:anywhere;padding:1rem 1rem 0}.tile--horizontal .tile__standout-info{bottom:.5rem;right:unset;top:unset;transform:translateX(calc(-100% - 1.5rem))}.tile--horizontal .tile__footer{align-self:end;border-top:1px solid #dadee0;margin-top:1rem;width:100%}} +.tile{flex-direction:column;height:100%;position:relative}.tile__link{z-index:2}.tile__action{position:relative;z-index:3}.tile__figure{aspect-ratio:16/9;overflow:hidden}.tile__figure picture{align-items:center;display:flex;height:100%;justify-content:center}.tile__figure picture img{margin-bottom:0;max-height:100%;width:auto}.tile__body{padding:1rem}.tile__standout-info{font-size:.875rem;right:.5rem;top:-1rem}.tile__info-icon,.tile__standout-info-icon{font-size:.75rem}.tile__info-icon{flex-shrink:0}.tile__info-text{-webkit-box-orient:vertical;-webkit-line-clamp:1;display:-webkit-box;overflow:hidden}.tile__default-img:after{background-color:#fff;border-radius:50rem;content:"";display:block;height:6rem;position:absolute;width:6rem}.tile__default-icon{color:#a2a8ab;height:3rem;width:3rem;z-index:1}.tile__body{flex:1 1 auto;padding:1rem 1rem 0}.tile__title{-webkit-line-clamp:2}.tile__text,.tile__title{-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.tile__text{-webkit-line-clamp:4}.tile__bundle-icon{background-color:#fae8cd;height:1.5rem;width:1.5rem}.tile .mark{align-items:center;background-color:#1073de;border-radius:50rem;display:flex;height:1.75rem;justify-content:center;position:absolute;right:.5rem;top:.5rem;width:1.75rem;z-index:1}.tile .mark.star:before{-webkit-mask-image:url(../icons/star.svg);mask-image:url(../icons/star.svg)}.tile .mark.pin:before,.tile .mark.star:before{background-color:#fff;content:"";display:inline-block;height:1em;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain;vertical-align:-.125em;width:1em}.tile .mark.pin:before{-webkit-mask-image:url(../icons/pin.svg);mask-image:url(../icons/pin.svg)}.tile__footer .flag__link{border-radius:50rem;padding:.25rem}.tile__footer .flag__link:hover{background-color:#e7f1fb;text-decoration:none}.tile--horizontal{width:100%}@media (min-width:768px){.tile--horizontal{flex-direction:row;flex-wrap:wrap;height:auto}.tile--horizontal .tile__figure{aspect-ratio:1/1;padding:1rem 0 0 1rem;width:180px}.tile--horizontal .tile__figure picture{align-items:start}.tile--horizontal .tile__body{flex:1 1 calc(100% - 180px);max-width:calc(100% - 180px);overflow-wrap:anywhere;padding:1rem 1rem 0}.tile--horizontal .tile__standout-info{bottom:.5rem;right:unset;top:unset;transform:translateX(calc(-100% - 1.5rem))}.tile--horizontal .tile__footer{align-self:end;border-top:1px solid #dadee0;margin-top:1rem;width:100%}} /*# sourceMappingURL=tile.min.css.map */ \ No newline at end of file diff --git a/web/themes/ventuno/assets/images/background.svg b/web/themes/ventuno/assets/images/background.svg index 2df02f4662f84cc33b7d58b254f00a8d3413364f..f7320f03ea7171ac937f69dde130312489d06d43 100644 --- a/web/themes/ventuno/assets/images/background.svg +++ b/web/themes/ventuno/assets/images/background.svg @@ -1 +1 @@ -<svg version="1.0" xmlns="http://www.w3.org/2000/svg" width="1700" height="293.333" viewBox="0 0 1275 220"><path fill="#004494" d="M0 63.6c0 60 .1 63.5 1.8 63 .9-.3 5.3-1.6 9.7-3 68.8-21.1 153.2-33 211.7-29.8 37.7 2.1 59.3 6.1 105.8 19.3 16.1 4.6 43.1 12.8 49 14.9 5.9 2.1 105.3 34.4 124 40.3C620.7 205.9 687.4 219 759.5 219c121.4-.1 197.2-10.7 279.5-39.3 75-26 151.5-70 222.8-128.3l13.2-10.7V0H0v63.6z"/></svg> +<svg version="1.0" xmlns="http://www.w3.org/2000/svg" width="1700" height="293.333" viewBox="0 0 1275 220"><path fill="#17458f" d="M0 63.6c0 60 .1 63.5 1.8 63 .9-.3 5.3-1.6 9.7-3 68.8-21.1 153.2-33 211.7-29.8 37.7 2.1 59.3 6.1 105.8 19.3 16.1 4.6 43.1 12.8 49 14.9 5.9 2.1 105.3 34.4 124 40.3C620.7 205.9 687.4 219 759.5 219c121.4-.1 197.2-10.7 279.5-39.3 75-26 151.5-70 222.8-128.3l13.2-10.7V0H0v63.6z"/></svg> diff --git a/web/themes/ventuno/assets/images/banner-md.svg b/web/themes/ventuno/assets/images/banner-md.svg index 91d60b827341d735b0d9e80c220d4bde85c99eaa..635f97641eab56422b04c8cec21876f88c1e0bbc 100644 --- a/web/themes/ventuno/assets/images/banner-md.svg +++ b/web/themes/ventuno/assets/images/banner-md.svg @@ -1 +1 @@ -<svg data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2400 800"><defs><clipPath id="a"><path style="fill:none" d="M0-14.28h1483.5V800H0z"/></clipPath></defs><g style="clip-path:url(#a)"><path d="M0-.58v799.47L1111.18 800s-34.22-65.56-22.5-128.25c33.85-181.05 191.9-245.45 151.21-429.23C1199 57.76 1483.5-.58 1483.5-.58Z" style="fill:#004494"/><path d="M1032.4 798.89s-9.37-68 50.18-190.21 95.77-90.26 169.52-204.92c78.87-122.6 40.69-193.8 65.1-279.24S1405-3 1405-3" style="stroke:#fff;stroke-width:8px;fill:none"/></g></svg> +<svg data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2400 800"><defs><clipPath id="a"><path style="fill:none" d="M0-14.28h1483.5V800H0z"/></clipPath></defs><g style="clip-path:url(#a)"><path d="M0-.58v799.47L1111.18 800s-34.22-65.56-22.5-128.25c33.85-181.05 191.9-245.45 151.21-429.23C1199 57.76 1483.5-.58 1483.5-.58Z" style="fill:#17458f"/><path d="M1032.4 798.89s-9.37-68 50.18-190.21 95.77-90.26 169.52-204.92c78.87-122.6 40.69-193.8 65.1-279.24S1405-3 1405-3" style="stroke:#fff;stroke-width:8px;fill:none"/></g></svg> diff --git a/web/themes/ventuno/assets/js/responsive-tables.min.js b/web/themes/ventuno/assets/js/responsive-tables.min.js index 9e1cb8a092bb4afd79739de8498f32ab152e6b2c..cc7eb272960ae90066d015a185e4e9bf9b74391a 100644 --- a/web/themes/ventuno/assets/js/responsive-tables.min.js +++ b/web/themes/ventuno/assets/js/responsive-tables.min.js @@ -1,2 +1,2 @@ -!function(e){"function"==typeof define&&define.amd?define(e):e()}((function(){"use strict";((e,t)=>{e.behaviors.responsiveTables={attach(e){t("responsive-tables",document.querySelectorAll("#block-ventuno-content table"),e).forEach((e=>{const t=document.createElement("div");t.classList.add("table-responsive"),e.classList.add("table"),t.appendChild(e.cloneNode(!0)),e.replaceWith(t)}))}}})(Drupal,once)})); +!function(e){"function"==typeof define&&define.amd?define(e):e()}((function(){"use strict";((e,t)=>{e.behaviors.responsiveTables={attach(e){t("responsive-tables",document.querySelectorAll("#block-ventuno-content table"),e).forEach((e=>{if(e.parentNode.classList.contains("table-responsive"))return;const t=document.createElement("div");t.classList.add("table-responsive"),e.classList.add("table"),t.appendChild(e.cloneNode(!0)),e.replaceWith(t)}))}}})(Drupal,once)})); //# sourceMappingURL=responsive-tables.min.js.map diff --git a/web/themes/ventuno/src/js/responsive-tables.js b/web/themes/ventuno/src/js/responsive-tables.js index b897c5b0bbc32755cad1a8003174cc0858667326..40566294f724cda90b8e4e9f42e83ce5ed4a81e4 100644 --- a/web/themes/ventuno/src/js/responsive-tables.js +++ b/web/themes/ventuno/src/js/responsive-tables.js @@ -13,6 +13,10 @@ context ); tables.forEach((element) => { + // Skip tables generated by view. + if (element.parentNode.classList.contains("table-responsive")) { + return; + } const wrapper = document.createElement("div"); wrapper.classList.add("table-responsive"); element.classList.add("table"); diff --git a/web/themes/ventuno/src/scss/components/tile.scss b/web/themes/ventuno/src/scss/components/tile.scss index 391c2ea8e8d34318feed48808c86bc515082f64b..49cac5b6c00a718632c9f09fb6df148e283a778c 100644 --- a/web/themes/ventuno/src/scss/components/tile.scss +++ b/web/themes/ventuno/src/scss/components/tile.scss @@ -22,6 +22,7 @@ align-items: center; & img { max-height: 100%; + width: auto; margin-bottom: 0; } } diff --git a/web/themes/ventuno/src/scss/partials/overrides/_colors.scss b/web/themes/ventuno/src/scss/partials/overrides/_colors.scss index 72dde41d98c7e2d483ebb6a49ba1fd07aa94364e..29f4cee21188de0e15aa734ae30daf0bb59c862e 100644 --- a/web/themes/ventuno/src/scss/partials/overrides/_colors.scss +++ b/web/themes/ventuno/src/scss/partials/overrides/_colors.scss @@ -25,11 +25,6 @@ $gray-700: #555859; $gray-800: #3d3f40; $gray-900: #242626; -// EU/EC colors -$ec-blue: #004494; -$eu-blue: #1b4ac3; -$eu-light-blue: #f4f6fb; - // Joinup colors $joinup--green: #0aa198; $joinup--brown: #988a7f;