Mooeypoo has uploaded a new change for review.

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

Change subject: [wip] Allow watching and unwatching of boards from Flow 
notifications
......................................................................

[wip] Allow watching and unwatching of boards from Flow notifications

Bug: T132975
Depends-On: Ib16d57c3f1a11a974
Change-Id: I75d0098e7718ec44bfb3a4d43e4e7e5a03c47331
---
M i18n/en.json
M i18n/qqq.json
M includes/Notifications/NewTopicPresentationModel.php
M includes/Notifications/Notifications.php
4 files changed, 15 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow 
refs/changes/15/303315/1

diff --git a/i18n/en.json b/i18n/en.json
index fbafbb9..c599d8e 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -14,6 +14,8 @@
                ]
        },
        "enableflow": "Enable Flow",
+       "notifications-dynamic-actions-flow-board-watch": "You are now watching 
the board \"$1\"",
+       "notifications-dynamic-actions-flow-board-unwatch": "You are no longer 
watching the board \"$1\"",
        "flow-desc": "Workflow management system",
        "flow-talk-taken-over-comment": "/* This page has been converted into a 
Flow discussion board */",
        "log-name-flow": "Flow activity log",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index e427050..282e0a2 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -25,6 +25,8 @@
                ]
        },
        "enableflow": "{{doc-special|EnableFlow}}",
+       "notifications-dynamic-actions-flow-board-watch": "Confirmation text 
for watching a board from within a notification.\n\nParameters:\n* $1 - Board 
name",
+       "notifications-dynamic-actions-flow-board-unwatch": "Confirmation text 
for unwatching a board from within a notification.\n\nParameters:\n* $1 - Board 
name",
        "flow-desc": 
"{{desc|name=Flow|url=https://www.mediawiki.org/wiki/Extension:Flow}}";,
        "flow-talk-taken-over-comment": "Comment of the new revision that is 
created when a page turns into a Flow discussion board.",
        "log-name-flow": "{{doc-logpage}}\nName of the Flow log filter on the 
[[Special:Log]] page.",
diff --git a/includes/Notifications/NewTopicPresentationModel.php 
b/includes/Notifications/NewTopicPresentationModel.php
index ee31046..cec4a5a 100644
--- a/includes/Notifications/NewTopicPresentationModel.php
+++ b/includes/Notifications/NewTopicPresentationModel.php
@@ -28,6 +28,13 @@
                        return array(
                                $this->getAgentLink(),
                                $this->getBoardByNewestLink(),
+                               // Watch/Unwatch board
+                               $this->getDynamicActionLink(
+                                       $this->event->getTitle(),
+                                       'flow-watch', // TODO: Figure out if 
this is 'watch' or 'unwatch'
+                                       false,
+                                       $this->getBoardLink()
+                               ),
                        );
                }
        }
diff --git a/includes/Notifications/Notifications.php 
b/includes/Notifications/Notifications.php
index 214600c..6f67b53 100644
--- a/includes/Notifications/Notifications.php
+++ b/includes/Notifications/Notifications.php
@@ -105,6 +105,10 @@
                        'Flow\\NotificationsUserLocator::locateMentionedUsers',
                        'EchoUserLocator::locateTalkPageOwner',
                ),
+               // Defining i18n keys:
+               // notifications-dynamic-actions-flow-board-watch
+               // notifications-dynamic-actions-flow-board-unwatch
+               'dynamic_actions' => array( 'flow-board-watch', 
'flow-board-unwatch' ),
        ) + $newTopicNotification,
        'flowusertalk-new-topic' => array(
                'section' => 'alert',

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I75d0098e7718ec44bfb3a4d43e4e7e5a03c47331
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
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