From 6b7bc78bae06f6823e2af9388172463ee4036c4f Mon Sep 17 00:00:00 2001 From: Jon Robson Date: Wed, 28 Sep 2022 12:16:20 -0700 Subject: [PATCH] Update name of body class to avoid confusion The class vector-feature-table-of-contents-disabled is confusing as it shows on pages with table of contents. What it actually means is the A/B test is disabled. This change gives it a more meaningful name. Use the class name vector-feature-table-of-contents-legacy-toc-enabled to describe it better. Bug: T310527 Change-Id: I17e7e6f7f553b8c06b118b5419c98c78ef26ad60 --- includes/Constants.php | 4 ++-- .../Requirements/TableOfContentsTreatmentRequirement.php | 2 +- includes/ServiceWiring.php | 4 ++-- includes/SkinVector22.php | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/includes/Constants.php b/includes/Constants.php index 779c6db2..6652e8b9 100644 --- a/includes/Constants.php +++ b/includes/Constants.php @@ -198,12 +198,12 @@ final class Constants { /** * @var string */ - public const FEATURE_TABLE_OF_CONTENTS = 'TableOfContents'; + public const FEATURE_TABLE_OF_CONTENTS_AB_TEST = 'TableOfContentsLegacyTOC'; /** * @var string */ - public const REQUIREMENT_TABLE_OF_CONTENTS = 'TableOfContents'; + public const REQUIREMENT_TABLE_OF_CONTENTS_AB_TEST = 'TableOfContentsLegacy'; /** * @var string diff --git a/includes/FeatureManagement/Requirements/TableOfContentsTreatmentRequirement.php b/includes/FeatureManagement/Requirements/TableOfContentsTreatmentRequirement.php index 3342d57e..4aed8e68 100644 --- a/includes/FeatureManagement/Requirements/TableOfContentsTreatmentRequirement.php +++ b/includes/FeatureManagement/Requirements/TableOfContentsTreatmentRequirement.php @@ -52,7 +52,7 @@ final class TableOfContentsTreatmentRequirement implements Requirement { * @inheritDoc */ public function getName(): string { - return Constants::REQUIREMENT_TABLE_OF_CONTENTS; + return Constants::REQUIREMENT_TABLE_OF_CONTENTS_AB_TEST; } /** diff --git a/includes/ServiceWiring.php b/includes/ServiceWiring.php index ea7783f8..e5691564 100644 --- a/includes/ServiceWiring.php +++ b/includes/ServiceWiring.php @@ -193,10 +193,10 @@ return [ ); $featureManager->registerFeature( - Constants::FEATURE_TABLE_OF_CONTENTS, + Constants::FEATURE_TABLE_OF_CONTENTS_AB_TEST, [ Constants::REQUIREMENT_FULLY_INITIALISED, - Constants::REQUIREMENT_TABLE_OF_CONTENTS, + Constants::REQUIREMENT_TABLE_OF_CONTENTS_AB_TEST, ] ); diff --git a/includes/SkinVector22.php b/includes/SkinVector22.php index 1e22a7da..df39ee6d 100644 --- a/includes/SkinVector22.php +++ b/includes/SkinVector22.php @@ -45,7 +45,7 @@ class SkinVector22 extends SkinVector { */ public function isUserInTocTreatmentBucket(): bool { $featureManager = VectorServices::getFeatureManager(); - return $featureManager->isFeatureEnabled( Constants::FEATURE_TABLE_OF_CONTENTS ); + return !$featureManager->isFeatureEnabled( Constants::FEATURE_TABLE_OF_CONTENTS_AB_TEST ); } /**