Skip to content
Snippets Groups Projects
Commit 3bf826e6 authored by Ghislain Loas's avatar Ghislain Loas
Browse files

Merge branch...

Merge branch 'hotline#151811_magasin_de_theme_exemplaires_de_la_meme_oeuvre_ne_focntionne_pas' into 'master'

hotline #151811 fix same work items rendering in MT

See merge request !4374
parents 8d10d107 8c0d95f9
Branches
Tags
1 merge request!4374hotline #151811 fix same work items rendering in MT
Pipeline #16522 passed with stage
in 33 minutes and 25 seconds
- correctif #151811 : Magasin de thèmes : Correction de l'affichage des exemplaires de la même oeuvre dans la vue notice.
\ No newline at end of file
......@@ -208,6 +208,11 @@ abstract class Intonation_Library_View_Wrapper_RichContent_Section {
}
public function getId() : string {
return get_class($this);
}
abstract public function getTitle();
abstract public function getContent();
abstract public function getClass();
......
......@@ -48,9 +48,9 @@ class Intonation_View_RenderRecord_RenderItems extends ZendAfi_View_Helper_BaseH
if ($same_work) {
$html [] = $this->view->div(['class' => 'col-12 same_work_items'],
$this->view->tag('h3', $this->_('Exemplaires de la même œuvre')));
$html [] = $this->view->div(['class' => 'col-12'],
$this->_getHtmlItems($same_work));
$this->view->tag('h3', $this->_('Exemplaires de la même œuvre'))
. $this->view->div(['class' => 'col-12'],
$this->_getHtmlItems($same_work)));
}
return $this->view->grid(implode($html));
......@@ -90,7 +90,10 @@ class Intonation_View_RenderRecord_RenderItems extends ZendAfi_View_Helper_BaseH
->setModel($element);
}, $items)));
return $this->view->renderWall($elements, $callback);
$helper = $this->view->getHelper('RenderWall');
$helper->setView($this->view);
return $helper->renderWall($elements, $callback);
}
......
......@@ -32,7 +32,7 @@ class Intonation_View_RenderWall extends Intonation_View_Abstract_Layout {
public function init() {
$this->_masonry_id = uniqid();
$this->setIdModule(uniqid());
}
......@@ -40,6 +40,10 @@ class Intonation_View_RenderWall extends Intonation_View_Abstract_Layout {
if ($collection->isEmpty())
return '';
if ( $collection->first() instanceof Intonation_Library_View_Wrapper_Abstract)
$this->setIdModule(md5(json_encode(array_map(fn($item) => $item->getId(),
$collection->getArrayCopy()))));
$this->renderHeadScriptsOn(Class_ScriptLoader::getInstance());
$html = array_filter($collection
......
......@@ -33,15 +33,25 @@ class ChiliItemsDispatchTest extends AbstractControllerTestCase {
$this->_buildTemplateProfil(['id' => 3,
'template' => 'CHILI']);
$this->fixture('Class_Notice',
$this->fixture(Class_Notice::class,
['id' => 2,
'clef_oeuvre' => 'BABAR'
]);
$this->fixture('Class_Exemplaire',
$this->fixture(Class_Notice::class,
['id' => 5,
'clef_oeuvre' => 'BABAR']);
$this->fixture(Class_Exemplaire::class,
['id' => 1,
'id_notice' => 2
]);
$this->fixture(Class_Exemplaire::class,
['id' => 78,
'id_notice' => 5
]);
$this->dispatch('noticeajax/items-resources/id/2');
}
......@@ -51,6 +61,25 @@ class ChiliItemsDispatchTest extends AbstractControllerTestCase {
$this->assertXPathContentContains('//div[@class="items_hold_link col-12 p-3 my-3 text-center"]//a[contains(@href, "/recherche/reservation/id_int_bib/0/id_bib/0/id_notice/2")]',
utf8_encode('Réserver'));
}
/** @test */
public function sameWorkItemsTitleShouldBeDisplay() {
$this->assertXPathContentContains('//div[contains(@class, "same_work_items")]/h3',
utf8_encode('Exemplaires de la même œuvre'));
}
/** @test */
public function itemsMasonryIdShouldBe35dba5d75538a9bbe0b4da4422759a0e() {
$this->assertXPath('//div[contains(@class, "items_wall")]//div[@id="35dba5d75538a9bbe0b4da4422759a0e"][@class="masonry"]');
}
/** @test */
public function sameWorkMasonryIdShouldBeAde70204180a5ae01d9f07f4da362946() {
$this->assertXPath('//div[contains(@class, "same_work_items")]//div[@id="ade70204180a5ae01d9f07f4da362946"][@class="masonry"]');
}
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment