Mooeypoo has uploaded a new change for review.

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

Change subject: Link project labels in xwiki bundle to their 
Special:Notifications page
......................................................................

Link project labels in xwiki bundle to their Special:Notifications page

Bug: T127419
Change-Id: I1b1285d84b7fb4775d13067e6ae1c50602ed3baf
---
M includes/ForeignNotifications.php
M modules/ooui/mw.echo.ui.BundledNotificationGroupWidget.js
M modules/viewmodel/mw.echo.dm.NotificationGroupItem.js
M modules/viewmodel/mw.echo.dm.NotificationsModel.js
4 files changed, 18 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Echo 
refs/changes/38/288738/1

diff --git a/includes/ForeignNotifications.php 
b/includes/ForeignNotifications.php
index 387b525..1bddc98 100644
--- a/includes/ForeignNotifications.php
+++ b/includes/ForeignNotifications.php
@@ -201,10 +201,13 @@
                        list( $major, $minor ) = $siteFromDB;
                        $server = $wgConf->get( 'wgServer', $wiki, $major, 
array( 'lang' => $minor, 'site' => $major ) );
                        $scriptPath = $wgConf->get( 'wgScriptPath', $wiki, 
$major, array( 'lang' => $minor, 'site' => $major ) );
+                       $articlePath = $wgConf->get( 'wgArticlePath', $wiki, 
$major, array( 'lang' => $minor, 'site' => $major ) );
 
                        $data[$wiki] = array(
                                'title' => static::getWikiTitle( $wiki, 
$siteFromDB ),
                                'url' => wfExpandUrl( $server . $scriptPath . 
'/api.php', PROTO_INTERNAL ),
+                               // We need this to link to 
Special:Notifications page
+                               'base' => wfExpandUrl( $server . $articlePath, 
PROTO_INTERNAL ),
                        );
                }
 
diff --git a/modules/ooui/mw.echo.ui.BundledNotificationGroupWidget.js 
b/modules/ooui/mw.echo.ui.BundledNotificationGroupWidget.js
index 1751bd9..5e4f03d 100644
--- a/modules/ooui/mw.echo.ui.BundledNotificationGroupWidget.js
+++ b/modules/ooui/mw.echo.ui.BundledNotificationGroupWidget.js
@@ -34,8 +34,10 @@
                        }
                );
 
-               this.title = new OO.ui.LabelWidget( {
-                       classes: [ 
'mw-echo-ui-bundledNotificationGroupWidget-title' ]
+               this.title = new OO.ui.ButtonWidget( {
+                       framed: false,
+                       classes: [ 
'mw-echo-ui-bundledNotificationGroupWidget-title' ],
+                       href: this.model.getSourceArticleUrl().replace( '$1', 
'Special:Notifications' )
                } );
 
                if ( this.model.getTitle() ) {
diff --git a/modules/viewmodel/mw.echo.dm.NotificationGroupItem.js 
b/modules/viewmodel/mw.echo.dm.NotificationGroupItem.js
index 835be87..5174c41 100644
--- a/modules/viewmodel/mw.echo.dm.NotificationGroupItem.js
+++ b/modules/viewmodel/mw.echo.dm.NotificationGroupItem.js
@@ -64,6 +64,7 @@
                                {
                                        type: this.getType(),
                                        source: source,
+                                       sourceArticleURL: this.sources[ source 
].base,
                                        foreign: this.isForeign(),
                                        title: this.sources[ source ].title,
                                        removeReadNotifications: 
this.removeReadNotifications,
diff --git a/modules/viewmodel/mw.echo.dm.NotificationsModel.js 
b/modules/viewmodel/mw.echo.dm.NotificationsModel.js
index 039800e..cc5fc61 100644
--- a/modules/viewmodel/mw.echo.dm.NotificationsModel.js
+++ b/modules/viewmodel/mw.echo.dm.NotificationsModel.js
@@ -39,6 +39,7 @@
 
                this.type = config.type || 'alert';
                this.source = config.source || 'local';
+               this.sourceArticleURL = config.sourceArticleURL;
                this.id = config.id || this.source;
                this.title = config.title || '';
                this.fallbackTimestamp = config.timestamp;
@@ -687,6 +688,15 @@
        };
 
        /**
+        * Get the article path for this source
+        *
+        * @return {string} URL for the article path
+        */
+       mw.echo.dm.NotificationsModel.prototype.getSourceArticleUrl = function 
() {
+               return this.sourceArticleURL;
+       };
+
+       /**
         * Get the title of this model
         *
         * @return {string} Title

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1b1285d84b7fb4775d13067e6ae1c50602ed3baf
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo <mor...@gmail.com>

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

Reply via email to