Glaisher has uploaded a new change for review.

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

Change subject: Convert Special:GlobalRenameRequest to OOUI
......................................................................

Convert Special:GlobalRenameRequest to OOUI

I also removed the help-message for the current username field
and email address field because it feels pretty self-explanatory
and redundant to me. The CSS has been removed so the field labels
are no longer bold faced because we don't that for other forms either.
The JS module has also been removed and instead of a popup, it now
shows the globalrenamerequest-email-why-explain message as a notice
generated on the PHP side.

Bug: T104299
Bug: T88214
Change-Id: I62a2c2ecab82652dbccb40d5605e429754f136ba
Depends-On: I512f3936bc3335df1bdf76505cfc39da6be99bed
---
M i18n/en.json
M i18n/qqq.json
M includes/CentralAuthHooks.php
M includes/specials/SpecialGlobalRenameRequest.php
D modules/ext.centralauth.globalrenamerequest.css
D modules/ext.centralauth.globalrenamerequest.js
6 files changed, 9 insertions(+), 74 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralAuth 
refs/changes/95/291595/1

diff --git a/i18n/en.json b/i18n/en.json
index b760439..6343d77 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -427,15 +427,12 @@
        "globalrenamerequest-forced": "The Wikimedia Foundation is 
[[:mw:SUL_finalisation|unifying usernames across all Wikimedia projects]]. This 
username was identified as being in use in other Wikimedia wikis and must be 
changed in order to finalize this unification. As a result, you must select a 
new username.",
        "globalrenamerequest-pretext" : "Request a new username to be known by 
across all projects.\n\nAll of your previous contributions will be connected 
with this new username.\n\nOnce you have requested a new username, a 
notification will be sent to Wikimedia stewards to perform the rename. You will 
be notified by email when this process is completed.",
        "globalrenamerequest-username-label": "Current username:",
-       "globalrenamerequest-username-help": "This is your username now.",
        "globalrenamerequest-newname-label": "Requested username:",
        "globalrenamerequest-newname-help": "Enter the new username you wish to 
use, e.g., \"$1\".",
        "globalrenamerequest-newname-err-invalid": "You have not specified a 
valid user name.",
        "globalrenamerequest-newname-err-taken": "Username entered already in 
use. Please choose a different name.",
        "globalrenamerequest-email-label": "Email address:",
-       "globalrenamerequest-email-help": "Enter your email address.",
-       "globalrenamerequest-email-why-label": "Why?",
-       "globalrenamerequest-email-why-explain": "<p>We need an email address 
during this process to ensure that you do not lose access to this 
account.</p><p>You can remove the email address after the rename process has 
completed.</p>",
+       "globalrenamerequest-email-why-explain": "We need an email address 
during this process to ensure that you do not lose access to this account.<br 
/>You can remove the email address after the rename process has completed.",
        "globalrenamerequest-email2-label": "Confirm email address:",
        "globalrenamerequest-email2-help": "Enter the same email address you 
entered above for confirmation.",
        "globalrenamerequest-email-mismatch": "Email addresses differ.<br 
/>Please check both and try again.",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 2d2476b..9cd2eae 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -443,15 +443,12 @@
        "globalrenamerequest-forced": "Explanation for users that are being 
forced to rename.\n\nFollowed by the message 
{{msg-mw|globalrenamerequest-pretext}}",
        "globalrenamerequest-pretext": "Instructions for rename process.",
        "globalrenamerequest-username-label": "Form field label.",
-       "globalrenamerequest-username-help": "Form field inline help.",
        "globalrenamerequest-newname-label": "Form field label.",
        "globalrenamerequest-newname-help": "Form field inline help.\n\n* $1 is 
a randomly generated username suggestion.",
        "globalrenamerequest-newname-err-invalid": "Used as error message.",
        "globalrenamerequest-newname-err-taken": "Used as error message.",
        "globalrenamerequest-email-label": "Form field 
label.\n{{Identical|E-mail address}}",
-       "globalrenamerequest-email-help": "Form field inline help.",
-       "globalrenamerequest-email-why-label": "Label for popup 
dialog.\n{{Identical|Why}}",
-       "globalrenamerequest-email-why-explain": "Message for popup dialog.",
+       "globalrenamerequest-email-why-explain": "Information message for email 
address field shown on Special:GlobalRenameRequest.",
        "globalrenamerequest-email2-label": "Form field label.",
        "globalrenamerequest-email2-help": "Form field inline help.",
        "globalrenamerequest-email-mismatch": "Error message shown when the 
user enters two different email addresses",
diff --git a/includes/CentralAuthHooks.php b/includes/CentralAuthHooks.php
index 76e3352..64b797c 100644
--- a/includes/CentralAuthHooks.php
+++ b/includes/CentralAuthHooks.php
@@ -97,24 +97,6 @@
                                'license-name' => 'GPL-2.0',
                        );
                        $wgSpecialPages['GlobalRenameRequest'] = 
'SpecialGlobalRenameRequest';
-                       
$wgResourceModules['ext.centralauth.globalrenamerequest'] = array(
-                               'scripts'       => array(
-                                       
'ext.centralauth.globalrenamerequest.js',
-                               ),
-                               'dependencies' => array( 'oojs-ui' ),
-                               'messages' => array(
-                                       'globalrenamerequest-email-why-label',
-                                       'globalrenamerequest-email-why-explain',
-                               ),
-                               'localBasePath' => "{$caBase}/modules",
-                               'remoteExtPath' => 'CentralAuth/modules',
-                       );
-                       
$wgResourceModules['ext.centralauth.globalrenamerequest.styles'] = array(
-                               'position'              => 'top',
-                               'styles'        => 
'ext.centralauth.globalrenamerequest.css',
-                               'localBasePath' => "{$caBase}/modules",
-                               'remoteExtPath' => 'CentralAuth/modules',
-                       );
 
                        $wgExtensionCredits['specialpage'][] = array(
                                'path' => "{$caBase}/CentralAuth.php",
diff --git a/includes/specials/SpecialGlobalRenameRequest.php 
b/includes/specials/SpecialGlobalRenameRequest.php
index ebada93..0160723 100644
--- a/includes/specials/SpecialGlobalRenameRequest.php
+++ b/includes/specials/SpecialGlobalRenameRequest.php
@@ -85,14 +85,6 @@
                                        );
                                        return;
                                }
-
-                               $out->addModuleStyles( array(
-                                       'mediawiki.ui',
-                                       'mediawiki.ui.button',
-                                       'mediawiki.ui.input',
-                                       
'ext.centralauth.globalrenamerequest.styles',
-                               ) );
-                               $out->addModules( 
'ext.centralauth.globalrenamerequest' );
                                parent::execute( $par );
                                break;
                }
@@ -119,7 +111,7 @@
         * @return string
         */
        protected function getDisplayFormat() {
-               return 'vform';
+               return 'ooui';
        }
 
        /**
@@ -142,7 +134,6 @@
                                'cssclass'      => 
'mw-globalrenamerequest-field',
                                'csshelpclass'  => 
'mw-globalrenamerequest-help',
                                'default'       => $this->getUser()->getName(),
-                               'help-message'  => 
'globalrenamerequest-username-help',
                                'label-message' => 
'globalrenamerequest-username-label',
                                'type'          => 'info',
                        ),
@@ -150,15 +141,15 @@
                                'cssclass'     => 
'mw-globalrenamerequest-field',
                                'csshelpclass' => 'mw-globalrenamerequest-help',
                                'default'      => $this->getRequest()->getVal( 
'newname', $this->par ),
-                               'help-message' => array(
-                                       'globalrenamerequest-newname-help',
-                                       $this->suggestedUsername(),
-                               ),
                                'id'            => 'mw-renamerequest-newname',
                                'label-message' => 
'globalrenamerequest-newname-label',
                                'name'          => 'newname',
                                'required'      => true,
                                'type'          => 'text',
+                               'notice-message' => array(
+                                       'globalrenamerequest-newname-help',
+                                       $this->suggestedUsername(),
+                               ),
                                'validation-callback' => array( $this, 
'validateNewname' ),
                        ),
                );
@@ -169,25 +160,25 @@
                                'cssclass'      => 
'mw-globalrenamerequest-field',
                                'csshelpclass'  => 
'mw-globalrenamerequest-help',
                                'default'       => $this->getRequest()->getVal( 
'email', $this->par ),
-                               'help-message'  => 
'globalrenamerequest-email-help',
                                'id'            => 'mw-renamerequest-email',
                                'label-message' => 
'globalrenamerequest-email-label',
                                'name'          => 'email',
                                'placeholder'   => 'usern...@example.com',
                                'required'      => true,
                                'type'          => 'email',
+                               'notice-message' => 
'globalrenamerequest-email-why-explain',
                        );
                        $fields['email2'] = array(
                                'cssclass'      => 
'mw-globalrenamerequest-field',
                                'csshelpclass'  => 
'mw-globalrenamerequest-help',
                                'default'       => $this->getRequest()->getVal( 
'email2', $this->par ),
-                               'help-message'  => 
'globalrenamerequest-email2-help',
                                'id'            => 'mw-renamerequest-email2',
                                'label-message' => 
'globalrenamerequest-email2-label',
                                'name'          => 'email2',
                                'placeholder'   => 'usern...@example.com',
                                'required'      => true,
                                'type'          => 'email',
+                               'notice-message' => 
'globalrenamerequest-email2-help',
                                'validation-callback' => array( $this, 
'validateEmail' ),
                        );
                }
diff --git a/modules/ext.centralauth.globalrenamerequest.css 
b/modules/ext.centralauth.globalrenamerequest.css
deleted file mode 100644
index fb3005d..0000000
--- a/modules/ext.centralauth.globalrenamerequest.css
+++ /dev/null
@@ -1,12 +0,0 @@
-.mw-globalrenamerequest-field label {
-  font-weight:bold;
-}
-.mw-globalrenamerequest-help {
-  font-size:smaller;
-  color:grey;
-  margin:-1em 0 .5em;
-}
-.mw-globalrenamerequest-field.mw-htmlform-field-HTMLInfoField .mw-input {
-  display:inline;
-  margin-left:.5em;
-}
diff --git a/modules/ext.centralauth.globalrenamerequest.js 
b/modules/ext.centralauth.globalrenamerequest.js
deleted file mode 100644
index 6582f37..0000000
--- a/modules/ext.centralauth.globalrenamerequest.js
+++ /dev/null
@@ -1,20 +0,0 @@
-( function ( mw, $, oo ) {
-       $( document ).ready( function () {
-               /* Explain why we are requiring an email address */
-               $( 'label[for=mw-renamerequest-email]' ).after(
-                       new oo.ui.PopupButtonWidget( {
-                               icon: 'help',
-                               label: mw.msg( 
'globalrenamerequest-email-why-label' ),
-                               framed: false,
-                               popup: {
-                                       $content: $( '<div>' ).html(
-                                               mw.msg( 
'globalrenamerequest-email-why-explain' )
-                                       ),
-                                       padded: true,
-                                       align: 'left'
-                               }
-                       } ).$element.addClass( 'mw-ui-flush-right' )
-               );
-       } );
-}( mediaWiki, jQuery, OO ) );
-

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I62a2c2ecab82652dbccb40d5605e429754f136ba
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: master
Gerrit-Owner: Glaisher <glaisher.w...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to