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

Change subject: Get rid of old flyout formatter code
......................................................................


Get rid of old flyout formatter code

This code is completely useless:
* for format=flyout, the new EchoFlyoutFormatter.php will be run
* and even that one has already been deprecated as it was replaced
  by format=model (flyout html is now built in client)

Change-Id: Iea23abb66397ecc4efb575fe33fdbedc5b4e0f70
---
M Echo.php
M i18n/qqq.json
M includes/formatters/BasicFormatter.php
M includes/formatters/EditUserTalkFormatter.php
M includes/formatters/MentionFormatter.php
M includes/formatters/NotificationFormatter.php
M tests/phpunit/formatters/NotificationFormatterTest.php
7 files changed, 9 insertions(+), 43 deletions(-)

Approvals:
  Sbisson: Looks good to me, approved
  Siebrand: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/Echo.php b/Echo.php
index c7dcc18..fdc5768 100644
--- a/Echo.php
+++ b/Echo.php
@@ -429,8 +429,6 @@
                'formatter-class' => 'EchoUserRightsFormatter',
                'title-message' => 'notification-user-rights',
                'title-params' => array( 'agent', 'user-rights-list' ),
-               'flyout-message' => 'notification-user-rights-flyout',
-               'flyout-params' => array( 'agent', 'user-rights-list' ),
                'email-subject-message' => 
'notification-user-rights-email-subject',
                'email-subject-params' => array(),
                'email-body-batch-message' => 
'notification-user-rights-email-batch-body',
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 1829b63..4fc7cc4 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -138,7 +138,7 @@
        "notification-mention-email-subject": "Email subject. Parameters:\n* $1 
- a username\n* $2 - name of the user viewing the notification, can be used for 
GENDER\nSee also:\n* {{msg-mw|Notification-mention}}\n* 
{{msg-mw|Notification-mention-flyout}}\n* 
{{msg-mw|Notification-mention-email-batch-body}}",
        "notification-mention-email-batch-body": "E-mail notification batch 
body.  Parameters:\n* $1 - a username, plaintext.  Can be used for gender 
support\n* $2 - (Unused) talk page title\n* $3 - the raw section title text\n* 
$4 - the title text without namespace (a page title in any namespace)\n* $5 - 
name of the user viewing the notification, can be used for GENDER\n\nSee 
also:\n* {{msg-mw|Notification-mention}}\n* 
{{msg-mw|Notification-mention-flyout}}\n* 
{{msg-mw|Notification-mention-email-subject}}",
        "notification-mention-nosection-email-batch-body": "E-mail notification 
batch body.  Parameters:\n* $1 - a username, plaintext.  Can be used for gender 
support\n* $2 - the title text without namespace (a page title in any 
namespace)\n* $3 - name of the user viewing the notification, can be used for 
GENDER\n\nSee also:\n* {{msg-mw|Notification-mention-nosection}}\n* 
{{msg-mw|Notification-mention-nosection-flyout}}\n* 
{{msg-mw|Notification-mention-email-subject}}",
-       "notification-user-rights-email-subject": "E-mail subject for user 
rights notification\n\nSee also:\n* {{msg-mw|Notification-user-rights}}\n* 
{{msg-mw|Notification-user-rights-flyout}}\n* 
{{msg-mw|Notification-user-rights-email-batch-body}}",
+       "notification-user-rights-email-subject": "E-mail subject for user 
rights notification\n\nSee also:\n* {{msg-mw|Notification-user-rights}}\n* 
{{msg-mw|Notification-user-rights-email-batch-body}}",
        "notification-user-rights-email-batch-body": "Email notification batch 
body. Parameters:\n* $1 - a user name, plaintext. Can be used for gender 
support.\n* $2 - a semicolon separated list of 
{{msg-mw|notification-user-rights-add}}, 
{{msg-mw|notification-user-rights-remove}}",
        "echo-notification-count": "{{optional}}\nThe new notification count 
next to notification link, for example: 99+\n\nParameters:\n* $1 - the count",
        "echo-email-subject-default": "Default subject for Echo e-mail 
notifications",
diff --git a/includes/formatters/BasicFormatter.php 
b/includes/formatters/BasicFormatter.php
index 6d80f07..e353db6 100644
--- a/includes/formatters/BasicFormatter.php
+++ b/includes/formatters/BasicFormatter.php
@@ -17,13 +17,7 @@
        protected $title;
 
        /**
-        * Notification title data for flyout
-        * @var array
-        */
-       protected $flyoutTitle;
-
-       /**
-        * Notification title data for bundling ( flyout and archive page )
+        * Notification title data for bundling ( archive page )
         */
        protected $bundleTitle;
 
@@ -82,13 +76,7 @@
                        'params' => $params['title-params']
                );
 
-               // Title for the flyout
-               $this->flyoutTitle = array(
-                       'message' => $params['flyout-message'],
-                       'params' => $params['flyout-params']
-               );
-
-               // Bundle title for both archive page and flyout
+               // Bundle title for both archive page
                $this->bundleTitle = array(
                        'message' => $params['bundle-message'],
                        'params' => $params['bundle-params']
@@ -137,9 +125,6 @@
                        'icon' => 'placeholder'
                );
 
-               // default flyout-message to title-message if not defined
-               $params += array( 'flyout-message' => $params['title-message'], 
'flyout-params' => $params['title-params'] );
-
                return $params;
        }
 
@@ -156,7 +141,7 @@
                // Use the bundle message if use-bundle is true and there is a 
bundle message
                $this->generateBundleData( $event, $user, $type );
                if ( $this->bundleData['use-bundle'] && 
$this->bundleTitle['message'] ) {
-                       $this->title = $this->flyoutTitle = $this->bundleTitle;
+                       $this->title = $this->bundleTitle;
                }
        }
 
@@ -211,11 +196,6 @@
                // Add footer (timestamp and secondary link)
                $content .= $this->formatFooter( $event, $user );
 
-               // Add the primary link (hidden)
-               if ( $this->outputFormat === 'flyout' ) {
-                       $content .= $this->getLink( $event, $user, 'primary' );
-               }
-
                $output .= Xml::tags( 'div', array( 'class' => 
'mw-echo-content' ), $content ) . "\n";
 
                // The state div is used to visually indicate read or unread 
status. This is
@@ -232,11 +212,7 @@
         * @return string
         */
        protected function formatNotificationTitle( $event, $user ) {
-               if ( $this->outputFormat === 'flyout' ) {
-                       return $this->formatFragment( $this->flyoutTitle, 
$event, $user );
-               } else {
-                       return $this->formatFragment( $this->title, $event, 
$user );
-               }
+               return $this->formatFragment( $this->title, $event, $user );
        }
 
        /**
@@ -492,7 +468,7 @@
                        $title->setFragment( "#$fragment" );
                }
 
-               if ( in_array( $this->outputFormat, array( 'flyout', 
'htmlemail' ) ) ) {
+               if ( in_array( $this->outputFormat, array( 'htmlemail' ) ) ) {
                        $attribs = array();
                        if ( isset( $props['attribs'] ) ) {
                                $attribs = (array)$props['attribs'];
diff --git a/includes/formatters/EditUserTalkFormatter.php 
b/includes/formatters/EditUserTalkFormatter.php
index fa4fa3c..78537f3 100644
--- a/includes/formatters/EditUserTalkFormatter.php
+++ b/includes/formatters/EditUserTalkFormatter.php
@@ -25,10 +25,6 @@
                                'message' => 
'notification-edit-talk-page-with-section',
                                'params' => array( 'agent', 'user', 
'subject-anchor', 'section-title' )
                        );
-                       $this->flyoutTitle = array(
-                               'message' => 
'notification-edit-talk-page-flyout-with-section',
-                               'params' => array( 'agent', 'user', 
'subject-anchor', 'section-title' )
-                       );
                        $this->email['batch-body'] = array(
                                'message' => 
'notification-edit-talk-page-email-batch-body-with-section',
                                'params' => array( 'agent', 'section-title' )
diff --git a/includes/formatters/MentionFormatter.php 
b/includes/formatters/MentionFormatter.php
index ea007ad..f81fe88 100644
--- a/includes/formatters/MentionFormatter.php
+++ b/includes/formatters/MentionFormatter.php
@@ -14,10 +14,6 @@
                                'message' => 'notification-mention-nosection',
                                'params' => array( 'agent', 'main-title-text', 
'title', 'user' )
                        );
-                       $this->flyoutTitle = array(
-                               'message' => 
'notification-mention-nosection-flyout',
-                               'params' => array( 'agent', 'main-title-text', 
'title' )
-                       );
                        $this->email['batch-body'] = array(
                                'message' => 
'notification-mention-nosection-email-batch-body',
                                'params' => array( 'agent', 'main-title-text', 
'user' )
diff --git a/includes/formatters/NotificationFormatter.php 
b/includes/formatters/NotificationFormatter.php
index bc901fc..26759db 100644
--- a/includes/formatters/NotificationFormatter.php
+++ b/includes/formatters/NotificationFormatter.php
@@ -12,7 +12,7 @@
         * List of valid output format
         * @var array
         */
-       protected $validOutputFormats = array( 'text', 'flyout', 'email', 
'htmlemail' );
+       protected $validOutputFormats = array( 'text', 'email', 'htmlemail' );
 
        /**
         * List of valid distribution type
@@ -58,7 +58,7 @@
 
        /**
         * Set the output format that the notification will be displayed in.
-        * @param $format string A valid output format (by default, 'text', 
'flyout', and 'email' are allowed)
+        * @param $format string A valid output format (by default, 'text', and 
'email' are allowed)
         * @throws InvalidArgumentException
         */
        public function setOutputFormat( $format ) {
diff --git a/tests/phpunit/formatters/NotificationFormatterTest.php 
b/tests/phpunit/formatters/NotificationFormatterTest.php
index 65a23d3..f7ff2ce 100644
--- a/tests/phpunit/formatters/NotificationFormatterTest.php
+++ b/tests/phpunit/formatters/NotificationFormatterTest.php
@@ -71,7 +71,7 @@
                                'remove' => array( 'other' ),
                        ),
                );
-               $formats = array( 'flyout', 'email', 'text' );
+               $formats = array( 'email', 'text' );
                $tests = array();
                $loggedUser = User::newFromName( 'Notification-formatter-test' 
);
                $anonUser = new User();

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iea23abb66397ecc4efb575fe33fdbedc5b4e0f70
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: Matthias Mullie <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: Sbisson <[email protected]>
Gerrit-Reviewer: Siebrand <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to