Commit graph

508 commits

Author SHA1 Message Date
jenkins-bot 0aa5b43469 Merge "Rename $glyphPrefix to $iconPrefix to better reflect variable value" 2020-04-30 17:08:31 +00:00
jenkins-bot 272e0baa54 Merge "Remove "last-modified-bar__text" as a JS selector" 2020-04-30 15:28:12 +00:00
Jan Drewniak 5144e73313 Remove "last-modified-bar__text" as a JS selector
When enchancing the watchlist items with the "time ago"
feature, the "last-modified-bar__text" class is added
to the element, which could have unexpected consequences.

That class is removed from the watchlist and instead
of using it as a JS selector, the `modified-enhancement`
class is used for both the watchlist and last-modified
bar.

Change-Id: I4a157adf51b9ed45bcba977f4f6622c7991471ba
2020-04-30 16:17:23 +02:00
Volker E b35fdfe9eb Rename $glyphPrefix to $iconPrefix to better reflect variable value
Aligning with other `$icon*` variables throughout MinervaNeue.

Change-Id: I18cbd06bdd44d127093655577ba4daeb69dbe8ec
2020-04-29 15:14:59 -07:00
Volker E 96132669fd [docs] Remove whitespace in 'WikimediaUI'
Change-Id: I24169651cb60c68ea1bc0d5c70ee6f44841382ab
2020-04-29 14:50:51 -07:00
jdlrobson fa6255dfd0 Use standard getJsConfigVars method
Depends-On:  I1e2927a5ced077c8764ff7872ca033f487ae7cc7
Change-Id: Ia5aae659d9882bef7a273c709789437719303a35
2020-04-28 19:06:51 +00:00
AronDemian f271350c91 Add .mw-footer CSS class to footer
Bug: T248137
Change-Id: I8a5af18e4aca663a7a9e9261fb360f7cd45f7283
2020-04-24 02:25:40 +00:00
Reedy 101a1430da Remove MediaWiki\Minerva\MenuBuilder
Move one more class to AutoloadNamespaces

Change-Id: Ib434c512bb4d85047ad7cd5f756c69802462bb48
2020-04-18 20:03:13 +01:00
Reedy d12308e38d Move some more classes to AutoloadNamespaces
Bug: T187154
Change-Id: Ia78f963a08cec1490aaff462b9787f7a826bf62c
2020-04-18 16:09:42 +00:00
jdlrobson e223d00e8f Update the icon glyph
In Ia3bafc74a85293c2414c0ef4ccf3bb20c75135d1 this icon was renamed
but this reference was not updated.
The module will soon be removed in I181d41f60481efa904d5e951cf08480bbae82015

This will not fixed cached HTML. The damage is already done, so we'll
have to live with this bug on old cached HTML for up to 7 days.

Bug: T249864
Change-Id: I20b838ed5ab478ae60b2cbf6abf5df448d8f4e59
2020-04-10 10:40:05 -07:00
jdlrobson 276ae636fe Use standardized icon classes and fix some missing icons
The icon pack wikimedia.ui was strangely using a non-standard
icon class using empty strings as a way to disable the default behaviour
of setIcon. Instead of fighting APIs - use the methods available.

The icon pack is also renamed to reflect what it's actually used for -
providing icons for overflow menus and it is no longer loaded as a dependency
by skins.minerva.scripts

Fixes issues with:
* History icon with AMC disabled and user is logged in
* Table of contents icon
* Language icon when it appears in overflow menu on user pages
when logged in where AMC is disabled
* listBullet appears in 2 modules as it is used in 2 places - the AMC
overflow menu (log icon on user overflow menu) and for table of contents
(JS only)

Bug: T232383
Change-Id: I05220ffa56195be6a594e3a8a57ae16858088444
2020-04-02 01:37:33 +00:00
Volker E 98d3225fc8 Rename several icons to WikimediaUI naming
Renaming to WikimediaUI standard naming and adding to module
skins.minerva.icons.wikimedia which is loaded via addModuleStyles
 'edit' → 'editLock'
 'edit-enabled' → 'edit'
 'toc' → 'listBullet' (already included in wikimedia.ui module)
 'mainmenu' → 'menu'
 'language-switcher' → 'language'
 'clock' → 'history'

Icon `page-actions-overflow` which is only needed on AMC is moved out of the stable icon
pack and added to skins.minerva.mainMenu.advanced.icons temporarily which is loaded on AMC pages only:
 'page-actions-overflow'

Additional changes:
* Renaming 'clockIconClass' to 'historyIconClass' to stay on name.
* Module `skins.minerva.icons.images` is deprecated and shipped for old
HTML markup. It will be removed in 2 weeks.

Bug: T232383
Change-Id: Ia3bafc74a85293c2414c0ef4ccf3bb20c75135d1
2020-03-31 11:48:57 -07:00
jdlrobson 1f94dbb094 Simplify hamburger button logic
It was a bit of a maze trying to work out how we generate our
hamburger button. Much of this abstraction seems unnecessary when
we can rely on template partials and data instead.

Change-Id: I791640fea29f87334dcc36baf92ea9e300d8a07c
2020-03-30 20:19:00 +00:00
Volker E 0f5f376b64 Remove unused 'talk' icon
Bug: T244444
Change-Id: I42f60785c4693da7542a61e0ad415850175cb0f5
2020-03-27 18:06:37 -07:00
Bartosz Dziewoński bc41bf5326 SkinMinerva: Fix link target for transcluded pages in doEditSectionLink()
Bug: T198011
Change-Id: I62caa73d9b337be8f987f077eced0b2e6ca4fa5f
2020-03-20 23:01:28 +01:00
Derick A 2afd3b5de2 menu: Remove local var $url whose usage was removed in the past
Poked around the revision history a bit and found that the usage
of this variable as removed in f5bef2e but its definition was not.

Added return type hint for the `prepareToggle()` method too.

Change-Id: I9950f4c81bb914bf2c2d3c13c60d3f0a040a0ae1
2020-03-20 07:02:38 +00:00
jenkins-bot 96c971ca77 Merge "Remove usage of deprecated Revision::newFromTitle" 2020-03-11 16:04:51 +00:00
James D. Forrester 0892d190b6 Drop support for $wgMinervaCustomLogos being set
Bug: T232140
Change-Id: I56dc8ac8d394ad7561ea09e67da6c51db2bc90f9
2020-03-10 20:40:32 +00:00
Petr Pchelko d9db54120d Remove usage of deprecated Revision::newFromTitle
Bug: T246284
Change-Id: Icd1d7ae5324ab83d0ec2f5ffd6e1f846fab3ca60
2020-03-03 18:53:53 -08:00
Petr Pchelko 583ac2305d Remove usage of deprecated Revision::getTimestampFromId
Bug: T246284
Change-Id: I852af2f19cbd1df0f9137e0f75ed7a272a54a169
2020-03-03 18:19:44 -08:00
James D. Forrester e56349f7a7 Hard-deprecate $wgMinervaCustomLogos being set
Bug: T232140
Depends-On: I2463fecfafbb4c08d80f624adf4cd47a6fb4e660
Change-Id: Ibb70f97c889edf8ffc21737e87949b0294044f9c
2020-02-27 22:04:09 +00:00
James D. Forrester 278c18057e Follow-up 51a34809: Don't hard-deprecate something still set in config, you'll break prod
Bug: T232140
Change-Id: Icd5b045c3ebc3234fa0e3bcaffb2172209fa0408
2020-02-20 15:20:29 -08:00
jenkins-bot e838fcec22 Merge "Deprecate wgMinervaCustomLogos in favor of $wgLogos" 2020-02-20 00:29:22 +00:00
jdlrobson 51a348097d Deprecate wgMinervaCustomLogos in favor of $wgLogos
Testing:
```
// Start with no Minerva config and no wgLogos defined in LocalSettings.php

// Set $wgMinervaCustomLogos
// Should trigger deprecation warning.
$wgMinervaCustomLogos = [
	'copyright' => 'https://en.m.wikipedia.org/static/images/mobile/copyright/wikipedia-wordmark-fr.svg',
	'copyright-height' => 40,
	'copyright-width' => 120,
];

// Set wgLogos without wordmark
// Should trigger deprecation warning as $wgMinervaCustomLogos is still
// defined.
$wgLogos = [
	'1x' => 'https://en.wikipedia.beta.wmflabs.org/static/images/project-logos/enwiki.png'
];


// Set wgLogos['wordmark']
// No deprecation warning. $wgMinervaCustomLogos will now be ignored
// in favor of the new wordmark key.
$wgLogos = [
	'1x' => 'https://en.wikipedia.beta.wmflabs.org/static/images/project-logos/enwiki.png',
	'wordmark' => [
		'src' => 'https://en.m.wikipedia.org/static/images/mobile/copyright/wikipedia-wordmark-fr.svg',
		'height' => 40,
		'width' => 120,
	],
];

// You can now safely drop $wgMinervaCustomLogos.

```
Depends-On: I66a971631c623cc94b58eb0e5e5bad804789bf1c
Bug: T232140
Change-Id: I013bd0904fe8c55efa49d14e84cf06ec1412896f
2020-02-19 23:59:28 +00:00
jenkins-bot dc688ad85f Merge "Check title value before proceeding to check if user page" 2020-02-18 21:31:25 +00:00
jdlrobson 7f47dff5e5 Use icons in skins.minerva.mainMenu.icons from OOUI
For all mainMenu icons pull from OOUI icon packs.

We make the necessary changes to Definitions.php, ToolbarBuilder
and LogoutMenuEntry to ensure to update icon glyph names.

There are caching implications for icons that show to anonymous users -
these have been fixed for grade A browsers running JS by appending the
new class to impacted elements.

Grade C browsers being served cached HTML will not benefit from this
emporary fix as available solutions are costly.
As a result these users will not see icons until the cache
expires (maximum of 4 weeks but likely 1 week) or is flushed via
action=purge.

This is acceptable given the amount of impacted users and the fact that
icons are not essential for using the main menu.

Note: The communityportal.svg icon while in the resources folder was
not referenced anywhere in the codebase so its removal is safe.
Please note the same icon in skins.minerva.mainMenu.advanced.icons which
is used for the community portal menu item.

Bug: T244444
Change-Id: I0f929f2f3b11362e02f0d02f57b90b34b5c93d24
2020-02-17 20:36:28 +00:00
jdlrobson d48ce1e729 Check title value before proceeding to check if user page
Bug: T245162
Change-Id: I7b826fb0e07a58947f381893604f308903c30304
2020-02-17 20:25:59 +00:00
jdlrobson a3179d8fff Use user sandbox icon from OOUI
It's called 'markup'. Since this icon only ever shows to logged in
users there are no caching implications.

Bug: T244444
Change-Id: I75f5365ccb5a41f1c0628532e81b5ec63804a2a8
2020-02-07 03:39:08 +00:00
Phuedx 6e4c6c99bc Revert "Reduce 'userContributions' icon code"
This reverts commit 7b4b65a30f, which
caused a regression in the user menu part of Advanced Mobile
Contributions mode.

Bug: T244436
Change-Id: Ifce627dac35b2cd05e1c5ebe658534b6b8d0de88
2020-02-06 11:05:26 -08:00
jenkins-bot 7131fa054c Merge "Fix double escaping of menu item messages" 2020-02-05 06:53:58 +00:00
jenkins-bot b216b8187f Merge "Dev: Address some FIXMEs" 2020-02-05 00:24:25 +00:00
Ammar Abdulhamid 3c77f935cd Fix double escaping of menu item messages
Bug: T244119
Change-Id: If87944c385af42323a404f95f9759fdfc9e039e4
2020-02-04 06:16:46 +01:00
jenkins-bot 070539c012 Merge "Reduce 'userContributions' icon code" 2020-02-04 03:03:11 +00:00
Volker E 7b4b65a30f Reduce 'userContributions' icon code
Also rename it to unified DSG/OOUI name and add standard XML declaration.

Change-Id: I6c908acd70c0dca5bcb1754d1b25d3da2389feb8
2020-02-04 09:54:22 +08:00
Nicholas Ray d87eed1c6b 🚿 Hygiene: Remove unused $menuData variable from getSkinConfigVariables method
As far as I can tell, this is unused and the invoked method doesn't
cause any side effects. Therefore, I think it can be safely removed.

Change-Id: I8b507b4bf38a8a0e70684165d8a48c2d284cdd11
2020-02-03 15:15:36 -07:00
jdlrobson 1e64fc8f3d Dev: Address some FIXMEs
* Drop non-existent pointer-overlay selector
* Drop redundant icon class for arrow
* Drop unnecessary !important
* Drop transparent-shield class
* Reword an existing FIXME about a contensious decision and
add a new FIXME for moving some code to a more appropriate place.
* Move an image into a ResourceLoaderImage module (test with
`mw.notify('error', { type: 'error'} )`)

Change-Id: I6e38f07772afae6f13c4851ca17a67d52ca7d331
2020-02-03 08:43:18 +00:00
Bartosz Dziewoński 700b1c43e9 Allow passing context to MinervaPagePermissions
Previously it always used the global context RequestContext::getMain(),
which is basically equivalent to using $wgTitle or $wgUser, and will
not produce the correct results when used in other situations than
regular web requests (e.g. API requests or jobs).

MinervaPagePermissions is required to parse pages (due to the custom
section edit links in SkinMinerva::doEditSectionLink), which is often
done in API requests or jobs.

Pass the appropriate context in SkinMinerva::getPermissions(). This
fixes T234868. Note that MinervaPagePermissions is also used elsewhere
and I am not fixing those cases.

Depends-On: Iaa83e5f801c7776bf8218d8ce7484e2485b227d4
Bug: T234868
Change-Id: I2d6fd525f20a0b6beeeaa731f6b8caa471b8529d
2020-01-29 10:33:36 -08:00
jenkins-bot 974a5fb1b0 Merge "Escape HTML in toolbar menu" 2020-01-29 05:29:11 +00:00
Ammar Abdulhamid e2c9c6cd59 Escape HTML in toolbar menu
Bug: T243502
Change-Id: Ic175e9430a3655da0ae1e4a82d423873da7eb721
2020-01-28 15:15:09 +01:00
Umherirrender 5b0a4f30b2 build: Updating mediawiki/mediawiki-codesniffer to 29.0.0
Change-Id: I529c6a67eeb5eb012031b69ef63f4338f3685178
2020-01-26 20:26:31 +01:00
jdlrobson db29aa53bd Make MobileFrontend dependency a soft one
This extends the work in Ie29a1eb7746d56f7d8c99b74e5e3c213c30fdcf2

Bug: T171000
Change-Id: Ib125e1bdaace1893804892909c27a9f328445835
2020-01-17 14:02:23 -08:00
Stephen Niedzielski 83432ba8b5 Fix: user navigation label when AMC is disabled
At some point I introduced a bad label aria ID,
minerva-user-menu-toggle, for the user navigation. This was the
incorrect text and ID to use. Further, the ID is not present in non-AMC
mode (which is what search engines use). This patches adds a new string,
minerva-user-navigation, and replaces the aria-labelledby attribute with
a direct aria-label.

Bug: T242281
Change-Id: Ic247eb77609862b62025dc5e6af550c079df26d9
2020-01-10 15:23:04 -07:00
jdlrobson da5798ef22 Settings link is hidden to non-JS users when beta and AMC unavailable
Bug: T198265
Change-Id: I6340da6dbbd031d8c91ae99801065bafe9245920
2020-01-08 22:57:04 +00:00
Umherirrender 960cd11fa8 build: Updating composer dependencies
composer:
* mediawiki/minus-x: 0.3.1 → 0.3.2
* jakub-onderka/php-console-highlighter: 0.3.2 -> 0.4.0
* mediawiki/mediawiki-phan-config: 0.8.0 -> 0.9.0

Change-Id: I6519f1e27777c13c432c25f46e35ab8b61bdcbab
2020-01-04 13:24:24 +01:00
Umherirrender 4b18fee06f Allow null on MinervaUI::iconClass
Change-Id: Ie9404dd35421144bce3e14fe6c55415530314792
2019-12-30 17:26:31 +01:00
Jan Drewniak f5bef2ea5c Main menu button works without JS
Converts the main menu button to work without JS using the CSS-only
"checkbox" hack, using the ToggleList module from the dropdown menus.

Bug: T225213
Change-Id: I0eff0439f7284ec74f6304324fab409e8a1b6245
2019-12-19 19:55:39 +00:00
jdlrobson f479c706fe Minerva doesn't add MFManifestThemeColor
This config is provided by MobileFrontend.
It should not be added in Minerva.

We need to remove this to avoid adding the theme twice.

Depends-On: Id21038e3df60f279af40681307e14ef82ce60294
Change-Id: I7f9a69eca396ef1a17898dc128f38feefa68a21a
2019-12-18 13:12:14 -08:00
Jan Drewniak e75c5caa7e Add missing class to contributions icon in page-actions menu
Bug: T240644
Change-Id: Ie3a301b998b54ccebebcf984aa46bfcce5036d11
2019-12-16 19:35:52 +01:00
jenkins-bot 9e370d9a84 Merge "Use User::getBoolOption" 2019-12-15 10:06:50 +00:00
Nicholas Ray ec93d34370 Resemble AMC mode for all users on user pages & user talk pages
This commit:

* Removes the blue secondary action links found on User pages

* Modifies ToolbarBuilder to add the contributions
icon into the toolbar when on a user page/user talk page.

* Turns on HISTORY_IN_PAGE_ACTIONS, TOOLBAR_SUBMENU,
TALK_AT_TOP skin options for all users on user pages / user talk pages.

* Languages icon is moved to overflow menu

* Remove $userPageHelper param from UserNamespaceOverflowBuilder as
it isn't using it and it is confusing to pass it in

Bug: T232653
Bug: T235681
Depends-On: I2138472e68d8cab1c50cbb42807bd5b79e7e2749
Change-Id: I940e5cf7638ff38686eeca3d41554b8a22d35615
2019-12-13 14:10:43 -08:00
Umherirrender 88df9f354a Use User::getBoolOption
The return value of User::getOption is passed to WebRequest::getBool,
that needs a real bool as default value, so using getBoolOption here

Change-Id: Ifc65f3e88c464afb0e620f3721422dad26bc1e47
2019-12-13 22:42:01 +01:00
Nicholas Ray 5eb26b67cd Remove haspageactions from MinervaTemplate templateData
minerva.mustache does not use this

Bug: T232653
Change-Id: I4cf4f3ba3889bc19d2490ab5f727c00b518fa995
2019-12-13 21:08:21 +00:00
Ammar Abdulhamid 898b048d1c Discontinue back-to-top feature
Bug: T237290
Change-Id: I06a6823bd3d1985a1d76384bb65c9d2ddf334a21
2019-12-11 05:12:43 +00:00
Piotr Miazga cb1cd438db Remove double setIcon() call for the History element on Toolbar
Fix History element classes by not using ::create named
constructor. The constructor was provided for easier object creation
when both icon and click tracking is the same as element name.
The History icon is not that case, as both tracking code and
icon are definited differently than the name, therefore we need
to initailize class, and set required attributes manually.

Change-Id: I7b74e8a7e976d6c1e47f15438f75a7de2f73f154
2019-12-10 13:12:03 +00:00
Piotr Miazga 7e2403c5ad Remove double setIcon() call for Contributions element on Toolbar
Fix Contributions element classes by not using ::create named
constructor. The constructor was provided for easier object creation
when both icon and click tracking is the same as element name.
The Contributions icon is not that case, as both tracking code and
icon are definited differently than the name, therefore we need
to initailize class, and set required attributes manually.

Change-Id: Ia91bbdcfd737a443a05fd4f61853fe8bd200e56c
2019-12-09 19:51:47 +00:00
jdlrobson 97c157b8e8 Replace .content class with .post-content on last modified bar
We use `.post-content` which has less side effects.

Change-Id: I40ce9b2c7410c4c361554b5b32d9c1178a59e234
2019-12-05 21:01:23 +00:00
Piotr Miazga 99f3c97c3c Logout users via API Ajax call to prevent extra step on Special:Logout
Currently the Special:Logout page will ask "do you want to logout"
even if we pass the logout token. To avoid that first let's log out
user via API Ajax call.

Bug: T232734
Change-Id: Ia4cc4253b99254d7a893a55d9e05918c5d8c87e5
2019-11-26 14:45:21 -08:00
Piotr Miazga 244fcdd332 Hygiene: Remove PageActionMenuEntry
There is no need to keep the PageActionMenuEntry as the code
is almost the same as SingleMenuEntry. Both classes were written
around the same time and there was no clue if those can be
merged together. Now it looks like it can be easily achieved.
So DRY.

Bug: T232734
Change-Id: I7ecf7440a241a18aac749b84dc86ff0f07910539
2019-11-26 22:26:24 +00:00
Nicholas Ray 9a2f66fe1f Make talk page explained message only appear on wikitext content model
talk pages

As T238474 shows
(https://commons.m.wikimedia.beta.wmflabs.org/wiki/Talk:Test), an
additional check is needed to see if the content model is wikitext.

As an aside: The SkinOptions::SIMPLIFIED_TALK option is badly named as
it is not the source of truth for whether the simplified talk page is
enabled. It merely tells minerva that the MobileFormatter ran. I plan to
address this in a follow up.

Bug: T238474
Change-Id: Id4b558033165069d03a8c650d0f7a6cf8647fb27
2019-11-25 15:41:01 -07:00
Nicholas Ray 071aa7a0c9 Enable Simplified Talk Page only on Pages With Expandable Sections
This patch should knock out two bugs we were seeing with the simplified
talk page:

1) Removes the "Add discussion" button and "There are no discussions"
message from appearing on Flow enabled talk pages.

2) Removes the "Read as wiki page" and "Active Discussions"/"There
are no discussions" message we were seeing on Minerva desktop talk
pages.

To address when the "There are no dicussions"/"Active Discussions"
message and "Read as wikipage" button are displayed, Minerva now listens
to MobileFrontend's `MobileFrontendBeforeDOM` hook and turns on the
simplified talk page (via a skin option) when this hook runs.

To address when the "Add discussion" button is added, a check was added
to SkinMinerva which only adds it to a talk page if the content model is
wikipage. Unfortunately, we can't just check the skin option because we
also want to display the button on desktop minerva.

Other changes:

* Moves around the logic in `getTalkPagePostHeadingHTML` for improved
readability

Bug: T237589
Bug: T237597
Change-Id: I83fd5cab174d90b24a5335f2b30c912c3b68040a
2019-11-20 21:41:43 +00:00
Piotr Miazga 4c224d2657 Hygiene: Drop optional parameters from SingleMenuEntry constructor
The SingleMenuEntry constructor has too many optional parameters
which makes it confusing and dificult to use.
Instead system should provide a named constructor `create` that
creates new menu entry instance with Icon and click tracking enabled.
If developer wants to override event tracking/change icon it is
possible via calling `trackClicks` and `setIcon` method calls.

This is a first refactoring step to simplify the SingleMenuEntry,
the next follow-up will remove unnecessary PageActionsDirector.

Bug: T232734
Change-Id: I7a631a635a5c5932845639123c285d1d18df1b5d
2019-11-07 19:04:21 +01:00
Nicholas Ray 2d579183c9 Render talk page as a tab instead of an overlay
Following up on Jon's POC, this will get rid of the talk board component in
favor of linking to the server rendered talk page.

Additional Changes:

* Cleaned up talk selenium tests. Removed talk_steps.rb which doesn't appear
to be used anymore.

* Changed talk add button classes to a single class

* Moved "Add discussion" button to postheadinghtml per design mock

* Added  "...talk-explained", "...talk-explained-empty" messages to
postheadinghtml per design mock

* Due to undesirable jumps in window scroll caused by the section anchor
& Toggler.js code when opening the TalkSectionOverlay (read fixme in
code), a Promise is always returned from OverlayManager route to reset
the scroll position to the top when the section overlay is opened.

* Moved
"mobile-frontend-talk-fullpage",
"mobile-frontend-talk-reply-success",
"mobile-frontend-talk-topic-feedback",
"mobile-frontend-talk-explained"
"mobile-frontend-talk-explained-empty"
messages to minerva as minerva is
the one who initiates those messages now.

* Limited $talk selector to only `.talk` elements since amc talk tab
does not need to be targeted

* After saving a reply from TalkSectionOverlay, the DOM that is not
part of the overlay becomes out of sync since a new reply was created.
To get around this, an `onSaveComplete` callback was passed (similar to
the TalkSectionAddOverlay) to execute a full page refresh. Although this
is clunky, it is the easiest way to resync.

Bug: T230695
Depends-On: I80201394fd7015db6700446142b0b4b20829f12e
Change-Id: I243f1193bce0da9fa710fc3b5379f90b2d079680
2019-11-05 09:51:43 -07:00
jdlrobson 7f68c3d3ad MainMenu is a controller not a View and server rendered (take 2)
There should be no caching implications for this change, as the main menu
has been server side rendered on all wikis since 10th October.

As Stephen pointed out somewhere, this is a bit of a micro-optimisation
Let's simplify this code by always rendering it in the HTML. MainMenu.js
as a result becomes a controller that just decides when to show it.

The geolocation check for Nearby is removed given the fact that all
grade A browsers for mediawiki have Geolocation support.

ev.preventDefault in onSkinClick is dropped since the link to the '#'
(the default behaviour) is wanted

Additional changes
* Browser support suggests "animations" class is redundant now
* `open` event no longer filed - not being used anywhere
* Transparent shield is now managed by the MainMenu controller not
the skin (which was confusing)
* Test geolocation using a simple feature tests
rather than abstracting it away inside Browser
* The main menu button is always hidden under either a translucent shield
and/or the main menu itself when it has been opened
so so it's not possible to ever click it while the menu is open
 - the click handler is thus simplified
removing a check for the class of the button

Bug: T234650
Change-Id: If101eebbdbda1519af922745917237648722820e
2019-10-29 16:37:04 -07:00
Piotr Miazga f9c055e7f5 Remove Share feature
The feature got into Beta in over a year ago and never made into
the beta mode. For most of the time it was disabled for all users.
There is no need to keep this code as it is dead code now.

Change-Id: I9037f58b97373195e9d1b9f57789a6c531f42831
2019-10-28 12:54:14 -07:00
Jan Drewniak 77a1424e4e Show labels in page-actions menu on desktop widths
Adds labels to page-actions menu via a new
`.mw-ui-icon-with-label-desktop` class that shows labels at the
desktop break-point.

Bug: T226562
Change-Id: If57ab44660e0dc2a58c04fbf22dee6c27dd1f45f
2019-10-28 12:53:38 -07:00
jenkins-bot 94c1378f0f Merge "Make add talk button show on talk page in AMC mode" 2019-10-28 19:21:29 +00:00
Nicholas Ray 259f24523a Make add talk button show on talk page in AMC mode
There is currently no way for AMC users to see the "Add discussion"
button on the Talk page (non-overlay version). This will be needed in
I243f1193bce0da9fa710fc3b5379f90b2d079680 when we remove the talkBoard
in favor of the server rendered page.

Bug: T230695
Change-Id: Ica63fed1fdfbd1c02018bea8215bfed5b20e5771
2019-10-25 14:22:50 -06:00
jdlrobson bfc7540f7f Menu groups have identifiers
For compatibility and consistency/convergence with Vector, Minerva's
menus are linked to their Vector counterparts.

This allows us to get mw.util.addPortletLink to work inside Minerva

Bug: T231925
Change-Id: I121f12497eac6fcf0b63b9ccce561320eb8b3e62
2019-10-25 19:00:54 +00:00
jenkins-bot 0c3f7bc52d Merge "Use core watchstar code" 2019-10-15 22:56:25 +00:00
jdlrobson bf8d325388 Use core watchstar code
Apply the mediawiki core watchstar to the
Minerva skin. Note, watchstars in search and other locations will
continue to be provided by the MobileFrontend library (see
follow up patch I7b748dc87089389400b0035c62a3b9a00c2e43f9)

Bug: T234970
Change-Id: I11bbe976412b50dba76a55f37887e4c9235d0be1
2019-10-15 15:33:25 -07:00
James D. Forrester e8d227b78e build: Upgrade mediawiki-codesniffer to v28.0.0
Change-Id: I8ce5f16f496f048f6bcf587c545745193dbfe151
2019-10-11 12:04:00 -07:00
jdlrobson ab61dbb173 Echo is removed from Minerva
Managing the transition from old implementation to new:
* A version number is exported from skins.minerva.scripts to
tell dormant code added to Echo in I09c27a084100b223662f84de6cbe01bebe1fe774
to begin running.
* A skinStyle is added for the new `ext.echo.mobile` module.
`mobile.notifications.overlay` will soon cease to exist but is kept registered for
backwards compatibility reasons
- Drop ev.preventDefault call from onSkinClick - it is no longer necessary and will ensure
notifications overlay closes when shield is clicked while it is open.

Integration:
* A server side hook SkinMinervaReplaceNotificationsBadge allows Echo to replace
the current Minerva notification badge
* A to-be-created client side hook is subscribed to to deal with the navigations drawer
like functionality using the mainMenu code
* id and class names are added to the container for the NotificationBadge for compatibility with
ext.echo.init in Minerva's desktop mode (it will work like Vector)

See I09c27a084100b223662f84de6cbe01bebe1fe774 for understanding the bigger
picture.

Depends-On:  I09c27a084100b223662f84de6cbe01bebe1fe774
Bug: T221007
Change-Id: I4c11f1b241d629e1b294ebaec17472fbf944f8c7
2019-10-08 23:21:12 +00:00
jdlrobson e72c0d7ba4 Render main menu and shield on server side
This is a second attempt at I3892afb5ed3df628e2845043cf3bbc22a9928921
that is cached HTML friendly and won't cause T234599.

This time rather than solving the entire problem, we'll start rendering
the menu on the server, to allow us in future to drop the Menu code

Bug: T234650
Change-Id: Iea5406ef1c561f2907ec6132481007673aabf1e9
2019-10-04 19:35:28 +00:00
jenkins-bot 18b483b6ea Merge "Revert "MainMenu is a controller not a View and server rendered"" 2019-10-04 15:18:11 +00:00
Jdlrobson 93b16db1c5 Revert "MainMenu is a controller not a View and server rendered"
This reverts commit 111757970e.

Although I cannot replicate the performance issue, the menu doesn't seem to be rendering at all on cached HTML so this is a deal breaker. Back to the drawing board..

Bug: T234599
Change-Id: Idadc5a079340f44ec66d20a38259b6b337d2dcee
2019-10-04 15:03:19 +00:00
jenkins-bot 3c6fd24f00 Merge "MainMenu is a controller not a View and server rendered" 2019-10-03 20:30:02 +00:00
jdlrobson 111757970e MainMenu is a controller not a View and server rendered
As Stephen pointed out somewhere, this is a bit of a micro-optimisation
Let's simplify this code by always rendering it in the HTML. MainMenu.js
as a result becomes a controller that just decides when to show it.

The geolocation check for Nearby is removed given the fact that all
grade A browsers for mediawiki have Geolocation support

Additional changes
* Browser support suggests "animations" class is redundant now
* `open` event no longer filed - not being used anywhere
* Transparent shield is now managed by the MainMenu controller not
the skin (which was confusing)
* Test geolocation using a simple feature tests
rather than abstracting it away inside Browser
* The main menu button is always hidden under either a translucent shield
and/or the main menu itself when it has been opened
so so it's not possible to ever click it while the menu is open
 - the click handler is thus simplified
removing a check for the class of the button

Depends-On: I7fd243366cceae780bd46e1aef2c08dae073f647
Change-Id: I3892afb5ed3df628e2845043cf3bbc22a9928921
2019-10-03 13:13:09 -07:00
jdlrobson 14476b4bd1 Remove "uploads" link from userpages in AMC mode
This follows up I0d7eb72a2663f1d1138afe09124a154ad0502498

Bug: T233985
Change-Id: I25cc6cd261cd92cd76ea914c73b2cd8d82fa9213
2019-10-03 17:34:17 +00:00
jdlrobson 8ee17cf2b0 Remove wgMinervaErrorLogSamplingRate
We are counting errors rather than sending them via EventLogging.
This code is thus being shipped unnecessarily to our users and is
not ever enabled in production

Given our work to use Sentry (T106915) let's remove this code.

Bug: T233663
Change-Id: I71ef7377e91e38f9ccc13493d52ab629d433f8f4
2019-10-03 14:57:14 +00:00
Ammar 6a0192bf37 Remove "uploads" link from userpages
*This commit also removes it from tests and references

Bug: T233985
Change-Id: I0d7eb72a2663f1d1138afe09124a154ad0502498
2019-10-02 00:11:13 +01:00
jdlrobson 7eb2e3bd07 Notification icon doesn't show to non-JS users
If JS is disabled and you are logged in, no icon shows.
Icon class is incorrect.

I also update the test.

Change-Id: I786ced58171f4ffb4a9d75dcfc6f993647399065
2019-09-30 14:38:59 -07:00
Jan Drewniak 51049c0ceb Refactor "last-modified" bar to use flexbox layout.
Brings the last-modified toolbar (links to history page at the bottom
of articles) in line with recent icon changes. Removes the icon
class from the toolbar itself and by employing a flexbox layout,
reducing the amount of CSS required for this toolbar.

Bug: T233172
Change-Id: I27658477aaeed3290aced844caa64fc5e1c34fbd
2019-09-27 00:03:14 +00:00
jdlrobson e888b487f4 Merge skins.minerva.talk and skins.minerva.watchstar into skins.minerva.script
Logic is moved from server to client. Config is added via getSkinConfigVariables (e.g.
passed to mw.config ) and a JavaScript if statement.

The IIFE in watchstar and talk files is replaced with a module.exports function to avoid
refactoring at this point and added risk. The file contents remain the same.

skins.minerva.options is left as is, given the code is more experimental and used in
the beta mode - should not be sent to all clients.

Additional change:
* Remove skins.minerva.toggling (that module has been empty for a week now and functionality
moved to mobile.init module)

Depends-On: Ie71adbe18e8dbeb661ddb9d7d3d1d0897891d515
Bug: T233048
Change-Id: Ife777e76d9d77894fb5d09e7c8f0238b00596a7a
2019-09-24 14:19:18 -06:00
jenkins-bot 1dd359d824 Merge "Migrate from onResourceLoaderTestModules to QUnitTestModule" 2019-09-23 18:37:46 +00:00
Timo Tijhof 30c12b3ddd Migrate from onResourceLoaderTestModules to QUnitTestModule
The hook is deprecated as of this release cycle, see:
<https://www.mediawiki.org/wiki/Manual:Hooks/ResourceLoaderTestModules>.

Moving away from PHP code. This can now be done from JSON, and
encourages use of a single module that is automatically named and
registered as needed.

Change-Id: I382692c70ca8e5f5ea658b07ebea6c47dd541724
2019-09-20 22:14:56 +00:00
Timo Tijhof f91aca18f3 Use cheaper ConfiguredReadOnlyMode instead of live Database check
Follows-up a0071643d3.

Bug: T233458
Change-Id: I8b3199d7be15aa19f3a0d313d4df926ea877d566
2019-09-20 22:07:30 +01:00
jdlrobson 98d91a66f3 Remove watch and watched icons from repository in favor of Wikimedia UI
Note, because of the two versions of the watch icon, this will temporarily
make the watchstar not display for JavaScript users. The accompanying patch
Ic974b4d6dff14b0d72b8ca71b02c5ef73b1b1d93 will restore this.

Bug: T231613
Change-Id: I16ca70f2892d7418ff245e15f838dfc2b092f3aa
2019-09-19 10:39:27 -07:00
Jan Drewniak 73e87fdc08 Align right-most header icon with content.
uses the CSS :last-child selector to align the last item in the header
with the edge of the container.
This is usually the notification icon in "normal" mode and
the user menu icon in AMC mode.

Bug: T229440
Change-Id: I4430f5659093f76896e2b86e076526a0b51d9630
2019-09-16 11:05:36 +02:00
Jdlrobson 9ec7217d47 Merge "Adjust notification icon to be the same size as the other icons" 2019-09-13 21:53:37 +00:00
Jdlrobson fd3599b603 Merge "Fix truncated text showing through icons & last-modified bar" 2019-09-13 21:53:27 +00:00
jdlrobson 109b24e0ee Adjust notification icon to be the same size as the other icons
Bug: T232011
Change-Id: I0300685d38551bc9ee2c2bd32d6348f32d4df4de
2019-09-13 13:55:01 -07:00
Jan Drewniak 633c48bddf Utilize the mw-ui-icon-flush-left/right classes to align icons
Affected icons:
- hamburger menu
- "search|notifications|user" menu in page header
- notification "circle" icon
- page actions menu
- section edit icon

Bug: T229440
Change-Id: I5587855d0d9ecf2fac20ce16845e6749c26ab7c2
2019-09-13 12:09:43 -07:00
Jan Drewniak 35e489de25 Fix truncated text showing through icons & last-modified bar
To accommodate for cached HTML a new class last-modified-bar__text
replaces last-modifier-tagline to help us distinguish between old
out dated HTML and the new HTML.

Bug: T232792
Bug: T232800
Change-Id: I53fa45058dbc81c91089840073e03113ff1a4b9c
2019-09-13 18:35:31 +00:00
jenkins-bot 7daf7ebb12 Merge "Rename UserRights to UserGroups" 2019-09-12 19:37:55 +00:00
Jan Drewniak be76f05ebb Prepare for new mw-ui-icon spec for Minerva
Includes icon fixes and removal of some CSS overrides.

This causes the following temporary defects to the skin:
* Last modified bar will temporarily be squashed
* clear search  icon will be misaligned vertically

Depends-On:  Ie811d25595d041c35e6c214190101821f3a5d466
Bug: T229440
Change-Id: I0a3a73421791ad353bbcebaeb8241ad062f67ae4
2019-09-12 18:44:44 +00:00
Piotr Miazga add29651b0 Rename UserRights to UserGroups
The "User Rights" is called "User groups" on desktop. The Mobile site
should not provide it's onw naming but use the same names as desktop.

Bug: T230694
Depends-On: Ic9b7033e3f52f415ec8aec845a65a8452d0e5d8f
Change-Id: Iaf116a5cc54cc400451550d9fa958adbbccc35c5
2019-09-12 15:58:51 +02:00
jdlrobson c0f08790ea Remove the mw-ui-icon hacks and overrides
Note: this agitates T230232 again - when merging this please
make sure a merge for I929090848f3e04647a97f4979ec78682623fa070
is pending.

In various places we try to override the default mw-ui-icon behaviours
The hacks need to be removed as part of addressing the core problem.

Changes:
* Wherever we use mw-ui-icon-before in PHP - wrap the label with a span
so that label font-size is altered where needed - not the icon
* Where a small icon is needed us isSmall parameter for the Icon component
* Apply font-size to labels of mw-ui-icon-before elements
* The browser tests need a slight update to access the span element inside
a menu item - in the case of the logout button the label is always hidden,
so we need to check the visibility of the parent element (secondary_action)

Bug: T229440
Depends-On:  I3f803ec4c9068b30aa93b803391aa4d65d8310ff
Change-Id: I07e4ae233979636b739f1117dd7703571e0a9366
2019-09-10 10:53:20 -07:00
jdlrobson fea60ba244 New table of contents icon, prepare for arrow->expand rename
Bug: T231613
Change-Id: I86a4bdac83e1d6caef025ad025962127d74556dd
2019-09-09 10:39:52 -07:00
jdlrobson 497044290a MobileFrontend is now managing the toggling code. Remove.
Depends-On: I6bdeb7198082c4b1d0a32960cc4dc679ff4c6762
Change-Id: I1815a730fc12f68c287d58f2de6f92e05db3abd2
2019-09-06 15:50:00 +02:00
jdlrobson 59b2aabe24 Use avatarIcon instead of profile
Bug: T231613
Change-Id: Ie956ac82869ea5ff91d5d39d6b679a4803e46458
2019-09-05 20:58:06 +00:00