Add move, delete, and protect options on mobile AMC user page

Turns out user page is using UserNamespaceOverflowBuilder instead of
DefaultOverflowBuilder.

This change is added move, delete, and protect entries to
UserNamespaceOverflowBuilder::getGroup, so those options would appear in
overflow menu on user page.

Bug: T283549
Change-Id: I8a22b57aaa195773ae9e82bd1e01f323a2c0e6e1
This commit is contained in:
Gagah Pangeran Rosfatiputra 2021-11-06 09:59:42 +07:00
parent 215364be3a
commit 00b06825c8
No known key found for this signature in database
GPG key ID: 4F5883B7B14765BC

View file

@ -90,12 +90,22 @@ class UserNamespaceOverflowBuilder implements IOverflowBuilder {
) ); ) );
} }
$permissionChangeAction = array_key_exists( 'unprotect', $actions ) ?
$this->buildFromToolbox( 'unprotect', 'unLock', 'unprotect', $actions ) :
$this->buildFromToolbox( 'protect', 'lock', 'protect', $actions );
$possibleEntries = array_filter( [ $possibleEntries = array_filter( [
$this->buildFromToolbox( 'user-groups', 'userGroup', 'userrights', $toolbox ), $this->buildFromToolbox( 'user-groups', 'userGroup', 'userrights', $toolbox ),
$this->buildFromToolbox( 'logs', 'listBullet', 'log', $toolbox ), $this->buildFromToolbox( 'logs', 'listBullet', 'log', $toolbox ),
$this->buildFromToolbox( 'info', 'infoFilled', 'info', $toolbox ), $this->buildFromToolbox( 'info', 'infoFilled', 'info', $toolbox ),
$this->buildFromToolbox( 'permalink', 'link', 'permalink', $toolbox ), $this->buildFromToolbox( 'permalink', 'link', 'permalink', $toolbox ),
$this->buildFromToolbox( 'backlinks', 'articleRedirect', 'whatlinkshere', $toolbox ) $this->buildFromToolbox( 'backlinks', 'articleRedirect', 'whatlinkshere', $toolbox ),
$this->permissions->isAllowed( IMinervaPagePermissions::MOVE ) ?
$this->buildFromToolbox( 'move', 'move', 'move', $actions ) : null,
$this->permissions->isAllowed( IMinervaPagePermissions::DELETE ) ?
$this->buildFromToolbox( 'delete', 'trash', 'delete', $actions ) : null,
$this->permissions->isAllowed( IMinervaPagePermissions::PROTECT ) ?
$permissionChangeAction : null
] ); ] );
foreach ( $possibleEntries as $menuEntry ) { foreach ( $possibleEntries as $menuEntry ) {