1
0
mirror of synced 2025-12-23 21:07:12 -05:00

SubLanding page filter (#19918)

* sub-landing: implement filtering in react, other cleanup
This commit is contained in:
Mike Surowiec
2021-06-15 11:16:24 -07:00
committed by GitHub
parent cfd962c2f5
commit e26a3446a7
12 changed files with 128 additions and 87 deletions

View File

@@ -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'])
}),
}
}