Skip to content

Instantly share code, notes, and snippets.

@jdlrobson
Created July 15, 2021 16:47
Show Gist options
  • Save jdlrobson/e795c574866e93299f5ace3c69590b4c to your computer and use it in GitHub Desktop.
Save jdlrobson/e795c574866e93299f5ace3c69590b4c to your computer and use it in GitHub Desktop.
diff --git a/includes/ServiceWiring.php b/includes/ServiceWiring.php
index 554239ae..54c55f6b 100644
--- a/includes/ServiceWiring.php
+++ b/includes/ServiceWiring.php
@@ -134,6 +134,28 @@ return [
]
);
+ $featureManager->registerRequirement(
+ new OverridableConfigRequirement(
+ $services->getMainConfig(),
+ $context->getUser(),
+ $context->getRequest(),
+ null,
+ 'StickyHeader',
+ 'requirement-sticky-header',
+ 'stickyheader',
+ null
+ )
+ );
+
+ $featureManager->registerFeature(
+ 'sticky-header',
+ [
+ Constants::REQUIREMENT_FULLY_INITIALISED,
+ Constants::REQUIREMENT_LATEST_SKIN_VERSION,
+ 'requirement-sticky-header'
+ ]
+ );
+
return $featureManager;
}
];
diff --git a/includes/SkinVector.php b/includes/SkinVector.php
index d2f2d607..3ae8a396 100644
--- a/includes/SkinVector.php
+++ b/includes/SkinVector.php
@@ -139,6 +139,14 @@ class SkinVector extends SkinMustache {
*/
private function isLanguagesInHeader() {
$featureManager = VectorServices::getFeatureManager();
+
+ if (
+ $featureManager->isFeatureEnabled(
+ 'sticky-header'
+ )
+ ) {
+ die;
+ }
// Disable button on pages without languages (based on Wikibase RepoItemLinkGenerator class)
return $this->canHaveLanguages() && $featureManager->isFeatureEnabled(
diff --git a/package.json b/package.json
deleted file mode 100644
index d63747a0..00000000
--- a/package.json
+++ /dev/null
@@ -1,42 +0,0 @@
-{
- "private": true,
- "scripts": {
- "start": "bash dev-scripts/setup-storybook.sh && start-storybook --quiet -p 6006",
- "test": "npm -s run lint && tsc && npm -s run doc",
- "test:size": "node ./tests/resource-loader-bundlesize.js",
- "lint": "npm -s run lint:js && npm -s run lint:styles && npm -s run lint:i18n",
- "lint:fix:js": "npm -s run lint:js -- --fix",
- "lint:fix:styles": "npm -s run lint:styles -- --fix",
- "lint:js": "eslint --cache .",
- "lint:styles": "stylelint \"**/*.{less,css}\"",
- "lint:i18n": "banana-checker --requireLowerCase=0 i18n/",
- "selenium-test": "npm -s run test:size",
- "doc": "jsdoc -c jsdoc.json && npm run build-storybook",
- "build-storybook": "bash dev-scripts/setup-storybook.sh && build-storybook --quiet --loglevel warn -o docs/ui",
- "minify-svg": "svgo --config=.svgo.config.js -q -r -f resources/",
- "pre-commit": "[ \"${PRE_COMMIT:-1}\" -eq 0 ] || npm -s t"
- },
- "pre-commit": "pre-commit",
- "devDependencies": {
- "@babel/core": "7.7.7",
- "@storybook/html": "5.2.8",
- "@types/jquery": "3.3.33",
- "@types/mustache": "4.0.1",
- "@types/node-fetch": "2.5.7",
- "babel-loader": "8.0.6",
- "bundlesize": "0.18.1",
- "eslint-config-wikimedia": "0.20.0",
- "grunt-banana-checker": "0.9.0",
- "jsdoc": "3.6.7",
- "jsdoc-wmf-theme": "0.0.3",
- "less": "3.8.1",
- "less-loader": "4.1.0",
- "mustache": "3.0.1",
- "node-fetch": "2.6.1",
- "pre-commit": "1.2.2",
- "stylelint-config-wikimedia": "0.10.3",
- "svgo": "2.3.0",
- "typescript": "3.8.3",
- "vue": "2.6.11"
- }
-}
diff --git a/skin.json b/skin.json
index 3255d627..97760f36 100644
--- a/skin.json
+++ b/skin.json
@@ -309,6 +309,12 @@
},
"description": "@var array Moves the personal user links into a consolidated dropdown menu with the exception of the user page link. User page link moves out of personal menu into top level item next to notifications."
},
+ "StickyHeader": {
+ "value": {
+ "logged_in": false,
+ "logged_out": false
+ }
+ },
"VectorDisableSidebarPersistence": {
"value": false,
"description": "@var boolean Temporary feature flag that disables saving the sidebar expanded/collapsed state as a user-preference (triggered via clicking the main menu icon). This is intended as a temporary kill-switch in the event that the DB is overloaded with writes to the user_options table."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment