Commit graph

975 commits

Author SHA1 Message Date
jenkins-bot 3aab8f585a Merge "Issues instrumentation: issuesClicked events should always send 1 sectionNumber" 2018-09-07 08:56:47 +00:00
Translation updater bot 2b8f6a3c9e Localisation updates from https://translatewiki.net.
Change-Id: Ic22d9ba97604358fd267c6556d2ca464dfde5f03
2018-09-07 09:26:43 +02:00
jdlrobson c68f7ba09f Issues instrumentation: issuesClicked events should always send 1 sectionNumber
Erroneously in I6fd55c35b9e2ce35894259f36d1a50fb5dca5e43 for the old treatment
 we sent sectionNumbers for all issues in the page.

This is inconsistent with the issuesSeverity field above it
Add a clarifying inline comment.

Bug: T203050
Change-Id: Ib1fcda0c49a162cd7aca8ee8b3221236f724e1d7
2018-09-06 17:40:34 -07:00
jdlrobson 0dd4f1cb4d Hygiene: Load errorLogger earlier in stack
Follow up to I07f01b4c025b2e5e4cbf88ec05e7c536442c62cc

Bug: T202026
Change-Id: I190417e90fd27b21844a20f96ec1237416c57079
2018-09-06 21:05:00 +00:00
jdlrobson e7f0cfd665 Hygiene: Consistent error naming
Rather than using err and error as variable, use error for consistency
Follow up to I07f01b4c025b2e5e4cbf88ec05e7c536442c62cc

Bug: T202026
Change-Id: I54165ff1f1b17284d8232c491244e1a98950d5e2
2018-09-06 21:04:53 +00:00
Ed Sanders fd517597aa Add a notifications overlay container to the skin
Bug: T202466
Bug: T202620
Depends-On: I5a78949efef88083bdafc4207a6872c76b463970
Change-Id: I4c05ec666d5cbc93c12c35ab8222871e698f345c
2018-09-06 16:25:19 +00:00
jenkins-bot 993e77e76b Merge "Correct the link for page issues in the old treatment." 2018-09-05 20:14:06 +00:00
jenkins-bot 002160ae9c Merge "page-issues sectionNumbers consistency on modalClose event" 2018-09-05 20:02:35 +00:00
jdlrobson dc6f707ea1 Correct the link for page issues in the old treatment.
createBanner was incorrectly always assigning the 'all' keyword
to the old page issues banner. Instead it should use the section
number in the function signature - as this decision of which issues
to show is made inside initPageIssues

For the old treatment, in the main namespace, we only show issues
in the lead section. When we use the 'all' keyword the visual is
the same, but it breaks the instrumentation requirement that
sectionNumbers and issuesSeverity should be the correct length

Note, for the talk and category pages treatment, we do not
log any events so the instrumentation doesn't matter here
and the 'all' keyword correctly targets all issues in the page
as before.

Bug: T203050
Change-Id: I63e45da05ca033fe282633f7fd59038a8e5d8c8d
2018-09-05 12:51:56 -07:00
Jan Drewniak 1a9bcd1e8a page-issues sectionNumbers consistency on modalClose event
For the page-issues modalClose event, the number of values for `sectionNumbers`
and `issuesSeverity` should be the same, since `sectionNumbers` should describe
the the section of each visible issue in the modal, not the section of the
modal itself.

Bug: T203050
Change-Id: Ic58c5940a6059e71aa3aeed26232afbe8faf1618
2018-09-05 21:29:53 +02:00
Kunal Mehta 24eac21513 Configure phan-taint-check-plugin
The plugin checks and flags potential security issues (XSS, SQLi, etc.)
using static analysis.

See <https://www.mediawiki.org/wiki/Phan-taint-check-plugin> for more
details.

Change-Id: Ief36c5b7c3fc61950e52044fde7feeed9fe28831
2018-09-04 20:36:47 -07:00
jenkins-bot 752557d88b Merge "Scope styling of kbd/samp/code/pre to content areas" 2018-09-04 21:33:30 +00:00
Ed Sanders 270fb18f2e Scope styling of kbd/samp/code/pre to content areas
Extensions may be using these tags and not want
these styles (especially the border).

Bug: T203474
Change-Id: I03a22cf6377002f968cabdcce9354e73354fb6b8
2018-09-04 21:08:12 +00:00
Timo Tijhof c1fe42fede Hygiene: Use early returns in a few places for special cases
When handling special cases that are logically distinct from
the function's main branch, it improves code quality (through
readability and maintainability) to place those first and with
an early return.

The has the benefit of the main return statement being easy to
find at the end of the function. (Not early and/or in a block).

It also means when working on the code, there is generally a
less complexity and fewer nesting levels, given that most code
is in the main branch. This makes is easier and quicker to verify
that code does what it should, as well as making it easy to
extend in the future. When considering to add code to end of a
function's main scope, it should relate to the function's main
branch by default, not a special case. For example, a getName()
method should not end with a top-level statement 'return false'
(unless it is a stub). Rather, one would expect it to end with
`return name`.

Change-Id: I1f3088f2409c82dd3bf757fc8fa27dc97ae2767b
2018-09-04 21:08:00 +00:00
jenkins-bot 2d2ceebf99 Merge "Set explicit output formats to prevent over escaping of messages" 2018-09-04 08:50:41 +00:00
Kunal Mehta 23d21c4ae7 Set explicit output formats to prevent over escaping of messages
Not calling an explicit output format defaults to ->escaped(), which often
leads to double escaping.

Spotted by the phan-taint-check-plugin.

Change-Id: Ie527768bea670808e63cfc8cbff64015ae29d4a3
2018-09-03 22:58:45 -07:00
libraryupgrader 4982558493 build: Updating mediawiki/mediawiki-codesniffer to 22.0.0
And updating CoC link to use Special:MyLanguage (T202047).

Change-Id: Idf2967084af29940ecb1d92a66365821c0290fd0
2018-09-04 01:31:06 +00:00
Translation updater bot 8c4d0d511c Localisation updates from https://translatewiki.net.
Change-Id: I24b0ff79ac38051b4f3d5e6391feacde1a53f523
2018-09-03 21:59:01 +02:00
jenkins-bot 7d87ec3b8f Merge "Replace ID selector with class selector (mw-notification-area)" 2018-09-03 16:18:45 +00:00
Translation updater bot cccbf729ac Localisation updates from https://translatewiki.net.
Change-Id: Ic18c48c7b87eaa09aaa36ccaf0530722afad50a0
2018-09-01 22:10:26 +02:00
Translation updater bot 0094483028 Localisation updates from https://translatewiki.net.
Change-Id: Ied3a6fefe22e50108579fc6e9e8cbdbdce6cc632
2018-08-31 21:58:27 +02:00
Ed Sanders 046e8072e7 Replace ID selector with class selector (mw-notification-area)
The former is deprecated.

Bug: T203259
Change-Id: Ie385f3820cc93931a6ccf2cf00e8457b0e48d3e0
2018-08-31 15:23:02 +00:00
jenkins-bot 34ead3f8c5 Merge "Client side error reporting for Minerva+MobileFrontend" 2018-08-30 22:40:19 +00:00
jdlrobson cd528e120b Client side error reporting for Minerva+MobileFrontend
This adds a client side error logger that will store errors
in EventLogging. We will use it to get a sense of the number
of errors inside mobile.

To enable make use of the new configuration variable
wgMinervaErrorLogSamplingRate = 1

Notes:
* the optional `meta` field will not be utilised by the generic
error handler.
* URI length is not trimmed for title. We will consider whether we need
to make any adjustments to the schema values during roll out.
** For stack trace, we limit the length by removing errorUrl (which is logged
separately)

Testing:
Add throw new Error('asasasa'); anywhere in your code and make
sure the code executes. It should trigger an Error event provided
that configuration has been updated.

Bug: T202026
Change-Id: I07f01b4c025b2e5e4cbf88ec05e7c536442c62cc
2018-08-30 14:35:27 -07:00
Translation updater bot cafe54918d Localisation updates from https://translatewiki.net.
Change-Id: I40789f46c2468f2ba44028a0b63217f8f43690b2
2018-08-30 23:21:22 +02:00
Jan Drewniak ce2826854b Add bottom margin to page issues
Bug: T202568
Change-Id: Iae5fe40ad8507b218594fe025dd6327ff37b753d
2018-08-30 19:22:49 +00:00
jenkins-bot 47781f5bcb Merge "For page-issues pageLoaded and editClicked events, treat "multiple issues" templates as one issue." 2018-08-30 09:11:05 +00:00
jenkins-bot 37d1737f31 Merge "Consistent sectionNumbers and issuesSeverity for page-issues." 2018-08-30 09:11:04 +00:00
Jan Drewniak 815f3d99ee For page-issues pageLoaded and editClicked events, treat
"multiple issues" templates as one issue.

When logging the `issuesSeverity` and `sectionNumbers` field,
any issues that are part of a "multiple issues" template only send
one value.

Adds an `isMultiple` property to IssueSummary to determine which
issues are part of a multiple-issues template.

Bug: T203050
Change-Id: I7d55dfead72439df4accadcdc8623a080e1321c2
2018-08-29 13:59:20 -07:00
Jan Drewniak 2cbd57c2f3 Consistent sectionNumbers and issuesSeverity for page-issues.
The value of `sectionNumbers` should be the section number of each issue
Not the number of the sections that have issues.

Bug: T203050
Change-Id: I6fd55c35b9e2ce35894259f36d1a50fb5dca5e43
2018-08-29 13:45:55 -07:00
Translation updater bot 9102325656 Localisation updates from https://translatewiki.net.
Change-Id: I8549e6c2b023dd3361c3232d0f2beb569a26089d
2018-08-29 21:58:32 +02:00
jenkins-bot 4cc3bfa6ae Merge "Remove webkit-transform hack to fix stacking" 2018-08-29 00:50:10 +00:00
jenkins-bot b104d5ca1b Merge "Remove duplicate heading styles" 2018-08-29 00:50:05 +00:00
jenkins-bot 6f9a81861a Merge "Fix width of headings in mobile editor" 2018-08-29 00:49:50 +00:00
jenkins-bot 198276256e Merge "Avoid abrupt and jarring white flash in media viewer" 2018-08-28 19:42:04 +00:00
jenkins-bot c49ebb5430 Merge "Don't send NaN as a value for sectionNumbers" 2018-08-28 19:02:51 +00:00
jdlrobson 0acfda1931 Don't send NaN as a value for sectionNumbers
The keyword "all" was being parsed as an integer incorrectly. To avoid this

Bug: T202940
Change-Id: I5553a4bb50cd7639c879f2c6e812fba25a216175
2018-08-28 18:26:09 +00:00
Ed Sanders a00d90ee6c Remove duplicate heading styles
These styles have since been moved such that they
apply in read and edit mode.

Change-Id: I2dc6fd69604d08dafeaf8cf17b3f048caa16496e
2018-08-28 15:06:12 +01:00
Ed Sanders 591370c35f Fix width of headings in mobile editor
This also fixes CE issues arising from using display:table.

Bug: T202991
Change-Id: I39ab5d4ed9a2ace7593dd3078382f522b75f5576
2018-08-28 15:05:05 +01:00
Ed Sanders d3eb0d7c30 Remove z-index:6 hack from VE mobile overlays
MobileFrontend no longer uses z-index:5 for the toobar,
the default z-index:2 is sufficient for the overlays to
appear on top.

Lowering this value allows toolbars to appears on top of
local overlays, such as deactivated selections.

Bug: T202990
Change-Id: I55ff6971249427c12c090018fcd4d4e5d0ec85d1
2018-08-28 14:24:59 +01:00
Ed Sanders 9ed6b24f69 Remove webkit-transform hack to fix stacking
Bug: T202980
Change-Id: Iea8a3b9cf6c837f04610310e5b495d77ef60b219
2018-08-28 13:02:47 +01:00
Zoranzoki21 6d877928f5 Fix common typos in code
Bug: T201491
Change-Id: I1b31983069a45ff6c0493f370596351a407f6a87
2018-08-27 20:54:16 +00:00
jenkins-bot 7fc910d0d8 Merge "Log sectionNumbers in PageIssues schema" 2018-08-27 20:43:50 +00:00
jenkins-bot 86a5913573 Merge "Don't send issuesSeverity given that's an event default" 2018-08-27 20:43:48 +00:00
Jan Drewniak ae19031f8e Log sectionNumbers in PageIssues schema
Adds logging for the sectionNumbers field in the PageIssues schema.

Additional changes:
* createBanner now requires section number to be a string - this ensures
consistency with how these are used.
* fix a bug which meant createBanner was being called with undefined
section number (due to table of contents)
* Fix some indents in some JSDoc blocks
* Change parameter in function signature from mixed type (int or string)
to explicit string
* update schema number

Depends-On: Ia2696b86c6855d7b46a3f668585377d106d7af23
Bug: T202098
Change-Id: I20511a77258ea245f3d6fe93ade238e5df397a71
2018-08-27 18:02:51 +00:00
jdlrobson ee36bcfccf Don't send issuesSeverity given that's an event default
An event only needs to send this field when overriding the
default. This line is thus unnecessary.

Change-Id: Ia1dfcac5dd25f36f5f4169daf6535fd66aedf754
2018-08-27 10:52:55 -07:00
jenkins-bot bad8347fb2 Merge "Make edit click handling consistent" 2018-08-27 13:34:50 +00:00
jdlrobson 60dd426ee6 Make edit click handling consistent
Previously, the main edit icon in the page actions was handled indirectly
by changing the URL and then routing the edit via detecting the hash
fragment has changed. On the other hand section edit links were hijacked
via a click handler. The latter is better as it doesn't modify the DOM,
which allows the editor to override the JavaScript behaviour. It's also
preferable as it doesn't interfere with EventLogging - this subtle difference
was supressing edits to the Edit and PageIssues schema.

Bug: T202786
Change-Id: I4175bc6f0ddda28397d185502d1839716d051c56
2018-08-27 13:23:27 +00:00
jenkins-bot 9dfe22ee8d Merge "Hide section edit icons when unable to edit" 2018-08-27 13:04:54 +00:00
Translation updater bot 5fefa5349e Localisation updates from https://translatewiki.net.
Change-Id: Ifc8705deaba5d25002a552a087b7ffe3178e1b57
2018-08-24 22:57:42 +02:00