Commit Graph

1577 Commits

Author SHA1 Message Date
Translation updater bot 5cd5785a85 Localisation updates from https://translatewiki.net.
Change-Id: I151633bf3908e792369578f3a6bd3fc0e5c508a6
2019-07-08 22:17:19 +02:00
jenkins-bot 61784701e2 Merge "Make failing Bucketing test more robust" 2019-07-08 15:59:15 +00:00
Translation updater bot 7610467f28 Localisation updates from https://translatewiki.net.
Change-Id: I7e91c8d281cf6ebfccfad584e9fc9f8182fe2610
2019-07-07 22:11:00 +02:00
Thiemo Kreuz 303a5019fc Make failing Bucketing test more robust
This test started failing on us for no apparent reason.

Example: Ic95f7b0
https://integration.wikimedia.org/ci/job/quibble-vendor-mysql-php72-docker/11469/consoleFull

Output: "test control group is about 25% (30.8%)"

It appears like the bucketing is not really done based on an actual
random number generator, but based on a hash that contains the session
ID. If this session ID is not really a random number, the hash might
not be random enough as well, but be skewed towards one or the other
direction.

We propose to take the normal distribution into account and change the
narrow +/- 10% margin to +/- 20%.

Change-Id: Ib163f1de4f9cff27aaf8dbc81189315142ff0d8a
2019-07-05 21:38:58 +00:00
Stephen Niedzielski 4c34cce9f3 Hygiene: move menu entries to subdirectory
The number of generic menu entry specific files is growing which is
cluttering the Menu/ directory. Move the entries to a new subfolder.

Bug: T214540
Change-Id: I807d6f6034ee1924e3a606f5e6782c3298896825
2019-07-05 21:32:44 +00:00
jenkins-bot 05de7b9387 Merge "Hygiene: extract ToggleList to a reusable component" 2019-07-05 00:27:11 +00:00
jenkins-bot c6b9bcb468 Merge "If the Overflow menu is visible, don't render user links" 2019-07-04 20:49:03 +00:00
jenkins-bot aacaa91f46 Merge "Add contributions link to toolbar on User pages" 2019-07-04 20:38:36 +00:00
Stephen Niedzielski edb4385345 Hygiene: extract ToggleList to a reusable component
A list that toggles visibility via the checkbox hack is needed in at
least two spots: the page actions overflow menu and the user menu. This
patch makes several refactors to turn what was previously hardcoded into
page actions a reusable component:

- Start a new components directory. Components are reusable and
  composable. The subdirectories are organized by function, not
  ResourceLoader module bundling which greatly improves the ability to
  see a component's full functionality in one directory instead of
  examining the entire codebase. See updates to README.

- Extract pageactions.less into:
  - ToggleList.less: LESS for any checkbox hack list.
  - DropDownList.less: LESS for lists that open downwards.
  - MenuListItem.less: LESS for list items of menus.
  The division makes it easier to see concerns, dependencies, and change
  code.

- Move pageActionMenu.mustache to a component and extract ToggleList
  template.

- Extract ToggleList.js from Toolbar.js.

Bug: T214540
Change-Id: I171831469a6733c458bc5c7ba249a5096ca975b8
2019-07-04 13:48:13 -06:00
Piotr Miazga 080049ffc5 Add contributions link to toolbar on User pages
We would like to hide the user links and show only toobar when
OverflowMenu is visible. The User contributions link is available
only in user_links section only, as we're going to hide this
section, we need to move that link to the Toolbar.

Bug: T224735
Change-Id: Ib4f297993213fcc8fc3dd998e282e5b39957485e
2019-07-04 21:46:45 +02:00
jenkins-bot e10f8a8b16 Merge "Allow overriding text and CSS class for home menu entry" 2019-07-04 15:11:10 +00:00
Kosta Harlan 9b7b10bbe9 Allow overriding text and CSS class for home menu entry
* Introduce a HomeMenuEntry class and use it for adding the home menu link
* Provide override methods for text and CSS class

Bug: T223210
Change-Id: I37160887478cba829a6e2f10a4d8f87d95167556
2019-07-03 16:42:47 -04:00
Translation updater bot 195b9a9fd6 Localisation updates from https://translatewiki.net.
Change-Id: Iefb4fb1e328a5fc0a3488632c3dbf980992d16a2
2019-07-03 22:12:45 +02:00
jenkins-bot 200e64d32a Merge "Make SkinOptionsTest extend unit test case" 2019-07-02 18:34:09 +00:00
Kosta Harlan b6682f6f93 Make SkinOptionsTest extend unit test case
Depends-On: I237a9f82e4d1b05cf2f08b3e4bb7ffcd8d47111c
Change-Id: I42ca6c315584ae04289b28efa766bf4e67fda67a
2019-07-02 13:54:11 +00:00
jdlrobson a9533fc463 Browser: Drop failing tests
Two tests are failing. These are false positives that
obscure real failures. Both are removed for the following reason.

1) Editor test is covered by the redirect tests - failing due to
concurrent edits (possibly because multiple browser tests act on the same
page at the same time). However, editing is already covered by the other
2 cases.

2) Remove unwatch test - this is failing as there is a problem in the
setup - the page starts unwatched when it should be watched. The test
for checking that an article can be watched should suffice here.

Bug: T224947
Change-Id: I3049e1b190c3cb2ddc198a45681f59782f770d6a
2019-07-01 18:02:54 -07:00
Translation updater bot 5b92c238b3 Localisation updates from https://translatewiki.net.
Change-Id: I9e523205a86d3dcfa93480f8c195a2f1b8f0a451
2019-07-01 22:02:09 +02:00
jenkins-bot a06df4ec9b Merge "Add DataAfterContent to footer (SkinAfterContent hook)" 2019-06-28 12:20:27 +00:00
Translation updater bot 2a3f2590dd Localisation updates from https://translatewiki.net.
Change-Id: Ib431a2b7786d7d83d36a8b14ecf57544930fce89
2019-06-26 22:01:47 +02:00
jenkins-bot 93ca7f2eee Merge "Move hamburger icon generation into Director" 2019-06-26 19:13:55 +00:00
jenkins-bot 141d9a89ed Merge "Don't scroll vertically when scrolling active tab into view" 2019-06-25 14:13:24 +00:00
Piotr Miazga 686e116d60 If the Overflow menu is visible, don't render user links
User links bar has the items already rendered in toolbar/overflow
menus. There is no need to render user links if the overflow menu
is available.

Bug: T224735
Change-Id: I613fa68b6cd43acf07bcb85af77d0239dc6bba6b
2019-06-25 12:25:26 +00:00
jenkins-bot 62090bcd69 Merge "Use wgRelevantPageTitle when setting up talk overlay" 2019-06-25 10:21:53 +00:00
Roan Kattouw b64b4c1b9f Don't scroll vertically when scrolling active tab into view
Do the scrolling math manually, and only do horizontal scrolling on the
tab container. Don't do vertical scrolling, and don't scroll the
viewport.

Bug: T226112
Bug: T223142
Change-Id: Ie67e15bd51252906897a213505ae82cf29ba5cf2
2019-06-24 15:18:56 -07:00
James D. Forrester 7ebab3c9eb build: Upgrade wdio-cucumber-framework to get a working version of fibers
Bug: T226442
Change-Id: Ia3772f620d8bfc511c0d4259734e0ce9a092c679
2019-06-24 14:37:58 -07:00
Translation updater bot 8d89172bac Localisation updates from https://translatewiki.net.
Change-Id: Ifadc568c590df9f67983668f7f8ed8c7455adf0b
2019-06-23 22:11:21 +02:00
jenkins-bot ab3fb1d148 Merge "MinervaPermissions must respect $wgHideInterlanguageLinks config" 2019-06-21 20:13:27 +00:00
jenkins-bot 0d9f6786e4 Merge "Hygiene: Drop isAuthenticatedUser method" 2019-06-21 19:56:44 +00:00
Piotr Miazga bb0071383a MinervaPermissions must respect $wgHideInterlanguageLinks config
MediaWiki Core defined $wgHideInterlanguageLinks that can be used to
disable the interwiki links. Minerva skin should respect this config,
furthermore, this config should take precedence over the Minerva's
$wgMinervaAlwaysShowLanguageButton config.

Bug: T214540
Bug: T221792
Change-Id: Id4fe8b67a17f9c28c00a8a3a207946e146502cde
2019-06-21 18:59:50 +00:00
Piotr Miazga 0e65adbf44 Move hamburger icon generation into Director
The MainMenu is built using Builder pattern. The hamburger icon
is always the same, and it should be defined in the Menu builder,
not as a separte UI element.
For better code organization, all things related to MainMenu
building should stay in the Menu Director/Builders, not in the
SkinMinerva class.

Changes:
 - moved hamburger icon build method into MainMenu/Director
 (as the menu icon is the same for all builders)
 - renamed stuff in BaseTemplate for better readability
 - use MediaWikiServices::getInstance()->getSpecialPageFactory()
 instead of deprecated SpecialPageFactory class.

Change-Id: Ie5b30c0dd1649d38a4023ccb40c99dee2a127a70
2019-06-21 20:57:32 +02:00
Piotr Miazga b8d5e3fac5 Hygiene: Drop isAuthenticatedUser method
Is used only in Minerva, and it's so simple, there is no need to
have a special function for that (no improvement no performance,
nor readability)

Change-Id: Id5a4edb077671dc12f58df31273f00a1a816f097
2019-06-21 19:18:27 +02:00
Piotr Miazga 8c7553935e Hygiene: Add return types for known services
We can define return types using `function(): TYPE` notation.
We should do that when it's possible.

For now, it's not possible to type nullable return type (PHP7.1
supports that, but PHP7.0 and most probably HVVM doesn't),

Change-Id: I6b58a882383832313ef47a296c726a4044a97954
2019-06-21 19:06:04 +02:00
Piotr Miazga 6352190684 Hygiene: Extract isAllowedPageAction into MinervaPagePermissions
The isAllowedPageAction is used in multiple places (SkinMinerva
and in PageActions toolbar builder). This logic should be defined
in separate service, easy accessible for different parts of the
Minerva skin.

Changes:
 - Introduced MinervaPagePermissions as a centralized place to manage
 user permissions
 - Introduced MinervaNoTitlePermissions, an NullObject pattern to
 handle situations when we do not have Title object (like in CLI)
 - removed Minerva.ContentHandler service as it's not required any
 more
 - moved all permission names into constants
 - moved isTalkAllowed() into MinervaPermissions
 - renamed isAllowedPageAction() it `isAllowed()` to not mix it
 with PageActions. Those checks are used in many places, not only
 on PageActions menu
 - made isAllowed( watch ) more robust - now it checks that Title
 is watchable

Bug: T221792
Change-Id: I87d44a9c717b5f752b8d1fd2f146d7f5eef3c53f
2019-06-21 15:30:11 +00:00
jenkins-bot 18a1d48d53 Merge "Build: add package-lock file" 2019-06-20 22:13:59 +00:00
Piotr Miazga 806663e158 Extract LanguageSwitcher to separate class
The Language switcher will be used in couple places:
 - Toolbar, if the AMC is off
 - both overflow mmenus when AMC is on

To make code DRY, first we should provide a single way to
create Language Switcher menu element, so we can use same way
in all possible scenarios.

Bug: T224735
Change-Id: I5ba0dbad7089012c7fd1bfc43787775c7e36d575
2019-06-20 17:18:20 +02:00
Stephen Niedzielski 36be88b5b5 Build: add package-lock file
Add package-lock file. The previous version of Node.js did not support
package-locks but v10.15.2 does.

Bug: T179229
Change-Id: I987bfb6f4c4cd0fe5c3f24d45e29c906e18a9e2b
2019-06-20 08:09:44 -06:00
Isarra 492b3fa63e Add DataAfterContent to footer (SkinAfterContent hook)
bug: T226143
Change-Id: I5b0ad889e633fde88c392577ce5373c81fc5486a
2019-06-20 01:49:05 +00:00
Translation updater bot 4b24daa117 Localisation updates from https://translatewiki.net.
Change-Id: I6343b83298d36d9ae8c240f5fbb5f35c4393dcb5
2019-06-19 23:37:08 +02:00
Stephen Niedzielski 1e61706e0e Hygiene: rename "secondary button" to "user notifications"
The secondary button is not generic. Rename it to match its specific
purpose.

Bug: T214540
Change-Id: I50b7e7fa7bea91a029a8ca71199b0309dff1c518
2019-06-19 11:31:16 -06:00
Stephen Niedzielski 02726555e0 Hygiene: rename user notification build method
Rename SkinMinerva->prepareUserButton() to
prepareUserNotificationsButton(). The function is responsible for
inflating the button that displays notifications when pressed. This name
would be especially confusing when an actual user button is added in
T214540.

Bug: T214540
Change-Id: I8965ef4c5b29ea692d67e821a06131ad5f287287
2019-06-19 11:16:23 -06:00
jenkins-bot 1aa31ea5b8 Merge "Correct Wikidata icon color in overflow menu" 2019-06-19 14:10:38 +00:00
Nicholas Ray 9676395529 Correct Wikidata icon color in overflow menu
This icon's stroke was explicitly set to `#000` before this commit, but
we need its color to be `#54595d` to match the other icons in the
overflow menu [1]. Unfortunately, although we set a variant in skin.json
for the icon to be colored this way [2], there are 2 problems that
prevent it from displaying this color:

1) The icon sets an explicit black color for its stroke attribute
2) ResourceLoader currently only sets the fill color on the `g` element
when applying the variant style [3]. It does not set the stroke color. Even
if problem 1) was removed, we would need RL to set the stroke color, but
I'm not sure how that would affect other variant icons that RL deals
with.

The simplest possible solution is to to change the stroke attribute on
the icon itself, although it unfortunately introduces technical debt as
this icon now differs slightly from the OOUI one :(

[1] https://phabricator.wikimedia.org/T222630#5266575
[2] https://github.com/wikimedia/mediawiki-skins-MinervaNeue/blob/master/skin.json#L262-L267
[3] 4e59467427/includes/resourceloader/ResourceLoaderImage.php (L331)

Bug: T222630
Change-Id: I8c10a6012c7d32ab8555b874e766bc2f36437cf8
2019-06-18 17:05:26 -06:00
Ed Sanders 240280b906 Tabs: Remove unnecessary flexbox styles
white-space:nowrap is simpler and better supported.

Change-Id: I8c44cdd3c30a4cad1817b7912f9bbaae9e5ef641
2019-06-18 21:36:28 +01:00
Stephane Bisson 5a3a8efc31 Use wgRelevantPageTitle when setting up talk overlay
wgRelevantPageTitle is generally the same as wgPageTitle.
It is different on special pages that act on a page.
For example, on Special:WhatLinksHere/Moai
  wgPageTitle => Special:WhatLinksHere
  wgRelevantPageTitle => Moai

This change would allow Special:Homepage to have the talk overlay
connected to its talk tab.

If Minerva has such special pages that act on a page AND those
pages have talk links AND the 'skins.minerva.talk' happens to
be loaded, those links would now show the talk overlay.
I found no such cases but I cannot say they don't exist.
I also don't know if this change would be a regression
or an improvement.

Bug: T225659
Change-Id: I5d60ff3f0295f44a6d59cd772e27656b69ef0972
2019-06-18 15:38:33 -04:00
jenkins-bot 48c3aa0662 Merge "Make the tabs scrollable horizontally" 2019-06-18 16:20:01 +00:00
Translation updater bot fffb5ab379 Localisation updates from https://translatewiki.net.
Change-Id: If6e23b739c2283e79b380104744dd75226d5a732
2019-06-17 22:09:24 +02:00
Translation updater bot 77779ce441 Localisation updates from https://translatewiki.net.
Change-Id: Ic64d6110f83ce3d8a06e1dabf76945e9145951e6
2019-06-16 22:07:40 +02:00
Stephane Bisson 4f5dbf7d55 Make the tabs scrollable horizontally
* Add a container around the tabs and use flexbox
  to position the tabs on one line and make it
  scrollable.
* Add some JS to scroll the currently selected
  tab into view.

Bug: T223142
Change-Id: Ie2205e6836797c2ac000e12a01f78a4aa7bc5b81
2019-06-14 13:50:23 -04:00
Piotr Miazga b8abf809ac Hygiene: rename $navUrls to $toolbox
Previously we were passing the $tpl->data['nav_urls'] array,
because of that all params were called $navUrls. That approach
was incorrect and we have to pass $tpl->getToolbox(), which
means all $navUrls variables/paramters have to be renamed to
$toolbox for better clarity

Changes:
 - renamed $navUrls to $toolbox
 - update phpdocs blocks
 - renamed buildEntry() into build()

Bug: T222630
Change-Id: Id0023cfbb9779c502edc0f91e31a2a912af84084
2019-06-14 19:05:37 +02:00
jenkins-bot 3461c9dd93 Merge "Add wikidata link to overflow menu" 2019-06-14 16:54:12 +00:00