Commit graph

10 commits

Author SHA1 Message Date
Sam Smith dfccc55bb5 Forward PopupsBetaFeature to the client
Bug: T146889
Change-Id: I66739b01e405bd7be29e912388005e0bb1f25b3f
2017-01-15 11:04:44 -08:00
Sam Smith 98b2dcf631 Hygiene: Rename SchemaPopupsSamplingRate
The SchemaPopupsSamplingRate config variable is inconsistently named and
even forwarded to the client as wgPopupsSchemaPopupsSamplingRate.

Changes:
* SchemaPopupsSamplingRate -> PopupsSchemaSamplingRate
* Forward PopupsSchemaSamplingRate to the client as
  $wgPopupsSchemaSamplingRate.

Bug: T146889
Bug: T146434
Change-Id: I80d6a0abccf462e2eb0fd96af6849b5e82b49c26
2017-01-15 11:01:00 -08:00
Piotr Miazga c13ab30bfa Move conflicting NavPopups gadget name into config var
Changes:
 - removed hardcoded comflicting Navigation Popups gadget name
 - introduced a config variable to specify conflicting gadget name

Bug: T151058
Change-Id: Ief5c6f90ec6dd6c074931f7d9ff20297d4718fe5
2017-01-12 18:07:20 +01:00
Piotr Miazga 211f1d1658 Disable Page Previews preferences when NavPopups are enabled
Changes:
 - introduced PopupsGadgetsIntegration class handles all checks
 - show help message on Preferences page when NavPopups is enabled
 - unit test everything

Bug: T151058
Change-Id: Ia474b1b30378efe84dedf3ad47c1f833e88d69b5
2017-01-11 01:06:48 +01:00
Piotr Miazga 05eccb31c1 Hygiene: use UserGetDefaultOptions instead of ExtensionRegistration
Changes:
 - removed onExtensionRegistration and related TODOs
 - introduced onUserGetDefaultOptions hook

Change-Id: I6648802c19d90df36a211d6494033aca30c078ca
2017-01-10 18:34:43 +01:00
Piotr Miazga c3cfcbe0e0 Inject preference option directly after skin select
Per #Design's mocks, the "Reading preferences" section should appear
immediately beneath the Skin section, if it's present.

Changes:
 - onGetPreferences will try to inject PagePreviews option after
skin section or on the end of section when skin select is not available
 - unit tests for new behaviour

Bug: T146889
Change-Id: Id14c0774aee917b7e949ab3ba5968a038b3ca933
2016-12-21 16:53:33 +00:00
Piotr Miazga c587a9785b Hygiene: Improve code quality by reaching 100% coverage
Changes:
 - added missing unit tests
 - introduced PopupsContextTestWrapper, removed all unit-tests logic
   from Hooks/Context classes
 - removed getModule() from Popups.hooks.php, it's hooks responsibility
   to keep single context instance
 - removed class_exists calls, use ExtensionRegistry instead
 - pass ExtensionRegistry as a dependency so it's easy to mock
 - reach 100% code coverage
 - introduce PoupsContext::isBetaOn() as it was used in many places

Change-Id: Id014efe72edf24628539c76968e53eb3e06709f4
2016-12-21 16:03:33 +01:00
Piotr Miazga 147772bbd8 ext.popups module should be loaded for anon users
Bug: T146889
Change-Id: I11dc6208334daa556d376f04aeb099a2642fcec0
2016-12-21 10:38:36 +00:00
Piotr Miazga 959bf40d9b Implement necessary wiring for preferences
Changes:
 - introduce unit tests
 - don't send module for anonymous users
 - renamed Module to Context
 - remove Config dependency from Popups.hooks.php

Bug: T146889
Change-Id: I3cbcdc1303411b28b613afa6dd1a00b410891471
2016-12-20 16:54:33 +01:00
Piotr Miazga f597e341af Introduce Opt-In option on user preferences page
This changes introduces new option on Special:Preferences page that
allows users to enable/disable Page Previews feature.
By default feature is disabled. Temporarily option in Preferences
page is smoke and mirrors as switching logic is still WIP.

Bug: T146889
Change-Id: Ifdd17ce265d2d4c7583433ed4991443c563f1fe3
2016-12-16 01:06:59 +01:00