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:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user