jenkins-bot has submitted this change and it was merged.

Change subject: Add password reset link from desktop on mobile
......................................................................


Add password reset link from desktop on mobile

Add QA test
Move the create account and help logging in link out of the form to have more
generic styling for these identical components (form already has bottom padding)

Bug: 61171
Change-Id: I95ee43ab87912156150e3b7cc8826aa235adbe74
---
M includes/skins/UserLoginMobileTemplate.php
M less/specials/userlogin.less
M tests/browser/features/login.feature
M tests/browser/features/step_definitions/login_steps.rb
M tests/browser/features/support/pages/login_page.rb
5 files changed, 23 insertions(+), 8 deletions(-)

Approvals:
  MaxSem: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/skins/UserLoginMobileTemplate.php 
b/includes/skins/UserLoginMobileTemplate.php
index b43d1c10..6cd9673 100644
--- a/includes/skins/UserLoginMobileTemplate.php
+++ b/includes/skins/UserLoginMobileTemplate.php
@@ -47,7 +47,7 @@
 
                $signupLink = Linker::link( SpecialPage::getTitleFor( 
'Userlogin' ),
                        wfMessage( 'mobile-frontend-main-menu-account-create' 
)->text(),
-                       array( 'class'=> 'mw-mf-create-account' ), $query );
+                       array( 'class'=> 'mw-mf-create-account mw-ui-block' ), 
$query );
 
                $login = Html::openElement( 'div', array( 'id' => 
'mw-mf-login', 'class' => 'content' ) );
 
@@ -79,11 +79,16 @@
                                array( 'id' => 'wpLoginAttempt',
                                        'class' => 'mw-ui-button 
mw-ui-constructive',
                                        'tabindex' => '3' ) ) .
-                       $signupLink .
                        Html::input( 'wpLoginToken', $token, 'hidden' ) .
                        Html::input( 'watch', $watchArticle, 'hidden' ) .
                        $stickHTTPS .
                        Html::closeElement( 'form' ) .
+                       Html::element( 'a', array(
+                                       'class' => 'mw-userlogin-help 
mw-ui-block',
+                                       'href' => SpecialPage::getTitleFor( 
'PasswordReset' )->getLocalUrl(),
+                               ),
+                               wfMessage( 'passwordreset' ) ) .
+                       $signupLink .
                        Html::closeElement( 'div' );
                echo $login;
                $this->renderGuiderMessage();
diff --git a/less/specials/userlogin.less b/less/specials/userlogin.less
index 79808c3..e69e982 100644
--- a/less/specials/userlogin.less
+++ b/less/specials/userlogin.less
@@ -20,6 +20,13 @@
                }
        }
 
+       // FIXME: Remove when mw-ui in MobileFrontend
+       .mw-ui-block {
+               display: block;
+               text-align: center;
+               padding-bottom: 12px;
+       }
+
        .headmsg {
                background-color: #eee;
                border: 1px solid #ccc;
@@ -43,12 +50,6 @@
        input {
                width: 100%;
                display: block;
-       }
-
-       .mw-mf-create-account {
-               padding-top: 12px;
-               display: block;
-               text-align: center;
        }
 }
 
diff --git a/tests/browser/features/login.feature 
b/tests/browser/features/login.feature
index 22bda12..5d01c3e 100644
--- a/tests/browser/features/login.feature
+++ b/tests/browser/features/login.feature
@@ -13,3 +13,8 @@
       And I am on the "Special:UserLogin" page
     Then I do not see a message box at the top of the login page
       And I see a message warning me I am already logged in
+
+  Scenario: Password reset available
+    Given I am logged into the mobile website
+    When I go to the login page
+    Then I see a password reset link
diff --git a/tests/browser/features/step_definitions/login_steps.rb 
b/tests/browser/features/step_definitions/login_steps.rb
index 378a4f8..bfb49b8 100644
--- a/tests/browser/features/step_definitions/login_steps.rb
+++ b/tests/browser/features/step_definitions/login_steps.rb
@@ -18,3 +18,6 @@
   on(LoginPage).warning_box_element.should_not be_visible
 end
 
+Then(/^I see a password reset link$/) do
+   on(LoginPage).password_reset_element.should be_visible
+end
diff --git a/tests/browser/features/support/pages/login_page.rb 
b/tests/browser/features/support/pages/login_page.rb
index b718b91..2a94d80 100644
--- a/tests/browser/features/support/pages/login_page.rb
+++ b/tests/browser/features/support/pages/login_page.rb
@@ -19,6 +19,7 @@
   a(:create_account_link, text: "Create account")
   div(:message_box, class:"headmsg")
   div(:warning_box, class:"alert warning")
+  a(:password_reset, css:".mw-userlogin-help")
 
   def login_with(username, password)
     # deal with autocomplete

-- 
To view, visit https://gerrit.wikimedia.org/r/117008
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I95ee43ab87912156150e3b7cc8826aa235adbe74
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <[email protected]>
Gerrit-Reviewer: Awjrichards <[email protected]>
Gerrit-Reviewer: JGonera <[email protected]>
Gerrit-Reviewer: Jdlrobson <[email protected]>
Gerrit-Reviewer: Kaldari <[email protected]>
Gerrit-Reviewer: MaxSem <[email protected]>
Gerrit-Reviewer: Swalling <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to