1
0
mirror of synced 2025-12-22 11:26:57 -05:00

Remove versions feature flag code (#15793)

* remove FEATURE_NEW_VERSIONS from feature-flags.json

* remove process.env.FEATURE_NEW_VERSIONS from include files

* remove process.env.FEATURE_NEW_VERSIONS from lib files

* remove process.env.FEATURE_NEW_VERSIONS from middleware files

* remove process.env.FEATURE_NEW_VERSIONS from script files

* remove process.env.FEATURE_NEW_VERSIONS from test files

* update test fixtures to use new versions as canonical fixtures
This commit is contained in:
Sarah Schneider
2020-09-29 13:36:07 -04:00
committed by GitHub
parent 6762f8c1b7
commit aa5a62d49d
95 changed files with 1333 additions and 3965 deletions

View File

@@ -5,14 +5,7 @@ const products = Object.values(require('../lib/all-products'))
const { getVersionedPathWithoutLanguage } = require('./path-utils')
const languageCodes = Object.keys(require('./languages'))
const addTitlesToTree = require('./site-tree-titles')
const allVersions = process.env.FEATURE_NEW_VERSIONS
? Object.keys(require('./all-versions'))
: require('./all-versions')
const versionsProp = process.env.FEATURE_NEW_VERSIONS
? 'versions'
: 'productVersions'
const allVersions = Object.keys(require('./all-versions'))
// This module builds a localized tree of every page on the site
// It includes single-source pages that have different variants
@@ -83,7 +76,7 @@ function buildCategoriesTree (tocItems, productHref, pages, redirects, version,
category.title = page.shortTitle || page.title
if (!getApplicableVersions(page[versionsProp], page.fullPath).includes(version)) {
if (!getApplicableVersions(page.versions, page.fullPath).includes(version)) {
return
}
@@ -135,7 +128,7 @@ function buildMaptopicsTree (tocItems, categoryHref, pages, redirects, version,
// if this is not a maptopic, return early
if (!page.mapTopic) return
if (!getApplicableVersions(page[versionsProp], page.fullPath).includes(version)) {
if (!getApplicableVersions(page.versions, page.fullPath).includes(version)) {
return
}
@@ -177,7 +170,7 @@ function buildArticlesTree (tocItems, categoryHref, pages, redirects, version, l
article.title = page.shortTitle || page.title
if (!getApplicableVersions(page[versionsProp], page.fullPath).includes(version)) {
if (!getApplicableVersions(page.versions, page.fullPath).includes(version)) {
return
}