Commit ea0cece0 authored by Ghislain Loas's avatar Ghislain Loas
Browse files

dev #156524 search result and items list now use grid layout instead of wall

parent 631e54f3
Pipeline #17523 passed with stage
in 25 minutes and 12 seconds
......@@ -114,4 +114,8 @@ vous devez procéder à l'étape d'installation de chacune d'elle.
- 8.0.154 - 20/03/2022 : Suite à une amélioration RGAA des thèmes du magasin de thèmes,
les tag "a" servant à afficher un dropdown ont été modifiés en
tag "button".
\ No newline at end of file
tag "button".
- 8.0.158 - 31/05/2020 : Suite à une amélioration de l'ergonomie, le résultat de recherche
et la liste des exemplaires dans le magasin de thèmes passent de
l'affichage mur à l'affichage grille.
\ No newline at end of file
- correctif #156524 : Magasin de thèmes : le résultat de recherche et la liste des exemplaires passent par défaut de l'affichage mur à l'affichage grille.
\ No newline at end of file
......@@ -148,10 +148,10 @@ abstract class Intonation_View_RenderRecord_RenderItemsStrategy {
protected function _renderItemsHTMLInner(array $items) : string {
return ($this->_view->newHelper('RenderWall'))
->renderWall($this->_initCollection($this->_sortItems($items),
$this->_getItemWrapper()),
fn($element) => $this->_view->renderingDescription($element));
return ($this->_view->newHelper('RenderWallGrid'))
->renderWallGrid($this->_initCollection($this->_sortItems($items),
$this->_getItemWrapper()),
fn($element) => $this->_view->renderingDescription($element));
}
......@@ -204,7 +204,7 @@ abstract class Intonation_View_RenderRecord_RenderItemsStrategy {
return
$this->_view->renderPaginatedCollection($collection,
Intonation_Library_Widget_Carousel_Definition::WALL,
Intonation_Library_Widget_Carousel_Definition::GRID,
Intonation_Library_Widget_Carousel_Definition::CARD_DESCRIPTION,
Class_Profil_ItemsSettings::current()->getPaginationThreshold());
}
......@@ -237,7 +237,7 @@ abstract class Intonation_View_RenderRecord_RenderItemsStrategy {
Intonation_Library_Widget_Carousel_Definition::CARD_DESCRIPTION,
Class_Profil_ItemsSettings::current()->getPaginationThreshold(),
$secondary_collection,
Intonation_Library_Widget_Carousel_Definition::WALL,
Intonation_Library_Widget_Carousel_Definition::GRID,
Intonation_Library_Widget_Carousel_Definition::CARD_DESCRIPTION);
return $html;
......
......@@ -274,15 +274,15 @@ class Intonation_View_Search_Result extends ZendAfi_View_Helper_BaseHelper {
protected function _renderWall(array $records) : string {
// Strictly use this helper to avoid Chili_View_RenderWall
$helper = (new Intonation_View_RenderWall)
// Strictly use this helper to avoid Chili_View_RenderWallGrid
$helper = (new Intonation_View_RenderWallGrid)
->setView($this->view);
return $helper->renderWall(new Storm_Collection($records),
function($wrapped)
{
return $this->view->renderingVertical($wrapped);
});
return $helper->renderWallGrid(new Storm_Collection($records),
function($wrapped)
{
return $this->view->renderingVertical($wrapped);
});
}
......
......@@ -85,16 +85,14 @@ class ChiliItemsDispatchTest extends AbstractControllerTestCase {
/** @test */
public function sameWorkItemsTitleShouldBeDisplay() {
$this->assertXPathContentContains('//div[@class="same_work_items col-12 mt-3"]/h3',
utf8_encode('Exemplaires de la même œuvre'),
$this->_response->getBody());
utf8_encode('Exemplaires de la même œuvre'));
}
/** @test */
public function itemsMasonryIdShouldBeFirstUniqid() {
$this->assertXPath('//div[@class="items_wall col-12"]'
. '//div[@id="' . $this->_uniqids[0] . '"][@class="masonry"]',
$this->_response->getBody());
. '//div[@id="' . $this->_uniqids[0] . '"][@class="masonry masonry_grid"]');
}
......@@ -110,7 +108,7 @@ class ChiliItemsDispatchTest extends AbstractControllerTestCase {
public function sameWorkMasonryIdShouldBeSecondUniqid() {
$this->assertXPath('//div[@class="same_work_items col-12 mt-3"]'
. '//div[@class="same_work_items_collection col-12"]'
. '//div[@id="' . $this->_uniqids[1] . '"][@class="masonry"]');
. '//div[@id="' . $this->_uniqids[1] . '"][@class="masonry masonry_grid"]');
}
......
......@@ -292,7 +292,7 @@ class TemplatesSearchItems15ItemsPaginationThreshold5AndAvailabilityKohaLimit9Te
/** @test */
public function shouldDisplay5ItemsInWallHasCardDescription() {
$this->assertXPathCount('//div[@class="masonry"]//div[@class="masonry-brick"]//div[contains(@class, "card card_template")]//div[contains(@class,"card-title card_title")]',
$this->assertXPathCount('//div[@class="masonry masonry_grid"]//div[@class="masonry-brick"]//div[contains(@class, "card card_template")]//div[contains(@class,"card-title card_title")]',
5);
}
......@@ -1026,7 +1026,7 @@ class TemplatesSearchItems15ItemsPaginationThreshold12AndAvailabilityKohaLimit1A
/** @test */
public function paginatedMasonryShouldBePresent() {
$this->assertXPath('//div[@class="container-fluid"]/div[@class="row no-gutters"]/div[@class="paginated_secondary_collection col-12 mt-3 list-group bg-transparent no_border"]/div[contains(@class, "masonry")]');
$this->assertXPath('//div[@class="container-fluid"]/div[@class="row no-gutters"]/div[@class="paginated_secondary_collection col-12 mt-3 list-group bg-transparent no_border"]/div[@class="masonry masonry_grid"]');
}
......
......@@ -840,7 +840,7 @@ class TemplatesSearchDispatchWithWallDefaultRenderingTest extends TemplatesSearc
/** @test */
public function defaultRenderingShouldBeListMode() {
$this->assertXPath('//main//div[contains(@class,"search_records_col")]//div[contains(@class, "masonry")]//div[contains(@class, "card")]');
$this->assertXPath('//main//div[contains(@class,"search_records_col")]//div[@class= "masonry masonry_grid"]//div[contains(@class, "card")]');
}
/** @test */
......@@ -1101,7 +1101,7 @@ class TemplatesSearchDispatchWallModeRenderingInChiliTest extends TemplatesSearc
/** @test */
public function renderingShouldBeWallModeMasonry() {
$this->assertXPath('//main//div[contains(@class,"search_records_col")]//div[contains(@class, "masonry")]//div[contains(@class, "card")]');
$this->assertXPath('//main//div[contains(@class,"search_records_col")]//div[@class= "masonry masonry_grid"]//div[contains(@class, "card")]');
}
......
Markdown is supported
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