Commit graph

2866 commits

Author SHA1 Message Date
Roan Kattouw bfbfa6be62 Sort wikis by timestamp of most recent notification
Both in the order of the cross-wiki bundles themselves, and
in the message in the notification body.

ForeignNotifications tracks timestamps per wiki per section,
and exposes these through getWikiTimestamp(). ApiEchoNotifications
adds these timestamps to the sources manifest, and also sorts
the list of wikis by timestamp (it'd be nicer to do this in
ForeignPresentationModel instead, but then we'd have to create a new
ForeignNotifications instance which causes a duplicated DB query).

NotificationsModel receives the timestamp for its wiki as its
fallback timestamp, and makes getTimestamp() return this value
during the pre-population phase. This causes its parent to
automatically sort it correctly.

Because the timestamp of a wiki depends on the section (alerts vs messages),
we can't put it in the global sources manifest at the top level
of the API response. Instead, get rid of this global sources
manifest and put all the sources data in the foreign notifications
directly. This allows us to specify different timestamps, and also
allows us to get rid of code in EchoApi that was already remapping
the API response to this format.

Bug: T130298
Change-Id: Ie083fbb1ccaf74fbe804633d87ef03c9e71b120f
2016-03-17 14:21:16 -07:00
jenkins-bot 059b368e2d Merge "Adjust line-height of bundle group titles" 2016-03-16 17:58:10 +00:00
jenkins-bot a624a95205 Merge "Adjust bottom-alignment of action buttons in notifications" 2016-03-16 17:58:07 +00:00
jenkins-bot 39820d8b62 Merge "Add MobileNotificationsWrapper for Mobile display" 2016-03-16 17:57:26 +00:00
jenkins-bot 66affc067f Merge "Clicking a marked-as-unread notification should mark it as read" 2016-03-16 17:48:42 +00:00
Moriel Schottlender 56c82f3f9d Add MobileNotificationsWrapper for Mobile display
This is to wrap the mobile notifications in MobileFrontend with
a pendingElement and organize the API calls specifically for the
mixed popup in mobile.

Also added a specific 'ext.echo.ui.mobile' module so we don't
load unnecessary files for mobile.

Bug: T124188
Change-Id: I4a8be19a79b9e38c21907bb9d4123540a648c535
2016-03-16 10:29:42 -07:00
Moriel Schottlender cd57ab5e54 Clicking a marked-as-unread notification should mark it as read
Bug: T129898
Change-Id: Ia8c699ccc4bb0feba0949082608357d35971a515
2016-03-15 17:53:36 -07:00
Moriel Schottlender 47eb8b0065 Adjust line-height of bundle group titles
Bug: T128069
Change-Id: Ic968e00c789e8dbb20d04bb1d277afec57a2bebc
2016-03-15 16:35:37 -07:00
Moriel Schottlender fdff3b1116 Adjust bottom-alignment of action buttons in notifications
Bug: T125969
Change-Id: If13fa27ede927901cf2fd9ffe99784b5086bd9e3
2016-03-15 16:27:59 -07:00
Moriel Schottlender 2ad15c724b Apply buttons styling to 'expand' bundle button
Bug: T126686
Change-Id: I4c6064fffae00b499de607598257828d9d0c05ee
2016-03-15 16:14:47 -07:00
Translation updater bot e537b2bac7 Localisation updates from https://translatewiki.net.
Change-Id: I36d99fd259847c354bef05b5bcfd9cde54e99e38
2016-03-15 22:59:38 +01:00
Kunal Mehta 7d4ac2a76b Have mw.echo.api.APIHandler.markItemRead actually return a promise
Per its docs which say it does.

Change-Id: I2a4fb393c1bc3eba31a1bad34342a11800767fb0
2016-03-14 15:23:08 -07:00
Translation updater bot f54c435ccc Localisation updates from https://translatewiki.net.
Change-Id: Iec59a5b6d38a3695c702686b4b6c74a28cf348d3
2016-03-14 22:48:04 +01:00
jenkins-bot ca208f222e Merge "Make clear not to translate 'alert'/'message'/'all' in API docs." 2016-03-14 17:38:04 +00:00
Timo Tijhof 35b7339152 Ignore value of MW_PHPUNIT_TEST
To match use of this constant everywhere else.

Change-Id: Ia173b2b7217ffa8b924d9f164da89bd3b547c452
2016-03-14 16:44:33 +00:00
Matthew Flaschen 6a3c8ffe15 Make clear not to translate 'alert'/'message'/'all' in API docs.
These strings must be passed exactly to the API untranslated for it
to work, so the developer-facing API documentation should reflect that.

Bug: T126908
Change-Id: Ie58611ac7dd510341867b6e86e3ffd71ad9aa1c6
2016-03-14 11:44:12 -04:00
Translation updater bot baba8154eb Localisation updates from https://translatewiki.net.
Change-Id: Iaf30f85fa310f25e6e04d01b2f9f47d64b9c7c0f
2016-03-13 22:52:42 +01:00
Translation updater bot 6598d483e5 Localisation updates from https://translatewiki.net.
Change-Id: Ib8b3e0be812005ae368391daa545bd42ae073060
2016-03-12 21:09:48 +01:00
jenkins-bot 154725b90f Merge "Follow-up 9a1defa5: unbreak mention notifications" 2016-03-11 23:07:36 +00:00
Roan Kattouw e0581ecff3 Follow-up 9a1defa5: unbreak mention notifications
Actually pass the required User object to getTruncatedUsername().

Change-Id: I69ad0ea12d4b4785fbfeec801228cae518fd0a05
2016-03-11 22:57:20 +00:00
jenkins-bot a767408f02 Merge "Allow mark-as-unread in notifications" 2016-03-11 22:43:58 +00:00
Moriel Schottlender 8657ef5e90 Allow mark-as-unread in notifications
Add a 'mark as unread' to all unread notifications and allow them
to be marked unread. These notifications will no longer be automatically
marked as read when the pages they refer to are visited.

Bug: T73564
Change-Id: I677d3c0399e46fd7c35531df1cc0e61db2d4eb1b
2016-03-11 14:05:10 -08:00
jenkins-bot 14c67d48df Merge "Fix duplicate impression logging" 2016-03-11 22:01:48 +00:00
Translation updater bot 2ca41557f5 Localisation updates from https://translatewiki.net.
Change-Id: I43c2c3245d061165de4524a81b27603c82b3f5c1
2016-03-11 22:14:40 +01:00
Kunal Mehta c99a93dd5c thank-you-edit: Cast counts as integers before comparing
Because somehow we're ending up with 100 !== 100 in the logs.

Change-Id: I9c24b5dca3fea7d52fc0e0a52e53702385eb0fb1
2016-03-11 11:30:15 -08:00
jenkins-bot 91a15811cb Merge "thank-you-edit: canRender for deleted page and extra fix" 2016-03-11 19:11:58 +00:00
Matthew Flaschen 07c962e82f thank-you-edit: canRender for deleted page and extra fix
Don't try to render if page was deleted, and fix 'extra' parameter
(was breaking message key and thus rendering)

Bug: T129641
Change-Id: I5d0fdfd3921427993211969eb5793f8e9e7667a8
2016-03-11 13:59:27 -05:00
jenkins-bot d796e84fa5 Merge "Clean up some code in EchoEmailBatch" 2016-03-11 17:31:54 +00:00
Roan Kattouw 933eecd2ec Follow-up 9a1defa: fix function name typo
Change-Id: I08466603a08496611ede9c0406d95c25a6a70e03
2016-03-10 19:53:34 -08:00
jenkins-bot 6fed475c40 Merge "Bidi isolate content items in notification header text" 2016-03-11 02:21:04 +00:00
jenkins-bot 4de459b6b5 Merge "Fix bundled notification width" 2016-03-10 23:50:25 +00:00
jenkins-bot d22d779504 Merge "Call static Language::fetchLanguageName() statically" 2016-03-10 23:31:48 +00:00
Moriel Schottlender f210528a74 Fix bundled notification width
Bug: T129469
Change-Id: Iaabeab59543d3e271ef84926fb7c7d000a2abd04
2016-03-10 15:22:14 -08:00
Siebrand Mazeland 2d42463552 Call static Language::fetchLanguageName() statically
Change-Id: Ifbc00dcda36e72467165b8ee4bc002f5d2d76686
2016-03-11 00:12:14 +01:00
Translation updater bot f38f7e64cd Localisation updates from https://translatewiki.net.
Change-Id: Ifd0154d1975a9319360dc752af7d3edb6c4072d1
2016-03-10 22:26:31 +01:00
jenkins-bot 9449405f63 Merge "build: Enable jscs jsDoc rule 'requireNewlineAfterDescription' and make pass" 2016-03-10 16:26:35 +00:00
Moriel Schottlender 9a1defa57f Bidi isolate content items in notification header text
Bug: T127407
Change-Id: I25c426f3d0190bd33c4aa1c2ffb3c97fe1424567
2016-03-09 16:22:52 -08:00
jenkins-bot c25265673b Merge "Defer onPersonalUrls() DB writes to post-send (try #2)" 2016-03-09 21:52:25 +00:00
Translation updater bot 175198570a Localisation updates from https://translatewiki.net.
Change-Id: I28a8d1547dd18d81c99713374e23a270fcccdb6e
2016-03-09 22:41:09 +01:00
Kunal Mehta 26a8bc2450 Defer onPersonalUrls() DB writes to post-send (try #2)
This reverts commit e372f3ce6f.

The previous attempt was broken because
EchoTargetPageMapper::fetchByUserPageId() returns a list of
EchoTargetPage objects, not a single one.

Bug: T117531
Change-Id: Id02a025e3736a7b92d9d6fb8adf29ef674f8e2fa
2016-03-09 11:07:50 -08:00
Roan Kattouw 7f079b7d4f Fix duplicate impression logging
We have a wrapper around logInteraction() called logNotificationImpressions()
that logs impressions uniquely (i.e. logs each notification impression only once),
but in addition to calling that (from NotificationsWidget), we were also manually
calling logInteraction() to log impressions from NotificationBadgeWidget
and NotificationGroupItemWidget. This resulted in two impression events
for every notification, each with different data, one of which is logged
only once and one of which can be logged multiple times.

Remove the manual logImpression() calls and route everything through
logNotificationImpressions(), which is called from only one place:
NotificationsWidget. Add support for logging foreign wikis to
logNotificationImpressions(), as it was previously missing.

This causes us to lose the notification type information in these
events, but that can also be derived after the fact by looking
up the event_id in the echo_event table.

Whether impression logging is even useful is another question,
but it certainly isn't useful if we log duplicate impression
events with different data.

Change-Id: I19b76a4ce796b21e9347dd9392af24918db82e18
2016-03-09 10:21:09 -08:00
Kunal Mehta 51dd4fd109 thank-you-edit: Only call User::getEditCount() once
And rename $editCount to $thresholdCount for clarity.

Change-Id: I115b2dfabf472c855c186d05fa4e31aa7c9c3d6c
2016-03-08 17:05:05 -08:00
jenkins-bot acdcb5c895 Merge "Revert "Defer onPersonalUrls() DB writes to post-send"" 2016-03-09 00:11:50 +00:00
Catrope e372f3ce6f Revert "Defer onPersonalUrls() DB writes to post-send"
Causes fatals in production for some reason.

This reverts commit 93387806c2.

Bug: T129299
Change-Id: Ie90aa493e2940fae9d6f380b95f87a4cc7e04622
2016-03-09 00:00:11 +00:00
Kunal Mehta 210f3a1d4a Clean up some code in EchoEmailBatch
* Address TODO to use a constant instead of hardcoding
* Only call User::getOption() once

Change-Id: I52d8c3698f8d915ec9d96de0976d242009b3df39
2016-03-08 15:37:34 -08:00
Translation updater bot e56b5d00ab Localisation updates from https://translatewiki.net.
Change-Id: Ie693000718f7b0c4d7e99002c1fcec72ba2473c7
2016-03-08 22:40:38 +01:00
Roan Kattouw e85c3832bb Add debug logging for when the thank-you-edit code detects a race condition
We seem to be discarding *all* thank-you-edit notifications as
race conditions now.

Bug: T128249
Change-Id: I1f284bd13e89fe2205c4c87a6c0f4a7dfe1c8bd1
2016-03-08 12:04:45 -08:00
jenkins-bot d1d8955825 Merge "Fix EchoAttributeManager::getNotificationSection() php doc" 2016-03-08 01:56:58 +00:00
Kunal Mehta b2961ccb0c EchoTargetPage: Don't call Title::newFromId() repeatedly
Title::newFromId() can return null, and if this were the case the
instance caching would never work, so it would continually make useless
database queries.

Initialize the $title member variable as false to begin with, and use
that to check whether we've already checked Title::newFromId().

Change-Id: Id07c2c963ffcd03e212bed0a666735bcb68b92e0
2016-03-08 01:43:08 +00:00
Kunal Mehta d02b28d99c Fix EchoAttributeManager::getNotificationSection() php doc
Change-Id: I5a82e4618907e7a58a61d10ecb93c76d9772de53
2016-03-08 01:42:50 +00:00