Commit graph

1396 commits

Author SHA1 Message Date
bsitu a7fbb53584 Add method for fetching unread notifications
* This will be used for the unread notifications in message overlay

* This will be used to "mark all as read" based on sections ( event types ),
  since we can't do updateJoin.  We could set a max update limit like 3000,
  and use this to do "mark all as read", this would handle majority "mark all as read"
  use cases. This would also prevent updating big amount of data on a web request

Change-Id: I2a9103a73d0aa91a52d5c0233e946a0ef979f96d
2014-08-13 13:10:38 -07:00
jenkins-bot fd5bfe80b7 Merge "Hygiene: Add abstract model and mapper for notification" 2014-08-13 15:26:38 +00:00
jenkins-bot 984be579ff Merge "make jshint command should run on tests directory" 2014-08-13 00:46:34 +00:00
bsitu ad691fb838 Use array_merge_resursive when merging based on array keys
When two array have the same keys, we want to merge them into one array
rather than one overwriting another one

This was preventing count and rawcount from appearing inside the messages
and alerts object returned by the API.

Change-Id: I989b9b0994a33925faf52c6d99d8c46920e62cd6
2014-08-13 00:42:07 +00:00
bsitu 4bf88aa741 Hygiene: Add abstract model and mapper for notification
* Shared function can be put in the abstract class and this also enforces some interface methods 

* Initialize a default dbFactory when it's not passed to the mapper

Change-Id: I1033dafaa90a1f683fbe9ad69bed04f4844e357b
2014-08-13 00:11:15 +00:00
bsitu 180a67c4a7 Hygiene: Add sub-directories to phpunit test
Change-Id: Ie5bb127f1ba36bd799f87535b14cd3712ad08a3c
2014-08-12 22:54:45 +00:00
jdlrobson 08c1c0dcee make jshint command should run on tests directory
Change-Id: Ieccf67d20d257f96bbb91476dba768237c32dd6f
2014-08-11 23:51:25 +00:00
Translation updater bot 4c5f1e0838 Merge "Localisation updates from https://translatewiki.net." 2014-08-11 21:24:09 +00:00
Translation updater bot f435fc8897 Localisation updates from https://translatewiki.net.
Change-Id: I94dd0d8707d671a9e58056d1eeecfe89031d1dbb
2014-08-11 22:47:25 +02:00
Translation updater bot 9f8379c6a3 Merge "Localisation updates from https://translatewiki.net." 2014-08-09 21:37:29 +00:00
Translation updater bot 32bceb92df Localisation updates from https://translatewiki.net.
Change-Id: I8f4b52e065644a02f8dd80a6c56e56ccf4a61bef
2014-08-09 19:54:35 +02:00
Brad Jorsch 33af802a61 Update token handling for core API change
Core change I2793a3f2 changes API handling in a way that needs updates
to extensions for proper operation:
* needsToken() now returns a string
* Most custom token types are being replaced with a 'csrf' token (the
  former 'edit' token); any others need a new hook.
* All tokens must use a static salt. Compat with web UI using non-static
  tokens is supported and also serves to handle the now-deprecated token
  fetching.
* Documentation in getParamDescription() should return a string (not
  array) for 'token', as the signal to core that it should be replaced
  with a standardized message.

When compatibility with earlier versions of MediaWiki is no longer
maintained, the entry for 'token' from getAllowedParams() and
getParamDescription() may be removed, as may getTokenSalt(). This patch
leaves them in place.

Note this is intended to be compatible with earlier versions of
MediaWiki, and so should be safe to merge before the core change.

Change-Id: I7cbdc5a7119cdfeadc1fe55469065a44c228a006
2014-08-09 16:30:07 +01:00
jenkins-bot 54f9b4a440 Merge "Hygiene: Break out _buildNotificationList" 2014-08-09 00:43:57 +00:00
jenkins-bot 8912e9c7c9 Merge "Remove qunit tests from mobile" 2014-08-09 00:08:50 +00:00
Florianschmidtwelzow ffd082b738 Remove qunit tests from mobile
ext.echo.overlay isn't loaded in mobile, so don't load the test in
mobile.

Bug: 69316
Change-Id: Iddd68aca84c69bed10a2afe4aea8463890485e26
2014-08-09 02:06:46 +02:00
jenkins-bot a765ba09bc Merge "QA: Add browser test for sign up notifications" 2014-08-08 23:45:48 +00:00
jdlrobson 4470d91e54 Hygiene: Break out _buildNotificationList
Make various properties of the overlay properties of
EchoOverlay to reduce need for function parameters

Change-Id: I70ec0c650d58322aad93d71292a836d7cf7e7474
2014-08-08 15:45:02 -07:00
jenkins-bot 3e9ae71dcd Merge "Hygiene: Introduce EchoOverlay initialisation class" 2014-08-08 22:24:05 +00:00
jdlrobson ccc0e713a0 Hygiene: Introduce EchoOverlay initialisation class
Not as scary as it looks. The change to _buildOverlay simply changes
indenting, and cleans up to reflect new parameter. Tests still pass ;-)

Kill noticationLimit concept
Only expose what's necessary on mw.echo.overlay

Change-Id: I2671a41af8188c14ad4c910396afa0d9000b6051
2014-08-08 14:35:07 -07:00
jenkins-bot 9edea65079 Merge "Fix Echo breaking" 2014-08-08 20:38:49 +00:00
Kunal Mehta 631d0252f7 Fix Echo breaking
Bug: 66992
Change-Id: I7add48c55e04ef4ea5d0f537c6a1a1ba959f628e
2014-08-08 21:35:58 +01:00
jdlrobson f4eadb5e0a Ensure override is more specific
is definitely more specific then
So let's make sure the override always works.

Change-Id: I8e1623357185ad7b55ddc9d60ab98984721075ae
2014-08-08 11:30:25 -07:00
jdlrobson df66e80648 Regression: Fix styling of new unread notifications
Change-Id: Icf9f1bc21c084070a21865232cdac5d978be0731
2014-08-08 10:44:18 -07:00
jdlrobson 02d73ad720 QA: Add browser test for sign up notifications
Change-Id: I9a8debd8a220516adbcf86d4ccfa0019278171bb
2014-08-07 14:47:41 -07:00
jdlrobson 71a1ec3f6f Reduce specifity of Echo css
The #p-personal only is needed to override the ul padding.
Let's make this explict.

Change-Id: Idf538d2a09ffc4d325d4fb3061564d8dd11b1e60
2014-08-07 21:07:14 +00:00
jdlrobson 1896424e9a Hygiene: use self where possible
Change-Id: I30e9d6ea8b59e168fc5b151f215c3592f475bedf
2014-08-06 13:30:42 -07:00
jdlrobson 0ff4295a88 Hygiene: Move the overlay initialisation code into a separate file
Change-Id: I4dcdf9708b700c57679ff878275c5560a62e3a06
2014-08-06 20:29:35 +00:00
jdlrobson a815733447 Hygiene: Move code for header into _getTitleElement
Change-Id: Ic53933189bf51772a88689794a7633ba8ba0ac2c
2014-08-06 20:29:30 +00:00
jdlrobson f02d3f059d Hygiene: Add _getFooterElement method
Continue to shrink down the size of buildOverlay

Change-Id: I69b339947bfe4d5e73c6d293f0ae5e9e494ec6ca
2014-08-06 20:29:25 +00:00
jdlrobson 9b30d33549 Hygiene: Refactor out mark as read button code
Change-Id: Iad935174925bd1c16e51bbc36c84b48769e9780c
2014-08-06 20:29:01 +00:00
jdlrobson e064126209 Hygiene: Split buildOverlay into smaller functions
Start with a getNotificationLimit and markAllAsRead function

Change-Id: Ice53af40a152f6c3b5a92683c574ef7dc2d01047
2014-08-06 20:28:55 +00:00
jdlrobson 8d12ef9a80 The first ever Echo QUnit tests
Also change coding conventions of Resources to allows use
array for scripts key.

Change-Id: I0c9f358ce3eb62adb07b68623e97c07993c9c45c
2014-08-06 13:26:42 -07:00
jdlrobson 0dc45e6c4a Regression: Fix styling on Special:Notifications
addModuleStyles ignores JavaScript in module.

Change-Id: I6c20a6ff05fbd52d30dea7d7633fb6f4b36b377b
2014-08-05 17:08:10 -07:00
jenkins-bot cb1375ccdf Merge "Add support for splitting notifications into alert & message" 2014-08-05 22:24:14 +00:00
bsitu 427b7e2c38 Add support for splitting notifications into alert & message
Change-Id: I8eeeeb9a7a1539a258bc42584274897f9e7dc775
2014-08-05 14:50:54 -07:00
Translation updater bot 8d15d1a810 Localisation updates from https://translatewiki.net.
Change-Id: I687dc3b8717b0439c0393feb3e15038e49c4feb6
2014-08-05 21:56:18 +02:00
jenkins-bot 792b9dfc31 Merge "Add ability to run QUnit tests" 2014-08-05 18:45:29 +00:00
jenkins-bot fd6822fac2 Merge "Hygiene: More LESS cleanup in ext.echo.overlays.less" 2014-08-05 18:40:11 +00:00
jdlrobson 01b0f912f3 Hygiene: More LESS cleanup in ext.echo.overlays.less
Change-Id: I2d2daad00a11a156dc0ac693ea99322c9470cc6f
2014-08-05 11:37:43 -07:00
bsitu 4e63ee6164 Hygiene: Update method documentation & split exception to a file
Change-Id: Id77db0f21ee3fdaad4e040c853fadc605df212ea
2014-08-04 17:43:57 -07:00
jdlrobson bb6eef198c QA: Add some basic browser tests
yippee ki yay!
Tests basic functionality
1) presence of Echo button
2) behaviour of clicking Echo button

Change-Id: I6334264e1ee73a59da1e7b0c3f18a1d43b565f3a
2014-08-04 16:22:01 -07:00
jenkins-bot 091d1c9b52 Merge "Hygiene: Port all Echo css to less." 2014-08-04 20:49:38 +00:00
Translation updater bot 3c22ef1012 Localisation updates from https://translatewiki.net.
Change-Id: If6bb59767b11f50154dbd7c92232ca4aef47adf4
2014-08-04 21:53:53 +02:00
jdlrobson 430628ccc1 Hygiene: Port all Echo css to less.
No changes.
Makes styling code more readable.

Change-Id: Ie45f2cd3671bee5b88ba92ca2946d6e77cd59508
2014-08-04 11:43:27 -07:00
Erik Bernhardson 74a56e6fc4 Convert existing notifications to use user-locators
Replace implementation specific code with generalized user-locator
implementations that can be re-used by more notifications in other
extensions.

This patch adjusts the `user-locators` notification parameter to allow
arrays which facilitate passing options to the locator.

Previously(still works):

    'user-locators' => array( 'foo', 'bar' ),

New functionality:

    'user-locators' => array(
	'foo',
	array( 'bar', 42 )
    )

In the second example the callback specified by `bar` will receive
an EchoEvent as the first argument and array( 42 ) as its second
argument.

Change-Id: I7305279bc91d1e40e7054e2fd42a819a35526b82
2014-08-04 11:16:34 -07:00
Translation updater bot a0b7251741 Localisation updates from https://translatewiki.net.
Change-Id: I147db21bede9248a01477d371287e9a9005830a9
2014-08-03 22:09:05 +02:00
jenkins-bot cf418a4ecb Merge "Generalize a couple implementations of EchoGetDefaultNotifiedUsers" 2014-08-02 00:10:42 +00:00
jdlrobson 5b46130173 Add ability to run QUnit tests
Point out there are no QUnit tests :-)
Add .jshintignore file

Change-Id: I02635b8620dda0110c04549724f50f561c5657fe
Note: See also 69034
2014-08-01 15:55:22 -07:00
Kunal Mehta e25eb66a3a Support BasicFormatter::getLinkParams returning raw urls
In some cases like I7e309c04bc2456f4f87554a3d70dd6c77ba22f71 we
only have a raw URL and not a Title object. This supports that
usecase as well.

Change-Id: Ie18698e3ef755ca5a2cecc1f1cfb4254184bb576
2014-08-01 22:40:59 +00:00
Erik Bernhardson 71c7e02858 Directory reshuffle, add dev tools
* Port Flow Makefile to Echo
* Move resources to Resources.php

Change-Id: I75e96cc1e51a7768600ffc083550fc94ea9d1e6c
2014-08-01 22:38:41 +00:00