BearND has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/327394 )
Change subject: Also show announcements on beta cluster
......................................................................
Also show announcements on beta cluster
So we can test announcement changes there.
Change-Id: I32c29accc354d679daf151375d0eb02e255d2d15
---
M lib/mobile-util.js
M routes/announcements.js
2 files changed, 5 insertions(+), 1 deletion(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/mobileapps
refs/changes/94/327394/1
diff --git a/lib/mobile-util.js b/lib/mobile-util.js
index 37bf3f8..11daa2c 100644
--- a/lib/mobile-util.js
+++ b/lib/mobile-util.js
@@ -108,6 +108,10 @@
return domain.split('.')[0];
};
+mUtil.isEnglishWikipedia = function(domain) {
+ return (domain === 'en.wikipedia.org' || domain ===
'en.wikipedia.beta.wmflabs.org');
+};
+
// Merge two arrays of objects by the specified property.
// Stolen from https://jsfiddle.net/guya/eAWKR/.
mUtil.mergeByProp = function(arr1, arr2, prop, pushIfKeyNotFound) {
diff --git a/routes/announcements.js b/routes/announcements.js
index bcb4776..ca0b237 100644
--- a/routes/announcements.js
+++ b/routes/announcements.js
@@ -111,7 +111,7 @@
*/
router.get('/announcements', (req, res) => {
const json = {
- announce: req.params.domain === 'en.wikipedia.org' ?
getEnwikiAnnouncements() : []
+ announce: mUtil.isEnglishWikipedia(req.params.domain) ?
getEnwikiAnnouncements() : []
};
const hash = mUtil.hashCode(JSON.stringify(json));
--
To view, visit https://gerrit.wikimedia.org/r/327394
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I32c29accc354d679daf151375d0eb02e255d2d15
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/mobileapps
Gerrit-Branch: master
Gerrit-Owner: BearND <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits