mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/Vector.git
synced 2024-11-23 23:33:54 +00:00
Only show notification after CentralAuth autologin on Vector 2022
This brings in CentralAuth for phan analysis, using config patch 8063720d68ee1d2db2c37c1ad55da3fbef688bce in CI. Bug: T345112 Change-Id: Iddd94b38f04a34dc18df8978c2bf45e8e204a85c
This commit is contained in:
parent
16f50e9277
commit
0bb02c9c57
|
@ -16,4 +16,20 @@
|
|||
*
|
||||
*/
|
||||
|
||||
return require __DIR__ . '/../vendor/mediawiki/mediawiki-phan-config/src/config.php';
|
||||
$cfg = require __DIR__ . '/../vendor/mediawiki/mediawiki-phan-config/src/config.php';
|
||||
|
||||
$cfg['directory_list'] = array_merge(
|
||||
$cfg['directory_list'],
|
||||
[
|
||||
'../../extensions/CentralAuth',
|
||||
]
|
||||
);
|
||||
|
||||
$cfg['exclude_analysis_directory_list'] = array_merge(
|
||||
$cfg['exclude_analysis_directory_list'],
|
||||
[
|
||||
'../../extensions/CentralAuth',
|
||||
]
|
||||
);
|
||||
|
||||
return $cfg;
|
||||
|
|
31
includes/CentralAuthHooks.php
Normal file
31
includes/CentralAuthHooks.php
Normal file
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Skins\Vector;
|
||||
|
||||
use MediaWiki\Extension\CentralAuth\Hooks\CentralAuthIsUIReloadRecommendedHook;
|
||||
use MediaWiki\User\UserOptionsLookup;
|
||||
use User;
|
||||
|
||||
/**
|
||||
* @package Vector
|
||||
* @internal
|
||||
*/
|
||||
class CentralAuthHooks implements CentralAuthIsUIReloadRecommendedHook {
|
||||
|
||||
private UserOptionsLookup $userOptionsLookup;
|
||||
|
||||
public function __construct( UserOptionsLookup $userOptionsLookup ) {
|
||||
$this->userOptionsLookup = $userOptionsLookup;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function onCentralAuthIsUIReloadRecommended( User $user, bool &$recommendReload ) {
|
||||
if ( $this->userOptionsLookup->getDefaultOption( 'skin' ) === Constants::SKIN_NAME_MODERN ) {
|
||||
// Vector 2022 does not support updating the UI without reloading the page (T345112)
|
||||
$recommendReload = true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -170,11 +170,18 @@
|
|||
"vector-toc-pinned": 1
|
||||
},
|
||||
"HookHandlers": {
|
||||
"VectorCentralAuthHooks": {
|
||||
"class": "MediaWiki\\Skins\\Vector\\CentralAuthHooks",
|
||||
"services": [
|
||||
"UserOptionsLookup"
|
||||
]
|
||||
},
|
||||
"VectorHooks": {
|
||||
"class": "MediaWiki\\Skins\\Vector\\Hooks"
|
||||
}
|
||||
},
|
||||
"Hooks": {
|
||||
"CentralAuthIsUIReloadRecommended": "VectorCentralAuthHooks",
|
||||
"GetPreferences": "VectorHooks",
|
||||
"LocalUserCreated": "VectorHooks",
|
||||
"MakeGlobalVariablesScript": "VectorHooks",
|
||||
|
|
Loading…
Reference in a new issue