Skip to content

Commit 37293fb

Browse files
authored
[Go live] Turn on new landing pages and turn off feature flag code (#58135)
1 parent 772f686 commit 37293fb

File tree

2 files changed

+6
-25
lines changed

2 files changed

+6
-25
lines changed

src/frame/middleware/context/generic-toc.ts

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,13 @@ function isNewLandingPage(currentLayoutName: string): boolean {
1212
)
1313
}
1414

15-
// TODO: TEMP: This is a temporary solution to turn off/on new landing pages while we develop them.
16-
function isNewLandingPageFeature(req: ExtendedRequest): boolean {
17-
return (
18-
req.query?.feature === 'bespoke-landing' ||
19-
req.query?.feature === 'journey-landing' ||
20-
req.query?.feature === 'discovery-landing'
21-
)
22-
}
23-
2415
// This module adds either flatTocItems or nestedTocItems to the context object for
2516
// product, category, and subcategory TOCs that don't have other layouts specified.
2617
// They are rendered by includes/generic-toc-flat.html or includes/generic-toc-nested.html.
2718
export default async function genericToc(req: ExtendedRequest, res: Response, next: NextFunction) {
2819
if (!req.context) throw new Error('request not contextualized')
2920
if (!req.context.page) return next()
3021
if (
31-
!isNewLandingPageFeature(req) &&
3222
req.context.currentLayoutName !== 'default' &&
3323
!isNewLandingPage(req.context.currentLayoutName || '')
3424
)
@@ -106,8 +96,7 @@ export default async function genericToc(req: ExtendedRequest, res: Response, ne
10696
recurse: isRecursive,
10797
renderIntros,
10898
includeHidden,
109-
textOnly:
110-
isNewLandingPageFeature(req) || isNewLandingPage(req.context.currentLayoutName || ''),
99+
textOnly: isNewLandingPage(req.context.currentLayoutName || ''),
111100
})
112101
}
113102

@@ -117,13 +106,9 @@ export default async function genericToc(req: ExtendedRequest, res: Response, ne
117106
renderIntros = false
118107
req.context.genericTocNested = await getTocItems(treePage, req.context, {
119108
recurse: isRecursive,
120-
renderIntros:
121-
isNewLandingPageFeature(req) || isNewLandingPage(req.context.currentLayoutName || '')
122-
? true
123-
: false,
109+
renderIntros: isNewLandingPage(req.context.currentLayoutName || '') ? true : false,
124110
includeHidden,
125-
textOnly:
126-
isNewLandingPageFeature(req) || isNewLandingPage(req.context.currentLayoutName || ''),
111+
textOnly: isNewLandingPage(req.context.currentLayoutName || ''),
127112
})
128113
}
129114

src/landings/pages/product.tsx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -172,11 +172,10 @@ export const getServerSideProps: GetServerSideProps<Props> = async (context) =>
172172
const additionalUINamespaces: string[] = []
173173

174174
// This looks a little funky, but it's so we only send one context's data to the client
175-
// TODO: TEMP: This is a temporary solution to turn off/on new landing pages while we develop them
176-
if (currentLayoutName === 'bespoke-landing' || req.query?.feature === 'bespoke-landing') {
175+
if (currentLayoutName === 'bespoke-landing') {
177176
props.bespokeContext = await getLandingContextFromRequest(req, 'bespoke')
178177
additionalUINamespaces.push('product_landing')
179-
} else if (currentLayoutName === 'journey-landing' || req.query?.feature === 'journey-landing') {
178+
} else if (currentLayoutName === 'journey-landing') {
180179
props.journeyContext = await getLandingContextFromRequest(req, 'journey')
181180

182181
// journey tracks are resolved in middleware and added to the request
@@ -186,10 +185,7 @@ export const getServerSideProps: GetServerSideProps<Props> = async (context) =>
186185
}
187186

188187
additionalUINamespaces.push('journey_landing', 'product_landing')
189-
} else if (
190-
currentLayoutName === 'discovery-landing' ||
191-
req?.query?.feature === 'discovery-landing'
192-
) {
188+
} else if (currentLayoutName === 'discovery-landing') {
193189
props.discoveryContext = await getLandingContextFromRequest(req, 'discovery')
194190
additionalUINamespaces.push('product_landing')
195191
} else if (currentLayoutName === 'product-landing') {

0 commit comments

Comments
 (0)