From 2933fa7769647f1c05286886865688010987fa53 Mon Sep 17 00:00:00 2001 From: gloas <gloas@afi-sa.fr> Date: Thu, 28 Jan 2021 16:35:02 +0100 Subject: [PATCH] hotline MT #126999 improve login form responsive behavior --- VERSIONS_HOTLINE/126999 | 1 + library/templates/Intonation/Library/Settings.php | 3 ++- library/templates/Intonation/View/RenderLogin.php | 5 ++--- tests/scenarios/Templates/ChiliTest.php | 10 ++++++++-- tests/scenarios/Templates/TemplatesAbonneTest.php | 4 ++-- .../Templates/TemplatesAdvancedSearchTest.php | 2 +- tests/scenarios/Templates/TemplatesAgendaTest.php | 3 +-- .../Templates/TemplatesAuthLoginTest.php | 6 ++++++ .../TemplatesDispatchIntonationScriptsTest.php | 2 +- tests/scenarios/Templates/TemplatesFormTest.php | 2 +- tests/scenarios/Templates/TemplatesFreeTest.php | 3 +-- .../scenarios/Templates/TemplatesRecordsTest.php | 3 +-- tests/scenarios/Templates/TemplatesSearchTest.php | 2 +- tests/scenarios/Templates/TemplatesTest.php | 15 +++++++-------- .../Templates/TemplatesWidgetInMenusTest.php | 3 +-- tests/scenarios/Templates/TemplatesWidgetTest.php | 15 ++++++--------- 16 files changed, 42 insertions(+), 37 deletions(-) create mode 100644 VERSIONS_HOTLINE/126999 diff --git a/VERSIONS_HOTLINE/126999 b/VERSIONS_HOTLINE/126999 new file mode 100644 index 00000000000..e7f987e1366 --- /dev/null +++ b/VERSIONS_HOTLINE/126999 @@ -0,0 +1 @@ + - ticket #126999 : Magasin de thèmes : amélioration de l'affichage du formulaire d'authentification. \ No newline at end of file diff --git a/library/templates/Intonation/Library/Settings.php b/library/templates/Intonation/Library/Settings.php index dc89576cba0..15c6ad382e3 100644 --- a/library/templates/Intonation/Library/Settings.php +++ b/library/templates/Intonation/Library/Settings.php @@ -190,7 +190,8 @@ class Intonation_Library_Settings extends Intonation_System_Abstract { 'div class search_no_records_col' => 'col-12 order-6', 'div class search_tools_col_2' => 'col-12 border-top border-bottom pt-2 mb-2 order-7', - 'form class login' => 'row no-gutters', + 'form class login' => 'row no-gutters col-md-6 col-xl-4 m-auto', + 'h2 class login_header' => 'col-12', 'div class wrapper_zendafi_form_login_username' => 'col-12 order-1', 'div class wrapper_zendafi_form_login_password' => 'col-12 order-2', diff --git a/library/templates/Intonation/View/RenderLogin.php b/library/templates/Intonation/View/RenderLogin.php index f53196e79f2..9f5ef7a384a 100644 --- a/library/templates/Intonation/View/RenderLogin.php +++ b/library/templates/Intonation/View/RenderLogin.php @@ -32,9 +32,8 @@ class Intonation_View_RenderLogin extends ZendAfi_View_Helper_BaseHelper { protected function _renderTitle($title) { return $this->_tag('h2', - Class_Template::current()->getIco($this->view, 'login', 'utils') - . ' ' . $title, - ['class' => 'col-md-6 col-sm-12']); + $this->view->templateIco('login', 'utils') . ' ' . $title, + ['class' => 'login_header']); } diff --git a/tests/scenarios/Templates/ChiliTest.php b/tests/scenarios/Templates/ChiliTest.php index 9de5be0f68b..1ab444e91f8 100644 --- a/tests/scenarios/Templates/ChiliTest.php +++ b/tests/scenarios/Templates/ChiliTest.php @@ -665,10 +665,16 @@ class ChiliTemplateNotLoggedTest extends ChiliTemplateTestCase { /** @test */ public function inputLoginShouldBeHydratedWithOrder3() { - $this->assertXPath('//form/input[@id="login"][@class= "zendafi_form_login_login btn btn-sm btn-primary order-3 my-3"]', - $this->_response->getBody()); + $this->assertXPath('//form/input[@id="login"][@class= "zendafi_form_login_login btn btn-sm btn-primary order-3 my-3"]'); } + + /** @test */ + public function loginFormShouldBeHydratedWithColMd6ColXl4AndMAuto() { + $this->assertXPath('//form[@class="login form row no-gutters col-md-6 col-xl-4 m-auto"]/input[@id="login"]'); + } + + /** @test */ public function searchWidgetShouldBeInMenu() { $this->assertXPath('//header//div[contains(@class, "boite menu")][contains(@class, "d-none")]//div[contains(@class, "navbar-collapse")]//div[contains(@class, "boite rech_simple")][contains(@class, "chili_widget")]'); diff --git a/tests/scenarios/Templates/TemplatesAbonneTest.php b/tests/scenarios/Templates/TemplatesAbonneTest.php index e996753107f..ead177fed97 100644 --- a/tests/scenarios/Templates/TemplatesAbonneTest.php +++ b/tests/scenarios/Templates/TemplatesAbonneTest.php @@ -459,7 +459,7 @@ class TemplatesDispatchAbonneMonHistoriqueTest extends TemplatesIntonationAccoun /** @test */ public function pageShouldDisplayTitleMonHistoriqueDePrets() { - $this->assertXPathContentContains('//h2//span', 'Mon historique de prêts', $this->_response->getBody()); + $this->assertXPathContentContains('//h2//span', 'Mon historique de prêts'); } } @@ -520,7 +520,7 @@ class TemplatesDispatchAbonneLoansWithHistoryTest extends TemplatesIntonationAcc /** @test */ public function pageShouldContainsPottifar() { - $this->assertXPathContentContains('//div','Pottifar', $this->_response->getBody()); + $this->assertXPathContentContains('//div','Pottifar'); } } diff --git a/tests/scenarios/Templates/TemplatesAdvancedSearchTest.php b/tests/scenarios/Templates/TemplatesAdvancedSearchTest.php index e7fc7d38a37..6bfd18266bd 100644 --- a/tests/scenarios/Templates/TemplatesAdvancedSearchTest.php +++ b/tests/scenarios/Templates/TemplatesAdvancedSearchTest.php @@ -81,7 +81,7 @@ class TemplatesAdvancedSearchWithProfilRedirectTest extends TemplatesAdvancedSea /** @test */ public function formActionShouldContainsIdProfilThree() { - $this->assertXPath('//form[contains(@action, "/form_id/advanced_form/id_profil/3")]',$this->_response->getBody()); + $this->assertXPath('//form[contains(@action, "/form_id/advanced_form/id_profil/3")]'); } } diff --git a/tests/scenarios/Templates/TemplatesAgendaTest.php b/tests/scenarios/Templates/TemplatesAgendaTest.php index a91c134967c..947be47b319 100644 --- a/tests/scenarios/Templates/TemplatesAgendaTest.php +++ b/tests/scenarios/Templates/TemplatesAgendaTest.php @@ -111,7 +111,6 @@ class TemplatesAgendaWidgetWithSessionActivityAndRightRegisterTest /** @test */ public function pageShouldContainsLinkToGererLesInscriptions() { $this->assertXPathContentContains('//a[contains(@href, "admin/session-activity/inscriptions/id/12")][@target="_blank"]', - 'Gérer les inscriptions', - $this->_response->getBody()); + 'Gérer les inscriptions'); } } \ No newline at end of file diff --git a/tests/scenarios/Templates/TemplatesAuthLoginTest.php b/tests/scenarios/Templates/TemplatesAuthLoginTest.php index fb6e4ed1114..c9d436bcb3b 100644 --- a/tests/scenarios/Templates/TemplatesAuthLoginTest.php +++ b/tests/scenarios/Templates/TemplatesAuthLoginTest.php @@ -70,4 +70,10 @@ class TemplatesAuthLoginWidgetTest extends TemplatesIntonationTestCase { public function shouldContainTitleMonCompte() { $this->assertXPathContentContains('//div[@data-action="auth_login"]//h2', 'Se connecter'); } + + + /** @test */ + public function loginHeaderShouldHaveClassCol12() { + $this->assertXPathContentContains('//h2[@class="login_header col-12"]', 'Se connecter'); + } } \ No newline at end of file diff --git a/tests/scenarios/Templates/TemplatesDispatchIntonationScriptsTest.php b/tests/scenarios/Templates/TemplatesDispatchIntonationScriptsTest.php index 4c73bb9fb0d..9d01d860940 100644 --- a/tests/scenarios/Templates/TemplatesDispatchIntonationScriptsTest.php +++ b/tests/scenarios/Templates/TemplatesDispatchIntonationScriptsTest.php @@ -46,7 +46,7 @@ class TemplatesDispatchIntonationScriptsTest extends TemplatesIntonationTestCase /** @test */ public function JSSTATshouldBeDisplayedInFooter() { - $this->assertXPathContentContains('//script', 'UA-41754005-1', $this->_response->getBody()); + $this->assertXPathContentContains('//script', 'UA-41754005-1'); } diff --git a/tests/scenarios/Templates/TemplatesFormTest.php b/tests/scenarios/Templates/TemplatesFormTest.php index 6e4f5835b0f..d9ea1fb257d 100644 --- a/tests/scenarios/Templates/TemplatesFormTest.php +++ b/tests/scenarios/Templates/TemplatesFormTest.php @@ -113,6 +113,6 @@ class TemplatesFormPreRegistrationWithConditionsTest extends TemplatesFormPreReg /** @test */ public function formChekBoxLabelShouldntBeEscaped() { - $this->assertXpathContentContains('//label//a[@href="#"]','Vous devez accepter les conditions de validation',$this->_response->getBody()); + $this->assertXpathContentContains('//label//a[@href="#"]','Vous devez accepter les conditions de validation'); } } diff --git a/tests/scenarios/Templates/TemplatesFreeTest.php b/tests/scenarios/Templates/TemplatesFreeTest.php index bcbe556fb7c..b3650df8e7e 100644 --- a/tests/scenarios/Templates/TemplatesFreeTest.php +++ b/tests/scenarios/Templates/TemplatesFreeTest.php @@ -87,8 +87,7 @@ class TemplatesFreeWidgetIndexTest extends TemplatesFreeWidgetTestCase { /** @test */ public function widgetOneShouldHaveLinkToAddNewArticle() { $this->assertXPathContentContains('//a[contains(@href, "admin/cms/add")]', - 'Ajouter un nouvel article', - $this->_response->getBody()); + 'Ajouter un nouvel article'); } diff --git a/tests/scenarios/Templates/TemplatesRecordsTest.php b/tests/scenarios/Templates/TemplatesRecordsTest.php index 1d9057b3803..d57296115a3 100644 --- a/tests/scenarios/Templates/TemplatesRecordsTest.php +++ b/tests/scenarios/Templates/TemplatesRecordsTest.php @@ -54,8 +54,7 @@ class TemplatesRecordsWidgetTestCase extends Admin_AbstractControllerTestCase { /** @test */ public function widgetKioskShouldContainsTruncatedSummaryUneBonneBDDotDotDot() { $this->assertXPathContentContains('//div[contains(@class, "boite kiosque")]//p[@class="model_description_Class_Notice"]', - 'Une bonne BD …', - $this->_response->getBody()); + 'Une bonne BD …'); } } diff --git a/tests/scenarios/Templates/TemplatesSearchTest.php b/tests/scenarios/Templates/TemplatesSearchTest.php index da85a29e69d..3e700ff0012 100644 --- a/tests/scenarios/Templates/TemplatesSearchTest.php +++ b/tests/scenarios/Templates/TemplatesSearchTest.php @@ -407,7 +407,7 @@ class TemplatesSearchDispatchIntonationSearchListFormatWallTest extends Template /** @test */ public function facetsBlocksShouldContainsOnclickToggleClassFacetBlockClosed() { - $this->assertXPathContentContains('//form[contains(@class, "form_facets")]//ul/li[contains(@class, "facette_titre facet_type_A facet_block_toggle_visibility facet_block_closed")]/b[contains(@onclick, "$(this).parent().toggleClass(\'facet_block_closed\');")]', 'Auteur', $this->_response->getBody()); + $this->assertXPathContentContains('//form[contains(@class, "form_facets")]//ul/li[contains(@class, "facette_titre facet_type_A facet_block_toggle_visibility facet_block_closed")]/b[contains(@onclick, "$(this).parent().toggleClass(\'facet_block_closed\');")]', 'Auteur'); } } diff --git a/tests/scenarios/Templates/TemplatesTest.php b/tests/scenarios/Templates/TemplatesTest.php index faf10cddf1d..59730317d81 100644 --- a/tests/scenarios/Templates/TemplatesTest.php +++ b/tests/scenarios/Templates/TemplatesTest.php @@ -527,7 +527,7 @@ class TemplatesDispatchIntonationTest extends TemplatesIntonationTestCase { /** @test */ public function navShouldContainsSearchDotGif() { - $this->assertXPath('//body//nav//img[contains(@src, "agenda.gif")][contains(@alt, "image de calendrier")]', $this->_response->getBody()); + $this->assertXPath('//body//nav//img[contains(@src, "agenda.gif")][contains(@alt, "image de calendrier")]'); } @@ -1118,7 +1118,7 @@ class TemplatesDispatchIntonationUnloggedWithToggleLoginTest extends TemplatesIn * @see http://forge.afi-sa.fr/issues/112372 **/ public function formChildDivShouldNotHaveRowClass() { - $this->assertNotXPath('//div[contains(@class,"boite login")]//form//div[contains(@class, "row")]', $this->_response->getBody()); + $this->assertNotXPath('//div[contains(@class,"boite login")]//form//div[contains(@class, "row")]'); } } @@ -1144,13 +1144,13 @@ class TemplatesDispatchIntonationWithHiddenSectionTest extends TemplatesIntonati /** @test */ public function sectionHeaderShouldNotBeVisible() { - $this->assertNotXPath('//header', $this->_response->getBody()); + $this->assertNotXPath('//header'); } /** @test */ public function sectionMainShouldBeVisible() { - $this->assertXPath('//main', $this->_response->getBody()); + $this->assertXPath('//main'); } } @@ -1805,8 +1805,7 @@ class TemplatesDispatchProfilIndexTest extends TemplatesIntonationTestCase { Class_Profil::getPortail()->setIdSite(1)->save(); Class_Profil::find(72)->setIdSite(1)->save(); $this->dispatch('/admin/profil/index'); - $this->assertXPath('//a[contains(@href, "/admin/profil/promote/id_profil/72")]', - $this->_response->getBody()); + $this->assertXPath('//a[contains(@href, "/admin/profil/promote/id_profil/72")]'); } } @@ -2307,13 +2306,13 @@ class TemplatesDispatchIntonationAuthLoginWithRedirectTest extends TemplatesInto /** @test */ public function formActionShouldContainsRedirectUrlMyBib() { - $this->assertXPath('//form[contains(@action, "/auth/login/id_profil/72/redirect/'.urlencode("http://mybib/modules/skilleos").'")]', $this->_response->getBody()); + $this->assertXPath('//form[contains(@action, "/auth/login/id_profil/72/redirect/'.urlencode("http://mybib/modules/skilleos").'")]'); } /** @test */ public function inputTypeHiddenShouldContainsRedirectUrlMyBib() { - $this->assertXPath('//input[@type="hidden"][@name="redirect"][@value="http://mybib/modules/skilleos"]', $this->_response->getBody()); + $this->assertXPath('//input[@type="hidden"][@name="redirect"][@value="http://mybib/modules/skilleos"]'); } } diff --git a/tests/scenarios/Templates/TemplatesWidgetInMenusTest.php b/tests/scenarios/Templates/TemplatesWidgetInMenusTest.php index 5668977f960..3fe689d77ff 100644 --- a/tests/scenarios/Templates/TemplatesWidgetInMenusTest.php +++ b/tests/scenarios/Templates/TemplatesWidgetInMenusTest.php @@ -40,8 +40,7 @@ class TemplatesWidgetInMenusNewsletterLoggedOutTest extends TemplatesIntonationT $this->dispatch('/opac/index/index/id_profil/7'); $this->assertXPathContentContains('//li[@class="nav-item"]//div[@id="boite_3-0"]//div[contains(@class, "widget-header")]', - 'Lettre d\'information : je m\'abonne', - $this->_response->getBody()); + 'Lettre d\'information : je m\'abonne'); } } diff --git a/tests/scenarios/Templates/TemplatesWidgetTest.php b/tests/scenarios/Templates/TemplatesWidgetTest.php index 8c3215a3d19..37bde30232e 100644 --- a/tests/scenarios/Templates/TemplatesWidgetTest.php +++ b/tests/scenarios/Templates/TemplatesWidgetTest.php @@ -53,8 +53,7 @@ class TemplatesWidgetsNewsletterTest extends TemplatesIntonationTestCase { 'contenu' => 'les nouveautés jeunesse']); $this->dispatch('/opac/abonne/fiche', true); - $this->assertXPathContentContains('//a[@href="/abonne/disable-newsletter"]', 'Ne plus recevoir de lettre d\'information', $this->_response->getBody()); - + $this->assertXPathContentContains('//a[@href="/abonne/disable-newsletter"]', 'Ne plus recevoir de lettre d\'information'); } } @@ -175,7 +174,7 @@ class TemplatesWidgetRenderAllContainersTest extends TemplatesWidgetRenderAllTes * @test */ public function withWidgetShouldRenderWidgetTitleInMainH1($widget_id, $content) { $this->dispatch('/opac/widget/render-all/profile_id/72/widget_id/' . $widget_id); - $this->assertXPathContentContains('//main//h1', $content, $this->_response->getBody()); + $this->assertXPathContentContains('//main//h1', $content); } @@ -315,7 +314,7 @@ class TemplatesWidgetFilterTest extends TemplatesWidgetRenderAllTestCase { /** @test */ public function eventLEteShouldBeDisplayedWithTownGrandAnnecySelected() { - $this->assertXPathContentContains('//div', 'L\'été', $this->_response->getBody()); + $this->assertXPathContentContains('//div', 'L\'été'); } @@ -521,8 +520,7 @@ class TemplatesWidgetLibraryWithOSMAndLinkToProfileTest extends TemplatesIntonat */ public function linkToDetailShouldTargetProfile123() { $this->assertXPathContentContains('//div[@id="boite_21"]//a[contains(@href, "/id_profil/123")]', - 'Annecy', - $this->_response->getBody()); + 'Annecy'); } } @@ -548,7 +546,7 @@ class TemplatesWidgetHiddenTest extends TemplatesIntonationTestCase { /** @test */ public function widgetLangueShouldNotBeVisible() { - $this->assertNotXPath('//div[contains(@class, "langue")]', $this->_response->getBody()); + $this->assertNotXPath('//div[contains(@class, "langue")]'); } } @@ -1258,8 +1256,7 @@ class TemplatesDispatchAdminWidgetEditActionRechercheViewNoticeTest extends Temp /** @test */ public function multiInputThumbnailZonesValuesShouldBeDisplayed() { $this->assertXPathContentContains('//script', - '"thumbnail_zone":["959","933"],"thumbnail_url":["3","3"]', - $this->_response->getBody()); + '"thumbnail_zone":["959","933"],"thumbnail_url":["3","3"]'); } } -- GitLab