Commit graph

857 commits

Author SHA1 Message Date
jenkins-bot e1b2823703 Merge "Add a mark-all-read button and a settings menu to Special:Notifications" 2016-07-21 14:04:39 +00:00
Moriel Schottlender 545d4e67ae Add a mark-all-read button and a settings menu to Special:Notifications
Add a global-wiki 'mark all as read' to the Special:Notifications page.
The 'mark all as read' will makr all notifications in the given
wiki. The context of the wiki changes when filters are chosen,
and so the message of the button changes as well.

Bug: T115528
Change-Id: Ibd9dcdf7072d6cbc1a268c18e558e6d0df28f929
2016-07-20 17:25:38 -07:00
Moriel Schottlender 8a69d86d18 Make Special:Notifications responsive
As a first step for mobile support, make the page responsive,
hide the sidebar, and slightly adjust button/title positions and
sizes so they fit in a small screen.

Bug: T140687
Change-Id: I98f264948a57924f6370a861381456ce9c82f8d8
2016-07-19 15:11:47 -07:00
jenkins-bot 1c7d93ba00 Merge "i18n: Native digits on PageNotificationsOptionWidget and PaginationWidget" 2016-07-19 21:53:38 +00:00
jenkins-bot 47de8691eb Merge "Show placeholder widget when there are no notifications" 2016-07-19 20:25:46 +00:00
Stephane Bisson c21c5cc821 Show placeholder widget when there are no notifications
When there are only foreign notifications, marking them all
as read empties the flyout completely. With this change,
we now show the placeholder widget with the 'no notifications'
message instead.

Bug: T132202
Change-Id: I7ee38b160ca03c08711670a3296ba4ab45a5eb6c
2016-07-19 20:14:39 +00:00
jenkins-bot 8b0dbd2031 Merge "Relate read-state filter and mark read/unread action" 2016-07-19 15:22:48 +00:00
jenkins-bot 060bc4e8b5 Merge "Fix truncation of notification headers" 2016-07-19 00:28:11 +00:00
jenkins-bot 184874473d Merge "Add tooltips to page filters" 2016-07-19 00:07:03 +00:00
Roan Kattouw d36c0ab123 Fix truncation of notification headers
We need a fixed-width CSS table with a number of fixed-width
cells and one cell that takes up the remaining width, with
text truncation. This is a pain to do with CSS tables,
but this trick I found on StackOverflow[1] works well:
wrap the contents of the cell in a div that's position: relative;,
containing another div that's position: absolute; width: 100%;

[1] http://stackoverflow.com/questions/7569436/css-constrain-a-table-with-long-cell-contents-to-page-width

Bug: T140349
Change-Id: I507f915f06185c767d7a5c8edbff6c341e07b6e2
2016-07-18 17:06:48 -07:00
Moriel Schottlender 5aaf6d26d8 Relate read-state filter and mark read/unread action
When we are viewing a certain read state filter ('read' or 'unread')
the visibility of items should correspond to that state even when
the user marks a specific item as read/unread. That means that the
system should remove these items from view when the action is taken.

In this commit:
* The controller makes the judgment of whether to remove items when
  read/unread action is taken, based on whether a filter is set.
* We clean up the terminology of discard - no more 'remove' - to
  make sure we have consistency in the code.
* Related: The 'discard' event is now scoped within the hierarchy;
  meaning, lists emit 'discard' when an item is removed, grouplist
  emits 'discard' when a group is removed, and the manager emits
  'discard' when an entire notification model is removed. This
  means we can actually have proper hierarchy and organization with
  a single event, and not worry about clashing between the intentional
  'discard' action and the event 'remove' that is also used while
  resorting happens.
* The model manager emits a discard event when a model is removed
  so that the general list can listen to the manager and remove an
  entire batch of items if needed.
* The pagination model now updates the count for the current page
  rather than some vague notion of the last page. This is also
  updated when the controller removes items, so we can get an
  accurate count in the page for the number of notifications that
  are displayed.

Bug: T136891
Change-Id: I247c618042ef256fadf09922f7b83bd1ad361f64
2016-07-18 13:23:57 -07:00
jenkins-bot d27cab59d6 Merge "Add a SeenTimeModel to handle seenTime in sources" 2016-07-18 13:01:35 +00:00
jenkins-bot 9352ce9756 Merge "Dim the title of current wiki if it has 0 notifications" 2016-07-15 19:09:43 +00:00
Moriel Schottlender eadaac1c84 Dim the title of current wiki if it has 0 notifications
Bug: T139646
Change-Id: I827cb43d5badd0a13666226691450a73ddcc85ea
2016-07-15 11:42:47 -07:00
Moriel Schottlender 3a710790d5 Add a SeenTimeModel to handle seenTime in sources
This organizes the operation of seenTime so we can store and
follow up on it based on different sources, as well as update
it correctly remotely when needed.

Change-Id: I629ecfc84999be998b45c9c7adb00ea7e3e51742
2016-07-15 11:25:38 -07:00
Moriel Schottlender 7660732bb7 Fade in/out elements that are moved in the notifications list
Bug: T126214
Change-Id: Iad5df1f56bfbd12cb6f42dd6e73860bdcc27cd68
2016-07-15 18:04:49 +00:00
jenkins-bot 880fb2a43d Merge "Fix messages/notices documentation" 2016-07-14 18:55:29 +00:00
jenkins-bot 1a9c47f527 Merge "Capitalize title dates in Special:Notifications" 2016-07-14 13:37:07 +00:00
Ed Sanders f000a82c1d Fix messages/notices documentation
Bug: T139682
Change-Id: I453b7377c13ca172774e103c1f097423bf68e9b2
2016-07-14 13:45:23 +01:00
Ed Sanders 1e4ed9cafe Remove extra 1px top border and margin from popup list
Bug: T140354
Change-Id: I06bfc014f485b9cd460dfda0a9c7f982de4f9bf6
2016-07-14 13:30:03 +01:00
Moriel Schottlender d47f0bd350 Capitalize title dates in Special:Notifications
Bug: T137634
Change-Id: I84b03f030f6182194a38a7bbfc200f5e0c187878
2016-07-13 13:56:17 -07:00
Moriel Schottlender ac5c9c17f8 Prevent click propogation when clicking 'mark as read' button
Bug: T139339
Change-Id: I3a19a0d01b036fe3c0379e3a5bc0c3f0e5f9473e
2016-07-13 11:30:55 -07:00
Stephane Bisson 35e782c3d8 Add tooltips to page filters
Bug: T139644
Change-Id: I6ae0d0e8c6c7dd79b9ab00db1d601f670764d3a4
2016-07-13 09:51:51 -04:00
jenkins-bot be3cca488d Merge "Make sure sidebar titles are under one another in Special:Notifications" 2016-07-11 15:23:12 +00:00
Ebrahim Byagowi 4eba4c1dd0 i18n: Native digits on PageNotificationsOptionWidget and PaginationWidget
Similar to Icdd52ea0267ffbaa0e103070655735eff8423ca1

Change-Id: I8667fc8b7027d2c9c8b42155a7b79ef18500dc2b
2016-07-09 07:52:23 +00:00
Moriel Schottlender 3f723ab7d1 Use 'uselang' when fetching unread page notifications
This would make the wiki names localized to the current user
interface language, rather than the wiki language.

Bug: T139807
Change-Id: I2b787e1486819d6833e169ac6db519cd36a3c3eb
2016-07-08 16:27:02 -07:00
Moriel Schottlender 4b204644a2 Make sure sidebar titles are under one another in Special:Notifications
Bug: T139807
Change-Id: I59621117835d5ba3f0314f3cdd0c7cd0f0cd6b7c
2016-07-08 16:00:59 -07:00
jenkins-bot 152bd3e622 Merge "Store local source as 'local' rather than dbName" 2016-07-08 14:27:51 +00:00
jenkins-bot 28aca00dce Merge "Properly aggregate the itemUpdate event" 2016-07-08 14:16:20 +00:00
jenkins-bot 39fef27775 Merge "Only fetch 'unreadfirst' for the Popup, not Special:Notifications" 2016-07-08 13:37:57 +00:00
Moriel Schottlender 4b137b3208 Followup Ib7f4dc4ea: Bring back message tooltip with 'notice' text
The message for tooltip-pt-notifications-message was removed to comply
with the new naming. The problem is that in the back end, sections are
still defined as 'message' vs 'alerts' and the sections in the user
toolbar are defined with those terms. In no-JS mode (which is before
the user clicks any of the badges) this tooltip is created automatically
by MediaWiki based on class names.

It's easier to return the message key with different text for translation
and wait for the bigger tech debt to correct all instances of 'message'
to 'notice' (including in the API, which would require a much more
massive work)

Bug: T139520
Change-Id: I6368b63e38f64aa065f2580df812de1c63a93716
2016-07-07 17:09:18 -07:00
Moriel Schottlender eea0dea7ce Only fetch 'unreadfirst' for the Popup, not Special:Notifications
We need the API to return the notifications for the special page
in timestamp order and not read/unread order, so that the 'continue'
value is still correct.

On top of that, if we have many unread notifications, they should
still be placed according to the dates, so the API must bring back
proper result.

In this fix, we add 'unreadFirst' to filters, and only use that
filter when needed (namely, in the popup)

Bug: T136885
Change-Id: I3018d09b009d735402d83074a5ffcd14ea1c242a
2016-07-07 16:29:40 -07:00
Moriel Schottlender 7879f0c9f8 Change 'messages' to 'notices' throughout the interface
Bug: T139520
Change-Id: Ib7f4dc4ea1ff4c5d1fccdc5fdf0c66b049162cb2
2016-07-07 15:57:49 -07:00
Moriel Schottlender fcd2f41151 Store local source as 'local' rather than dbName
When we fetch the pages per wiki, the API returns an object that
defines the local wiki we are in as its dbName; this then gets
stored into the model as the source, which forces us to check against
the dbName whenever we want to perform an operation so we can tell
the API layer to fetch and perform the actions locally, rather than
use a foreign API.

The term 'local' makes no sense for naming the model (and upcoming
tech debt work will fix this) but it makes sense in the context of
the API layer -- and hence, the source name should follow suit.

This fix makes sure that the local wiki objects always have their
sources defined to be 'local', and thus making us use the test for
dbName in very specific points (when we get the data) rather than
throughout the codebase, randonly.

This is also the first step to allow proper updating of things like
seenTime accross wikis, especially in cases where we view a remote
wiki as if it is local (in the Special:Notifications page)

Change-Id: I94633a1cd074580cbc5029d7c75d179e908e5c52
2016-07-07 12:20:39 -07:00
Moriel Schottlender 5c81ac8d3b Properly aggregate the itemUpdate event
Instead of 'cheating' and externally aggregating the itemUpdate event
we should just let the relevant (non-xwiki) models aggregate this
centrally and properly, and include it as an offered event.

Change-Id: Ibe528fe971e1be8309a97275b1a1be8979306ff5
2016-07-07 19:08:47 +00:00
Matthew Flaschen 5022af0b22 Correct section (alert/message/all)
Fix issue where it said 'View x messages' in the alerts popup.

Change-Id: I4b6d00f0ba704ec76c6b5068ab923e51d5804f07
2016-07-06 20:15:47 -04:00
Stephane Bisson db838e42ce Keep bundled notification compact header on one line
Bug: T139321
Change-Id: I4b0a7173bc06a0760efff544bcc28a59ba72ce7f
2016-07-06 20:44:00 +00:00
jenkins-bot 4d5e4505df Merge "Followup Iae32cbf82cdb: Set width to Special:Notifications" 2016-07-05 21:52:34 +00:00
jenkins-bot 27a1572d5c Merge "Use accessible colors on read status marker" 2016-07-05 21:50:03 +00:00
Moriel Schottlender f07a825b23 Followup Iae32cbf82cdb: Set width to Special:Notifications
Following up on setting max-width, this actually should be strict
width for the moment (until we decide on more responsive design)
since without restricting width, the notification view becomes really
thin and compact if the list contains notifications that have short
titles and descriptions.

Bug: T138433
Change-Id: Ia663f7968033b01f3553a326f70736cc6a6a54a9
2016-07-05 14:38:24 -07:00
Moriel Schottlender 0340611b72 Set a fixed max-width to the Special:Notifications page
This is to make sure that concatenation of text inside items works
properly given CSS table-layout.

Bug: T138433
Change-Id: Iae32cbf82cdb91880c7ccd7df14d167eb75527cf
2016-07-05 11:23:01 -07:00
Stephane Bisson cead7142c7 Fix mark xwiki as read
Marking local or xwiki notifications as read
are different operations that require different
information. Call different functions on the
controller.

Bug: T139114
Change-Id: I824ca668c31ab41d101c632442c91d3a8a1e5c5a
2016-07-04 10:00:59 -04:00
Volker E 135f96a13a Use accessible colors on read status marker
Using accessible colors on read status marker notifications.

Bug: T139167
Change-Id: I2dc35d02abe2fccaf1f9d13d7672b2e432e7d1f0
2016-07-01 21:56:08 +02:00
Moriel Schottlender 984441f8d9 Pad the content so it doesn't stretch beyond the markread button
Bug: T136572
Change-Id: I1db8289722526184b64dbb3e92827988a0e04afc
2016-06-30 15:45:34 -07:00
Moriel Schottlender ce354678b4 Limit 2 secondary actions outside the menu
If there are more than 2 prioritized actions, put those actions
in the dotdotdot menu.

Also, correct the name of a variable from "isInsideMenu" to what
it actually represents, which is, in fact, "isOutsideMenu"

Bug: T126617
Bug: T125949
Change-Id: I95fcae8f822e51d9353599c09f1550797e4ad673
2016-06-30 11:59:37 -07:00
jenkins-bot 95681a694c Merge "Clean up another bit of leftover OptionWidget styling" 2016-06-29 17:22:17 +00:00
jenkins-bot 8a8666637e Merge "Use pointer cursor when hovering CrossWikiNotificationItemWidget" 2016-06-29 12:46:41 +00:00
Roan Kattouw 2488cf0491 Clean up another bit of leftover OptionWidget styling
This rule ensures that long human-readable wiki names
don't cause horizontal scroll bars in the notifications
popup.

Change-Id: Id0c954d2059aeed875fa2eea7a45537aac4e2e58
2016-06-29 12:02:15 +02:00
Roan Kattouw 4ca406e4e8 NotificationItemWidget: Apply hover colors
Also remove OptionWidget-related styles that no longer apply.

Bug: T138917
Change-Id: I9e748549bcfa5aac5a68f0c51cbbe4c0a4537676
2016-06-29 11:55:30 +02:00
Roan Kattouw 254c3309e0 Use pointer cursor when hovering CrossWikiNotificationItemWidget
The bounding box of where this cursor effect is applied isn't
quite the same as with bundled notifications (which in turn isn't
the same as with normal notifications), but to fix that we need
to normalize the DOM structures of the three types. They
currently differ in the presence/absence of the <a> wrapper
and in how padding and margins are used.

Bug: T138913
Change-Id: I1ed32e0a9deca62b68d08acd0699431ddda8ca44
2016-06-29 11:22:10 +02:00
Stephane Bisson f8a8d392d6 Expandable bundle
Support bundles being expandable
to show their sub-notifications.

Bug: T114356
Change-Id: I1507cae360f45cc87f2d60e966b4d047abfa202d
2016-06-28 15:37:54 -04:00
jenkins-bot 731cde01b8 Merge "Dynamic bundles" 2016-06-28 19:34:42 +00:00
Moriel Schottlender e15c258d7b Remove initiallyUnseen before marking item read/unread
If we are marking the item as read/unread, we don't want the change
in class to trigger the unseen animation. When that happens, first
remove the 'initiallyUnseen' class (that triggers the animation)
and only then mark the item as read or unread.

Bug: T138522
Change-Id: I05e02518feb1fc166297594053a084718dcb7194
2016-06-28 11:25:39 -07:00
jenkins-bot 1cca7453b3 Merge "Add a PromisePrioritizer and use it for notifications fetching" 2016-06-27 17:42:41 +00:00
Roan Kattouw 9429e78e61 ToggleReadCircleButtonWidget: Tweak colors per Pau
Also add border-box to prevent the circle from appearing
to grow when a border appears.

Bug: T126214
Change-Id: Id5e89ff87759c4ae44851d5ad3061230a0e59ff0
2016-06-27 17:16:54 +02:00
Stephane Bisson 24caf50ff6 Dynamic bundles
To allow individual notifications to be
marked as read/unread or moderated,
bundles are created by grouping associated
notifications when they are fetched for display
instead of when they are created.

From a product perspective, this change doesn't
introduce moderation or expandable bundles but
it counts each individual notifications.
For instance, the bundled notification
"3 new topics on PageA" now counts as 3
notifications.

Bug: T93673
Bug: T120153
Change-Id: Iacd098573efd92bb1e3fcd7da4cd40cea9522f15
2016-06-27 09:49:13 -04:00
jenkins-bot 79aad8f479 Merge "Add support for querying notifications not associated with any page" 2016-06-27 13:35:02 +00:00
jenkins-bot 711e2f84c2 Merge "CrossWikiUnreadFilterWidget: Remove unused this.localSource" 2016-06-27 13:28:06 +00:00
Roan Kattouw 8bb8594940 Follow-up 6c4bf99da8: Fix incorrect comment
Change-Id: I14df92823d8e3c19b94cc225f00d45315e8300c5
2016-06-24 01:14:47 +02:00
Roan Kattouw 7d97881344 Add support for querying notifications not associated with any page
Uses the magic value '[]' to mean 'no title'. This is a bit ugly,
but I think introducing an additional &notwithouttitle=1 parameter
is uglier and results in more code.

Change-Id: I83278182aeaf3905eb0f3e24c4c6c247720b1e76
2016-06-24 00:37:21 +02:00
Moriel Schottlender a1ec29d06a Add a PromisePrioritizer and use it for notifications fetching
This will allow us to let the user click filters quickly, effectively
changing the promises sent to the API, but let the API only resolve
with the latest requested promise.

Bug: T136895
Change-Id: I698a2b8eced6d8ee997efef353697d27d92cfb2f
2016-06-23 14:12:00 -07:00
Stephane Bisson 462ef564e8 Fix position of page filters in firefox
Bug: T138454
Change-Id: Ib19f9ab1cedc4613c9ac3a07d40111dd39a55774
2016-06-23 16:18:50 -04:00
jenkins-bot c90176a2cb Merge "ApiUnreadNotificationPages: Output pages as an array rather than an object" 2016-06-23 19:35:37 +00:00
Roan Kattouw eae458801f CrossWikiUnreadFilterWidget: Remove unused this.localSource
This also means PageFilterWidget can stop worrying about being
given a nonexistent source.

Change-Id: Id999a117c66d0600a4386713c98501cc5ed4236a
2016-06-23 17:44:08 +02:00
Roan Kattouw 6c4bf99da8 ApiUnreadNotificationPages: Output pages as an array rather than an object
Make the frontend code based on page titles rather than page IDs.

Change-Id: I79c6a0e3a7178acdb14039a0c5208e90a7341044
2016-06-23 17:00:51 +02:00
jenkins-bot 190994bab2 Merge "Use the actual total notification count in the special page sidebar" 2016-06-23 11:05:14 +00:00
Stephane Bisson c93800e17c Support for PlaceholderWidget with no link
Bug: T137490
Change-Id: Ia861b5aa3f100124418956a0e09603a9ba29215a
2016-06-22 12:54:13 -04:00
Roan Kattouw e4b79c1bc2 Use the actual total notification count in the special page sidebar
Adding up numbers in the front-end is not enough, because it could
be that not all pages are listed (it's a top 10). So get the
total count from the backend.

Change-Id: Ibbc76691ef88333b92132a514fdba3cde3797e10
2016-06-22 17:11:34 +01:00
jenkins-bot 45d8fdf24f Merge "Add a cross-wiki sidebar to the Special:Notifications page" 2016-06-21 21:57:48 +00:00
Moriel Schottlender 820d2b0fa7 Add a cross-wiki sidebar to the Special:Notifications page
Add a sidebar with cross-wiki sources and pages of unread notifications.
The filter allows the user to fetch notifications from a foreign source
and specific pages if those exist.

Bug: T129366
Change-Id: I57d827a47f80274d75364c2099a9624049a26834
2016-06-21 14:49:42 -07:00
Ed Sanders 1f002745a7 Wrap table-cell buttons in table-row
Removes unwanted 2px bottom margin from footer buttons.

Change-Id: I67c1d5f21d7c62a436010932e3d7b6257e4b73ff
2016-06-21 20:24:20 +01:00
jenkins-bot b846c11910 Merge "Change mark as read buttons to circles" 2016-06-21 19:06:00 +00:00
Moriel Schottlender f84808b83a Change mark as read buttons to circles
Allow for mark read and mark unread through the side button, and
change its style according to spec in the ticket.

Bug: T126214
Change-Id: I78a93c0545bbe2d7c11a0c62557cd2e97e9d3866
2016-06-21 11:54:00 -07:00
Roan Kattouw 92d1d600ae SubGroupListWidget: use timestamp from model, not from listWidget
This ensures that the fallback timestamp is used if the list is
still empty. Not doing this causes the wikis in the cross-wiki bundle
to appear in the wrong order. Also, it makes more sense to use the
model as the source of truth regardless.

Bug: T138115
Change-Id: Icbfdc7e7c7f67179e50f0f692aef1a54568265e6
2016-06-21 13:41:45 +00:00
Stephane Bisson 5a5e1970c5 Improve client-side unread count estimation
- Remove duplicated counter adjustments.

- Differentiate between all IDs to mark as
  read vs. all IDs that represent visible
  notifications when adjusting the counter.

Change-Id: I1b3e52a929c6e920e3b782c9ef028539b3db0c99
2016-06-21 08:27:39 -04:00
Roan Kattouw 2872b5eae2 Remove automatic mark-as-read-when-seen
Bug: T132525
Change-Id: I095704252eaf2f8fe71950a4cfcd42a6fce431ff
2016-06-17 17:09:25 +01:00
jenkins-bot 1a9656691f Merge "Don't mark alerts as read when seen" 2016-06-14 15:34:11 +00:00
Stephane Bisson 26bc47c1b2 Don't mark alerts as read when seen
This is done the quick way by just turning
off a config option. The full cleanup
is in I095704252eaf2f8fe71950a4cfcd42a6fce431ff

Bug: T132525
Change-Id: I5becaa2f91b7eff6ebe4ce3943e86975c844c884
2016-06-14 08:50:47 -04:00
Roan Kattouw 65c6b8cbaf NotificationBadgeWidget: Fix header getting larger when "Mark all as read" present
The "Mark all as read" button had margins that made it just a little
bit taller than the header would otherwise be. This pushed the
bottom border of the header and the top border of the first notification
away from each other.

We only need top and right margins on this button, so drop the
bottom and left margins.

Bug: T137778
Change-Id: I8d47d84c79cbdad707b8cbaa8d43187c054755b3
2016-06-14 11:12:54 +01:00
jenkins-bot b98392824d Merge "Separate model's symbolic name and model's source" 2016-06-13 12:30:15 +00:00
Roan Kattouw 4028160906 Use localized weekdays on Special:Notifications
Bug: T137634
Change-Id: I97d7058657782d1bbc878c30e0712b1a8833dda1
2016-06-13 13:09:51 +01:00
Moriel Schottlender 3101bfc537 Separate model's symbolic name and model's source
This should have been done from the beginning; the model manager
pulls models by their symbolic names. So far, we've used the source
for that, but that assumes that two modules always have different
sources, and that is absolutely not necessarily the case.

For example, internal local bundles will each be a model, but have
the same ('local') source. They should still be differentiated in
the manager by their names, but the source should state clearly that
it is local.

For this, the models now have "getName" method and the name is
created separately from their source. Items also preserve a
reference to their parent's symbolic name so they can provide
that for items that require the controller to manipulate a specific
model.

Change-Id: I8c39d5d28383d11fb330addce21e07d5c424da6f
2016-06-09 16:20:57 -07:00
Moriel Schottlender df18946387 Listen to 'mark as read' secondary link in xwiki bundles
We weren't even listening to the choose event from that menu in
xwiki bundles.

Bug: T136878
Change-Id: Ib15bb6888dadd154b97e5820972cdcdf8bd89d2e
2016-06-03 12:37:18 -07:00
Stephane Bisson aa578a44a1 Mark bundled notifications as read
In the current bundling system, only the
bundle base is mark as read. It leaves all
the non-base bundled notifications without
a read_timestamp. They would all appear
as read in the new bundling system.

With this change, all notifications in
a bundled are update with a read_timestamp
when the bundle is read.

The implementation of this change is
somewhat temporary as the new bundling
system brings changes to the models
and controller.

Bug: T136368
Change-Id: I70b71d722d8d62cbdd1adc004293030ef900ac94
2016-06-02 13:48:33 -04:00
jenkins-bot 7c89fc0fa2 Merge "No-JS special page: One-click mark as read" 2016-06-01 18:21:56 +00:00
jenkins-bot 6824dbd020 Merge "Display a message if there are no notifications in Special:Notifications" 2016-05-31 23:22:43 +00:00
jenkins-bot 0d56040d06 Merge "Clean up the pagination in Special:Notifications" 2016-05-31 23:22:39 +00:00
Moriel Schottlender cf99479468 Display a message if there are no notifications in Special:Notifications
The zero results can either be because there are no notifications
at all for this user in the local wiki, or because there are no
results for the specific filter. Both messages are used for either
case.

Also, clean up the display of push/pop pending for the inbox widget
and hide the label in case the message count is 0 or 1 notifications
as it is unhelpful and irrelevant in these cases.

Bug: T136586
Bug: T136574
Bug: T129363
Change-Id: I1465f772bb9f5247df645d6612f951e5fd7d38cf
2016-05-31 23:13:48 +00:00
Moriel Schottlender 6e21a620ef Clean up the pagination in Special:Notifications
Add a pagination widget with events and separate the logic for
organization. Let the widget listen to events from the pagination
model so it always keeps itself updated.

Change-Id: Id1df112cbb0d90195217e88fbee97a59170b99c5
2016-05-31 16:12:09 -07:00
Moriel Schottlender acc672ca64 Darken the dates in the Special:Notifications groups
Bug: T132739
Change-Id: I8dd4d481fde239528620fb245e2733780f76c689
2016-05-31 14:26:05 -07:00
jenkins-bot 683ef3b737 Merge "Adjust styling for Special:Notification items" 2016-05-31 18:39:06 +00:00
Moriel Schottlender 070656731d Adjust styling for Special:Notification items
The items should resemble the popup items, but the styles clashed
with the popup's cross-wiki notification item, so the image size
was smaller and the border was incomplete.

Bug: T136572
Change-Id: I3c3f825d469ccee1e711da21f627eeb9491e9480
2016-05-31 11:30:35 -07:00
jenkins-bot 7647737b00 Merge "Styling changes to Special:Notifications headers and toolbar" 2016-05-31 00:48:15 +00:00
Moriel Schottlender fd45db9eb2 Styling changes to Special:Notifications headers and toolbar
Bug: T136580
Bug: T136568
Change-Id: I1a7f08cca8884ada42eca50ba802b4d1e0b788e0
2016-05-31 00:40:07 +00:00
Moriel Schottlender cc3e40b408 Make the notifications list the pending element
Change the pending element to be the notifications list rather than
the whole inbox widget in the Special:Notifications page.

Bug: T136581
Change-Id: I82b073c9cd628f30c13305510d6604e3ef636c2a
2016-05-30 17:24:12 -07:00
Roan Kattouw d6c340f591 Display error message on API failure or empty result
Show an API failure message if the request failed.
Also take this opportunity to show a message in case
there are no notifications at all.

Bug: T136467
Change-Id: If5761ec3d3df10a8774561bed06a4ade54458c4b
2016-05-30 15:01:33 -07:00
jenkins-bot a0aead0416 Merge "Fix JS error when API request fails" 2016-05-30 08:59:50 +00:00
Roan Kattouw ab1bcbefd4 Fix JS error when API request fails
We don't show an error message in this case, just an
empty popup, so that should be fixed regardless.

Bug: T136467
Change-Id: I06ddd5306bd8d7edeb8c75bdae7abd7215285e3d
2016-05-29 21:18:59 +00:00
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
jenkins-bot 6d3e9babb9 Merge "Fix regression from 0fc63bde36: unbreak number formatting in short timestamps" 2016-04-17 18:18:56 +00:00
Stephane Bisson f3ce2de964 Add tooltips for 'mark as read' and 'more options'
Bug: T130831
Change-Id: I1533d20019157c05f9354a60661512a33920c336
2016-04-15 16:30:14 -04:00
Matthew Flaschen 732c8496f0 Also show the survey tooltip on click
To implement this, use PopupButtonWidget and override to handle hover
in addition to click.

Bug: T128937
Change-Id: I79f5bb5839491516b0a3f77630b481cd6c2cc3da
2016-04-08 17:13:28 -07:00
Roan Kattouw a4ea2de123 FooterNoticeWidget: Set image height explicitly
If we don't do this, the footer becomes slightly taller
when the image loads, which makes the popup clip incorrectly.

Change-Id: Ica84d704692676d884b847f8fe01c49319f04931
2016-04-08 17:13:28 -07:00
Moriel Schottlender bdb50c7b60 Update notifications when reopening the popup
When reopening the popup, update the notification list to reflect
changes.

Bug: T127027
Change-Id: I6c3e948293b7c25cfab37f96b1faaca844014c28
2016-04-06 15:09:03 +00:00
Roan Kattouw a9c6515a4b Fix regression from 0fc63bde36: unbreak number formatting in short timestamps
We were using momentjs here before (causing bug T123845),
but we switched to using a hack for short timestamps.
This hack didn't call convertNumber(), so we stopped performing
number formatting for languages that don't use Western Arabic
numerals (0-9).

Strictly, that regression "fixed" T123845 because it caused
0-9 to be used in all cases, including the case that that bug
asked for. This patch fixes the regression but preserves the
desired behavior for arwiki, since convertNumber() respects
$wgTranslateNumerals.

Bug: T123845
Change-Id: Ic9acb12f534e0f049e22577afe276f8bf68f691d
2016-04-02 18:40:22 +03:00
Matthias Mullie f1c708ef9e Make foreign NotificationGroupItems aware of their section
This caused notifications on mobile to show notifications for
both alert|message, as the type was always "all".

Bug: T130801
Change-Id: Ice245eb407ca360d8e882c0ba48cb7b3e0ecb851
2016-04-01 15:38:22 +02:00
jenkins-bot 722f9f58a8 Merge "Remove unused icon files" 2016-04-01 11:15:53 +00:00
Roan Kattouw c15cb2675f jscs: Enable checkRedundantParams and make pass
Change-Id: I3182708b5ab5b127b7e4a32d875d390485370816
2016-03-31 07:12:46 +00:00
jenkins-bot ffa21614c3 Merge "jscs: Enable checkRedundantReturns and make pass" 2016-03-30 20:36:27 +00:00
Roan Kattouw 8f01e880b6 Change threshold for survey invitation from 2 unread notifs to 1
Bug: T128937
Change-Id: I28d5d46a5ecd1c184269b7f8d3ba984bfedad77b
2016-03-29 17:25:40 -07:00
Moriel Schottlender e0ffd26c23 Change parameters for user survey footer message
Bug: T128937
Change-Id: Idd299293fad8264298174bc372318445cf26c4d3
2016-03-28 13:45:59 -07:00
jenkins-bot cd6f1b80ff Merge "Stop counting notifications objects on the client" 2016-03-25 20:45:44 +00:00
jenkins-bot d91612014a Merge "jscs: Enable checkParamNames and make pass" 2016-03-25 20:37:02 +00:00
Stephane Bisson 623d07011c Stop counting notifications objects on the client
The flyout loads no more than 25 notifications
from a given source. Using those in-memory notification
objects to count how many are currently unread (and
update the badge) produces a result of at most 25.

This patch extracts the responsibility or counting the
unread from the Model/Item/Groupitem structure into
a new UnreadNotificationCounter class. It receives
estimated updates from other components and synchronizes
with the server after markRead/markUnread operations
have completed.

Bug: T129726
Change-Id: I9af4defc00dd491ed2b355eb4e85073476e08ce7
2016-03-25 15:31:00 -04:00
jenkins-bot 9aa272b721 Merge "jscs: Add "checkTypes": "strictNativeCase" and make pass" 2016-03-25 19:27:26 +00:00
Roan Kattouw df8e97173f jscs: Enable checkRedundantReturns and make pass
Change-Id: I8013198fdb5852246a0f8360b931334740eaa147
2016-03-25 11:54:55 -07:00
Roan Kattouw ee7b10bf4b jscs: Enable checkParamNames and make pass
Change-Id: I50340b156b7c23483da1613eaabe8f40c559660a
2016-03-25 11:54:44 -07:00
Roan Kattouw 44a015970f jscs: Add "checkTypes": "strictNativeCase" and make pass
Change-Id: I4be0d72ba192f0b79a92f5efa2f5a16fb0f327b5
2016-03-25 11:47:00 -07:00
Moriel Schottlender 2df435c1fb Styling changes to the footer message
Change-Id: Ie57c0f981671392b751a9774de7be6bb187de3b8
2016-03-24 15:42:10 -07:00
jenkins-bot 22958ab0d0 Merge "Apply text-decoration: none; on non-hover as well" 2016-03-24 01:04:00 +00:00
Roan Kattouw 011bd2e558 Apply text-decoration: none; on non-hover as well
Hover effects aren't the only thing that cause link underlining,
the "Underline links" preference can do this too.

We do still need the :hover selectors too, for specificity reasons.

Bug: T130793
Change-Id: I01c0eaee449470380f3bd752e509043c4580fea9
2016-03-23 16:12:29 -07:00
Moriel Schottlender 94fa679568 Remove duplicate mobile module
Followup to I7891eb3fb46b3 this should be merged only after
the changes in MobileFrontend in Ie592ca738ac2d82 are merged.

Change-Id: I0f28e0757170e8a5b12075d3e9a2343fea7e7155
2016-03-23 20:00:52 +00:00
Moriel Schottlender 06ae707d6e Rename MobileNotificationsWrapper to NotificationsWrapper
We need to use it in more than just the context of mobile, and
there is nothing actually mobile-specific in it. Renaming the
class so it isn't awkward to use elsewhere.

This makes the ext.echo.ui.mobile module unnecessary, but
we leave it in until next patchset so that MobileFrontend
doesn't crash while we wait for the adjustments in
Ie592ca738ac2d8 to be merged.

Change-Id: I7891eb3fb46b350f0b325bf0a2b56b2cd55ff1d7
2016-03-23 19:47:23 +00:00
jenkins-bot cf99b3214e Merge "Add footer notice widget for invitations for feedback" 2016-03-22 19:32:57 +00:00
jenkins-bot 3a246a2ea2 Merge "Sort wikis by timestamp of most recent notification" 2016-03-22 17:17:50 +00:00
Moriel Schottlender e50ef3841a Add footer notice widget for invitations for feedback
Add a mw.echo.ui.FooterNoticeWidget that includes a link to
a feedback survey, and three config variables:

* $wgEchoShowFooterNotice: Enable this feature per wiki
  (Defaults to false)
* $wgEchoFooterNoticeURL: The URL for the survey
  (Defaults to '')
* User preference 'echo-dismiss-feedback-alert': determines
  whether the user permanently dismissed the feedback alert.
  (Defaults to false)

Bug: T128937
Change-Id: I918a70beaba7b173e764519fe4fe0f780b61082d
2016-03-18 17:02:31 -07:00
jenkins-bot 8b15325346 Merge "Make plural support for large values (100 or more) explicit in l10n" 2016-03-17 21:53:40 +00:00
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
Matthew Flaschen cac85b635f Make plural support for large values (100 or more) explicit in l10n
This involves:

* Making this value no longer admin-configurable.
* Changing getNotificationCountForOutput to return only a single value
  Since there is no + in the formatted value anymore, we can actually
  use the same value for both.

  This is a B/C break, but hopefully worth it to simplify the method
  call.

  For now, the excess parameter is just marked unused.  It could be
  removed at some point if the translations are updated.

This must be merged at the same time as:
* Flow - Ibfa56b1af9e8c56b4c5f900e0d487bc09688b2a2
* MobileFrontend - Ibf784b279d56773a227ff261b75f2b26125bbb63 (well, MF
  can be merged first)
* translatewiki - I2a4b6938aed49e4101deb6b9351c43656a863490

Also, change 1 to One/one, per Siebrand on the task.  This can easily
be dropped/undone if we don't want it.

Also, remove reference to no-longer-existent notification-page-linked-bundle

Bug: T127288
Change-Id: Iabeaae747f99980c0610d552f6b38f89d940b890
2016-03-16 18:43:16 -04:00
Roan Kattouw 02252d0531 Work around regression in OO.ui.FloatableElement
FloatableElement incorrectly believes it doesn't need to
position itself when its closest scrollable is the same as
the closest scrollable of the container. This causes
the dotdotdot menu to be placed at the top left of the screen
if the notifications popup is not scrollable. If it is scrollable,
everything works fine. This regression was introduced by I5b5d7936c4d.

Work around this by setting overflow-x: auto; on the popup body.
This is a no-op, but tricks OOUI into thinking that the popup
body is scrollable even when it visually isn't. We can't use
overflow-y for this, because we still need to set overflow-y: auto;
on the popup body to work around a Chrome bug where right-floated
elements don't move over when the scrollbar appears.

Bug: T130153
Change-Id: I8bd8a26a4931444a760d2159779240272c51f966
2016-03-16 15:40:27 -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
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
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
jenkins-bot 4de459b6b5 Merge "Fix bundled notification width" 2016-03-10 23:50:25 +00:00
Moriel Schottlender f210528a74 Fix bundled notification width
Bug: T129469
Change-Id: Iaabeab59543d3e271ef84926fb7c7d000a2abd04
2016-03-10 15:22:14 -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
Ricordisamoa 4107a4a495 build: Enable jscs jsDoc rule 'requireNewlineAfterDescription' and make pass
Change-Id: I264fafad95ddb4a4cc925815a62af83744f122e4
2016-03-07 14:29:15 +01:00
Ricordisamoa 9c83e14c59 build: Enable jscs rule 'requireVarDeclFirst' and make pass
Change-Id: Id1581858e59ea5f49804b6cf753b0c2860fb9855
2016-03-07 11:57:31 +00:00
jenkins-bot 8556b8037e Merge "Remove resolved TODO about adding wiki field to Schema:EditInteraction" 2016-03-04 23:06:07 +00:00
jenkins-bot a8909f44dd Merge "Styling adjustments for notifications" 2016-03-04 22:55:41 +00:00
jenkins-bot ff41a87105 Merge "Add a short abbreviation for timestamps in notifications" 2016-03-04 02:52:22 +00:00