Commit graph

133 commits

Author SHA1 Message Date
Stephane Bisson ac4b0ea899 Make icon not overlap with confirmation message
Use widgets instead of mixins to compose the ConfirmationPopupWidget.

Bug: T184733
Change-Id: I608e820ef81b01efc54a13df5de189ef40ce335f
2018-02-02 20:31:43 +00:00
Ed Sanders 2121daac96 Don't hide notification popup when scrolling
hideWhenOutOfView is for preventing popups from appearing
outside their container, but in this case the container
is the document, so it is already clipped.

Bug: T178384
Change-Id: Ie0cd83849446cf74b61e708f0a1fa79f2384a94a
2018-01-22 15:32:35 -08:00
jenkins-bot d0550c9f6c Merge "Truncate page name in the sidebar and organize into table view" 2018-01-18 11:43:47 +00:00
Moriel Schottlender df4aa8ea0b Truncate page name in the sidebar and organize into table view
Organize into table view for consistency and truncate the title.

Bug: T184143
Change-Id: I0ae3105ea60dcc2ae6c0f7f2545368a5f86cb2c4
2018-01-16 12:09:01 -08:00
jenkins-bot 9e56017681 Merge "Use findItem(s)FromData instead getItem(s)FromData" 2018-01-11 01:37:27 +00:00
Bartosz Dziewoński ada3be576c mw.echo.ui.NotificationBadgeWidget: Do not flip popups
Bug: T183296
Change-Id: I3850cf71626d700a73bbefae7da9870d59491347
2017-12-30 00:51:18 +01:00
jenkins-bot 010bb75603 Merge "Move the popups to the overlay" 2017-12-21 18:14:50 +00:00
Moriel Schottlender 77acb5b3ee Move the popups to the overlay
This will solve multiple issues with the design having to overcome
the theme-based design for the #p-tools.

Bug: T156080
Change-Id: Ibfcdfeea649e566059fd88485e146fbad2201016
2017-12-20 15:44:27 -08:00
Prateek Saxena 391f14cb4b Use findItem(s)FromData instead getItem(s)FromData
Depends-on: Ia2110f71d1642f61451cb8acc7e8a930d0feb31f
Bug: T76630
Change-Id: Iddd1d3f5abaa233adbf030114343a8ed248de28b
2017-12-14 13:36:26 +05:30
Ed Sanders cfa130cc13 Use position:sticky for toolbar floating
Avoids any scroll-based DOM changes which slow down scroll events.
Removes floating in browsers without sticky support (mostly IE).

Change-Id: If75e2a90d76644296fe3db5ef8bd9b26de4e7b0c
2017-10-17 15:22:26 +01:00
Ed Sanders 892ba8e5fe build: Update eslint and other linters
Change-Id: I68b74742bea0c3d4c8e359fd7850beaa6bbc4190
2017-10-17 13:53:08 +01:00
jenkins-bot 31709919e4 Merge "Consistently use the message when updating count" 2017-09-18 15:08:17 +00:00
Moriel Schottlender 57f14931b6 Consistently use the message when updating count
The current initial message in the button label is "Alerts (x)" or
"Notices (x)" but when the badge loaded, we changed that to only show
the rendered number. This is inconsistent; the badge should always
update the label properly, even if it's not visible in most cases.

Bug: T173970
Change-Id: I6a5e13fc36ddb1bf467c712fcf49af3b18e582d0
2017-09-14 17:33:48 -07:00
Matthew Flaschen f80a11d53b Fix interpretation of 'prioritized'
Docs (especially in EventPresentationModel.php) say true means outside
the menu, false inside.

However, it was interpreting any non-undefined value as true.

Change-Id: Icb438538e5c588c1ac7d4bbac0b762dd07057199
2017-09-07 19:13:10 -04:00
Roan Kattouw 23252571a4 Migrate from FloatingMenuSelectWidget (deprecated) to MenuSelectWidget
Bug: T168679
Change-Id: I987a4b12560d03cc5eec7f8a57020a3e726a040f
2017-06-23 12:58:22 -07:00
Moriel Schottlender ebbe2e81af Make date headings a proper semantic <h2> heading
To support accessibility, make sure the titles in Special:Notifications
are <h2> headings.

Bug: T149955
Change-Id: I4f15694efb04896e9bd7b026d297891047759644
2017-04-13 22:39:28 +00:00
Mooeypoo 84d34a3901 Revert "Do not use fancy styled badge on Modern and CologneBlue"
This reverts commit 08d224e955.

Causes bugs in Vector when displaying the badges.

Bug: T162173
Change-Id: I9e92c304b47ce9204d7a7d2fba67118e67b1bdc9
2017-04-04 18:40:09 +00:00
Bartosz Dziewoński 08d224e955 Do not use fancy styled badge on Modern and CologneBlue
Just show the textual "Alerts (1)" and "Notices (1)".

Updated NotificationBadgeWidget to use that internally as label,
same as the PHP-generated list item does after d4d325e7.

Bug: T141944
Change-Id: I468c67b0866530e21c9af32cd02816075a3693a1
2017-04-01 14:57:34 +02:00
jenkins-bot 85c9397bce Merge "Fire 'ext.echo.badge.countChange' after DOM changes" 2017-04-01 04:52:54 +00:00
Moriel Schottlender 5c35535f36 Fire 'ext.echo.badge.countChange' after DOM changes
The event should fire after the count actually changes in the
DOM as well as the internal workings of Echo.

Change-Id: I03f1742b209305080af8784632f07dff63135d81
2017-03-30 15:22:02 -07:00
Roan Kattouw 089531c1e9 Fix JS error when closing notification popup while animating a moving notification
This failed because it tried to call .resetInitiallyUnseen()
on a ClonedNotificationItemWidget.

Change-Id: Ib675aecfb0d916bfb25f17ad738f3a493a49dd1b
2017-03-28 12:24:25 -04:00
Moriel Schottlender bee8aaa499 Add and listen to 'modified' event for popup clip()
Separate the behavior of promise vs event when changes happen and
we need to clip the popup. The popup should only clip itself after
the DOM has finished populating, not "just" after the model has
been populated with data.

Adding an event that triggers whenever the main list changes anything
that is in its DOM, and having the badge widget trigger a popup clip
will solve this issue and untangle the expectation of the promises
vs. the widgets populating themselves through the events.

Change-Id: Iff9996eb1810e7ade135359139e16837e6dc74f0
2017-03-07 14:35:42 -08:00
Stephane Bisson 01a1924187 Adjust unread counter position based on length
Move unread counter to the left (or right, in RTL)
when it's longuer than 2 characters so as to
have harmonious spacing between the counters and
the next link on the toolbar.

Bug: T142454
Change-Id: Ib8aa673cf9e60ade80490ea0eccb7453d3747cd0
2016-12-20 13:40:54 -05:00
Ed Sanders c8d24ebd17 build: Replace jscs/jshint with eslint
Change-Id: Iee1d1b20ed31e636bfb8fc8cf9b18ff328bf608c
2016-11-23 15:25:59 -08:00
jenkins-bot 84ad297d8e Merge "(re)Add JavaScript hooks to Notifications" 2016-10-14 22:36:37 +00:00
Moriel Schottlender e9264022a7 (re)Add JavaScript hooks to Notifications
Added the following Javascript hooks:
* ext.echo.notifications.beforeRender: Firing before a group of
  notification widgets are rendered, whether in the popup, in
  the special page, or in a cross-wiki bundle (which requires
  async loading)
* ext.echo.badge.countChange: Fired when the badge count changes
  with the notification type, count and the label count for
  display purposes.
* ext.echo.popup.onInitialize: Fired when the popup is opened and
  after notifications were fetched, with the context of the popup
  notification type.
* ext.echo.special.onInitialize: Fired when the special page is
  ready and notifications were fetched. Note that it will be fired
  whenever the special page is updated with notifications list,
  as well, like when changing filter, remote wiki or pagination.

The hooks were also documented in hooks.txt

Bug: T146296
Change-Id: Ie3dc97f97e8d1f90b67f62fcdc65dd29cb379aad
2016-10-14 17:25:25 -05:00
Kavitha Muthu cc2189f009 Remove notifications bottom controls
Bug: T140964
Change-Id: I5c1a07161ab75de0537c002785da89ebeadc508a
2016-10-13 14:16:46 -07:00
Roan Kattouw 4e5d2a8aa6 Use colors for pressed/selected options in the Special:Notifications sidebar
Unfortunately there's no generic support for using colors for icons in
OOUI yet, so we have to copy what OutlineOptionWidget does and
override setPressed()/setSelected() to add/clear the progressive flag.
Also reintroducing colors for text which are aligned with icons on
the different states and use transitions.

Change-Id: I07cf4011d28c1db4eefb451367e29c271b5efaeb
2016-10-04 17:21:26 -07:00
jenkins-bot 717b53dbe4 Merge "Make notifications top toolbar controls sticky" 2016-10-04 22:37:27 +00:00
Kavitha Muthu eed48aa7fe Make notifications top toolbar controls sticky
Bug: T140964
Change-Id: I483c91344918f602da3280b9f8ad7e966bf55596
2016-10-04 22:27:49 +00:00
Touhid Arastu 50384e2f30 i18n: Native digits on CrossWikiNotificationItemWidget
Change-Id: I982319c81405917461297e96e47030953d5070d4
2016-10-04 13:49:57 +03:30
jenkins-bot f40f1aa36c Merge "Convert 'seenTime' to a global property" 2016-09-20 23:22:26 +00:00
Moriel Schottlender 1575e2bb7a Convert 'seenTime' to a global property
This transforms seenTime concept to a global property for all wikis
and sources, and updates the global seen time on opening the popup.

Bug: T134855
Change-Id: I67bcc4b346237317c7a9204dd43cd0e9ee02792f
2016-09-19 14:37:31 -07:00
Moriel Schottlender 58c53af1d1 Remove primary link from the bundle of page linked notification
Also, make sure that the bundle follows the same behavior as the
xwiki bundle, where if it does not have a primary link, the 'click'
event triggers the 'expand' action.

Bug: T145902
Change-Id: I456bf76a7bd531ffcad5462708f37cd54d8af99d
2016-09-19 14:16:43 -07:00
Catrope bba984c002 Revert "Make seen/unseen badge more consistent across wikis"
Has bugs, and will likely cause deployment problems.
This'll need to be reverted in wmf.19 at least
until we fix it up.

This reverts commit 00e0b9f45d.

Change-Id: Ia9d220ebcb607f96dee6bc856755305ed8501fcc
2016-09-13 14:21:32 -07:00
jenkins-bot 4063a26c0e Merge "Allow for count cap display in Special:Notifications sidebar" 2016-09-13 17:26:36 +00:00
jenkins-bot 1159a14b1f Merge "Generalize getCappedNotificationCount and move to counter" 2016-09-13 16:07:18 +00:00
Moriel Schottlender fcc2e1ddfc Allow for count cap display in Special:Notifications sidebar
Some of the counts are capped (wiki counts) and some are not (page
counts) - so we are adding a config option ('isCapped') to the
widget to make sure that capped numbers appear with the proper
i18n message ('99+' in English) and non-capped numbers appear
as-is.

Bug: T144707
Change-Id: I7332e7f5108621d0bd403edefe4feacca44b1f88
2016-09-12 16:35:38 -07:00
Moriel Schottlender dbd2f4ccf7 Generalize getCappedNotificationCount and move to counter
This follows the generalization we made in the back-end and allows
us to always use the same method to get capped notification count
in the display.

Bug: T144707
Change-Id: I4d7f406b05a195972dca0d2088bde2ff739d313d
2016-09-12 15:32:52 -07:00
Moriel Schottlender 5e8377b2f6 Make sure to use mw.language.convertNumber on displayed counts
In the special page, the counts should always display with
mw.language.convertNumber.

Change-Id: I9acafff9a35f2d3a1eb83ad003e57491905cb233
2016-09-12 22:02:13 +00:00
Moriel Schottlender 42832ad04a Use echo-badge-count message for cross-wiki counts in Special:Notifications
These numbers are already "capped" for display as 99+ after they pass
100, so we should use this message for proper display.

Individual page number counts are not capped (they are accurate) so
they can remain the same.

Bug: T144707
Change-Id: Iecb877c11e2f372d58f4fc926119dbf3b316e825
2016-09-09 13:11:34 -07:00
Moriel Schottlender 00e0b9f45d Make seen/unseen badge more consistent across wikis
- Add a 'hasUnseen' data to the xwiki bundle so the badge can
  consider its value when changing its color even without the
  bundle being opened.
- Check and store seenTimes from all sources that the xwiki
  has in a new JS object that the SeenTimeModel can store

Bug: T134855
Change-Id: Ifdcee88b4378cdc7acb4ae5c0cbc60b76339757e
2016-09-08 12:40:15 -07:00
Moriel Schottlender ed453c1026 Hide separator when bundled item is expanded
Bug: T142260
Change-Id: I5ea12d426c29a4b82bdfa5453d14841800b7a108
2016-09-07 16:44:03 -07:00
jenkins-bot 32e8a8c845 Merge "Add confirmation popup widget" 2016-09-02 23:28:09 +00:00
Moriel Schottlender 4047f2f2c1 Hide xwiki widget separator when widget is expanded
Bug: T142260
Change-Id: I24fbd6bd2eba3c7b2d16cb1e46130cfd4a981fb3
2016-09-01 14:30:49 -07:00
Moriel Schottlender f449c68780 Add confirmation popup widget
Mainly used for mobile actions, and should be appended to the
overlay - this widget assumes it should appear and then fade out
with some confirmation message.

Also moved 'doubleCheck' icon to the ooui definitions, including
an inverted icon that is necessary for this widget.

Bug: T141404
Change-Id: I67a44962eaee6b7bd8cac26dcb5277177fa5d224
2016-08-31 14:47:59 -07:00
Moriel Schottlender 4eab01b3b4 Display a message when API fail due to session end
Bug: T144231
Change-Id: I3ced44de097ba5b17d9edb91d4e3c527a5f18f03
2016-08-29 12:56:56 -07:00
Matthew Flaschen 299b66f937 Dynamic actions: Reuse label/description for those fields
This is necessary to preserve backwards compatibility for the API, and
this also fixes the no-JS special page.

Also, fix additional warnings.

Change-Id: Id603b4ab22c69097d5559a756bec72a6ba785661
2016-08-25 22:00:25 -04:00
jenkins-bot 4e99a5095f Merge "Add dynamic secondary actions to notification items" 2016-08-23 17:43:08 +00:00
Moriel Schottlender 480ce92bd8 Add dynamic secondary actions to notification items
Allow extensions to add dynamic actions that perform some
API request and display a confirmation message.

Bug: T132975
Change-Id: Ib16d57c3f1a11a9749564c6e2112bf1ca32c55e8
2016-08-22 16:04:48 -07:00