SubLanding page filter (#19918)
* sub-landing: implement filtering in react, other cleanup
This commit is contained in:
@@ -45,20 +45,22 @@ export const getProductSubLandingContextFromRequest = (req: any): ProductSubLand
|
||||
return {
|
||||
...pick(page, ['intro', 'allTopics']),
|
||||
title: req.context.productMap[req.context.currentProduct].name,
|
||||
featuredTrack: page.featuredTrack ? {
|
||||
...pick(page.featuredTrack, ['title', 'description', 'trackName', 'guides']),
|
||||
guides: (page.featuredTrack?.guides || []).map((guide: any) => {
|
||||
return pick(guide, ['title', 'intro', 'href', 'page.type'])
|
||||
})
|
||||
} : null,
|
||||
featuredTrack: page.featuredTrack
|
||||
? {
|
||||
...pick(page.featuredTrack, ['title', 'description', 'trackName']),
|
||||
guides: (page.featuredTrack?.guides || []).map((guide: any) => {
|
||||
return pick(guide, ['title', 'intro', 'href', 'page.type'])
|
||||
}),
|
||||
}
|
||||
: null,
|
||||
learningTracks: (page.learningTracks || []).map((track: any) => ({
|
||||
...pick(track, ['title', 'description', 'trackName', 'guides']),
|
||||
...pick(track, ['title', 'description', 'trackName']),
|
||||
guides: (track.guides || []).map((guide: any) => {
|
||||
return pick(guide, ['title', 'intro', 'href', 'page.type'])
|
||||
}),
|
||||
})),
|
||||
includeGuides: (page.includeGuides || []).map((guide: any) => {
|
||||
return pick(guide, ['href', 'title', 'intro', 'page.type', 'topics'])
|
||||
return pick(guide, ['href', 'title', 'intro', 'type', 'topics'])
|
||||
}),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user