Skip to content

Commit

Permalink
Remove hvd guide name filter (#2417)
Browse files Browse the repository at this point in the history
  • Loading branch information
RubenSandwich authored Apr 23, 2024
1 parent 7549e10 commit bca5f08
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/views/validated-designs/__tests__/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const mockedHvdCategoryGroups: HvdCategoryGroup[] = [
slug: 'terraform-operation-guides',
title: 'terraform operation guides',
description: 'description',
product: 'terraform',
productSlug: 'terraform',
guides: [
{
slug: 'terraform-operation-guides-adoption',
Expand Down Expand Up @@ -47,7 +47,7 @@ const mockedHvdCategoryGroups: HvdCategoryGroup[] = [
slug: 'terraform-integration-guides',
title: 'terraform integration guides',
description: 'description',
product: 'terraform',
productSlug: 'terraform',
guides: [
{
slug: 'terraform-integration-guides-run-task-prisma-cloud-by-palo-alto',
Expand Down
2 changes: 1 addition & 1 deletion src/views/validated-designs/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default function ValidatedDesignsLandingView({
className={s.categoryGroupContainer}
>
<section className={s.categoryGroupHeader}>
<IconTileLogo size="large" productSlug={category.product} />
<IconTileLogo size="large" productSlug={category.productSlug} />
<Heading
level={2}
size={400}
Expand Down
11 changes: 5 additions & 6 deletions src/views/validated-designs/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,6 @@ export function getHvdCategoryGroups(): HvdCategoryGroup[] | null {
const pathParts = item.split('/')
const [product, category] = pathParts

if (!isProductSlug(product)) {
return
}

const metadata = loadMetadata(path.join(HVD_CONTENT_DIR, item))
if (!metadata) {
return
Expand All @@ -115,7 +111,10 @@ export function getHvdCategoryGroups(): HvdCategoryGroup[] | null {
slug,
title: metadata.title,
description: metadata.description,
product: product as Exclude<ProductSlug, 'sentinel'>,
productSlug: (isProductSlug(product) ? product : 'hcp') as Exclude<
ProductSlug,
'sentinel'
>,
guides: [],
})
} else if (isHvdMetadata) {
Expand Down Expand Up @@ -208,7 +207,7 @@ export async function getHvdGuidePropsFromSlug(
for (const categoryGroup of categoryGroups) {
for (const guide of categoryGroup.guides) {
if (guide.slug === guideSlug) {
validatedDesignsGuideProps.productSlug = categoryGroup.product
validatedDesignsGuideProps.productSlug = categoryGroup.productSlug

for (let index = 0; index < guide.pages.length; index++) {
const page = guide.pages[index]
Expand Down
2 changes: 1 addition & 1 deletion src/views/validated-designs/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export interface HvdCategoryGroup {
slug: string // start of slug e.g. terraform-operation-guides-adoption, used to add to it's guides after the category group is created
title: string // from YAML
description: string // from YAML
product: Exclude<ProductSlug, 'sentinel'>
productSlug: Exclude<ProductSlug, 'sentinel'>
guides: HvdGuide[]
}

Expand Down

0 comments on commit bca5f08

Please sign in to comment.