Commit graph

1542 commits

Author SHA1 Message Date
jdlrobson 3cd45bca2a Give summary a min-height to avoid overlap with gradient.
Bug: T188581
Change-Id: I5b6012b61577ead60dc0d0e87ebcad5042304104
2018-03-09 09:07:19 -08:00
jdlrobson f5f21a8d09 RESTBase url is configurable
Allow developers to use different endpoints for summaries
= developer happiness

This is useful for the following use cases:
* A developer wants to test against a production endpoint via
CORS
* A developer has setup an API where REST is hosted elsewhere
e.g. http://localhost:6927/en.wikipedia.org/v1/
* A user wants to create their own REST summary compatible
endpoint
* A wiki e.g. wikidata wants to use a different endpoint which is compatible
with the summary endpoint.

We are unlikely to use it ourselves on Wikimedia wikis (the
default should suffice) but this will be a powerful tool for

When not configured this will continue to work as per normal

Change-Id: I8a7e12fbc43cddbac678e0d7b81d1e877b747b22
2018-03-09 16:15:19 +00:00
jdlrobson ca440dfbed Remove client side formatters in Popups code base for MW API.
Stripping parentheticals were designed specifically for working around
issues with content inside wikimedia wikis and error prone.

This problem for wikimedia wikis is solved by the mobile content
service.

Given we have no intentions to use the MediaWiki API for summaries.
They are not necessarily useful to third parties and it makes little
sense to maintain them (a third party can configure their own API or
use their own REST endpoint if they really do need them).

Bug: T189042
Change-Id: I2729dc9f172af0afee1c6f0cd563c556b4ae0aeb
2018-03-08 21:05:49 +00:00
Stephen Niedzielski e9e3d59232 Hygiene: only report diff status
When the diff test fails, don't dump 40k characters to console. Just
report that the failure occurred.

Change-Id: I1cc31fcdebe3e1097ed9e80dfbe3fb6e0dfc34b2
2018-03-07 13:58:08 -06:00
Kunal Mehta e351fd1550 Use SPDX 3.0 license identifier
SPDX released version 3 of their license list (<https://spdx.org/licenses/>),
which changed the FSF licenses to explicitly end in -only or -or-later
instead of relying on an easy to miss + symbol.

Bug: T183858
Change-Id: If21be3dd6d81dbeb30911bbe3be29e20b55bf6da
2018-03-02 15:33:58 -08:00
jdlrobson 8e47b54796 Remove client side formatters in the REST formatter
These are now taken care of by the Mobile-Content-Service's
summary  endpoint and no longer needed here!

They are actually breaking certain previews so time for these
to go!

Bug: T183833
Change-Id: Icd2a21127c2f5881943564eca4df6bed3c15e223
2018-03-02 12:04:08 -08:00
Sam Smith 58ae3d01ea i13n: Clarify nature of timestamp property
Specifically, clarify why the timestamp property is merged into the data
bag that represents the event when it is.

Change-Id: I184de734e66490fc728a4f9c2f84bf0765aeed08
2018-02-28 18:06:14 +00:00
Translation updater bot 9899f10a2d Localisation updates from https://translatewiki.net.
Change-Id: Ia7a4e7cb6b9778410606fb38e66885f2c1e65d7d
2018-02-27 22:25:54 +01:00
Željko Filipin 541a42dd17 Update README file for Selenium tests
Bug: T187862
Change-Id: Ib62a6059e8048712617870d07746bee1ab92e371
2018-02-27 14:04:39 +01:00
Translation updater bot 308203f8b8 Localisation updates from https://translatewiki.net.
Change-Id: I1b2b4f8cc4958123f9961946166efcf19de1a00d
2018-02-26 22:20:46 +01:00
jdlrobson 535149c16c Upgrade schema and log the required fields
This change updates the schema and begins to log
additional information such as source_namespace, id
and title. This information is provided inside the
boot action.

Additional changes:
* Allow camel case in bundle artifact

Bug: T184793
Bug: T186728
Change-Id: I425ffecc018bef2958d0dfe957a40a065e3e6c56
2018-02-26 10:25:30 -08:00
jdlrobson fe654d7f5e Hygiene: namespaceID => namespaceId
For consistency with pageId and sessionId let's rename
namespaceID to namespaceId

Change-Id: Id0f6f6434691b62d3c5c7ae941970b79e0a99366
2018-02-26 10:23:38 -08:00
joakin 0502d90f60 Hygiene: Consistent quotes in webpack.config.js
Change-Id: Id1315f3dad411aad1395642c6fcb2b781503de73
2018-02-26 12:38:41 +01:00
joakin 5154739a46 Hygiene: Add comment about @nomin and source-maps in production
Clarify why we don't have source maps in production and the interaction
with ResourceLoader's production mode, and reference phab task.

Bug: T188081
Change-Id: I4c5f60585429792ee3047268ad44449ab47fcff4
2018-02-26 12:36:46 +01:00
Translation updater bot 0905f8ed56 Localisation updates from https://translatewiki.net.
Change-Id: I35465fc16e496868440c3f8073f2f132a3d60c74
2018-02-25 22:34:21 +01:00
libraryupgrader 46ac149155 build: Updating mediawiki/mediawiki-codesniffer to 16.0.1
Change-Id: Id52239c46b00ca2d066f1444da01a060add10af8
2018-02-25 10:38:23 +00:00
Translation updater bot b1a4b6e952 Localisation updates from https://translatewiki.net.
Change-Id: I6ad68d75b18526280f3a1ed727d51e370865fc7e
2018-02-23 23:01:47 +01:00
Translation updater bot e8ffaaed8b Localisation updates from https://translatewiki.net.
Change-Id: I9bb6e8678588155a38ece4d1d4831a13369bf9d0
2018-02-22 23:22:24 +01:00
Stephen Niedzielski e406d4556f Fix: don't assume thumbnail URLs contain pixel size
Don't assume that thumbnail URLs contain a dimension delimiter of "px-".
Previously, thumbnail URLs always contained the width. e.g.:

  https://upload.wikimedia.org/wikipedia/commons/a/aa/100px-Red_Giant_Earth_warm.jpg

However, thumbnail URLs that actually point to the original are not
sizable:

  https://upload.wikimedia.org/wikipedia/commons/a/aa/Red_Giant_Earth_warm.jpg

These are provided, for example, when the thumbnail size requested is
larger than the original. There was code designed to handle this
scenario but it only applies when RESTBase and page preview thumbnail
sizes happen to be in sync. In other words, if RESTBase requests a large
thumbnail on behalf of page previews, and page previews only requested a
small thumbnail, the original may be unexpectedly provided. A
conditional is introduced in this patch to verify that "px-" is actually
detected. If it is not present, the original is used.

Bug: T187955
Change-Id: If4e29dd870aecd6d461cc8203f6576d1bb8844f2
2018-02-22 12:36:30 -06:00
Sam Smith 35daa2a689 Hygiene: Page view -> Pageview
Pageview is consistent with verbiage used by Research and Analytics
Engineering in their reports and documentation, e.g.
https://wikitech.wikimedia.org/wiki/Analytics/Pageviews.

Bug: T184793
Change-Id: I8ae085b4af85aa72f234f3db27f0cac2c4d014e5
2018-02-21 18:51:49 +00:00
Translation updater bot ea2c0d71ea Localisation updates from https://translatewiki.net.
Change-Id: I8d5752698c6ff75a1f09e442e9e002dc86978a02
2018-02-19 22:25:48 +01:00
jdlrobson 21f2d4ab0f Model should capture page id
We're going to need this for logging page views.

Change-Id: I1fc46a9fab54f512edaf5feb5abbaa4f025dcb4a
2018-02-19 16:46:13 +00:00
Pmiazga f8533dbac8 Merge "Capture page view-like interactions" 2018-02-19 16:45:29 +00:00
Translation updater bot 2ddf8a96d8 Localisation updates from https://translatewiki.net.
Change-Id: Iffdf847fa767ccdea4b65b6e733740835c07e2f0
2018-02-18 22:41:02 +01:00
libraryupgrader a7ca711185 build: Updating mediawiki/minus-x to 0.3.1
Change-Id: Ifb9cbb6fe4b9a6dd36c1213890bdc42c3b7f7574
2018-02-18 07:12:34 +00:00
jdlrobson a702c0f499 Capture page view-like interactions
* New action added PREVIEW_SEEN
* The action will be used to signal that a page view needs
to be recorded.
* PREVIEW_SEEN is a delayed action which is triggered
as a side-effect of the previewShow action. It is only dispatched
if the user is still previewing the same card and the page
related to the card has preview type `page`
* The pageview changelistener is added when
$wgPopupsVirtualPageViews is set to true.
* The page view changelistener listens for page views and logs
them using EventLogging when needed using
https://meta.wikimedia.org/wiki/Schema:VirtualPageView

Note:
* Currently if a user has enabled the DNT header, the
event will not be logged. There is ongoing discussion on the
ticket and fixing this will be addressed separately.
* Only title and referrer are logged in the initial version.
The task demands that "namespace" is logged but this information
is not provided by the summary endpoints we use so will need
to be added later (if indeed needed) either via a change to that
endpoint of by using JavaScript to parse the URL.

Bug: T184793
Change-Id: Id1fe34e4bdada3a41f0d888a753af366d4756590
2018-02-16 23:03:33 +00:00
jenkins-bot 8bd51dec2d Merge "Improve & fix action and integration tests" 2018-02-16 19:11:59 +00:00
joakin 1fff0d2ea7 Improve & fix action and integration tests
This change fixes some issues with assertions not running, removes
unnecessary promise dances, and improves legibility and some code
patterns in the action and integration node tests mainly.

Detailed changes:

* actions.js
  * Fully migrate out of jQuery 1 promises (no done/fail)
  * Fix linkDwell action not returning the fetch action promise

* actions.test.js
  * Simplify setupWait for the tests
    * It always autoresolves immediately the wait call to ensure speedy tests
    * No waitDeferreds or waitPromises array coordination, rely on action
      returned promises instead
  * Get rid of that = this in favor of arrow functions
  * Rename generic "p" promises to meaningful names
  * Add assert.expect for more solid tests (so that we don't skip assertions in
    the future if we change them)
  * Fix some assertions that weren't being run because of the incorrect promise
    being returned (p.then, and then just returning p)
  * Get rid of $.when stubbing in favor of waiting for the promise returned from
    the action
    * Get rid of hacky setTimeout(..., 0) to run assertions after the promises

* integration.test.js
  * Get rid of wait(0) calls to hack around asynchronous actions
    * Use the action returned promises instead of the waitPromises/Deferreds
  * Remove unused "el" parameter being passed to this.abandon in several tests
  * Remove unnecessary test helper this.abandonPreview (it was the same as
    this.abandon)
  * Clarify a bit the last and more complex test with some comments and variable
    name changes
  * Get rid of that=this in favor of arrow functions

* container.test.js
  * Get rid of that=this in favor of arrow functions

* previewBehavior.test.js
  * Get rid of that=this in favor of arrow functions
  * Get rid of $.each in favor of .forEach

Bug: T170807
Change-Id: I06fafd92a1712f143018e2ddff24fadf1a6882b3
2018-02-16 13:52:56 +01:00
Translation updater bot 9ed23bdcfa Localisation updates from https://translatewiki.net.
Change-Id: Ic1ffbf229666c32a6b8d3c274c5ce40eef73630b
2018-02-15 22:47:18 +01:00
jenkins-bot 99a37a19a7 Merge "Don't leak deferreds out of functions" 2018-02-15 17:45:15 +00:00
joakin 2df22ef2b2 Don't leak deferreds out of functions
Always try to return a promise.

Bug: T170807
Change-Id: I4a48b6e40a5398a743e39589b5c2fcac4482a814
2018-02-15 15:01:36 +01:00
libraryupgrader 6c294c91c2 build: Updating mediawiki/mediawiki-codesniffer to 16.0.0
Change-Id: I62343b120937faf99bae94188e6a934cc0402fe5
2018-02-15 13:44:12 +00:00
Jan Drewniak 95b880aa29 Return promises from action thunks
Returning promises from the `linkDwell` and `abandon` thunks and
removing some of the `wait` stubs in the unit test for these actions.

Also converting a fetch callback from a `.fail` to a Promise A+
compatible `.catch`.

Bug: T170807
Change-Id: I4bbf2863db090e222ba926d3bc36a99da4bdb601
2018-02-14 20:08:05 +00:00
Jan Drewniak 10465c8bf8 Centering settings dialog and overlay
- Removing the javascript positioning of the settings dialog.
- Placing the settings dialog inside the settings overlay.
- Using flexbox to center the settings dialog.

Bug: T157072
Change-Id: If8d929fe019a04ed5f96aa593779841a52f58eff
2018-02-14 17:54:38 +01:00
Translation updater bot b3d466a399 Localisation updates from https://translatewiki.net.
Change-Id: I63690cc500a6fed1fc74a0fe5c5e7c9e3c0964d3
2018-02-11 10:42:20 +01:00
Jan Drewniak f4d04b95b6 Updating mw-node-qunit to v3
Fixes tests for sinon v4, which is a dependency of mw-node-qunit v3.

Bug: T180255
Change-Id: I8c7b703f81140e06546aa954f98b8766f5225ff5
2018-02-08 12:20:52 +01:00
Translation updater bot c81af043b2 Localisation updates from https://translatewiki.net.
Change-Id: Ibf99ad57f69106e0c9ed0b03a67296c531d17211
2018-02-07 22:17:43 +01:00
Translation updater bot 44b598c554 Localisation updates from https://translatewiki.net.
Change-Id: I17a0f6f52888deb34e969e40f990d17ac9fd3578
2018-02-06 22:35:39 +01:00
Translation updater bot b3a1134c82 Localisation updates from https://translatewiki.net.
Change-Id: I025dbee5a26f72faa40045013d955f013cbd27a4
2018-02-05 22:36:58 +01:00
Ed Sanders 998d7c4f22 build: Update linters
Change-Id: I1af64c55fdd26a2923a1ec20500e97ea13d92bc8
2018-02-04 22:09:45 +00:00
Translation updater bot 8b14ce2773 Localisation updates from https://translatewiki.net.
Change-Id: I9210687d1b1fabcd15bfc9f2f5ed95d96fa3ba51
2018-01-31 22:20:18 +01:00
jenkins-bot 83731256d8 Merge "Hygiene: add bundlesize test" 2018-01-30 23:35:18 +00:00
Translation updater bot c791fcb891 Localisation updates from https://translatewiki.net.
Change-Id: Id6065cd4a419a4c56bdfd7ef5b75919c33950d14
2018-01-30 22:17:02 +01:00
Stephen Niedzielski 7da20008c0 Hygiene: add bundlesize test
This patch adds a production build output gzipped file size check to the
test script so that any future changes may only introduce known size
differences. Note:

• The initial limit was taken from the present gzipped file size rounded
  up to the 10th of a kibibyte.

• JEDEC notation is used. bundlesize internally uses Bytes utility which
  only supports base 2 units.

  https://github.com/visionmedia/bytes.js

Bug: T176211
Change-Id: Ie95f388673b0b982b105fef9a2917513a3307060
2018-01-30 20:04:06 +00:00
Translation updater bot e96b24dabc Localisation updates from https://translatewiki.net.
Change-Id: Ifbfed34f64161826a5f94aaea4bd3365745918a3
2018-01-29 22:20:33 +01:00
Translation updater bot 8c79531ffa Localisation updates from https://translatewiki.net.
Change-Id: I4c42c1dca2b3f1346c72197ee4e1f39b2647035e
2018-01-26 22:36:44 +01:00
Translation updater bot 6c1f103656 Localisation updates from https://translatewiki.net.
Change-Id: I449db3c60904a8c9741445851b0ff70b72e1a062
2018-01-25 22:18:11 +01:00
Translation updater bot 8fe2b34ab1 Localisation updates from https://translatewiki.net.
Change-Id: If01fbb13df323a8130a2e3bd3d2f92e1f6b01f0b
2018-01-24 22:20:59 +01:00
Translation updater bot a30a23419c Localisation updates from https://translatewiki.net.
Change-Id: Ie14145b63630282a534ac028f35389231153cde7
2018-01-22 22:18:33 +01:00
jenkins-bot ac6dea8ab5 Merge "Limit line length to 80 characters" 2018-01-22 20:40:34 +00:00