Create feature flag for VectorTitleAboveTabs feature

Adds a feature called VectorTitleAboveTabs that will be used to
toggle a forthcoming feature that moves the page title above the
tabs (the ones that link to talk/history etc).

Bug: T303549
Change-Id: Ibadb4293eca16a83e5e7a9f90ddcf51fab0a0e41
This commit is contained in:
Jan Drewniak 2022-05-10 11:41:01 -04:00
parent 24ad8721b1
commit 29d938b0f9
4 changed files with 48 additions and 0 deletions

View File

@ -264,6 +264,26 @@ final class Constants {
*/
public const WEB_AB_TEST_ARTICLE_ID_FACTORY_SERVICE = 'WikimediaEvents.WebABTestArticleIdFactory';
/**
* @var string
*/
public const REQUIREMENT_TITLE_ABOVE_TABS = 'TitleAboveTabs';
/**
* @var string
*/
public const CONFIG_TITLE_ABOVE_TABS = 'VectorTitleAboveTabs';
/**
* @var string
*/
public const QUERY_PARAM_TITLE_ABOVE_TABS = 'titleabovetabs';
/**
* @var string
*/
public const FEATURE_TITLE_ABOVE_TABS = 'TitleAboveTabs';
/**
* This class is for namespacing constants only. Forbid construction.
* @throws FatalError

View File

@ -217,6 +217,29 @@ return [
]
);
// Feature: Title above tabs
// ================================
$featureManager->registerRequirement(
new OverridableConfigRequirement(
$services->getMainConfig(),
$context->getUser(),
$context->getRequest(),
null,
Constants::CONFIG_TITLE_ABOVE_TABS,
Constants::REQUIREMENT_TITLE_ABOVE_TABS,
Constants::QUERY_PARAM_TITLE_ABOVE_TABS,
null
)
);
$featureManager->registerFeature(
Constants::FEATURE_TITLE_ABOVE_TABS,
[
Constants::REQUIREMENT_FULLY_INITIALISED,
Constants::REQUIREMENT_TITLE_ABOVE_TABS,
]
);
return $featureManager;
}
];

View File

@ -167,6 +167,7 @@ class SkinVector22 extends SkinVector {
Constants::FEATURE_STICKY_HEADER_EDIT
)
) : false,
'is-title-above-tabs' => $featureManager->isFeatureEnabled( Constants::FEATURE_TITLE_ABOVE_TABS )
];
}
}

View File

@ -511,6 +511,10 @@
"VectorTableOfContentsCollapseAtCount": {
"value": 20,
"description": "@var When `VectorTableOfContents` is enabled, the minimum number of headings required to collapse all headings in the sticky table of contents by default."
},
"VectorTitleAboveTabs": {
"value": false,
"description": "@var boolean `VectorTitleAboveTabs` places the tittle of the page above the tabs that link to history/talk etc."
}
},
"ServiceWiringFiles": [