Commit graph

1793 commits

Author SHA1 Message Date
Jan Drewniak 3b2480d6ce Ensure popup thumbnail images are a supported format
Prevents video files and other non-image files from being rendered as
popup thumbnails. Restricts thumbnail format to either jpg, png, or gif.

Bug: T193792
Change-Id: I7a9be5d1c8396c02ebf0893c960f65644acc9d99
2018-06-21 00:55:04 +02:00
Translation updater bot e09c4faabe Localisation updates from https://translatewiki.net.
Change-Id: I4eab89d9eadcf81cb0c6aec3c2afb19253303d1a
2018-06-20 23:11:45 +02:00
Stephen Niedzielski 36741c96c8 Hygiene: don't auto-add on pre-commit
Since it can be unexpected for a pre-commit hook to make edits to the
commit, leverage the existing tests to simply verify that the proper
files have been staged. This also slightly simplifies the existing NPM
scripts and forces the dev to run the same test about to be executed CI,
`npm test` itself, which previously had no other automation tie in.

Change-Id: I74e407ea17a6c2809a49ba56d3ef28b25d5ba5de
2018-06-20 09:40:47 -05:00
Stephen Niedzielski c2a37d75e2 Hygiene: remove doc:start script
The `doc:start` NPM script simply runs the `doc` script whenever a
change is detected. It doesn't seem especially useful for standard
development and adds an extra nodemon depedency. This patch removes the
script and nodemon.

Change-Id: Ib679f6d83bd10f0b8d1572c07080fba7f8d6a701
2018-06-20 09:36:53 -05:00
Stephen Niedzielski 95047ba360 Fix: code coverage
Replace Istanbul with nyc, Istanbul's CLI. nyc appears to have some
bugs that this patch works around:

  - When all files in the project are considered, not just those
    imported via tests, the coverage rates and line numbers vary between
    runs. This patch disables the `all` option for now and points to the
    bug:
    https://github.com/istanbuljs/nyc/issues/537#issuecomment-390814662.

  - Source map line numbers appear to be incorrect except when `all` is
    enabled and working correctly (see previous bullet).

  - `sourceMap` must be disabled to avoid ENAMETOOLONG errors when nyc
    tries to include them as encoded strings. The patch disables the
    setting and points to: https://github.com/istanbuljs/nyc/issues/847.
    Using babel-plugin-istanbul and source-map-support appears to have
    no effect (the former in tests/node-qunit/run.js and .babelrc).

  - CI fails with
    `Error: EACCES: permission denied, mkdir '/nonexistent'`. Specify
    `SPAWN_WRAP_SHIM_ROOT` instead of constructing a subdirectory from a
    nonexistent home directory.

Bug: T196952
Bug: T193519
Change-Id: Idf2e3accd4a6277cbef91c1156fcd206c9e7d882
2018-06-19 18:10:02 -05:00
Translation updater bot 3cf54a0ff6 Localisation updates from https://translatewiki.net.
Change-Id: If1d1cad8c459ee659546d250b7c15f901c53169a
2018-06-19 22:25:20 +02:00
L10n-bot 41fe4877cb Merge "Localisation updates from https://translatewiki.net." 2018-06-18 20:11:31 +00:00
jenkins-bot f8252ec071 Merge "Hygiene: replace QUnit assert.equal with strictEqual()" 2018-06-18 20:10:39 +00:00
Translation updater bot 5b3aa7af2e Localisation updates from https://translatewiki.net.
Change-Id: I748362d7eadd42e6dd5a32ea3fb52cba3df2fcc4
2018-06-18 22:09:50 +02:00
Stephen Niedzielski abc2026890 Hygiene: replace QUnit assert.equal with strictEqual()
Via jscodeshift:

  jscodeshift \
    -t jscodeshift-recipes/src/qunit-assert-equal-to-strictEqual.js \
    Popups/tests

Also, some very minor manual clean up.

https://github.com/niedzielski/jscodeshift-recipes/blob/5944e50/src/qunit-assert-equal-to-strictEqual.js

Additional change:
* Drop redundant clipPath parameter from createThumbnailElement - this
parameter does not exist in the function signature.

Change-Id: I209ecf2d54b6f5c17767aa2041d8f11cb368a9b5
2018-06-18 19:48:16 +00:00
Stephen Niedzielski fe2c3b23ee Hygiene: replace call to rm with clean-webpack-plugin
The invocation of `rm -rf resources/dist` in package.json
(`check-built-assets`) is replaced with clean-webpack-plugin.
The benefit of this change is that calling `npm run build` now works the
same as the `check-built-assets` script.

Bug: T193522
Change-Id: I64f048855ddceb7159279671b2174a7937e169ff
2018-06-18 09:09:28 -05:00
Stephen Niedzielski 3e248d75cc Hygiene: refactor common popup template code
Move the outer container common to all previews to a new template.

Bug: T191646
Change-Id: I8f3d99b25c457495ece7b66bfa6026fe827608be
2018-06-14 07:50:22 -05:00
jenkins-bot e88c639879 Merge "Always set the PagePreviews visibility state" 2018-06-11 21:54:58 +00:00
Jan Drewniak 941d4b07b8 Adjusts margin on settings icon
Bug: T193058
Change-Id: I0908ebbf7ab5fd6a54e5734cdc91531961cf10fa
2018-06-11 23:23:44 +02:00
Translation updater bot 662192e0a5 Localisation updates from https://translatewiki.net.
Change-Id: I802a0f06126412b941b2521c0a9d1cb657e7fbe9
2018-06-11 22:34:15 +02:00
Piotr Miazga 0837535bdd Always set the PagePreviews visibility state
Changes:
 - ignore autocreated flag and always set the popups visilibity state
 CentralAuth will create users with `autocreated=on` when user logs
 into different wikis
 - do not call saveSettings(). AuthManager will call
 $user->saveSettings() s after calling all hooks.

Bug: T191888
Change-Id: Iac753ebbaaf175636fdc3e20d8f37883771c33d2
2018-06-11 21:46:03 +02:00
Translation updater bot 45fda11500 Localisation updates from https://translatewiki.net.
Change-Id: Ieb79ba1d9b858bb0baf3c959db0d59720aeae028
2018-06-06 23:06:16 +02:00
Jan Drewniak a782b7b7da Update setting icon
- Adds an extra element in popups template to contain settings icon.
- Resizes the setting icon so that the hover/active state is a square.
- Updates the settings icon SVG file.
- Modifies margin rule for icons placed near top of popup.

Bug: T193058
Change-Id: Icc16a788bba8e2f0a82a27c2b5c7be6c2cccaa90
2018-06-05 10:07:35 +01:00
Translation updater bot 4e591bbfb7 Localisation updates from https://translatewiki.net.
Change-Id: I20b151dfce14ebcf2976c08b63e83db318cb65d7
2018-06-04 22:44:39 +02:00
Translation updater bot dde7e127be Localisation updates from https://translatewiki.net.
Change-Id: Iff6e5324a38bedf3fdffd453df52bb45a503d319
2018-06-01 22:27:43 +02:00
jenkins-bot db1b685265 Merge "Coalesce and cleanup use of then blocks" 2018-05-31 17:17:51 +00:00
jdlrobson f444c15a2d Restore stylelinting
When moving the LESS files to the src folder we disabled this.

Change-Id: I4d3a94c3511a7896777535a5f036c5161c6a8fcd
2018-05-31 11:57:57 +00:00
Translation updater bot ad647724e5 Localisation updates from https://translatewiki.net.
Change-Id: Id0e85b3a16e15c011c2c41662d9e62bf40df97f3
2018-05-30 22:24:45 +02:00
jdlrobson 79daacb235 Coalesce and cleanup use of then blocks
Bug: T190141
Change-Id: I345befc24397e27c965af0a593821333f2a71f21
2018-05-30 17:32:08 +01:00
Translation updater bot 8b5bf188a4 Localisation updates from https://translatewiki.net.
Change-Id: I4c3dc7d4886f3b77ab06e1f154bb5bc0694fbfb4
2018-05-29 22:25:07 +02:00
jenkins-bot 250ca88e6f Merge "Fix IE11 settings dialog centering" 2018-05-29 19:16:59 +00:00
jenkins-bot 8ea676892f Merge "Properly escape messages passed to HTMLForm" 2018-05-29 10:17:42 +00:00
jenkins-bot 4c397700d1 Merge "Change the PopupsVisibility state to visible to match anon experience" 2018-05-29 08:14:28 +00:00
Translation updater bot d7f880c164 Localisation updates from https://translatewiki.net.
Change-Id: I339b40ec9216a00fb7c8704b31da8ab41ec8361d
2018-05-28 22:42:35 +02:00
libraryupgrader 9713f14b87 build: Updating mediawiki/mediawiki-codesniffer to 20.0.0
Change-Id: Ib22e2e3ebe667c1f245d665abcc2b72ae1c4a884
2018-05-26 05:52:59 +00:00
Brion Vibber 9602856226 Fix for changes to preferences form
The PreferencesFormPreSave hook now may return any HTMLForm
subclass, not just a PreferencesForm. It may be the new
PreferencesFormLegacy, or the future PreferrencesFormOOUI.

Change the function signature to accept any HTMLForm,
which seems to fix saving of preferences.

Bug: T195580
Change-Id: I41e37d78d87ab8965995c6e19ef76db87f7616fa
2018-05-25 09:52:48 -07:00
Translation updater bot 5b202cce4c Localisation updates from https://translatewiki.net.
Change-Id: I7c8f73ac8f1d0fccbc5bf652e7c56a9c2c456015
2018-05-24 22:25:00 +02:00
Jan Drewniak a93256e406 Fix IE11 settings dialog centering
Removing positioned:fix on settings dialog to properly center it
on IE11

Bug: T192004
Change-Id: I868e036b8517dfe94ea877648bec8f75fa5d990f
2018-05-24 12:27:40 +00:00
Kunal Mehta 87fac42511 Properly escape messages passed to HTMLForm
THe messages in 'options' need to be HTML escaped.

Spotted by the phan-taint-check plugin.

Change-Id: I1e207e5ca644551ae56cdd484f5f29267b6d764f
2018-05-20 13:41:33 -07:00
Thiemo Kreuz 865bd524f2 Add missing "public" visibility in PopupsHooks.php
Public is the default, and hook handlers must be public. I assume this
was nothing but a mistake.

Change-Id: I20eedfd8c4cb954db770afdda3f373e272530b82
2018-05-20 21:13:36 +02:00
Translation updater bot ce7cb2c336 Localisation updates from https://translatewiki.net.
Change-Id: Ic207ffa61a6cb3f4746852a990be4ff42199a976
2018-05-18 22:48:34 +02:00
Mukunda Modell 2d6bd5f4b7 Remove comments from json file - won't pass scap's json lint
Comments in this json file preventing scap deploy

Change-Id: I71a3c29c0d0d6d125fff2803bb5d912536c1a4d0
2018-05-17 17:43:32 -05:00
Translation updater bot ce64d4fa0f Localisation updates from https://translatewiki.net.
Change-Id: Ia6b87d828f53391e19c16745fa5da8dd841756b5
2018-05-13 22:18:29 +02:00
Translation updater bot 686319e500 Localisation updates from https://translatewiki.net.
Change-Id: I1d8162b45ab5cc1df5cb83df9c4d5f6e6bacb476
2018-05-10 22:20:48 +02:00
Piotr Miazga a492d5f609 Change the PopupsVisibility state to visible to match anon experience
PagePreviews are visible to anonymous users, we would like to match
the same experience, when user creates a new account. On account
creation we mark PagePreviews settings to ON or OFF (configurable
via PopupsOptInStateForNewAccounts settings). With that approach
we can provide the best experience for new users, and keep existing
users happy (not enabling feature by default for everyone).

Bug: T191888
Change-Id: I39f42aa7268ce59c51f038048025ccf1bdf16481
2018-05-10 00:57:44 +02:00
jenkins-bot f80cf4db3b Merge "Hygiene: add assertion messages" 2018-05-09 18:14:13 +00:00
jenkins-bot 080aaf0f32 Merge "Hygiene: bump ESLint to ES6 and lint more files" 2018-05-09 18:14:12 +00:00
Stephen Niedzielski ae44042cbf Hygiene: add assertion messages
Change-Id: Ic0a47bd468532824e8648c3f6371cc403896603c
2018-05-08 15:55:23 -05:00
jenkins-bot 4dbb3a4734 Merge "Hygiene: replace calledOnce / Twice w/ callCount" 2018-05-08 20:37:34 +00:00
Translation updater bot 1704bdbbfe Localisation updates from https://translatewiki.net.
Change-Id: I3d8f684f9379be76a91b3615f33f3f197db7306a
2018-05-08 22:20:39 +02:00
Stephen Niedzielski cb362d125c Hygiene: replace calledOnce / Twice w/ callCount
Replace all test assertions for calledOnce / Twice with callCount.
assert.ok( calledOnce / Twice ) only lets the dev know that a test
fails. assert.strictEqual( callCount, EXPECTATION ) starts the debugging
process when it fails since it provides the difference in the failure
output. strictEqual() was deliberately used since it's a saner default
and the codebase already favors === equivalency checks.

  find tests -name \*.js|
  xargs -rd\\n sed -ri '
    s%ok\(([^,]+)calledOnce%strictEqual(\1callCount, 1%g;
    s%ok\(([^,]+)calledTwice%strictEqual(\1callCount, 2%g;
  '

Change-Id: I07c3c6d20e07c5b8107583a01d820e3fbd68a4e1
2018-05-08 15:01:16 -05:00
jenkins-bot 44684b760b Merge "Remove A/B testing code" 2018-05-08 14:39:43 +00:00
jenkins-bot 4dbb57c076 Merge "Update extension authors" 2018-05-08 10:15:54 +00:00
jdlrobson 912402e840 Remove A/B testing code
No longer needed. We can't turn something off again for people
now they expect it to exist.

Clarified usage instructions of PopupsEventLogging to make sure
it's more scary given the implications

Bug: T173952
Change-Id: I7be005b79da498d8e7b7df8f18b60c1327636a2c
2018-05-07 12:37:41 -07:00
Translation updater bot e43e28fb64 Localisation updates from https://translatewiki.net.
Change-Id: I9631e9f5ecfda7ba7741c774d20d88a3de78d110
2018-05-05 22:15:20 +02:00