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
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
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
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
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
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
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
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
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
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
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
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
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
The Minerva permission manager distinguishes between user edit
permissions and content model edit support. Rename EDIT constant to
CONTENT_EDIT to help clarify the distinction.
The resolved name in skin.json is not updated to avoid deprecation
policy.
Change-Id: If86b8b5cd9d04ec2881931a3b629bc50e1dd9252
When a user is blocked, only present the "locked" page edit link. Omit
the section edit links entirely.
The logic for checking user permissions already existed in
ToolbarBuilder. Move this logic to MinervaPagePermissions and add a new
"EDIT_OR_CREATE" action distinct from IMinervaPagePermissions::EDIT.
These names will be revisited in a following patch.
Bug: T206265
Change-Id: Ia43a670a259cabc313c004fe06c91e078bd41562
Change the info icon from an outline ("info") to a filled or inverted
("infoFilled") representation.
Bug: T230693
Change-Id: I10f9421661c5244c6859871793bd75650cb0e1e5
Changes:
- added support of event-data-name to toggle list and all menu
entries
- track main menu open actions
- prefix all menu interactions with `menu.`
- prefix menu opening with `ui.`
- track tab clicks (also a part of new ui)
- track notification icon clicks
We're not tracking the Download icon as it has it's own
instrumentation.
Bug: T220016
Change-Id: I442103c1f8967c6710429329f024f266c9b11ea6
Changes:
- Title::getTalkPage() is deprecated, use NamespaceInfo instead
- Http::isValidURI is deprecated, use MWHttpRequest instead
Change-Id: I6938fe93d18372ef855f398a506c8b5ba68b640e
For better readability Main Menu building classes should
contain MainMenu in the name as not everyone uses smart
IDEs.
Change-Id: Ica3bf4bbd18cab1a6cd88061dfb9d1ce51b0f63d
* New module skins.minerva.icons.wikimedia provides icons
from Wikimedia UI in Minerva
* search selector in skins.minerva.content.styles.images is
retained for cached HTML
* skins.minerva.icons.loggedin now a
ResourceLoaderOOUIIconPackModule and bell removed from repo.
* userAvatar replaced with userAvatarOutline
Bug: T224070
Change-Id: Ibed609371060acc4b69e5cd4cd4f20edc871b3ba
Changes:
- We should limit the interfaces we pass around,
AdvancedUserMenuBuilder doesn't need whole IContextSource as it
uses only msg() method. It's better to define that this methods
needs only MessageLocalizer
- move UserMenuDirector into ServiceWiring to be consistent with
other Directors/Builders
- pass PersonalTools as a dependency to UserMenuDirector, which
will pass to each Builder. The personalTools is set of links
that can/should be used when rendering user menu (which in the
fact has almost same subset of tools as the personal toolbox)
Bug: T214540
Change-Id: I7f744651b0665452a5a9d1ce661f20547e80812d
Old MainMenuAdvancedBulder doesn't require the personal section
any more as that section is handled by new UserMenu.
Additionally we should add hook support in the new UserMenu so
different extensions can add their own menu entries.
Bug: T214540
Change-Id: Ibbfbee9d13d58c92d90a22d2b6dcf124b1313c23
Add new user menu. The changes required include:
- Break up AuthMenuEntry into reusable components. They're now simple,
independent, static functions in AuthUtil that are easy to reason
about and compose.
There's lots of verbose code because of the builder and director
patterns. That is, most of the code is for building the thing we
actually want to build instead of just building it. It's easy to write
but no fun to read--even simple configurations are extremely verbose
expressions that must be threaded through the system.
These builders are also single purpose and unlikely to be reusable
unlike a URI builder, for example. As objects, they're not especially
composable either.
- Similarly, break up Menu/DefaultBuilder into BuilderUtil and ban
inheritance. Inheritance has not worked well on the frontend of
MobileFrontend. I don't think it's going to work well here. E.g., I
could have made changes to the base class' getPersonalTools() method
such that the client passes a parameter for the advanced config or
maybe I just override it in the subclass. In either case, I think it
makes the whole hierarchy nuanced and harder to reason about for
something that should be simple.
- Add ProfileMenuEntry and LogOutMenuEntry for the user menu.
- Rename insertLogInOutMenuItem() to insertAuthMenuItem() which matches
the entry name, AuthMenuEntry.
- Extension:SandboxLink is needed to display the sandbox link in the
user menu.
- Performance note: the toolbar is now processed in MinervaTemplate,
which corresponds to removing the buildPersonalUrls() override.
- To mimic the design of main menu, the following steps would be
necessary:
1. Create a user/Default and user/Advanced user menu builder and also
a user/IBuilder interface.
2. Create a user/Director.
3. Create a service entry for Minerva.Menu.UserDirector in
ServiceWiring. The Director is actually powerless and doesn't get
to make any decisions--the appropriate builder is passed in from
ServiceWiring which checks the mode.
4. Access the service in SkinMinerva to set a userMenuHTML data member
on the Minerva QuickTemplate.
5. In MinervaTemplate, access the userMenuHTML QuickTemplate member
and do the usual song and dance of inflating a Mustache template.
This patch does everything except add a service, which was agreed to
be unnecessary, so that logic is now in SkinMinerva.
- Wrap the existing echo user notifications button and new user menu
button in a nav element. This seems like a semantic improvement.
- The existing styling and logic for the search bar and search overlay
are pretty messy and delicate. Changes made to that LESS endeavored to
be surgical. There's lots of room for improvement in the toolbar but
it's out of scope.
- Rename logout icon to logOut.
Bug: T214540
Change-Id: Ib517864fcf4e4d611e05525a6358ee6662fe4e05
Break up Menu/DefaultBuilder into functions that are reusable without
inheritance. The functions do not need much state to produce their
outputs and a weighty inheritance hierarchy makes the code difficult to
reason about. The functions are used in a following patch for the user
menu. They're now simple, independent, static functions in BuilderUtil
that are easy to reason about and compose.
Also, ban inheritance via `final` in a few places nearby. Inheritance
has not worked well in MobileFrontend and enabling it should be a
special deliberate case, not a default. E.g., in the user menu, the
changes could have been to the base class' getPersonalTools() method
such that the client passes a parameter for the advanced config or maybe
just override it in the subclass. In either case, it makes the whole
hierarchy nuanced and harder to reason about for something that should
be dead simple.
Bug: T214540
Change-Id: I6e9a2b36a1bff387eb3b33ea65b0a6806962810a
- Separate AuthMenuEntry into reusable parts.
- Add some missed finals in nearby classes.
Bug: T214540
Change-Id: Icf285bf8d2b791dd1aa4ee37ae90d27afe42bd91
Make an interface for changing the URL of the menu profile item. This
functionality is needed by Growth and a subsequent patch will provide a
second profile implementation that should implement this interface.
Bug: T214540
Change-Id: Ie3647ac52a83b4cc34f3582a41c5d5524343965c
There's no reason to copy and paste all this here. These icons
can be imported directly from core using ResourceLoaderOOUIIconPackModule
Depends-On: I7800da87a6a10399f705b43e05c8592c766bae6f
Change-Id: I1f25aaca9b7313cd95cefc7f5629b8a7e65c887f
The $hasLangauges and $hasVariants checks were used in couple places,
which lead to the same code used in many places.
Following the DRY rule, let's implement a Service that can do that
check, and use that service everywhere in code.
Bug: T224735
Change-Id: I46d58758356e870c408a74b2c087a42d6ad0ddea
The Language icon is not useful on user pages as most probably there
are no translated user pages, thus there is no need to show all-time
disabled Language icon.
If overflow menu is available, don't show Language switcher icon in
toolbar, show it as first item in the overflow menu.
Bug: T224735
Follow-Up: I46d58758356e870c408a74b2c087a42d6ad0ddea
Change-Id: I05be9e6457257a1f2eb224ca9ec5808814bc9ed7
The `randompage-url` message might not be defined, or be set to
'-' which means - this text do not exist. Minerva should respect
that, instead of showing a link that points nowhere/to a '-' page
Bug: T188697
Change-Id: If97d29b0e25f3635e94bf3b80b051355ea49cf7d
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
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