[Go live] Turn on new landing pages and turn off feature flag code (#58135)
This commit is contained in:
@@ -12,15 +12,6 @@ function isNewLandingPage(currentLayoutName: string): boolean {
|
||||
)
|
||||
}
|
||||
|
||||
// TODO: TEMP: This is a temporary solution to turn off/on new landing pages while we develop them.
|
||||
function isNewLandingPageFeature(req: ExtendedRequest): boolean {
|
||||
return (
|
||||
req.query?.feature === 'bespoke-landing' ||
|
||||
req.query?.feature === 'journey-landing' ||
|
||||
req.query?.feature === 'discovery-landing'
|
||||
)
|
||||
}
|
||||
|
||||
// This module adds either flatTocItems or nestedTocItems to the context object for
|
||||
// product, category, and subcategory TOCs that don't have other layouts specified.
|
||||
// They are rendered by includes/generic-toc-flat.html or includes/generic-toc-nested.html.
|
||||
@@ -28,7 +19,6 @@ export default async function genericToc(req: ExtendedRequest, res: Response, ne
|
||||
if (!req.context) throw new Error('request not contextualized')
|
||||
if (!req.context.page) return next()
|
||||
if (
|
||||
!isNewLandingPageFeature(req) &&
|
||||
req.context.currentLayoutName !== 'default' &&
|
||||
!isNewLandingPage(req.context.currentLayoutName || '')
|
||||
)
|
||||
@@ -106,8 +96,7 @@ export default async function genericToc(req: ExtendedRequest, res: Response, ne
|
||||
recurse: isRecursive,
|
||||
renderIntros,
|
||||
includeHidden,
|
||||
textOnly:
|
||||
isNewLandingPageFeature(req) || isNewLandingPage(req.context.currentLayoutName || ''),
|
||||
textOnly: isNewLandingPage(req.context.currentLayoutName || ''),
|
||||
})
|
||||
}
|
||||
|
||||
@@ -117,13 +106,9 @@ export default async function genericToc(req: ExtendedRequest, res: Response, ne
|
||||
renderIntros = false
|
||||
req.context.genericTocNested = await getTocItems(treePage, req.context, {
|
||||
recurse: isRecursive,
|
||||
renderIntros:
|
||||
isNewLandingPageFeature(req) || isNewLandingPage(req.context.currentLayoutName || '')
|
||||
? true
|
||||
: false,
|
||||
renderIntros: isNewLandingPage(req.context.currentLayoutName || '') ? true : false,
|
||||
includeHidden,
|
||||
textOnly:
|
||||
isNewLandingPageFeature(req) || isNewLandingPage(req.context.currentLayoutName || ''),
|
||||
textOnly: isNewLandingPage(req.context.currentLayoutName || ''),
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -172,11 +172,10 @@ export const getServerSideProps: GetServerSideProps<Props> = async (context) =>
|
||||
const additionalUINamespaces: string[] = []
|
||||
|
||||
// This looks a little funky, but it's so we only send one context's data to the client
|
||||
// TODO: TEMP: This is a temporary solution to turn off/on new landing pages while we develop them
|
||||
if (currentLayoutName === 'bespoke-landing' || req.query?.feature === 'bespoke-landing') {
|
||||
if (currentLayoutName === 'bespoke-landing') {
|
||||
props.bespokeContext = await getLandingContextFromRequest(req, 'bespoke')
|
||||
additionalUINamespaces.push('product_landing')
|
||||
} else if (currentLayoutName === 'journey-landing' || req.query?.feature === 'journey-landing') {
|
||||
} else if (currentLayoutName === 'journey-landing') {
|
||||
props.journeyContext = await getLandingContextFromRequest(req, 'journey')
|
||||
|
||||
// journey tracks are resolved in middleware and added to the request
|
||||
@@ -186,10 +185,7 @@ export const getServerSideProps: GetServerSideProps<Props> = async (context) =>
|
||||
}
|
||||
|
||||
additionalUINamespaces.push('journey_landing', 'product_landing')
|
||||
} else if (
|
||||
currentLayoutName === 'discovery-landing' ||
|
||||
req?.query?.feature === 'discovery-landing'
|
||||
) {
|
||||
} else if (currentLayoutName === 'discovery-landing') {
|
||||
props.discoveryContext = await getLandingContextFromRequest(req, 'discovery')
|
||||
additionalUINamespaces.push('product_landing')
|
||||
} else if (currentLayoutName === 'product-landing') {
|
||||
|
||||
Reference in New Issue
Block a user