Commit graph

203 commits

Author SHA1 Message Date
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 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 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
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
Roan Kattouw c15cb2675f jscs: Enable checkRedundantParams and make pass
Change-Id: I3182708b5ab5b127b7e4a32d875d390485370816
2016-03-31 07:12:46 +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
Roan Kattouw ee7b10bf4b jscs: Enable checkParamNames and make pass
Change-Id: I50340b156b7c23483da1613eaabe8f40c559660a
2016-03-25 11:54:44 -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
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
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
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
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
jenkins-bot 3fd75c41a4 Merge "Echo API layer" 2016-03-04 01:00:55 +00:00
Roan Kattouw e239d4c256 Use padding instead of margin to separate cross-wiki sections from each other
So that margin collapsing doesn't eat up the extra space we wanted to create.

Bug: T128069
Change-Id: Ib3b96c54c2ace52cf28047a5f9f012fcc56ccb9c
2016-03-03 16:19:45 -08:00
Moriel Schottlender 0834b91f56 Echo API layer
Split and refactor Echo network handling and create a proper API
layer for the UI to use consistently. Split Echo's API methods into
its own module so they can be loaded along with the initialization
script and manage the API requests.

Change-Id: I0526a14bb8cc0d9729a303e24ab6e43259cc86bb
2016-03-03 23:40:12 +00:00
Moriel Schottlender 541335d90f Styling adjustments for notifications
Bug: T125969
Bug: T128444
Change-Id: I3dba4fcddf5262450cce4ba384abfdc3518b7cb8
2016-03-03 23:11:19 +00:00