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

Change subject: Revert "Use csrf token for watching"
......................................................................

Revert "Use csrf token for watching"

Additional changes
* Pass message to error toast not message key
* Don't skip such an important browser test!!

This reverts commit 81e45cb38b021552c56f68801bd8f5cfdf180c83.

Bug: T165209
Change-Id: Ia4278354e5ea43a3985f2e0b2cb025a6cb798f7f
(cherry picked from commit 2869a192101ca3739edeb81b0d73738afa7dfe30)
---
M extension.json
M resources/mobile.watchstar/Watchstar.js
M resources/mobile.watchstar/WatchstarGateway.js
M tests/browser/features/watchstar.feature
M tests/qunit/mobile.watchstar/test_Watchstar.js
5 files changed, 6 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/80/353880/1

diff --git a/extension.json b/extension.json
index e67c3e9..cad5815 100644
--- a/extension.json
+++ b/extension.json
@@ -350,9 +350,6 @@
                        ]
                },
                "mobile.pagelist.scripts": {
-                       "messages": [
-                               "mobile-frontend-watchlist-error"
-                       ],
                        "targets": [
                                "mobile",
                                "desktop"
@@ -969,6 +966,7 @@
                        "messages": [
                                "watchthispage",
                                "unwatchthispage",
+                               "mobile-frontend-watchlist-error",
                                "mobile-frontend-watchlist-add",
                                "mobile-frontend-watchlist-removed",
                                "mobile-frontend-watchlist-cta",
diff --git a/resources/mobile.watchstar/Watchstar.js 
b/resources/mobile.watchstar/Watchstar.js
index f2ccfb3..8e962c7 100644
--- a/resources/mobile.watchstar/Watchstar.js
+++ b/resources/mobile.watchstar/Watchstar.js
@@ -184,7 +184,7 @@
                                        toast.show( mw.msg( 
'mobile-frontend-watchlist-removed', page.title ) );
                                }
                        } ).fail( function () {
-                               toast.show( 'mobile-frontend-watchlist-error', 
'error' );
+                               toast.show( mw.msg( 
'mobile-frontend-watchlist-error' ), 'error' );
                        } );
                },
 
diff --git a/resources/mobile.watchstar/WatchstarGateway.js 
b/resources/mobile.watchstar/WatchstarGateway.js
index 45fc55c..0177ce2 100644
--- a/resources/mobile.watchstar/WatchstarGateway.js
+++ b/resources/mobile.watchstar/WatchstarGateway.js
@@ -103,7 +103,7 @@
                        if ( this.isWatchedPage( page ) ) {
                                data.unwatch = true;
                        }
-                       return this.api.postWithToken( 'csrf', data ).done( 
function () {
+                       return this.api.postWithToken( 'watch', data ).done( 
function () {
                                var newStatus = !self.isWatchedPage( page );
                                self.setWatchedPage( page, newStatus );
                                M.emit( 'watched', page, newStatus );
diff --git a/tests/browser/features/watchstar.feature 
b/tests/browser/features/watchstar.feature
index 8f9ffdd..e756399 100644
--- a/tests/browser/features/watchstar.feature
+++ b/tests/browser/features/watchstar.feature
@@ -1,4 +1,4 @@
-@chrome @en.m.wikipedia.beta.wmflabs.org @firefox @integration @skip @smoke 
@test2.m.wikipedia.org @login @vagrant
+@chrome @en.m.wikipedia.beta.wmflabs.org @firefox @integration @smoke 
@test2.m.wikipedia.org @login @vagrant
 Feature: Manage Watchlist
 
   Background:
diff --git a/tests/qunit/mobile.watchstar/test_Watchstar.js 
b/tests/qunit/mobile.watchstar/test_Watchstar.js
index c087acd..41195227 100644
--- a/tests/qunit/mobile.watchstar/test_Watchstar.js
+++ b/tests/qunit/mobile.watchstar/test_Watchstar.js
@@ -63,7 +63,7 @@
                        $el = w.$el;
 
                $el.trigger( 'click' );
-               assert.ok( this.spy.calledWith( 'csrf', {
+               assert.ok( this.spy.calledWith( 'watch', {
                        action: 'watch',
                        pageids: 42
                } ), 'The watch happened' );
@@ -84,7 +84,7 @@
                        $el = w.$el;
 
                $el.trigger( 'click' );
-               assert.ok( this.spy.calledWith( 'csrf', {
+               assert.ok( this.spy.calledWith( 'watch', {
                        action: 'watch',
                        unwatch: true,
                        pageids: 42

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia4278354e5ea43a3985f2e0b2cb025a6cb798f7f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: wmf/1.30.0-wmf.1
Gerrit-Owner: Jdlrobson <jrob...@wikimedia.org>

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

Reply via email to