Commit graph

609 commits

Author SHA1 Message Date
Matthew Flaschen 188e8d7395 No-JS special page: One-click mark as read
Bug: T136361
Change-Id: I7896dbdf25d2c1624f97777f4c8d0af41b195ef0
Depends-On: Ic31f857c749d62a32cafae68dc3f1cbd86e1e382
2016-05-27 17:23:29 -07:00
Stephane Bisson 1bef12c3e7 Stop outputting $nextContinue in Special:Notifications
Bug: T129176
Change-Id: If0d05cb1df0b2e0f93c7367c0848fbcbb04fea8d
2016-05-27 16:46:20 -07:00
jenkins-bot 5d30e4cfac Merge "Filter notifications by read state in Special:Notifications" 2016-05-27 21:35:41 +00:00
jenkins-bot 95bea57983 Merge "Initial version of Special:Notifications Javascript page" 2016-05-27 21:34:44 +00:00
Moriel Schottlender e5e19dd0f1 Filter notifications by read state in Special:Notifications
Change-Id: I7b47e76ae48eaf4732d99616baa3b4b1ee4ddff5
2016-05-27 13:47:41 -07:00
Moriel Schottlender 9262614ded Initial version of Special:Notifications Javascript page
Bug: T129176
Change-Id: I2f55358c16f78e234ec19154b944a4edebfbe639
2016-05-27 13:42:25 -07:00
matejsuchanek 38adb78619 Use native MediaWiki linking to help pages
There was quite a small link under the main title in Special:Notifications
which pointed to a related help page. Now the OutputPage::addHelpLink()
method is used which moves this link to the upper right corner and allows
configuring this on-wiki (instead of LocalSettings.php or so).

Bug: T101057
Change-Id: Ib4aecee8006b8d71bb3cd86f1d4ebdfee9080870
2016-05-27 20:40:41 +02:00
jenkins-bot 23cc46be36 Merge "Avoid calc() in CSS" 2016-05-26 23:06:08 +00:00
jenkins-bot b894c3407a Merge "Add style to the NotificationsWrapper" 2016-05-26 22:58:40 +00:00
jenkins-bot e9482fbd34 Merge "Remove technical error from echo-api-failure" 2016-05-26 22:55:46 +00:00
Bartosz Dziewoński cc9e667c49 Avoid calc() in CSS
* Use `margin: A` with `padding: B` rather than `padding: calc(A + B)`.
* Remove a `display: inline-block` which necessitated `width: 100%`.

I think this results in the same rendering, but please test carefully,
as I didn't check it for all the possible notifications.

(There is one more calc() in mw.echo.badge.less that can't be avoided.)

Bug: T135936
Change-Id: Ic01f16c8469c3b9d45d2885108ec6260e967731a
2016-05-26 22:52:44 +00:00
jenkins-bot 3fc46a639d Merge "Adjust styling for "Mark group as read"" 2016-05-26 22:43:12 +00:00
Stephane Bisson 194b75cfed Remove technical error from echo-api-failure
Bug: T129764
Change-Id: Ia8779ff90b71c1c8b4df5b28fd61bfb891533b06
2016-05-26 13:43:14 -07:00
Stephane Bisson 52525249e6 Adjust styling for "Mark group as read"
Bug: T134204
Change-Id: Ia0486fa400be7e96ffc4e1ad47f952c17f40042c
2016-05-26 13:30:49 -07:00
jenkins-bot 35f1388e7f Merge "Generalize the SubGroupListWidget" 2016-05-26 20:26:31 +00:00
jenkins-bot 76a391220d Merge "Allow for overriding parameters in fetch notifications API request" 2016-05-26 20:26:28 +00:00
Moriel Schottlender c649c29e7d Generalize the SubGroupListWidget
Allow for the widget to have a mark-as-read button to its individual
groups, as well as change the event listening from 'remove' to 'discard'

The problem with 'remove' event is that it is triggered when an item
is either intentionally removed from the list *and* when an item is
changing its position in the list (move event includes 'remove' and
then 'add' event)

If we listen to 'remove' events we will get both cases, which is
unhelpful. Instead, a new event - 'discard' - was introduced so
we are certain it is used with the clear intention of removing the
item completely.

Change-Id: Ia08720bf4c547fa41edf62331eeb1a45ff4965b7
2016-05-26 18:44:16 +00:00
Moriel Schottlender ac9bbb8e07 Allow for overriding parameters in fetch notifications API request
Change-Id: I677d6d1b3a8f9424820969a12005d7a457d938b1
2016-05-26 11:42:14 -07:00
Stephane Bisson c96bc7ec38 Pagination on no-js Special:Notifications
Bug: T129169
Change-Id: I48aff35352bbda7f8818d456284c5c7adb346bb1
2016-05-23 15:39:43 -07:00
Moriel Schottlender 299adfe6b1 Add style to the NotificationsWrapper
We have to make sure that any notifications wrapper has the css
term overflow-y: auto; so that the popup menus behave properly.

Change-Id: I14a1a9f1c3610ef27fe04aa4b1e7197c08d1dfd4
2016-05-19 13:43:51 -07:00
Moriel Schottlender 8e76bc4126 Refactoring Echo's front end for MVC
Changing the way Echo's front-end architecture works to work with
model-view-controller methodology.

Change-Id: I97862402c41bc04dd41cd08d79f19ff677340249
2016-05-18 12:28:45 -07:00
Moriel Schottlender 28feb4bf82 Link project labels in xwiki bundle to their Special:Notifications page
Also, get rid of the feature where we hide the project name when there
is only one project available. The titles are always showing.

Bug: T127419
Change-Id: I1b1285d84b7fb4775d13067e6ae1c50602ed3baf
2016-05-16 13:33:18 -07:00
Stephane Bisson 52b60075d1 Handle empty foreign notification sources
Foreign notification sources can end up being empty
for legitimate reasons (already marked as read on the
foreign wiki) or errors (failed to query remote server).

This change makes the front-end resilient by
removing the sources if they end up being empty,
and removing the foreign notifications bundle if
all the sources end up being empty.

Bug: T135252
Bug: T135250
Change-Id: I5901bb0007420a19d8c0727faa982eb00809c074
2016-05-13 15:42:58 -04:00
Stephane Bisson 413206d82a Pass source url when creating API handler
Change-Id: I8e42c6678766baea1b8b1f66537ec15b1f2bdff7
2016-05-13 14:54:38 -04:00
Matthias Mullie 876197b520 Get rid of addApiHandler factory
Some complexity is now gone. We didn't currently have a good justification
for a the APIHandler factory: the apiHandler caller would have to specify
(variable `foreign`) what kind of handler it would like to initiate anyway,
so it might as well just inject the object (which makes the code easier to
follow, decreases bugs risk because there are less code paths)

This also gives the caller more control of the API handlers:
registerForeignSources will now be able to do more. Now it can e.g. create
1 object that is shared for multiple wikis (to do lookups for multiple
wikis at once)

Also renamed addApiHandler to setApiHandler (it just sets the value it needs
without checking if it already existed anyway)

Change-Id: Ie1814c5bf1a1f0e5607033beb506df67f3585b24
2016-05-13 14:11:42 -04:00
Matthias Mullie 84b016e695 Make sure APIHandler has this.api
this.api is used in APIHandler.createNewFetchNotificationPromise,
so we should make sure it always has a valid this.api

Change-Id: Id476661fb427adbbb3c5741737c293c32ad8a27e
2016-05-13 17:29:56 +00:00
Roan Kattouw 468ead1ca1 Correctly update locally cached seenTime
> Object.keys( wgEchoSeenTime );
["alert", "message", "m", "e", "s", "a", "g"]

Bug: T134854
Change-Id: I167e0eba1bad61a683f36218d2c90235f285a3c2
2016-05-12 16:04:24 -07:00
jenkins-bot dcdfb59567 Merge "Add JSDuck support and fix errors" 2016-05-11 21:38:17 +00:00
Moriel Schottlender 2d184c087c Add JSDuck support and fix errors
Change-Id: I7816110862d9ca1b16e2ec9ce842d240bee6b46b
2016-05-11 14:07:12 -07:00
Moriel Schottlender 8f5c718a4f Add 'mark section as read' to Special:Notifications
Allow marking notifications as read per 'section' (days) in the
Special:Notifications page.

Bug: T115528
Bug: T134204
Change-Id: I7324a2c693aa92b9327cf8ff98f125293d5fba10
2016-05-11 20:00:24 +00:00
jenkins-bot 4331c30993 Merge "Add mark-as-read button to notifications in Special:Notifications" 2016-05-11 18:42:46 +00:00
Moriel Schottlender 15a44768f4 Add mark-as-read button to notifications in Special:Notifications
Bug: T115528
Change-Id: I54dba5f86d28a069659d66dede5b7ab9981213aa
2016-05-11 10:41:32 -07:00
Roan Kattouw 351297caf1 Don't apply margin to dotdotdot menu items
Otherwise the background color on hover doesn't cover the entire item.

Bug: T130677
Change-Id: I7c0a4cd7a77e3ae333e1ea0161bfc909e246c6e6
2016-05-09 15:00:18 -07:00
Stephane Bisson 6cca5b6a01 Fetch foreign notifications before marking them as read
Bug: T134579
Change-Id: I4b88bbf5e23d9fbc066e17e1af77a3874a824b04
2016-05-06 11:47:58 -04:00
Moriel Schottlender 7055f83fe0 Use server-side cross-wiki requests in the frontend
Fetch cross-wiki notifications by asking the local API, but still
maintain the ability to send remote requests to the foreign wikis
for mark-as-read operations.

Bug: T130636
Change-Id: I48524cb9dff43257a401d7483e939edfb042b928
2016-05-04 21:21:08 +00:00
Roan Kattouw 7942a2de79 Replace mark-as-read-on-click with ?markasread= URL parameter
Notifications were being marked as read in response to a click event
in JavaScript, but that causes a jarring effect in the UI, and it's
not reliable (the browser could abort the AJAX request).

Instead, add ?markasread=XYZ to the end of every primary link URL,
where XYZ is the event ID.

Bug: T133975
Depends-On: Icb99d5479836fea25a47451b5a758dd71f642f71
Change-Id: I8047d121584b43e6172463a50ad0e0de5f7fa73c
2016-05-03 00:20:03 -07:00
Roan Kattouw 73b0a083d4 FooterNoticeWidget: Top-align the close icon
Bug: T117669
Change-Id: I70d8df95e719824c8f135d01d6d9bf63a20daf02
2016-05-02 14:36:01 -07:00
Roan Kattouw fbf702aa7e Follow-up 1608a5e6fc: add hasOwnProperty check
To prevent crashes when wikis extend Array.prototype.

Bug: T133817
Change-Id: I40063d7997a1dfb72053eb09e48d4480dbf371a8
2016-04-28 00:34:11 +00:00
Roan Kattouw 4f7f1a3a09 Repurpose survey call-out in the footer for beta feature invitation
Removing the info popup because we don't have to show
a privacy notice when linking within the wiki.

This adds a database query to every page view for logged-in
users; If78bfc710, once merged, will fix that.

Bug: T117669
Change-Id: I8451db34ae8e94264e4921ecd6df6e4b32c7623a
2016-04-27 07:23:30 +00:00
Roan Kattouw 1608a5e6fc Follow-up b10bd7003: allow object instead of array for b/c with wikis running old code
Change-Id: I1566b73e0d8daea6c2e701f60cbcb9dd42129ec9
2016-04-26 15:57:25 -07:00
Roan Kattouw 91a7833209 Follow-up 57ee9759: add notnoforn=1 for b/c with wikis running old code
Change-Id: I24b697d59f9306b9cfa40372c5d4a92ba331b20b
2016-04-26 15:55:07 -07:00
Matthias Mullie 57ee975984 Change (opt-out) noforn to (opt-in) crosswikisummary
I thought the name was confusing, and would be even more so
if we get real notifications from other sources.

Meanwhile also split $crossWikiSummary into 2 properties:
- 1 with the class
- 1 to indicate if it should be used

Change-Id: I0e83be7924c8c77680ea1ada3f2bd6a190ce6149
2016-04-22 12:14:21 -07:00
Matthias Mullie b10bd70033 List is no longer an associative array
This would soon become problematic when output can come from
multiple sources, with potentially conflicting ids.
The ID is already included in the result anyway.

Change-Id: Id92150c71c68958819fe0ee329e70393052c34c9
2016-04-22 12:13:21 -07:00
Matthias Mullie e8d1f6a888 Remove param index
It's (mostly) unused, and it would become problematic once we have
notifications from multiple places (where those ids could conflict)

Change-Id: Ib3bb5ae1e5689037b38290c9ce3d8691f52582b0
2016-04-21 13:33:15 +02:00
jenkins-bot 93c118693a Merge "Apply momentjs hack for short relative times on mobile too" 2016-04-20 01:50:51 +00:00
Roan Kattouw c9332d8b50 Apply momentjs hack for short relative times on mobile too
Split the moment hack out into its own file and put it in
ext.echo.ui, so it gets picked up by both the desktop and
the mobile modules.

Bug: T133134
Change-Id: Ic5b3e63fb6941a310d85ea7776447d1d7153cf91
2016-04-19 17:53:02 -07:00
Roan Kattouw 6c49d3edda Update OOUI hacks for I8987dade5ed
min-width and min-height are now set on icons. This breaks the ability
to scale icons down, so override these rules.

Change-Id: I6372f0fe17ccfd853bde497730c49cbcf9f89a41
2016-04-19 15:57:11 -07:00
Stephane Bisson 62216cab80 Display only one foreign bundle on mobile
Display a single foreign bundle containing both
alerts and messages on mobile.

Bug: T131683
Change-Id: I9d3d160586c31457d3a1825e9cecadde42debf7c
2016-04-19 16:02:41 +00:00
jenkins-bot c594852bf7 Merge "Add tooltips for 'mark as read' and 'more options'" 2016-04-19 01:33:28 +00:00
Matthew Flaschen bb1192a531 Increase line-height for survey to 16px
Bug: T131893
Change-Id: I51e80117d810e2927b6b31f4b2c68de08d07293d
2016-04-18 18:43:40 -04:00