Commit Graph

1598 Commits

Author SHA1 Message Date
jdlrobson 9f2ca0d072 Refactor: Portal is also a Menu
To complete the refactor, the Portal is also refactored
as a Menu using the getMenu function.

An old code path supporting portals outputted by hooks with
strings is marked as deprecated to simplify this code in future.

array-portals-first -> data-portals-first (the value is not
an array)

Changes:
* $this->getLanguages and  $this->getToolbox() always returns an array (see BaseTemplate)
but we previously supported portals made using raw HTML. Let's move away from that
behaviour and deprecate it.
* Hooks are moved into buildSidebarProps and marked as deprecated where possible
(SkinTemplateToolboxEnd). SidebarBeforeOutput can be used instead.

Bug: T249372
Change-Id: I2549af3e24e5d51c09e9a88ca50a0d9b2e154c3f
2020-05-07 16:56:59 -07:00
jdlrobson e4a4050b81 Organize CSS by common, layout, typography and components
Moving styles from the existing styles to common/layout
or components stylesheets they should be associated with.

Components are identified using PascalCase. Lowercase names are used for things
that are not components. This distinction should help us reason with the code
better and make it clearer where CSS belongs, saving us lots of wasted
effort discussing conventions.

Patch isn't making actual CSS changes themselves - for testing purposes this
should be a NOOP.

In preparation for the gradient removal,
'background-gradient.less' is marked as legacy.

Merged 'externalLinks.less' into content.less, they belong to content.

Bug: T249073
Change-Id: I8dbc29b7a19f7613b57b0984a8befaeae9c08798
2020-05-07 22:57:13 +00:00
jenkins-bot 6f57028553 Merge "Use semantic HTML5 elements where applicable" 2020-05-07 22:14:50 +00:00
jenkins-bot 85e162caea Merge "Class names with hyphens preferred over camel case" 2020-05-07 22:12:51 +00:00
Volker E 125af06692 Use semantic HTML5 elements where applicable
Also remove superflous `role` attributes in modern Vector. Only leaving
`role="contentinfo"` on `footer` to address a known VoiceOver bug.
And leaving `role="main"` in legacy Vector due to possible old
Internet Explorer and screenreader combinations, which we can
test specifically for with this separation.

Bug: T66477
Bug: T252090
Change-Id: I422ef2a4cf7aa94e5cac4d95efb4b2d2c8c6617d
2020-05-07 14:45:35 -07:00
jdlrobson 4dfe4a97c9 Class names with hyphens preferred over camel case
The classes were recently changed so provided this is merged before
next branch cut no need to worry about cached HTML.

Bug: T249073
Change-Id: Ib20c7a359bda858df89ebb245e682d321dd5acd0
2020-05-07 14:43:13 -07:00
jenkins-bot c913a7ee23 Merge "Remove `#footer` selectors now that cache has expired" 2020-05-07 18:44:54 +00:00
Translation updater bot 0ac61e7ae5 Localisation updates from https://translatewiki.net.
Change-Id: Ie5ef3a30a952cca610b64436ac424ed65ef5988b
2020-05-07 08:37:24 +02:00
Volker E 9934783544 Remove `#footer` selectors now that cache has expired
Following-up Ica9f8c43617c624648fa12dc86ebb3daa10f0409.

Change-Id: I6f698ff98b9c474085bf7370ecaa78db3a3617e8
2020-05-06 18:55:50 -07:00
jdlrobson 9cd47c5339 Refactor: VectorMenu merged in to Menu
Bug: T249372
Change-Id: Ifaf78b507c12aa251228213c89751cbb4d111d9a
2020-05-06 16:09:22 -07:00
jenkins-bot 397da708e1 Merge "Refactor: Merge VectorTabs into Menu" 2020-05-06 22:54:46 +00:00
jenkins-bot 688ea75bfa Merge "Refactor: Generalise personal menu" 2020-05-06 22:31:13 +00:00
jdlrobson a43e79c1d3 Refactor: Merge VectorTabs into Menu
Bug: T249372
Change-Id: Ib6ae191b31564dc23a3b1d6aedf48cbaaad006af
2020-05-06 10:23:58 -07:00
Translation updater bot 718d0fe312 Localisation updates from https://translatewiki.net.
Change-Id: I577e47ec7c2f205d273443e34bebccf4b8950f7d
2020-05-06 08:34:34 +02:00
jdlrobson a3bb097cf8 Refactor: Generalise personal menu
the PersonalMenu should be generalised. In future we will use it as
the template for all menus

Bug: T249372
Change-Id: Id1c43d2e9eefef1d7aec45f0137e27f10ad935df
2020-05-05 17:34:44 -07:00
jenkins-bot 4086a4c824 Merge "Refactor: Remove indirection (where alternatives exist)" 2020-05-05 20:34:03 +00:00
jdlrobson 7efe7c3468 Refactor: Remove indirection (where alternatives exist)
The get method while well intended, adds an unnecessary level of
indirection to our code and can't be easily typechecked. Using
the methods directly (which if you review core code, these all
directly map to those methods) makes the code much more of a pleasure
to read.

Bug: T251212
Change-Id: Ibb2a69801d3b004a0a174308d3ac04d1d228807c
2020-05-05 13:07:14 -07:00
Nicholas Ray 91c25bc253 Add title attribute to opt-out link
The opt-out link was missing a tooltip which is important for
accessibility and to help people gain more context as to what it does.

Bug: T250093
Change-Id: Ie6cbaf5c941615d1662700415b8f1823987a563d
2020-05-05 09:52:20 -06:00
jenkins-bot 027af8656f Merge "Tests: Always set Skin" 2020-05-04 19:20:00 +00:00
Stephen Niedzielski 8a915e6829 [config] Temporarily default to Legacy mode
For all accounts, temporarily default to the Legacy skin version. This
is to prevent regressions for third-parties until master has a complete
logo and is in a shippable state. This change should be reverted as soon
as interim changes in Latest mode are finished.

Do these defaults need to be set elsewhere for development?

Change-Id: I3c39352efe276b8574ab5d27fdab22901bc30b46
2020-05-04 07:25:38 -06:00
Translation updater bot 3cba63147e Localisation updates from https://translatewiki.net.
Change-Id: Icd8591c3b3ecd100d27db2825a3134ee5e810f92
2020-05-04 09:19:17 +02:00
jdlrobson 6d9e7c07e5 Tests: Always set Skin
VectorTemplate relies on many of SkinVector's methods. To future
proof these tests we need to set the skin in the mocked object.

Bug: T251212
Change-Id: Ifd9bbc9c909626ecfe8ccd085673bc777423d560
2020-05-02 16:57:04 -07:00
jdlrobson 97121a228f [Minor] Favor msg and getConfig over getMsg and ->config
Change-Id: I69ff5b8fc51292f745e0aa496b8129053c9d2f23
2020-05-01 19:11:58 +00:00
Stephen Niedzielski 4b9d307c33 [doc] fix reference in VectorDefaultSkinVersionForNewAccounts config
Nick Ray identified in I7982b4c34283ba81d0232ee6f501c44cf0a74b98 that
the config documentation for `VectorDefaultSkinVersionForNewAccounts`
incorrectly referenced `VectorDefaultSkinVersion` for existing accounts.
This should be `VectorDefaultSkinVersionForExistingAccounts`. This patch
fixes the reference.

Bug: T251415
Change-Id: I840831773f4b5996c4b7ffb9f29576830d55916f
2020-05-01 07:58:16 -06:00
AronDemian ffcd4b6113 refactor: Move up `.portal` underline gradient from `.body` to `h3`
Change-Id: I3c057e048ada0601497ee6697c19bf207c3bc821
2020-04-30 22:16:29 +00:00
jenkins-bot 48b680744d Merge "Use consistent function names to SkinVector" 2020-04-30 22:16:06 +00:00
jenkins-bot 337244ebdf Merge "[modern] A new version of Vector with a new logo" 2020-04-30 21:47:44 +00:00
jdlrobson 6a9ee465bc [modern] A new version of Vector with a new logo
Changes to support feature:
* ResourceLoaderSkinModule logo features are dropped
* New layout provided given the fork in layout between legacy and new.
* Legacy sidebar styles now pulled out
* breakpoint styles are not carried over from legacy Vector
The new Vector layout for now has one breakpoint.

Changes to storybook:
* The storybook script now pulls down image assets so that the logos can
be shown in storybook. The script is adjusted to make use of a static folder to
serve these images.

Note:
* The legacy mode is not touched as part of this patchset.
* The personal menu is unaffected by this patch and is out of scope.
* The alignment issue is noted, but will be solved at a later date.
* Changes to portal are out of scope.
* Adding storybook for modern descoped, given its not possible to load
both legacy layout and modern layout inside a storybook at current time.

Sample config:

$wgLogos = [
        'icon' => 'https://di-logo-sandbox.firebaseapp.com/img/globe.png',
        'tagline' => [
                'src' => 'https://di-logo-sandbox.firebaseapp.com/img/tagline/en-tagline-117-13.svg',
                'width' => 117,
                'height' => 13,
        ],
        '1x' => 'https://en.wikipedia.org/static/images/project-logos/enwiki.png',
        'wordmark' => [
                'src' => 'https://en.wikipedia.org/static/images/mobile/copyright/wikipedia-wordmark-en.svg',
                'width' => 116,
                'height' => 18,
        ],
];

Coauthor: Aron Manning

Bug: T246170
Change-Id: Ibc4b055150761388a6b78f9127da342c451ce0e7
2020-04-30 14:11:54 -07:00
Libraryupgrader 1d0fd0bd1b build: Updating eslint-config-wikimedia to 0.15.3
Change-Id: Id8e58bed6af439ccbb12f8947b046c76e7b242c9
2020-04-30 12:47:54 -07:00
Translation updater bot 43e01426ba Localisation updates from https://translatewiki.net.
Change-Id: I622fc03c1be441ee035dc461e10a63f28d18833b
2020-04-30 08:43:11 +02:00
jenkins-bot ec6307e669 Merge "[fix] "Existing account only" skin version config" 2020-04-29 18:55:30 +00:00
Stephen Niedzielski 709772fa12 [fix] "Existing account only" skin version config
de76ab5 added the config,
`$wgVectorDefaultSkinVersionForExistingAccounts`. Its usage in
`Hooks::onUserGetDefaultOptions()` was invoked not only for existing
accounts but anonymous users _as well._  This is a bug, due to my own
misconceptions about the hook, that went against both the config's name
and its documentation.

Unfortunately, user sessions are unavailable in
`Hooks::onUserGetDefaultOptions()` so it does not seem to be possible to
determine whether the active user is an anonymous or existing account.
This patch drops the hook and centralizes all version determination
logic in SkinVersionLookup::getVersion(). SkinVersionLookup requires a
the active User object and can make the anonymous / existing account
determination by checking login state.

The issued was identified while responding to review feedback given by
@polishdeveloper / @pmiazga in
I52d80942b4270c008d4e45050589ed9220255a50.

Bug: T251415
Change-Id: I7982b4c34283ba81d0232ee6f501c44cf0a74b98
2020-04-29 18:36:03 +00:00
Sam Smith d4c2e2b441 [Hygiene] featureManager: ComplexRequirement -> Requirement
FeatureManager::registerRequirement registering an instance of
SimpleRequirement with ::registerComplexRequirement was awkward.

Changes:

* Rename FeatureManager::registerRequirement to
  ::registerSimpleRequirement, which is exactly what it does!

* Rename FeatureManager::registerComplexRequirement to
  ::registerRequirement

Bug: T244481
Change-Id: I612af959cee4cdcd0bdcda51a81b86ed61ee2e16
2020-04-29 15:26:50 +01:00
Translation updater bot 28c286526f Localisation updates from https://translatewiki.net.
Change-Id: Ic1b8a393170b921c1d9d55440c298ba34a88ebd0
2020-04-29 08:39:21 +02:00
jdlrobson d9f4a2b041 Use consistent function names to SkinVector
In future we'll convert VectorTemplate to SkinVector. In preparation
for this we create wrapper functions getMsg and getConfig so that
the interface for VectorTemplate is more similar to SkinVector.

Bug: T251212
Change-Id: I1f839d3147499d67e1c7cf71cf934bb7d20beedb
2020-04-28 15:32:06 -07:00
jenkins-bot db29a88ee0 Merge "Add buildSidebar method" 2020-04-28 20:49:31 +00:00
jenkins-bot 1a62d2d264 Merge "[cleanup] Drop empty `class` attribute from `#footer > ul` elements" 2020-04-28 18:41:40 +00:00
jdlrobson df681e031d Add buildSidebar method
Move all the sidebar generation logic into a new VectorTemplate
function.

The name mirrors the function name in SkinVector. In future,
( I7a14f74728703c50874935e9d77b35ad9434b436)
we will move this code into SkinVector where it will be able
to call parent::buildSidebar()

Bug: T251212
Change-Id: I0a4838120f6ffd3d3d798f876e3463a3f16af95b
2020-04-28 10:44:39 -07:00
jenkins-bot a06ccff66f Merge "[modern] Add Header element and styles" 2020-04-28 16:53:03 +00:00
jenkins-bot 5a525489a1 Merge "Refactor: Revert to previous ordering" 2020-04-28 16:51:58 +00:00
jenkins-bot 0f25ad1aa7 Merge "[doc] Add link in readme to hooks.txt" 2020-04-28 16:22:04 +00:00
AronDemian f6cbbbfd95 [modern] Add Header element and styles
- Removed `#mw-head-base`.
- `#mw-page-base` -> `.mw-header-placeholder`.
- `#mw-head` moved down to `@height-header` to make space for new header.
- Content moved down to `@height-header + @height-tabs`.

Added Less variables:
- @height-header: 69px;
- @height-logo-icon: 50px;
- @height-header--inner: 54px;
- @height-tabs: 2.5em;

Style splits:
- Added Header.less
- @height-header: 2.5em;

Bug: T246170
Change-Id: I07280c4c7a2054439153e76359f712281049df0b
2020-04-28 18:15:39 +02:00
Stephen Niedzielski 19edb3d612 [doc] Add link in readme to hooks.txt
I always forget hooks.txt exists but I guess it's a bit of a convention:

- extensions/CirrusSearch/docs/hooks.txt
- extensions/Echo/modules/hooks.txt

Add a link to hooks.txt in the readme to keep the convention but help
surface the documentation.

Change-Id: Ic40809ee79af2f40cb4b0d21e665441530439968
2020-04-28 09:29:52 -06:00
jdlrobson 95c80c4efe Refactor: Revert to previous ordering
In I23f18fc5f078da3331cad540bbaf533d348f2108 layout was pulled out
into a separate file and we changed the ordering of our CSS.

This was done with the thinking that media print queries would be
mixed with media screen.

After discussions with Volker, I have been convinced this was a
mistake.

media queries of the same type can be nested so the @media screen
is removed from layout.less and the media query in index.less will
be used instead.

Change-Id: I3aab00c9bcc734ea1ba5a9cf242c6e36ac1cc076
2020-04-28 14:37:54 +00:00
Translation updater bot 7ccb3a0fe1 Localisation updates from https://translatewiki.net.
Change-Id: I8f14ac016312a124d1220b2b864e9b2c47c6c45d
2020-04-28 08:34:40 +02:00
AronDemian 487eda02f4 [cleanup] Drop empty `class` attribute from `#footer > ul` elements
Change-Id: Ice0241b054cbc296e9f0adf1d2920023316c8ca0
2020-04-28 02:05:30 +00:00
jenkins-bot 54739cf1ba Merge "Replace deprecated `@colorFieldBorder` variable and use others" 2020-04-28 01:58:40 +00:00
Volker E f5d55bcf54 Replace deprecated `@colorFieldBorder` variable and use others
Replacing deprecated `@colorFieldBorder` with WikimediaUI Base equivalent
`@border-base` shorthand.
Also replace `@borderRadius` with new base and static `background-color`
values.

Depends-On: I2e2277957b79b81909b80a6c0b7b2220be6ba903
Change-Id: I90bb0eb0c2206483f71f0553dfb590d9df2c5781
2020-04-28 01:42:09 +00:00
jenkins-bot b2dee16b63 Merge "Add `.mw-footer` CSS class & replace `#footer` selector with it" 2020-04-27 22:49:47 +00:00
AronDemian c2e9a7b366 Add `.mw-footer` CSS class & replace `#footer` selector with it
Does not add `.mw-footer-*` CSS classes to `ul#footer-*` and
`li#footer-*-*` to save bandwidth.

NOTE:
- The former id selectors can be removed form the styles after the varnish cache
  is updated with the new DOM.
- The modern version still uses the legacy layout at this stage.

Bug: T248137
Change-Id: Ica9f8c43617c624648fa12dc86ebb3daa10f0409
2020-04-27 14:55:28 -07:00