Commit graph

1434 commits

Author SHA1 Message Date
jenkins-bot 6ef2816fbd Merge "Hygiene: Dependency Injection for Popups" 2017-07-26 16:28:34 +00:00
Translation updater bot aafe4b8080 Localisation updates from https://translatewiki.net.
Change-Id: Ia5d7849f66ac5b3150ee39da1eb35d320b7f2d36
2017-07-25 22:37:54 +02:00
Piotr Miazga 3d0c5b1cc3 Hygiene: Dependency Injection for Popups
Changes:
 - removed ugly PopupsContext::getInstance
 - removed ugly PopupsContextTestWrapper helper
 - defined all services inside ServiceWirings
 - fixed unit tests to test classes directly or use MediawikiServices

Change-Id: Ie27e28bb07aebe01014848c290369b1b1f098e9b
2017-07-24 22:41:28 +00:00
Translation updater bot 7431854374 Localisation updates from https://translatewiki.net.
Change-Id: Iabeb98f756b4f7c631150cce5a1eae78fdada75c
2017-07-24 23:09:54 +02:00
Sam Smith 8e00ecc5d1 i13n: popupEnabled = false for disabled event
... for consistency with the server-sent disabled event introduced in
I63faecb0.

Bug: T167365
Change-Id: I3a96df5279f6f0f4e573765735ab0e1fc6f406a8
2017-07-24 17:31:59 +00:00
jenkins-bot 12a1a7201e Merge "Hygiene: Update required MediaWiki version" 2017-07-24 16:02:08 +00:00
Piotr Miazga 4bc3aeeaa0 Hygiene: Update required MediaWiki version
Per I28003c5898d64031e1efb212cb0bec58ff44b958 Popups require at least
MediaWiki version 1.30. Documentation should respect that

Change-Id: Ifc87ac5cdcf61ae54cefe3f6ccab7aac5c52e0a6
2017-07-24 16:12:03 +02:00
Kunal Mehta 9dfa3e5ee5 build: Updating mediawiki/mediawiki-codesniffer to 0.10.1
Change-Id: I835fadf053efea56a3037d7b64af8feca12f9c0f
2017-07-23 00:35:36 -07:00
Translation updater bot d07bed3093 Localisation updates from https://translatewiki.net.
Change-Id: If65162a748e28fcf8b10272fd1b92b5a2eb3aeb6
2017-07-21 22:47:38 +02:00
Translation updater bot da667c980d Localisation updates from https://translatewiki.net.
Change-Id: Ib04f86edaae0ffccfc9a1a999079452f58e94f06
2017-07-20 22:56:14 +02:00
Translation updater bot d1513da942 Localisation updates from https://translatewiki.net.
Change-Id: If257ec909d3ad8e73276cc05057ce2abe297faa0
2017-07-18 22:58:58 +02:00
Translation updater bot 18821a70a1 Localisation updates from https://translatewiki.net.
Change-Id: I8e6b34d20712fe13429898e2d88c16301df594cd
2017-07-17 22:59:54 +02:00
Piotr Miazga c0052fcb08 Re-enable MediaWiki.Commenting.FunctionComment.MissingDocumentationPublic sniff
Bug: T168384
Change-Id: I4d4681121df974a8471d7c4c8df8a6158f8df22a
2017-07-13 21:14:29 +02:00
jenkins-bot 8ea2211719 Merge "Re-enable MediaWiki.Commenting.FunctionComment.MissingReturn sniff" 2017-07-13 17:42:22 +00:00
jenkins-bot 22d9ef3e24 Merge "Re-enable MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment sniff" 2017-07-13 17:42:21 +00:00
Piotr Miazga 75ef7c4f93 Re-enable MediaWiki.Commenting.FunctionComment.MissingReturn sniff
Bug: T168384
Change-Id: I8d7b750503ca9c951267a948862c3685ea036100
2017-07-13 15:47:00 +02:00
Piotr Miazga 5b62bc625b Re-enable MediaWiki.Commenting.FunctionComment.MissingParamTag sniff
Changes also solve the MediaWiki.Commenting.FunctionComment.ParamNameNoMatch
sniff

Bug: T168384
Change-Id: Idd80e42943a57a4b6211c50a4aac2f1d20e6232d
2017-07-13 10:43:00 +00:00
Piotr Miazga b8e7a79a20 Re-enable MediaWiki.Commenting.FunctionComment.MissingParamComment sniff
Bug: T168384
Change-Id: I8b29f0ec6804e24ea4d61fb1bf1a528dddaf8fb8
2017-07-13 11:33:04 +01:00
Piotr Miazga 18b6675b4a Re-enable MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment sniff
Bug: T168384
Change-Id: Id64269f5950d6da5fee3f18825ce2d713d0446b0
2017-07-12 22:44:12 +02:00
jenkins-bot 311466cad0 Merge "Send disabled event when user disables Page Preview" 2017-07-12 14:16:36 +00:00
Piotr Miazga 8bba8c1417 Send disabled event when user disables Page Preview
Changes:
 - introduced new UserPreferencesChangeHandler class that listens to
 PreferencesFormPreSave hook
 - introduced wrapper for EventLogging extension plus NullLogger when
 EventLogging extension is not availalbe
 - when user changes PagePreview to disabled system will trigger
 disabled event

Bug: T167365
Change-Id: I63faecb0495eb30a9fc2763e7ddf3944baf7f55a
2017-07-12 15:59:42 +02:00
Translation updater bot 0fb8f5a65a Localisation updates from https://translatewiki.net.
Change-Id: I61de05da6e1679a12952612b7aba25c7cb59d9e5
2017-07-11 22:58:31 +02:00
Translation updater bot fa04af56c6 Localisation updates from https://translatewiki.net.
Change-Id: I1a6585835a1721ba30f7e23a2f7c634950a268fd
2017-07-08 00:18:40 +02:00
Translation updater bot 83aecd60b7 Localisation updates from https://translatewiki.net.
Change-Id: I40de42b4bb595fff4074f95766cd05e078c24fba
2017-07-06 22:55:34 +02:00
jenkins-bot 59290bcf4a Merge "Remove duplicate events filtering" 2017-07-06 18:05:18 +00:00
jenkins-bot eebd0c5e8b Merge "Send disabled event from settings windows" 2017-07-06 18:05:17 +00:00
Piotr Miazga 426356e822 Remove duplicate events filtering
We had instrumentation for over 4 weeks and duplicate events rate
was very low. We want to keep stats so we check the duplicate events
rate but there is no need to filter those.

Bug: T167365
Change-Id: I72585beb21e9db589e45eeace657ef25f432abc9
2017-07-06 17:38:42 +02:00
Translation updater bot caec0a85b5 Localisation updates from https://translatewiki.net.
Change-Id: I954cca0dba2970339111682f70a6014023a61c27
2017-07-05 22:37:47 +02:00
Translation updater bot ef058cacc4 Localisation updates from https://translatewiki.net.
Change-Id: I5c82f25ce87124ad5d64d7052e77c9b459dbb06e
2017-07-04 22:42:26 +02:00
Piotr Miazga 7e2c79ae0d Send disabled event from settings windows
Changes:
 - introduced new event 'disabled', sent from settings popup
 - added unit tests for 'disabled' event handling

Bug: T167365
Change-Id: I048b38122b8843199c86fd1ed9ec2ff21767e114
2017-07-04 19:08:37 +02:00
Amire80 9df91fd043 Change "article" to "page"
This is the usual practice in MediaWiki extensions,
for consistency among wikis where pages are
not necessarily articles.

Change-Id: I25d8ccb9090c31e4672998c8a01ebdfcaf625e9f
2017-07-04 07:15:44 +03:00
jenkins-bot 6a1176c0d2 Merge "Enforce no top&bottom margins on lists on page previews" 2017-07-03 13:52:28 +00:00
jenkins-bot 4f9ad4d0a7 Merge "Override eventLogging to enabled when debug flag is on" 2017-07-03 11:54:56 +00:00
Kunal Mehta e7ac7f0b7d build: Updating mediawiki/mediawiki-codesniffer to 0.10.0
Change-Id: I5c8aaff0ed7b9eef97db7e22188212e37ee3beb1
2017-07-01 01:40:13 -07:00
Translation updater bot 82ee8e990a Localisation updates from https://translatewiki.net.
Change-Id: If9ba575dec354efce94bb24dc52ad3a9a6d5ad63
2017-06-30 23:34:00 +02:00
Piotr Miazga a82e54bf2d Override eventLogging to enabled when debug flag is on
In order to debug the EventLogging instrumentation in production
environments, we want to be able to bucket ourselves at will.
When the debug flag (?debug=true) is passed send all events
for given page view.

Bug: T168847
Change-Id: Id1b13b0ecaa791b4f26be4d1151bdbbe5270b64d
2017-06-30 18:52:51 +00:00
Piotr Miazga 06ef34c05f Enforce no top&bottom margins on lists on page previews
Changes:
 - set margin-top and margin-bottom to 0 on following elements:
   ul, ol, li, dl, dd and dd

Bug: T168941
Change-Id: I80478de046d7944fde3c0de3f96f5c9dc4623c36
2017-06-30 20:51:21 +02:00
Piotr Miazga 450e6bc34c Allow events without linkInteractionToken to be logged
Changes:
 - when event doesn't have linkInteractionToken do not check for
   duplicated tokens
 - hygiene, move event duplication logic into separate functions
   for better readability

Bug: T168449
Change-Id: I3ae197567ec9f67e104af109d4f1a1c1a6769d32
2017-06-30 18:03:40 +02:00
Fomafix 75c6d5dd18 Add missing dependencies
resources/dist/index.js uses mw.user.generateRandomSessionId.

Change-Id: Id8b3d565aa76fe0451240c8679d14c77a4b2ad38
2017-06-28 13:35:39 +02:00
jenkins-bot 38970b488d Merge "Remove paragraph margins from HTML extracts" 2017-06-22 09:33:23 +00:00
Baha dac21ea832 Document decision to cache requests
The date is the date T161284 was created.

Bug: T167093
Change-Id: Ia013b2c4dec611c72ee9ac798372fdbe40a19018
2017-06-22 07:12:49 +01:00
Baha def31b9e90 Remove paragraph margins from HTML extracts
This allows us to display an exact number of lines of texts in a preview.

Bug: T168332
Change-Id: I2066fbca2fce77c9eb1f0fe4278b96f13383e9a6
2017-06-20 16:11:22 -04:00
jenkins-bot 86075fbaf2 Merge "Hygiene: Group instrumentation modules" 2017-06-20 11:06:10 +00:00
jenkins-bot 34dcf587ac Merge "build: Updating mediawiki/mediawiki-codesniffer to 0.9.0" 2017-06-20 11:05:14 +00:00
Sam Smith dcf8532cdf Hygiene: Group instrumentation modules
Following on from I4f653bba, since the schema and statsvInstrumentation
modules are similar, let's group/rename them:

  schema -> instrumentation/eventLogging
  statsvInstrumentation -> instrumentation/statsv

Change-Id: Ic59e0da7d4917f6733fd090f15d3c269af863f05
2017-06-20 11:41:37 +01:00
Kunal Mehta ba9e3c68f6 build: Updating mediawiki/mediawiki-codesniffer to 0.9.0
The following sniffs are failing and were disabled:
* MediaWiki.Commenting.FunctionComment.MissingParamComment
* MediaWiki.Commenting.FunctionComment.MissingParamTag
* MediaWiki.Commenting.FunctionComment.MissingReturn
* MediaWiki.Commenting.FunctionComment.ParamNameNoMatch
* MediaWiki.FunctionComment.Missing.Public
* MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment

Change-Id: Id9e98b7a4e87d00c63e7b509506c23f12cf0d380
2017-06-20 00:19:34 -07:00
Sam Smith 67eb3b1dcf i13n: Log EL events with mw.track
Currently, the mw.eventLog.Schema class samples per pageview. However,
we expect that if a user is bucketed for a session, then all
EventLogging events logged during that session are in the sample.

Moreover, loading the class in the way that we did - asynchronously,
using mw.loader#using - introduced an issue where the eventLogging
change listener would subscribe in the next tick of the JavaScript VM's
event loop and miss the "pageLoaded" event being queued (see T167273).

Changes:
* Make the schema module follow the form of the statsvInstrumentation
  module, i.e. make it expose the #isEnabled method, and add the
  associated getEventLoggingTracker function.
* Update the eventLogging change listener accept the tracker returned by
  getEventLoggingTracker.
* Update/fix related JSDoc documentation.

Bug: T167236
Bug: T167273
Change-Id: I4f653bbaf1bbc2c2f70327e338080e17cd3443d4
2017-06-17 00:51:32 +00:00
joakin 9ed1703cf8 Test: Upgrade mw-node-qunit and use globs
To get cross-shell and OS glob support and fix some of the sinon
deprecation warnings regarding getConfig.

Bug: T168054
Change-Id: Idd6d47c1e63836c8429156cd9030ef9fda4479b1
2017-06-16 14:50:19 +02:00
joakin 98d9415361 Hygiene: Rename builder vars on require preview/model
preview/model is just a module/namespace object, not a builder class or
similar.

This patch changes a couple of imports to reference some of the exposed
functions of the preview/model where required.

In a shiny future, this pattern would be:

    const { createModel, createNullModel } =
      require( '../preview/model' )

Bug: T165018
Change-Id: If6ad4611538ca4f24e2443c0c3ed433275e995a6
2017-06-16 14:50:19 +02:00
joakin 010a4d91a6 Hygiene: Simplify gateways
gateway/*/rest were copies of gateway/restProvider just passing
a different provider. Docs were the same, they were untested, and
looking at them they seemed like unnecessary abstraction.

This patch removes the plain vs html structure, and separates gateways
like before, by endpoint.

There is a light utility in gateway/restFormatters.js that adapts the
call from the rest gateway to use formatters.js functions. It needs
testing, that I'll add in the next patch.

The flow for creating a gateway ends up as follows:

1. index.js calls gateway/index#createGateway( mw.config )
2. createGateway chooses based on wgPopupsGateway and invokes
  * mediawiki.js#createMediaWikiApiGateway or
  * rest.js#createRESTBaseGateway w/ restFormatters.js#parsePlainTextResponse or
  * rest.js#createRESTBaseGateway w/ restFormatters.js#parseHTMLResponse

Changes:
* Removed src/gateway/{plain,html}/rest.js
  * Extracted formatter functions to src/gateway/restFormatters.js
* src/gateway/plain/mediawiki.js -> src/gateway/mediawiki.js
         * tests/node-qunit/gateway/plain/mediawiki.test.js ->
           tests/node-qunit/gateway/mediawiki.test.js
* gateway/restProvider{,.test}.js -> gateway/rest{,.test}.js
* Change gateway/index.js#createGateway to properly call the rest
  gateways with the rest formatters

Bug: T165018
Change-Id: Ia75695dfc192aad5bc581a68882514bad6c29646
2017-06-16 14:49:59 +02:00