update references
This commit is contained in:
@@ -2,7 +2,7 @@ const slash = require('slash')
|
||||
const path = require('path')
|
||||
const patterns = require('./patterns')
|
||||
const { latest } = require('./enterprise-server-releases')
|
||||
const allProducts = require('./all-products')
|
||||
const { productIds } = require('./all-products')
|
||||
const allVersions = require('./all-versions')
|
||||
const supportedVersions = new Set(Object.keys(allVersions))
|
||||
const nonEnterpriseDefaultVersion = require('./non-enterprise-default-version')
|
||||
@@ -43,7 +43,7 @@ function getVersionStringFromPath (href) {
|
||||
const versionFromPath = href.split('/')[1]
|
||||
|
||||
// If the first segment is a supported product, assume this is FPT
|
||||
if (allProducts[versionFromPath]) {
|
||||
if (productIds.includes(versionFromPath)) {
|
||||
return nonEnterpriseDefaultVersion
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ function getProductStringFromPath (href) {
|
||||
|
||||
if (pathParts.includes('early-access')) return 'early-access'
|
||||
|
||||
return allProducts[pathParts[2]]
|
||||
return productIds.includes(pathParts[2])
|
||||
? pathParts[2]
|
||||
: pathParts[1]
|
||||
}
|
||||
@@ -99,20 +99,13 @@ function getCategoryStringFromPath (href) {
|
||||
|
||||
if (pathParts.includes('early-access')) return null
|
||||
|
||||
const productIndex = allProducts[pathParts[2]]
|
||||
const productIndex = productIds.includes(pathParts[2])
|
||||
? 2
|
||||
: 1
|
||||
|
||||
return pathParts[productIndex + 1]
|
||||
}
|
||||
|
||||
// Return the corresponding object for the product segment in a path
|
||||
function getProductObjectFromPath (href) {
|
||||
const productFromPath = getProductStringFromPath(href)
|
||||
|
||||
return allProducts[productFromPath]
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
getPathWithLanguage,
|
||||
getPathWithoutLanguage,
|
||||
@@ -120,6 +113,5 @@ module.exports = {
|
||||
getVersionStringFromPath,
|
||||
getVersionObjectFromPath,
|
||||
getProductStringFromPath,
|
||||
getCategoryStringFromPath,
|
||||
getProductObjectFromPath
|
||||
getCategoryStringFromPath
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user