diff --git a/composer.json b/composer.json index 7b839c0da..cd89274e4 100644 --- a/composer.json +++ b/composer.json @@ -97,7 +97,7 @@ "https://www.drupal.org/project/entity_reference_revisions/issues/2937835": "https://www.drupal.org/files/issues/2021-03-26/entity_reference_revisions-field_formatter_label-2937835-36.patch" }, "openeuropa/oe_bootstrap_theme": { - "latest": "https://github.com/openeuropa/oe_bootstrap_theme/compare/1.0.0-beta4...1.x.diff" + "temporary ticket patch": "https://patch-diff.githubusercontent.com/raw/openeuropa/oe_bootstrap_theme/pull/250.diff" } }, "drupal-scaffold": { diff --git a/modules/oe_whitelabel_paragraphs/oe_whitelabel_paragraphs.module b/modules/oe_whitelabel_paragraphs/oe_whitelabel_paragraphs.module index 143bea034..e7e824d0a 100644 --- a/modules/oe_whitelabel_paragraphs/oe_whitelabel_paragraphs.module +++ b/modules/oe_whitelabel_paragraphs/oe_whitelabel_paragraphs.module @@ -226,11 +226,10 @@ function oe_whitelabel_preprocess_paragraph__oe_list_item_block(array &$variable $card_badges[] = $meta_item->value; } - $card_title = $card_paragraph->get('field_oe_title')->value; /** @var \Drupal\link\LinkItemInterface|null $card_link_item */ $card_link_item = $card_paragraph->get('field_oe_link')->first(); $variables['items'][] = [ - 'title' => $card_title, + 'title' => $card_paragraph->get('field_oe_title')->value, 'url' => $card_link_item ? $card_link_item->getUrl() : '', 'text' => $card_paragraph->get('field_oe_text_long')->value, 'image' => $card_image, diff --git a/modules/oe_whitelabel_paragraphs/tests/src/Kernel/Paragraphs/ListingParagraphsTest.php b/modules/oe_whitelabel_paragraphs/tests/src/Kernel/Paragraphs/ListingParagraphsTest.php index f0e291872..5ef21e0b9 100644 --- a/modules/oe_whitelabel_paragraphs/tests/src/Kernel/Paragraphs/ListingParagraphsTest.php +++ b/modules/oe_whitelabel_paragraphs/tests/src/Kernel/Paragraphs/ListingParagraphsTest.php @@ -36,7 +36,6 @@ protected function setUp(): void { * Test List Items Block paragraph rendering. */ public function testListing(): void { - // Create a sample media entity to be embedded. $image_file = File::create([ 'uri' => $this->getTestFiles('image')[0]->uri, @@ -50,7 +49,6 @@ public function testListing(): void { ]); $node = $this->createNode([ - 'created' => 1636977600, 'type' => 'article', ]); $nid = (int) $node->id(); @@ -75,8 +73,7 @@ public function testListing(): void { $assert->assertDefaultListingRendering($crawler, $image_file); $this->assertCount(1, $crawler->filter('div.bcl-listing--default-1-col')); $this->assertCount(1, $crawler->filter('div.row.row-cols-1')); - $this->assertCount(6, $crawler->filter('div.col-md-3.col-lg-2.rounded')); - $this->assertCount(6, $crawler->filter('div.col-md-9.col-lg-10')); + $this->assertCount(6, $crawler->filter('div.card-body')); // Testing Default 2 col. $paragraph->get('field_oe_list_item_block_layout')->setValue('two_columns'); @@ -88,9 +85,8 @@ public function testListing(): void { $assert->assertListingRendering($crawler, $nid); $assert->assertDefaultListingRendering($crawler, $image_file); $this->assertCount(1, $crawler->filter('div.bcl-listing--default-2-col')); - $this->assertCount(1, $crawler->filter('div.row.row-cols-1.row-cols-md-2')); - $this->assertCount(6, $crawler->filter('div.col-xl-3.col-md-5')); - $this->assertCount(6, $crawler->filter('div.col-xl-9.col-md-7')); + $this->assertCount(1, $crawler->filter('div.row.row-cols-1')); + $this->assertCount(6, $crawler->filter('div.card-body')); // Testing Default 3 col. $paragraph->get('field_oe_list_item_block_layout')->setValue('three_columns'); @@ -102,9 +98,8 @@ public function testListing(): void { $assert->assertListingRendering($crawler, $nid); $assert->assertDefaultListingRendering($crawler, $image_file); $this->assertCount(1, $crawler->filter('div.bcl-listing--default-3-col')); - $this->assertCount(1, $crawler->filter('div.row.row-cols-1.row-cols-md-2.row-cols-xl-3')); - $this->assertCount(6, $crawler->filter('div.col-lg-4.col-md-6')); - $this->assertCount(6, $crawler->filter('div.col-lg-8.col-md-6')); + $this->assertCount(1, $crawler->filter('div.row.row-cols-1')); + $this->assertCount(6, $crawler->filter('div.card-body')); // Testing Highlight 1 col. $paragraph->get('oe_paragraphs_variant')->setValue('highlight'); @@ -118,7 +113,6 @@ public function testListing(): void { $assert->assertHighlightListingRendering($crawler, $image_file); $this->assertCount(1, $crawler->filter('div.bcl-listing--highlight-1-col')); $this->assertCount(1, $crawler->filter('div.row.row-cols-1')); - $this->assertCount(6, $crawler->filter('div.col.mt-4-5')); $this->assertCount(6, $crawler->filter('div.card-body')); // Testing Highlight 2 col. @@ -174,7 +168,6 @@ protected function createListItems(File $image_file, Node $node): array { 'alt' => 'Alt for image ' . $i, 'target_id' => $image_file->id(), ], - 'field_oe_date' => '2011-11-13', 'field_oe_meta' => [ 0 => [ 'value' => 'Label 1 - ' . $i, diff --git a/modules/oe_whitelabel_paragraphs/tests/src/Kernel/PatternAssertions/ListingAssertion.php b/modules/oe_whitelabel_paragraphs/tests/src/Kernel/PatternAssertions/ListingAssertion.php index 5217906dc..a1e9728b2 100644 --- a/modules/oe_whitelabel_paragraphs/tests/src/Kernel/PatternAssertions/ListingAssertion.php +++ b/modules/oe_whitelabel_paragraphs/tests/src/Kernel/PatternAssertions/ListingAssertion.php @@ -59,14 +59,14 @@ public function assertListingRendering(Crawler $crawler, int $nid): void { $this->assertCount(6, $crawler->filter('div.row-cols-1.g-4 > div.col')); $this->assertStringContainsString('Listing item block title', trim($crawler->filter('h2.bcl-heading')->text())); $this->assertCount(6, $crawler->filter('h1.card-title')); - $link_element = $crawler->filter('a.text-underline-hover'); + $link_element = $crawler->filter('a.standalone'); $this->assertCount(6, $link_element); $this->assertStringContainsString( 'node/' . $nid, $link_element->attr('href') ); $text_element = $crawler->filter('div.card-text'); - $this->assertStringContainsString('Item title 1', trim($crawler->filter('h1.card-title > a.text-underline-hover')->text())); + $this->assertStringContainsString('Item title 1', trim($crawler->filter('h1.card-title > a.standalone')->text())); $this->assertStringContainsString('Label 1 - 1', trim($crawler->filter('span.badge')->eq(0)->text())); $this->assertStringContainsString('Label 2 - 1', trim($crawler->filter('span.badge')->eq(1)->text())); $this->assertStringContainsString(