Ladsgroup has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/349411 )

Change subject: Change client setting 'repoIcon' to 'echoIcon'
......................................................................

Change client setting 'repoIcon' to 'echoIcon'

The icon for echo notifications can be anything

Bug: T142104
Change-Id: I0d98bf6e1e0ff90f656901fb790a92cee4b87366
---
M client/config/WikibaseClient.default.php
M client/includes/Hooks/EchoNotificationsHandlers.php
M client/tests/phpunit/includes/Hooks/EchoNotificationsHandlersTest.php
M docs/options.wiki
4 files changed, 16 insertions(+), 16 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/11/349411/1

diff --git a/client/config/WikibaseClient.default.php 
b/client/config/WikibaseClient.default.php
index 3c57f69..25eb5e1 100644
--- a/client/config/WikibaseClient.default.php
+++ b/client/config/WikibaseClient.default.php
@@ -26,7 +26,7 @@
                'injectRecentChanges' => true,
                'showExternalRecentChanges' => true,
                'sendEchoNotification' => false,
-               'repoIcon' => false,
+               'echoIcon' => false,
                'allowDataTransclusion' => true,
                'propagateChangesToRepo' => true,
                'otherProjectsLinksByDefault' => false,
diff --git a/client/includes/Hooks/EchoNotificationsHandlers.php 
b/client/includes/Hooks/EchoNotificationsHandlers.php
index bfba19b..c193344 100644
--- a/client/includes/Hooks/EchoNotificationsHandlers.php
+++ b/client/includes/Hooks/EchoNotificationsHandlers.php
@@ -48,7 +48,7 @@
        /**
         * @var array|false
         */
-       private $repoIcon;
+       private $echoIcon;
 
        /**
         * @var string
@@ -59,20 +59,20 @@
         * @param RepoLinker $repoLinker
         * @param string $siteId
         * @param bool $sendEchoNotification
-        * @param array|false $repoIcon
+        * @param array|false $echoIcon
         * @param string $repoSiteName
         */
        public function __construct(
                RepoLinker $repoLinker,
                $siteId,
                $sendEchoNotification,
-               $repoIcon,
+               $echoIcon,
                $repoSiteName
        ) {
                $this->repoLinker = $repoLinker;
                $this->siteId = $siteId;
                $this->sendEchoNotification = $sendEchoNotification;
-               $this->repoIcon = $repoIcon;
+               $this->echoIcon = $echoIcon;
                $this->repoSiteName = $repoSiteName;
        }
 
@@ -87,7 +87,7 @@
                        $wikibaseClient->newRepoLinker(),
                        $settings->getSetting( 'siteGlobalID' ),
                        $settings->getSetting( 'sendEchoNotification' ),
-                       $settings->getSetting( 'repoIcon' ),
+                       $settings->getSetting( 'echoIcon' ),
                        $settings->getSetting( 'repoSiteName' )
                );
        }
@@ -142,8 +142,8 @@
                        'bundle' => [ 'web' => true, 'email' => false ],
                ];
 
-               if ( !empty( $this->repoIcon ) ) {
-                       $icons[self::NOTIFICATION_TYPE] = $this->repoIcon;
+               if ( !empty( $this->echoIcon ) ) {
+                       $icons[self::NOTIFICATION_TYPE] = $this->echoIcon;
                } else {
                        $icons[self::NOTIFICATION_TYPE] = $icons['placeholder'];
                }
diff --git 
a/client/tests/phpunit/includes/Hooks/EchoNotificationsHandlersTest.php 
b/client/tests/phpunit/includes/Hooks/EchoNotificationsHandlersTest.php
index df5633d..c7d28a4 100644
--- a/client/tests/phpunit/includes/Hooks/EchoNotificationsHandlersTest.php
+++ b/client/tests/phpunit/includes/Hooks/EchoNotificationsHandlersTest.php
@@ -51,7 +51,7 @@
                        $this->repoLinker,
                        $settings->getSetting( 'siteGlobalID' ),
                        $settings->getSetting( 'sendEchoNotification' ),
-                       $settings->getSetting( 'repoIcon' ),
+                       $settings->getSetting( 'echoIcon' ),
                        'repoSiteName'
                );
        }
@@ -63,7 +63,7 @@
                $settings = new SettingsArray();
                $settings->setSetting( 'siteGlobalID', 'enwiki' );
                $settings->setSetting( 'sendEchoNotification', true );
-               $settings->setSetting( 'repoIcon', false );
+               $settings->setSetting( 'echoIcon', false );
 
                $handlers = $this->getHandlers( $settings );
 
@@ -163,7 +163,7 @@
                $settings = new SettingsArray();
                $settings->setSetting( 'siteGlobalID', 'enwiki' );
                $settings->setSetting( 'sendEchoNotification', false );
-               $settings->setSetting( 'repoIcon', false );
+               $settings->setSetting( 'echoIcon', false );
 
                $handlers = $this->getHandlers( $settings );
                $handlers->doBeforeCreateEchoEvent(
@@ -199,22 +199,22 @@
                $this->assertEquals(
                        $wgEchoNotificationIcons['placeholder'],
                        $wgEchoNotificationIcons[$handlers::NOTIFICATION_TYPE],
-                       "Failed asserting that missing repoIcon setting 
defaults to Echo's default"
+                       "Failed asserting that missing echoIcon setting 
defaults to Echo's default"
                );
 
                unset( $wgEchoNotifications[$handlers::NOTIFICATION_TYPE] );
                unset( $wgEchoNotificationCategories['wikibase-action'] );
                unset( $wgEchoNotificationIcons[$handlers::NOTIFICATION_TYPE] );
 
-               $repoIcon = [ 'url' => 'some_url_here' ];
-               $settings->setSetting( 'repoIcon', $repoIcon );
+               $echoIcon = [ 'url' => 'some_url_here' ];
+               $settings->setSetting( 'echoIcon', $echoIcon );
                $handlers = $this->getHandlers( $settings );
 
                $handlers->doBeforeCreateEchoEvent(
                        $wgEchoNotifications, $wgEchoNotificationCategories, 
$wgEchoNotificationIcons
                );
                $this->assertEquals(
-                       $repoIcon,
+                       $echoIcon,
                        $wgEchoNotificationIcons[$handlers::NOTIFICATION_TYPE],
                        "Failed asserting that the notification icon is 
correctly registered to Echo"
                );
diff --git a/docs/options.wiki b/docs/options.wiki
index 6e5d59a..78a70cd 100644
--- a/docs/options.wiki
+++ b/docs/options.wiki
@@ -103,7 +103,7 @@
 ;injectRecentChanges: Whether changes on the repository should be injected 
into this wiki's recent changes table, so they show up on watchlists, etc. 
Requires the <code>dispatchChanges.php</code> script to run, and this wiki to 
be listed in the <code>localClientDatabases</code> setting on the repository.
 ;showExternalRecentChanges: Whether changes on the repository should be 
displayed on Special:RecentChanges, Special:Watchlist, etc on the client wiki. 
In contrast to <code>injectRecentChanges</code>, this setting just removes the 
changes from the user interface. The default is <code>false</code>. This is 
intended to temporarily prevent external changes from showing in order to find 
or fix some issue on a live site.
 ;sendEchoNotification: If true, allows users on the client wiki to get a 
notification when a page they created is connected to a repo item. This 
requires the Echo extension.
-;repoIcon: If <code>sendEchoNotification</code> is set to <code>true</code>, 
you can also provide what icon the user will see. The correct syntax is 
<code>array( 'url' => '...' )</code> or <code>array( 'path' => '...' )</code> 
where <code>path</code> is relative to <code>$wgExtensionAssetsPath</code>. 
Defaults to <code>false</code> which means that there will be the default Echo 
icon.
+;echoIcon: If <code>sendEchoNotification</code> is set to <code>true</code>, 
you can also provide what icon the user will see. The correct syntax is <code>[ 
'url' => '...' ]</code> or <code>[ 'path' => '...' ]</code> where 
<code>path</code> is relative to <code>$wgExtensionAssetsPath</code>. Defaults 
to <code>false</code> which means that there will be the default Echo icon.
 
 === Pseudo-configuration ===
 Settings mentioned in this section are not really configuration. They are used 
to pass definitions of services to service locators. Wiring files should 
generally not be replaced with other files, neither should be their content 
(PHP code) editted by users, as the usual configuration.

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0d98bf6e1e0ff90f656901fb790a92cee4b87366
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Ladsgroup <[email protected]>

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

Reply via email to