Commit graph

1430 commits

Author SHA1 Message Date
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
jdlrobson b42493a476 Refactor: DRY up menu creation!
Bug: T249372
Change-Id: I098e6921e8f7ef65dacacf09b9c25f70c945e58e
2020-04-27 13:36:39 -07:00
jenkins-bot 358f26323e Merge "Refactor: Make VectorTabs template data conform with MenuDefinition" 2020-04-27 18:33:36 +00:00
jenkins-bot f522973a34 Merge "Refactor: Make VectorMenu template data conform with MenuDefinition" 2020-04-27 17:59:40 +00:00
Translation updater bot 75244528cd Localisation updates from https://translatewiki.net.
Change-Id: Icce49ef60b7ec0e8bba2b1ea82fadf403912fc39
2020-04-27 09:06:22 +02:00
Translation updater bot b320b618c1 Localisation updates from https://translatewiki.net.
Change-Id: I6009e6f3db2abd91bf0b193713fefd6520627309
2020-04-24 08:25:20 +02:00
Translation updater bot c745dc19f9 Localisation updates from https://translatewiki.net.
Change-Id: If0ab0ee83fada9b414263cafe633a93511207e52
2020-04-23 08:45:46 +02:00
Translation updater bot b5d0ecd71a Localisation updates from https://translatewiki.net.
Change-Id: Ic194a805168de29d4f83f39e023eccdaf52d7297
2020-04-22 08:58:36 +02:00
jdlrobson 0b8693ccec Refactor: Make VectorTabs template data conform with MenuDefinition
menu-id -> id
menu-label-id -> label-id
msg-label -> label
empty-portlet -> class

Bug: T249372
Change-Id: I15fd88269b3d111ff47e64f3669575afaeea9f97
2020-04-22 05:18:44 +00:00
jdlrobson 286b07b20a Refactor: Make VectorMenu template data conform with MenuDefinition
menu-id -> id
menu-label-id -> label-id
msg-label -> label
empty-portlet -> class

Bug: T249372
Change-Id: I50bf2424f9077ac987e03a1e552577bf7c48b3bb
2020-04-22 05:18:29 +00:00
Reedy 983bf1c9ac Load files from gerrit not phab
Bug: T250881
Change-Id: I963399cd1936e0e7645a09712c2ef589db70a17a
2020-04-22 02:21:00 +00:00
Sam Smith 37fc80d562 [Hygiene] featureManager: Move SimpleRequirement...
... to the Vector\FeatureManagement\Requirements namespace.

Change-Id: I205eff9d257c040874fe31e5eda33b4e8cb229cc
2020-04-21 18:22:07 +01:00
Sam Smith cee5ee0003 Make legacy mode a feature
Changes:

- Add the LatestSkinVersionRequirement requirement class, which lazily
  evaluates the application state to get the version of the skin for the
  request.

  This majority of this class is taken from Stephen Niedzielski's
  Vector\SkinVersionLookup class, which was introduced in d1072d0fdf.

- Register an instance of LatestSkinVersionRequirement and register the
  'LatestSkin' feature that requires that requirement

- Re-introduce SkinVector::isLegacy and make it defer to the Feature
  Manager

Bug: T244481
Change-Id: If6b82a514aa5afce73e571abdd8de60b16a62fa8
2020-04-21 10:57:11 -06:00
Translation updater bot 14aee3e147 Localisation updates from https://translatewiki.net.
Change-Id: Ifbf1cc7610dd582c423a79e7cf48809de8b34e1e
2020-04-20 08:46:42 +02:00
Reedy 46549db31e Move some more classes to AutoloadNamespaces
Bug: T187154
Change-Id: I7e9407c1b0e03ccb699e4a11b6b44529d70fee3d
2020-04-18 03:59:38 +01:00
libraryupgrader a89c424181 build: Updating grunt-banana-checker to 0.9.0
Change-Id: Ia656ffd71cdbf846cadff005ea34a47bb78bad78
2020-04-17 23:31:20 +00:00
Stephen Niedzielski 3b906fdd66 [dev] Fix indent in VectorTemplate data
Jon spotted this in Ic9d54de7e19ef8d5dfd703d95a45b78c0aaf791a.

Bug: T246419
Change-Id: Ie760610898c1754ac0640e8077faa6ec79da66c1
2020-04-17 14:23:56 -06:00
Translation updater bot 286fcb94d3 Localisation updates from https://translatewiki.net.
Change-Id: I322840b459b880e8c52f2ab5ea8f2933f7cf7f1f
2020-04-17 09:09:28 +02:00
jenkins-bot 697d796288 Merge "[Refactor] Move footer layout rules to layout.less" 2020-04-17 00:23:28 +00:00