[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Fix "Edit History" link in notifications.

2017-01-30 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/335085 )

Change subject: Fix "Edit History" link in notifications.
..


Fix "Edit History" link in notifications.

When a notification comes from Wikidata, the text() property contains the
Q-number, and the full() contains the label. When directing the user to
the edit history of the item, we actually want the Q-number, since
navigating to the label in Wikidata will go to a nonexistent page.

Change-Id: I2193847d1182dd58b28c31663de982ce89f6898f
---
M app/src/main/java/org/wikipedia/notifications/NotificationPresenter.java
1 file changed, 2 insertions(+), 1 deletion(-)

Approvals:
  Niedzielski: Looks good to me, approved
  jenkins-bot: Verified



diff --git 
a/app/src/main/java/org/wikipedia/notifications/NotificationPresenter.java 
b/app/src/main/java/org/wikipedia/notifications/NotificationPresenter.java
index 4e31cd9..db381a8 100644
--- a/app/src/main/java/org/wikipedia/notifications/NotificationPresenter.java
+++ b/app/src/main/java/org/wikipedia/notifications/NotificationPresenter.java
@@ -30,7 +30,8 @@
 @DrawableRes int icon = R.mipmap.launcher;
 @ColorInt int color = ContextCompat.getColor(context, 
R.color.foundation_gray);
 
-Uri historyUri = uriForPath(n, "Special:History/" + n.title().full());
+Uri historyUri = uriForPath(n, "Special:History/"
++ (n.isFromWikidata() ? n.title().text() : n.title().full()));
 Uri agentUri = uriForPath(n, "User:" + n.agent().name());
 
 Intent pageIntent = PageActivity.newIntent(context, n.title().full());

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I2193847d1182dd58b28c31663de982ce89f6898f
Gerrit-PatchSet: 1
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Dbrant 
Gerrit-Reviewer: Brion VIBBER 
Gerrit-Reviewer: Mholloway 
Gerrit-Reviewer: Niedzielski 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Fix "Edit History" link in notifications.

2017-01-30 Thread Dbrant (Code Review)
Dbrant has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/335085 )

Change subject: Fix "Edit History" link in notifications.
..

Fix "Edit History" link in notifications.

When a notification comes from Wikidata, the text() property contains the
Q-number, and the full() contains the label. When directing the user to
the edit history of the item, we actually want the Q-number, since
navigating to the label in Wikidata will go to a nonexistent page.

Change-Id: I2193847d1182dd58b28c31663de982ce89f6898f
---
M app/src/main/java/org/wikipedia/notifications/NotificationPresenter.java
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia 
refs/changes/85/335085/1

diff --git 
a/app/src/main/java/org/wikipedia/notifications/NotificationPresenter.java 
b/app/src/main/java/org/wikipedia/notifications/NotificationPresenter.java
index 4e31cd9..db381a8 100644
--- a/app/src/main/java/org/wikipedia/notifications/NotificationPresenter.java
+++ b/app/src/main/java/org/wikipedia/notifications/NotificationPresenter.java
@@ -30,7 +30,8 @@
 @DrawableRes int icon = R.mipmap.launcher;
 @ColorInt int color = ContextCompat.getColor(context, 
R.color.foundation_gray);
 
-Uri historyUri = uriForPath(n, "Special:History/" + n.title().full());
+Uri historyUri = uriForPath(n, "Special:History/"
++ (n.isFromWikidata() ? n.title().text() : n.title().full()));
 Uri agentUri = uriForPath(n, "User:" + n.agent().name());
 
 Intent pageIntent = PageActivity.newIntent(context, n.title().full());

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2193847d1182dd58b28c31663de982ce89f6898f
Gerrit-PatchSet: 1
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Dbrant 

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