Commit Graph

1369 Commits

Author SHA1 Message Date
Translation updater bot 15960b33c7 Localisation updates from https://translatewiki.net.
Change-Id: Ie7160c050f3aced480433fb77a367ae8c79c17be
2020-04-13 09:07:27 +02:00
Stephen Niedzielski c9d5b2e4fb [dev] [JS] Move JavaScript to package modules
Move all Vector JavaScript to ResourceLoader `packageFiles`[0] which are
much more compatible with modern development practices:

- The entrypoint is the first `packageFiles` entry (unless specified
  otherwise). All other JavaScript must be explicitly executed.

- Remove a level of indentation due to IIFEs from every JavaScript file.
  Regretfully, ESLint does not support modules except in ES6+ so the
  otherwise useful `no-implicit-globals` rule must be disable. The
  change comes with a comment so we always remember.

- IDEs and other tooling understand Node.js-like `module.exports` /
  `require()`.

This change seemed the most sensible way to start developing new
JavaScript in Vector needed by the collapsible sidebar.

[0]: https://www.mediawiki.org/wiki/ResourceLoader/Package_modules

Change-Id: I287e604d5b1055aa97b5f987c24872755757ea1a
2020-04-10 09:39:25 -06:00
Translation updater bot ce1c8709fc Localisation updates from https://translatewiki.net.
Change-Id: I923e235581d6fed875bc9b029cfc1d3a2bfa90eb
2020-04-09 08:41:40 +02:00
Stephen Niedzielski 16670834d7 [dev] [Mustache] replace spaces with tabs
The Mustache templates were a bit of a mix of tabs and spaces. I like
spaces personally but dislike inconsistency within the project more. Use
tabs.

Change-Id: I22b777489d7281b42d1ab1981b47b2a71d3b639a
2020-04-08 15:40:56 -06:00
jenkins-bot 63d9d37777 Merge "Revert "Move indicators underneath `#firstHeading` in DOM"" 2020-04-08 13:56:49 +00:00
VolkerE 087808ece6 Revert "Move indicators underneath `#firstHeading` in DOM"
This reverts commit f400fc57c3.

Bug: T248761
Change-Id: I3a4f1202d5e1cca9f82d1735cc498049fa25613c
2020-04-08 13:43:10 +00:00
Translation updater bot 6667b65c6c Localisation updates from https://translatewiki.net.
Change-Id: Ib1ee31fe83deb370809f4aaaa37be50cc2cfece5
2020-04-08 09:07:13 +02:00
jenkins-bot 2670c08817 Merge "Move indicators underneath `#firstHeading` in DOM" 2020-04-07 01:23:05 +00:00
Volker E f400fc57c3 Move indicators underneath `#firstHeading` in DOM
Adding `margin-top` property only with sibling selector for now
until cache is cleared.
Also removing already inherited from
`.mw-body-content` properties `position`,
`font-size` and `line-height` of same value.

Bug: T248761
Change-Id: I1ea5e08927a96ac69c1b65f248ae0420968b4d00
2020-04-06 17:06:31 -07:00
jdlrobson e326517213 Add and use LESS variable for personal menu top offset
Going into the header work, we'll need this variable available so
that we can align the header with the personal tools menu.

Per Volker's request we change the value to `px` from `em`s.
Previously it was 5.28333px. It will now be 6px.

Bug: T246170
Change-Id: Ic1514e8592db8ef168fc846b8f8e485fdd465e49
2020-04-06 22:39:03 +00:00
Translation updater bot 2939100fff Localisation updates from https://translatewiki.net.
Change-Id: I21f34b2e922b1970a14f33da0bc9c7579701839b
2020-04-06 09:06:21 +02:00
libraryupgrader bf16830b21 build: Updating npm dependencies
* webpack: 4.42.0 → 4.42.1
  * https://npmjs.com/advisories/1179
* cacache: 12.0.3 → 12.0.4
  * https://npmjs.com/advisories/1179
* mkdirp: 0.5.1 → 0.5.5
  * https://npmjs.com/advisories/1179
* postcss-sass: 0.4.2 → 0.4.4
  * https://npmjs.com/advisories/1179

Change-Id: I7d4b86c7bd6f0ce44007f2758e2b1612b69ba420
2020-04-05 14:08:32 +00:00
Timo Tijhof 87a1d25079 watchstar: Remove PNG fallback for watchstar icon
Instead, for the subset of Grade C browsers without SVG support (currently
IE8), we remove the icon and display the label text instead –
in a hacky, but acceptable way.

Bug: T248062
Change-Id: I87660b69fe65b9ec2989ea606e5f76d427c28fee
2020-04-03 20:49:39 +01:00
Translation updater bot 8a5fec19c5 Localisation updates from https://translatewiki.net.
Change-Id: I8ad09f3c059746952234c5d85f379b604d966a69
2020-04-03 08:30:14 +02:00
Stephen Niedzielski d1072d0fdf [dev] add skin version query parameter override
As described in the readme but not implemented until now, this patch
enables the skin version to be specified as a URL query parameter. This
is useful for testing both skin versions during development and on wiki,
as well as enabling sharing URLs with a specific skin (Vector) and skin
version (1 or 2).

Obtaining the actual skin version requires tying together three input
sources, WebRequest, User, and Config. It seems simple but it'd be easy
to botch. For this reason, a helper class to correctly interrogate them
and tests are provided.

Bug: T244481
Change-Id: I52d80942b4270c008d4e45050589ed9220255a50
2020-04-02 16:22:26 -06:00
Stephen Niedzielski b80ad85bb1 [dev] [Less] centralize z-indices
Move all the LESS `z-index` settings to variables.less so it's easy to
conceptualize how UI will be layered. jQuery CSS rules are untouched but
documented.

Also, remove the seemingly redundant re-setting of the `mw-searchButton`
`z-index`:

  #mw-searchButton
    z-index: 1;
  }

This rule was added in 0c77e4f.

The sidebar work will require `z-index` properties and this refactor
eases the comprehension of those changes, as well as prevents the
accrual of more `z-index` technical debt.

Bug: T246419
Change-Id: Ic112a0ee3f701f87432838797be45c6069fdb522
2020-04-02 15:05:22 -06:00
Translation updater bot 6dfae96ed2 Localisation updates from https://translatewiki.net.
Change-Id: I89a09c1be0737a6d30bcf4c23f04955a8243ecbb
2020-04-02 08:27:12 +02:00
AronDemian f2fad08fb7 Define the legacy and modern root template names in the same location (improve locality)
Follow-up to I580fe55ca6aeb35dae8afee41e87172a5a729c7b

Change-Id: Iea8be07c7a86c5ca258ffdfa07fa52713cb1d6d5
2020-04-02 01:55:55 +02:00
jenkins-bot 177891cc91 Merge "Split legacy and modern experience on template level" 2020-04-01 19:44:28 +00:00
Translation updater bot 72c44e60b0 Localisation updates from https://translatewiki.net.
Change-Id: Ic28331d6b0009db3e7c5720cf9f2da4409ce44dc
2020-04-01 08:27:11 +02:00
jdlrobson c8001f91b1 Split legacy and modern experience on template level
The new template 'index.mustache' drops the Navigation
template partial (component) - instead embedding it in
the master template given its lack of usability.

Note to reviewer: Please ensure index.mustache and
legacy.mustache are identical.

Change-Id: I580fe55ca6aeb35dae8afee41e87172a5a729c7b
2020-03-31 14:35:00 -07:00
Translation updater bot 13c6a959a9 Localisation updates from https://translatewiki.net.
Change-Id: Id859f5f0730f60b31ae13e6e6c4a08e9da81b1ea
2020-03-31 08:31:02 +02:00
jenkins-bot caf0fa023f Merge "Drop the Navigation component" 2020-03-30 23:20:21 +00:00
jdlrobson 872519ab94 Drop the Navigation component
It is not the most useful of components and adds an additional layer
of complexity similar to multiple inheritance chains that we find in
Object oriented programming.

I suggest we use index.mustache going forward for laying out the different
components and use components/template partials for reusable components.

Change-Id: I6fd5fe1c3d3826d737ccd8ed5a38890305664876
2020-03-30 15:26:34 -07:00
jenkins-bot a8685e3f0e Merge "Use `calc` in `font-size` to harmonize IE 9-11" 2020-03-30 21:07:26 +00:00
Nicholas Ray b9dc654a4f Add end margin to opt-out link
This adds the same end margin as the portal container making the
opt-out-link more visually pleasing if it overflows its container.

Bug: T243281
Change-Id: I42eb3ec4a18ad9e4f6bcdb451593fec7e6e4992a
2020-03-27 10:15:30 -06:00
Translation updater bot 633affb6cf Localisation updates from https://translatewiki.net.
Change-Id: Id05e808e2c18e4ef0ad917be73d11d395ded9bd6
2020-03-27 08:43:55 +01:00
Volker E 24749a3595 Use `calc` in `font-size` to harmonize IE 9-11
IE 9-11 cuts values 2 digits after the decimal point leading
to small miscalculations throughout the interface derived from `.mw-body-content`'s `em` value.
With `calc` it's forced to use same parent value for its
rendering calculations.

Bug: T102364
Change-Id: Id4ba39bc90174bab445ae0fb4d039c28a4f0b300
2020-03-26 20:18:49 -07:00
jenkins-bot 70c2f70262 Merge "Use `.transform-origin()` mixin" 2020-03-27 00:51:22 +00:00
jenkins-bot d2b19192c7 Merge "Add opt-out link to Sidebar for Vector/Logged-in Users Without Abstractions" 2020-03-27 00:36:29 +00:00
Nicholas Ray ec382a8c86 Add opt-out link to Sidebar for Vector/Logged-in Users Without Abstractions
This commit is singularly focused on adding a link to the sidebar for
Vector, logged-in users. It does the bare minimum to fulfill the
requirements of T243281.

Additionally, it will help to answer the question "Do we need to use
abstractions (other than maybe different templates) to separate Legacy
Vector from Vector" by intentionally leaving out any abstractions in
order to make it easier to compare with a follow-up patch
(Ib2ef15180df73360cc1de25b893e49d415d23e1a) which does use abstractions.

It is a good thing to question whether or not we need addtional
abstractions in VectorTemplate and if they will help us as unnecessary
abstractions can have the opposite effect and just lead to further
frustrations down the road.

Therefore, I urge you, the reviewer, to let me know your thoughts! If
abstractions are viewed as not making our lives any easier, the
follow-up patches may be completely discarded and that's totally okay
with me. :) I think it's a good think to talk about now though.

Important changes:

* The VectorTemplate constructor was changed to allow injecting the
config, templateParser, and isLegacy boolean (only the config was
allowed before this commit). According to MediaWiki's Stable Interface
Policy, "Constructor signatures are generally considered unstable unless
explicitly declared stable for calling" [3]. Given that VecorTemplate's
constructor is not marked as stable, it is justified to do this without
warning according to the policy.

* Due to the above, the 'setTemplate' method is no longer needed and was
marked as deprecated.

* VectorTemplateTest was made to adapt to the new VectorTemplate
constructor. Additionally, it now extends from
MediaWikiIntegrationTestCase which my intelliphense server can pick up.
I *think* MediaWikiTestCase is just an alias to
MediaWikiIntegrationTestCase [1] and MediaWikiTestCase file was renamed
to MediaWikiIntegrationTestCase in [2], but I'm willing to change it
back if there is pushback to this.

Open questions:

* What are VectorTemplate's responsibilities? To me, it acts right now
as a controller (because it echos the full HTML string from the
template), a model (because SkinTemplate::prepareQuickTemplate sets data
on it which it later retrieves through `$this->get()`), a presenter
(because it adds data tailored for a web-centric view), and a view
(because it renders HTML strings instead of letting the view/template be
solely responsible for that). Arguably, some business logic might be
mixed in there as well (because it checks to see if a User is logged
in/has necessary permissions to show x which my changes here add to).
This might not be a problem if we keep VectorTemplate relatively small,
but will it remain this way as we progress further in Desktop
Improvements?

* How do we write tests for VectorTemplate without exposing unnecessary
public methods? For example, if I want to test the `getSkinData()`
method to see what state will be sent to the template, how should I do
this? One option might be to use `TestingAccessWrapper` to expose these
private methods which is what
`VectorTemplateTest::testbuildViewsProps()` does. Another option is to
accept this method as public. Is there a better way? Keep in mind that
even with access to this method, there might be many things to mock.

[1] 0030cb525b/tests/common/TestsAutoLoader.php (L64)
[2] Ie717b0ecf4fcfd089d46248f14853c80b7ef4a76
[3] https://www.mediawiki.org/wiki/Stable_interface_policy

Bug: T243281
Change-Id: I0571b041bcd7f19bec9f103fa7bccdd093f6394d
2020-03-26 17:39:47 -06:00
Volker E d9d9fdc522 Use `.transform-origin()` mixin
Adding support for older Firefox and IE 9.

Change-Id: I9b9e1f4923707676a751ae58edd6b11d1182c01d
2020-03-26 15:50:05 -07:00
Stephen Niedzielski 6b6bed86ed [docs] [dev] [PHP] [FeatureManager] revise docs and add DynamicConfigRequirement test
Address some feedback from I7a2cdc2dfdf20d78e4548f07cf53994563b234b3:

- Miscellaneous documentation improvements.
- Add a false case test to `DynamicConfigRequirement->isMet()`.

Bug: T244481
Change-Id: Ic5637f42da755f871c5a6d545e14effd3ac8c670
2020-03-26 20:39:40 +00:00
Translation updater bot ac79997d87 Localisation updates from https://translatewiki.net.
Change-Id: Iacb49685bda1c21698f13d1f70682b7c04eb3edd
2020-03-26 08:34:53 +01:00
jdlrobson 4091a6729f Document setupTemplate method and mark Vector as @final
Various skins may extend SkinVector (although none are in production)
(https://github.com/search?q=%22extends+SkinVector%22&type=Code)
This makes it clear we no longer support that behaviour.

Because of the skins that are extending SkinVector currently we have
not resorted to using the final keyword at this time.

Depends-On: Ie3759c2acbf53c628577f6b05cfed17e0998a6bb
Bug: T248399
Change-Id: I2af8b2930c80f888791247bdaa2ae1c80576317e
2020-03-25 18:04:16 +00:00
jenkins-bot f855c3948e Merge "featureManager: Add DynamicConfigRequirement requirement" 2020-03-25 15:20:47 +00:00
Translation updater bot 04e539c531 Localisation updates from https://translatewiki.net.
Change-Id: I4d499dbbcd0729f2d09ad63e61251f19fe991b5a
2020-03-25 08:36:06 +01:00
jenkins-bot 3677f1901d Merge "Use only JSON syntax in .eslintrc.json" 2020-03-23 21:21:15 +00:00
Kunal Mehta b10df06c91 Use only JSON syntax in .eslintrc.json
Breaks libup otherwise.

Change-Id: Ib1aeb412939e14911e1afec29336c63ea3e8ef8a
2020-03-23 14:05:42 -07:00
Volker E eecd2a73f9 docs: Remove overqualified element-id combination selectors
Bug: T248137
Change-Id: I8b2bc0843f9151269d4dbcbf278f8ce43ee8f872
2020-03-23 13:25:45 -07:00
Translation updater bot 70f33d106d Localisation updates from https://translatewiki.net.
Change-Id: I74692926553636a9a5c6cea27022a2e0d2afdb9e
2020-03-23 09:08:05 +01:00
Umherirrender af4ce06bf6 Fix indent in en.json
Change-Id: I240883c739175b7b242b4bdd7c29c8e0997c8efd
2020-03-20 22:04:04 +01:00
Translation updater bot 6365eff58c Localisation updates from https://translatewiki.net.
Change-Id: If4e36572cc91c4e8aad2ea78e5c93a5d8bd41d8d
2020-03-20 08:27:04 +01:00
jenkins-bot 68d2cb26ae Merge "skins.vector.styles.legacy needs to define legacy feature" 2020-03-19 03:41:26 +00:00
jdlrobson 4615f7d6d1 skins.vector.styles.legacy needs to define legacy feature
Caused by If32b59036e5cd62cbb804944ca93fa1a101c5129. Looks like
that patch clashed with Ic7af947cfd5a5df4218f006232ede4ee7ed36c62
which touched same good without a merge conflict.

Bug: T247566
Change-Id: I0c918842ac2243e47bda702fb8fdc19ce57b005e
2020-03-18 20:20:43 -07:00
jenkins-bot 49b7140a99 Merge "Mustache Documentation: Cleanup/Clarify Mustache template params" 2020-03-18 22:26:21 +00:00
Nicholas Ray 9964e56156 Mustache Documentation: Cleanup/Clarify Mustache template params
* Content.mustache doc param order was modified to follow the html structure
order (with html-dataAfterContent at bottom ). `html-userlangattributes`
was added to param documention since it was absent.

* Footer.mustache doc param order was modified to follow the html structure
order (with `html-userlangattributes` placed after `html-vector-before-footer`)

* Navigation.mustache was modified to remove `html-sidebar`,
`html-navigation-left-tabs` and `html-navigation-right-tabs` params from
doc since those are absent from Navigation.mustache.

* `data-namespace-tabs`, `data-variants`, `data-page-actions`,
`data-page-actions-more`, `data-search-box`, `data-sidebar` params were
added in Navigation.mustache documentation since those are present.

Bug: T243281
Change-Id: I321f8d61ad0305f508521e8d4d805e846103b357
2020-03-18 14:47:31 -07:00
jenkins-bot 3618a6dede Merge "Add script 'npm run lint:fix:js' and 'lint:fix:styles', remove 'lint:fix'" 2020-03-18 19:26:11 +00:00
Sam Smith 84226b41b6 featureManager: Add DynamicConfigRequirement requirement
We expect the vast majority of requirements and features to be defined
in services as possible. However, there are some "complex" requirements
that require additional application/HTTP request state. Unfortunately,
service wiring is done before some of that state is available.

I65702426 attempted to work around this by requiring clients of the
Feature Manager to pass that additional state on every interaction with
the system. Those complex requirements would then select the parts of
the state that they required when it was required. However
implementations of \IContextSource are God objects and their use should
be limited.

Whilst reviewing I65702426, Stephen Niedzielski mentioned that the
application state being available is a requirement. This remarkably
simple solution:

- Keeps the Requirement interface and FeatureManager API free of God
  objects;

- Is true to the nature of the Feature Manager - it makes clear and
  centralizes the various checks for application state being available
  across the codebase; and

- Inject a Requirement implementations' dependencies at construction
  time

It just so happens that the $wgFullyInitialised variable flags whether
the application state is available...

Changes:

- Add the the FeatureManager\Requirements\DynamicConfigRequirement class
  and tests. The DynamicConfigRequirement lazily evaluates a single
  configuration value whenever ::isMet is invoked

- Register an DynamicConfigRequirement instance, configured to evaluate
  $wgFullyInitialised while constructing the Vector.FeatureManager
  service

Bug: T244481
Change-Id: I7a2cdc2dfdf20d78e4548f07cf53994563b234b3
2020-03-18 10:10:42 +00:00
jenkins-bot c85c0700a9 Merge "Add comments to the font-stacks, reference documentation" 2020-03-16 18:29:48 +00:00