Jdlrobson has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/117008

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/README.mediawiki
M tests/browser/features/login.feature
M tests/browser/features/step_definitions/login_steps.rb
M tests/browser/features/support/pages/login_page.rb
6 files changed, 22 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/08/117008/1

diff --git a/includes/skins/UserLoginMobileTemplate.php 
b/includes/skins/UserLoginMobileTemplate.php
index b43d1c10..25b6003 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,14 @@
                                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::openElement( 'div', array( 'class' => 
'mw-userlogin-help mw-ui-block' ) ) .
+                       wfMessage( 'userlogin-helplink' )->parse() .
+                       Html::closeElement( 'div' ) .
+                       $signupLink .
                        Html::closeElement( 'div' );
                echo $login;
                $this->renderGuiderMessage();
diff --git a/less/specials/userlogin.less b/less/specials/userlogin.less
index 79808c3..52d2300 100644
--- a/less/specials/userlogin.less
+++ b/less/specials/userlogin.less
@@ -20,6 +20,12 @@
                }
        }
 
+       // FIXME: Remove when mw-ui in MobileFrontend
+       .mw-ui-block {
+               display: block;
+               text-align: center;
+       }
+
        .headmsg {
                background-color: #eee;
                border: 1px solid #ccc;
@@ -43,12 +49,6 @@
        input {
                width: 100%;
                display: block;
-       }
-
-       .mw-mf-create-account {
-               padding-top: 12px;
-               display: block;
-               text-align: center;
        }
 }
 
diff --git a/tests/browser/README.mediawiki b/tests/browser/README.mediawiki
index 6e40c04..9831f05 100644
--- a/tests/browser/README.mediawiki
+++ b/tests/browser/README.mediawiki
@@ -4,6 +4,7 @@
 [https://bugzilla.wikimedia.org/show_bug.cgi?id=56057 bug 56057].
 
 These include:
+* Create the page "Help:Logging_in" with text "42".
 * Sitename needs to be set to Wikipedia (for purpose of 
login_required_uploads.feature)
 * Create an account Selenium_newuser which has an edit count of 0
 * Create an account and store the username in MEDIAWIKI_USER which has
diff --git a/tests/browser/features/login.feature 
b/tests/browser/features/login.feature
index 3ac3a9b..6afb2d1 100644
--- a/tests/browser/features/login.feature
+++ b/tests/browser/features/login.feature
@@ -12,3 +12,9 @@
     When I go to the login 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
+
+  @wip
+  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 20a4e27..bec0f28 100644
--- a/tests/browser/features/step_definitions/login_steps.rb
+++ b/tests/browser/features/step_definitions/login_steps.rb
@@ -14,3 +14,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 1b3a404..0997bce 100644
--- a/tests/browser/features/support/pages/login_page.rb
+++ b/tests/browser/features/support/pages/login_page.rb
@@ -17,6 +17,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 a")
 
   def logged_in_as_element
     @browser.div(id: "mw-content-text").p.b

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I95ee43ab87912156150e3b7cc8826aa235adbe74
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <[email protected]>

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

Reply via email to