It should be possible to persist Vector font size for registered users

Bug: T346987
Change-Id: I01e0fac5ba781480ee32a8b32f6ef7fafb8d1ca5
This commit is contained in:
Jon Robson 2023-09-20 15:48:26 -07:00 committed by Jdlrobson
parent fbc456b666
commit d35db97615
5 changed files with 16 additions and 15 deletions

View file

@ -253,12 +253,12 @@ final class Constants {
/**
* @var string
*/
public const CONFIG_KEY_FONT_SIZE = 'VectorCustomFontSize';
public const PREF_KEY_FONT_SIZE = 'vector-font-size';
/**
* @var string
*/
public const FEATURE_FONT_SIZE = 'CustomFontSizeClientpref';
public const FEATURE_FONT_SIZE = 'CustomFontSize';
/**
* @var string

View file

@ -145,6 +145,10 @@ class FeatureManager {
$suffixEnabled = 'clientpref-1';
$suffixDisabled = 'clientpref-0';
break;
case 'custom-font-size':
$suffixEnabled = 'clientpref-enabled';
$suffixDisabled = 'clientpref-disabled';
break;
default:
// FIXME: Eventually this should not be necessary.
$suffixEnabled = 'enabled';

View file

@ -619,6 +619,9 @@ class Hooks implements
*/
public function onGetPreferences( $user, &$prefs ): void {
$vectorPrefs = [
Constants::PREF_KEY_FONT_SIZE => [
'type' => 'api'
],
Constants::PREF_KEY_PAGE_TOOLS_PINNED => [
'type' => 'api'
],

View file

@ -280,12 +280,12 @@ return [
// Feature: T343928: Feature Font Size.
// ================================
$featureManager->registerRequirement(
new OverridableConfigRequirement(
$services->getMainConfig(),
new UserPreferenceRequirement(
$context->getUser(),
$context->getRequest(),
Constants::CONFIG_KEY_FONT_SIZE,
Constants::REQUIREMENT_FONT_SIZE
$services->getUserOptionsLookup(),
Constants::PREF_KEY_FONT_SIZE,
Constants::REQUIREMENT_FONT_SIZE,
$context->getTitle()
)
);

View file

@ -168,7 +168,8 @@
"vector-limited-width": 1,
"vector-page-tools-pinned": 1,
"vector-main-menu-pinned": 1,
"vector-toc-pinned": 1
"vector-toc-pinned": 1,
"vector-font-size": 0
},
"HookHandlers": {
"VectorCentralAuthHooks": {
@ -639,13 +640,6 @@
"logged_out": false
},
"description": "@var boolean Temporary feature flag that enables the zebra design for the Vector skin."
},
"VectorCustomFontSize": {
"value": {
"logged_in": false,
"logged_out": false
},
"description": "@var boolean feature flag that enables customizing the Vector font-size."
}
},
"ServiceWiringFiles": [