Commit graph

628 commits

Author SHA1 Message Date
Translation updater bot fcf830188e Localisation updates from https://translatewiki.net.
Change-Id: I7173240e7e9fc4b173ae858d490a15c8c44a8825
2022-06-20 08:17:47 +02:00
Translation updater bot c50ba8d371 Localisation updates from https://translatewiki.net.
Change-Id: Ib68ced4009ef383c22b9241eb65392c481ca1000
2022-06-13 08:28:59 +02:00
Translation updater bot fc028aabbf Localisation updates from https://translatewiki.net.
Change-Id: I26f0278e40ee759e28f6cd40b000608fa2cbf721
2022-06-03 08:58:06 +02:00
Translation updater bot 50b93a41e3 Localisation updates from https://translatewiki.net.
Change-Id: I661554def5510526b709a9f26d5d53eb7ebb3637
2022-05-30 09:24:08 +02:00
Željko Filipin 1dbc2915f6 selenium: Use @wdio/spec-reporter
Dot reporter provides no information on which tests suites and tests are
executed. Spec reporter is more verbose but it also provides much more
information that is useful in general, but especially when debugging.
For example, which tests are executed and which tests are skipped.

Bug: T280331
Change-Id: If50b811df856abc555904ecab298077215b2621d
2022-05-24 14:46:02 +02:00
Jon Robson 4d883cf58a Pages that do not exist shouldn't output related articles
Bug: T308078
Change-Id: Ie86ea03e4529e74cc5d9f71c973a5ab738ca499b
2022-05-11 19:13:35 +00:00
Jon Robson 2665e3c319 Add TypeScript support
For now it is limited to a single file RelatedPagesGateway.js
For now @types/jquery is requirement due to use of
wikimedia/mw-node-qunit and usage of MediaWiki core methods
and OOUI that use jQuery.

Change-Id: I370826bb3f521dcb5a68491990571ee1c87117ae
2022-04-27 19:11:10 +00:00
Jon Robson e5431a1c0b Limit RelatedArticles feature to ES6 browsers
We currently require support for IntersectionObserver.
which is supported on Edge >= 15 (15 has partial support),
Firefox >55, Chrome >58, Safari 12.1, Opera >=38,
iOS Safari >=12.2, Android 100

Full ES6 is supported in Edge >=15, Firefox >=54, Chrome >=51,
Safari >=10, Opera >=38, iOS Safari >=10, so such a change
would only drop support for Edge 15 and Firefox 54.

CSS.escape is guaranteed in all these browsers according to
caniuse, with the only discrepancy being the Edge browser (versions
16-18) so it is also suggested we remove support for those browsers.

Firefox 54 accounts for 0.0026% of page views
Edge 15-18 accounts for 0.069% of page views

Bug: T306355
Change-Id: Id2987e3456607b610c38da9ee157a026d1d00ada
2022-04-27 15:45:42 +00:00
Jon Robson b528100f3d Add jest testing infrastructure
Adds a test for  resources/ext.relatedArticles.readMore/index.js

Change-Id: Icf8a5afca2489308e2bcaa611c0fe27ed9f46f3a
2022-04-19 18:51:58 +00:00
jenkins-bot d043e31869 Merge "[Development] Allow us to pull RelatedArticles from production APIs" 2022-04-18 21:55:19 +00:00
Jon Robson 5f6e311255 Remove unused mediawiki experiments
mw.experiments is never used in this codebase. Presumably this
dates back to when we did A/B tests for this feature.

Change-Id: I7d5bc63349686063ecd2c1fc63d078af91d2c541
2022-04-18 12:53:02 -07:00
Jon Robson dca7580757 [Development] Allow us to pull RelatedArticles from production APIs
useful for testing real world data

Suggested test config:
```
$wgRelatedArticlesUseCirrusSearchApiUrl = "https://en.wikipedia.org/w/api.php";
$wgRelatedArticlesUseCirrusSearch = true;
$wgRelatedArticlesDescriptionSource = 'wikidata';
```

This will allow us to enable on patchdemo with production content.

Change-Id: I73c0d73d3369f27ed2fd74b37ae71bfc12b6ee57
2022-04-18 16:28:26 +00:00
Jon Robson dfce5b1cb7 RelatedArticles should not use mw.trackSubscribe
Instead export a render method

Bug: T149317
Change-Id: I2b88690d381f896d6a646046574528a2312c91c2
2022-04-18 16:28:14 +00:00
Jon Robson 4c9904952b Drop OO dependency on gateway
The RelatedPagesGateway is an OO class.
There is no reason for it to be, we don't use any
of it's features e.g. the event emitter

Change-Id: I8f807d35b0ce36ea5764508a66f88d74577e3653
2022-04-18 15:51:43 +00:00
Jon Robson 911d78e8ee [organization] organize file by module
Follow up to I9442b0336e22ca795cc06f76068215266fe81271

Bug: T306228
Change-Id: Ifb1f1937009b098999471cfa5e820a063dc5a4a0
2022-04-18 08:37:22 -07:00
Jon Robson df1ff38877 [Maintenance] Reduce related articles to two modules
1) Merge ext.relatedArticles.readMore and ext.relatedArticles.cards modules

These are always loaded together. No need to have them in separate modules.
In process switch to packagefiles

2) Merge ext.relatedArticles.readMore.bootstrap and ext.relatedArticles.readMore.gateway

Always loaded together.

Bug: T306228
Change-Id: I9442b0336e22ca795cc06f76068215266fe81271
2022-04-14 17:48:37 -07:00
Jon Robson dc2e65a084 Drop outdated references to Cards extension
Previously RelatedArticles required the Cards extension
This code refers to that old state and is cleaned up.

ext.relatedArticles.cards is added a dependency of
ext.relatedArticles.readMore since it now belongs to the same
extension

Change-Id: I4a89ed4256a4ae9fd22b0191748bd47ac3ffc593
2022-03-31 08:14:23 -07:00
osamaahmed17 078cfb2347 selenium: Refactor WebdriverIO tests from sync to async mode
WebdriverIO has dropped support of sync mode due to breaking changes in Chromium, hence all tests have been changed to async.

Update npm packages: @wdio/*, wdio-mediawiki and webdriverio
because async mode needs at least webdriverio v7.9.

Remove npm package: @wdio/sync.

Bug: T300797
Change-Id: Ia2a857eb46dbd613a10f48c686bcf6b2fdc3e202
2022-02-09 16:15:05 +00:00
libraryupgrader 43ccc9c8b0 build: Updating mediawiki/mediawiki-phan-config to 0.11.1
Change-Id: I6fbd3e06b1881bcb659a833189f3c4e1d5c587fd
2021-12-19 04:06:28 +00:00
Translation updater bot 6eaf45307a Localisation updates from https://translatewiki.net.
Change-Id: I8d2d0c8757e6022a3c8e0588eee63aa53fb2b15e
2021-12-10 09:19:44 +01:00
libraryupgrader 6b45f6ea82 build: Updating jsprim to 1.4.2
* https://npmjs.com/advisories/1006724 (CVE-2021-3918)

Change-Id: I25ac93c55a9d4971851c353e5b0ab284751d3a55
2021-11-30 06:25:23 +00:00
Translation updater bot 67eee4e266 Localisation updates from https://translatewiki.net.
Change-Id: I7e049d69a340b09a394ccf2784f47ca85b03c272
2021-11-22 09:03:40 +01:00
Translation updater bot db85e74196 Localisation updates from https://translatewiki.net.
Change-Id: I8cb057a33f17757447d506c448997fbd84f9a4cc
2021-11-11 10:02:54 +01:00
libraryupgrader 524f3773f2 build: Updating validator to 13.7.0
* https://npmjs.com/advisories/1004784 (CVE-2021-3765)

Change-Id: I94248f824b066d42414a8edb71c0851ca8f7bf23
2021-11-05 11:04:36 +00:00
jdlrobson 83c2b071c4 Fix loading of related articles via IntersectionObserver
For IntersectionObserver to work the element we listen on needs to
have a non-zero height.

Bug: T223844
Change-Id: I308f646670b112e42b0aaa11c438dbc5cdc5edd8
2021-11-04 12:30:11 -07:00
jdlrobson 923f594916 RelatedArticles should use IntersectionObserver rather than deprecated mediawiki.viewport module
Bug: T284251
Change-Id: Ia3139df0beb24268a1e37b85c755b0d0f62910b5
2021-10-29 14:53:20 -07:00
libraryupgrader 6ffacad442 build: Updating mediawiki/mediawiki-codesniffer to 38.0.0
Change-Id: I19c4813849e01faea802a025f1c272120356e873
2021-10-24 12:03:47 +00:00
Reedy cb5b1baecf Use namespaced Disambiguator Hooks class
Change-Id: I1b2e6e4ac6e4612221f1f720356860c16c5aa5ee
2021-10-19 15:58:36 +01:00
libraryupgrader 07e7b5bb0b build: Updating npm dependencies
* @wdio/mocha-framework: 7.4.6 → 7.13.2
  * https://npmjs.com/advisories/5197 (CVE-2021-3807)
* ansi-regex: 5.0.0 → 5.0.1
  * https://npmjs.com/advisories/5197 (CVE-2021-3807)

Additional changes:
* composer.json: Updated phpcs command in composer test (T280592).
* composer.json: Added phpcs command to scripts (T280592).

Change-Id: I9bac58167708f2a07337d9d0350a11422753208e
2021-10-05 07:35:01 +00:00
libraryupgrader 6a6c872611 build: Updating composer dependencies
* mediawiki/mediawiki-phan-config: 0.10.6 → 0.11.0
* php-parallel-lint/php-parallel-lint: 1.3.0 → 1.3.1

Change-Id: Iad868957534ffedf01edd4830efcda121d546fbd
2021-09-09 06:16:23 +00:00
jdlrobson f318d3acd2 Skip Selenium tests
Discussed with Edward, and there seems to be some problems with
these Selenium tests that are being surfaced in
Ie7cfa3e2b19d22086bfa1ba9c64e17760eb29ad2. Skipping on the short term.

Change-Id: Id9dc0b3bf6a619bec73e0e18915c184fe20936d5
2021-09-07 19:08:43 +00:00
libraryupgrader e9179d5577 build: Updating stylelint-config-wikimedia to 0.11.1
Change-Id: I122553868da7515bd46d8115549fa5a116ac660f
2021-09-04 21:51:08 +00:00
acald d9dccf23fd RelatedArticles uses Grunt. This package is unecessary and inconsistent with other repositories.
Uninstalled the following packages: grunt, grunt-eslint, grunt-stylelint

Removed Gruntfile.js since Gruntfile is not longer necessary

Bug: T286832
Change-Id: I4fe5ee2db080f1a2be9607f302704c8c3bf5a233
2021-08-02 20:12:04 +00:00
libraryupgrader 6d03335fb9 build: Updating dependencies
composer:
* mediawiki/mediawiki-codesniffer: 36.0.0 → 37.0.0

npm:
* postcss: 7.0.35 → 7.0.36
  * https://npmjs.com/advisories/1693 (CVE-2021-23368)
* glob-parent: 5.1.1 → 5.1.2
  * https://npmjs.com/advisories/1751 (CVE-2020-28469)
* trim-newlines: 3.0.0 → 3.0.1
  * https://npmjs.com/advisories/1753 (CVE-2021-33623)

Change-Id: I8c7d9480e97f500a851775c9444c9e21a9ca5b82
2021-07-23 20:55:02 +00:00
jenkins-bot fd1b475738 Merge "selenium: Update wdio-mediawiki" 2021-07-01 18:15:52 +00:00
Translation updater bot 3faaedb620 Localisation updates from https://translatewiki.net.
Change-Id: I9aacfc9e4e2e35e0ed8e27fedaac9f46989935e6
2021-07-01 08:09:47 +02:00
Volker E 6ea57f8060 Remove outdated browser workarounds
Linear gradients are now supported by all our basic support browsers.

Change-Id: I5563f70f45ab90be6b1073f2c0af7c56d0bd366b
2021-06-22 06:47:26 -07:00
sahil 0512e508db selenium: Update wdio-mediawiki
wdio-mediawiki v1.1.1:
- Includes wdio-defaults.conf.js file that vastly simplifies wdio.conf.js.
- Replaces @wdio/spec-reporter with @wdio/dot-reporter.
- Introduces video recording.

Bug: T283597
Change-Id: I35a7b000de1f0b55d8e797e0ff35b0b3590460e7
2021-06-21 20:46:30 +05:30
sahil 3a2f197a9e selenium: Upgrade WebdriverIO to v7
Update npm packages: @wdio/* and webdriverio.

Bug: T274579
Change-Id: I2efdb705cba8515963143d6ce025396f5c0672b8
2021-06-17 21:50:01 +05:30
Translation updater bot d10b726a1b Localisation updates from https://translatewiki.net.
Change-Id: I2583aa604ec06e0ae1464b5b318381b0077b6e38
2021-06-14 08:38:15 +02:00
libraryupgrader c9de950ffd build: Updating browserslist to 4.16.6
* https://npmjs.com/advisories/1747 (CVE-2021-23364)

Change-Id: I52662b22940a12c3df9559683bab69a96b1753cc
2021-05-28 03:51:56 +00:00
Translation updater bot 2befc7c9c4 Localisation updates from https://translatewiki.net.
Change-Id: I45f04fdde5410d9f6cd46202f7e34520751b2995
2021-05-27 12:06:10 +02:00
jenkins-bot 0cf8f8f2d1 Merge "selenium: Update README.md file" 2021-05-25 14:48:17 +00:00
sahil 2578a87e28 selenium: Update README.md file
Bug: T282237
Change-Id: Ia14349e8630e7a075e5f3ce8dea1572027309ef3
2021-05-24 18:00:35 +00:00
Translation updater bot 98fbe16fc3 Localisation updates from https://translatewiki.net.
Change-Id: I86432b7c51fa4740a8de46d9c8f85e254a0e525a
2021-05-24 09:55:14 +02:00
libraryupgrader 68cd3839e7 build: Updating hosted-git-info to 2.8.9
Change-Id: I8a933ce63d0f1353b3bcf0d4a2dcb68385bebda5
2021-05-21 04:47:56 +00:00
libraryupgrader 64282bce15 build: Updating dependencies
composer:
* mediawiki/mediawiki-codesniffer: 35.0.0 → 36.0.0
* php-parallel-lint/php-parallel-lint: 1.2.0 → 1.3.0

npm:
* grunt: 1.3.0 → 1.4.0
* lodash: 4.17.19 → 4.17.21
  * https://npmjs.com/advisories/1673 (CVE-2021-23337)
* hosted-git-info: 2.8.8 → 3.0.8
  * https://npmjs.com/advisories/1677 (CVE-2021-23362)
* ua-parser-js: 0.7.21 → 0.7.28
  * https://npmjs.com/advisories/1679 (CVE-2021-27292)
* postcss: 7.0.35 → 8.2.15
  * https://npmjs.com/advisories/1693 (CVE-2021-23368)

Change-Id: Ie00a61524a48d62913c31f344e9aeb7e631aec5c
2021-05-13 04:31:19 +00:00
Translation updater bot 04d3b21834 Localisation updates from https://translatewiki.net.
Change-Id: I4f953273e94cd791bb4424a58862ff24b6e6100b
2021-05-10 08:53:24 +02:00
Reedy 804debdd8e Remove RelatedArticlesFooterWhitelistedSkins
Bug: T277958
Depends-On: I34519c75bafb56b7f042d7bb95eed49b59bb01a8
Change-Id: Id4391badba750d5acc0d03c8caf0165ba5910741
2021-05-03 23:29:06 +00:00
Jdlrobson 80ef6cffb4 Hotfix: loadRelatedArticles should consider existence of container element
If undefined, the offset function will return undefined.

Bug: T281547
Change-Id: I8ae3c1ee1d259c67d597a1891af029e6192008f8
2021-04-30 16:03:28 -07:00