From 830d365f3bfdf0ee132bf8a8c621f9701f241569 Mon Sep 17 00:00:00 2001 From: Kamran Ahmed Date: Mon, 18 Aug 2025 21:25:53 +0100 Subject: [PATCH] Fix empty guides listing on dashboard --- src/components/Dashboard/DashboardPage.tsx | 4 ++-- src/components/Dashboard/PersonalDashboard.tsx | 4 ++-- src/pages/dashboard.astro | 3 ++- src/pages/index.astro | 3 ++- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/components/Dashboard/DashboardPage.tsx b/src/components/Dashboard/DashboardPage.tsx index a401e31de..054b5c98a 100644 --- a/src/components/Dashboard/DashboardPage.tsx +++ b/src/components/Dashboard/DashboardPage.tsx @@ -10,9 +10,9 @@ import { DashboardTabButton } from './DashboardTabButton'; import { PersonalDashboard, type BuiltInRoadmap } from './PersonalDashboard'; import { TeamDashboard } from './TeamDashboard'; import type { QuestionGroupType } from '../../lib/question-group'; -import type { GuideFileType } from '../../lib/guide'; import type { VideoFileType } from '../../lib/video'; import { cn } from '../../lib/classname'; +import type { OfficialGuideDocument } from '../../queries/official-guide'; type DashboardPageProps = { builtInRoleRoadmaps?: BuiltInRoadmap[]; @@ -20,7 +20,7 @@ type DashboardPageProps = { builtInBestPractices?: BuiltInRoadmap[]; isTeamPage?: boolean; questionGroups?: QuestionGroupType[]; - guides?: GuideFileType[]; + guides?: OfficialGuideDocument[]; videos?: VideoFileType[]; }; diff --git a/src/components/Dashboard/PersonalDashboard.tsx b/src/components/Dashboard/PersonalDashboard.tsx index 0c4f1485f..bf7d20817 100644 --- a/src/components/Dashboard/PersonalDashboard.tsx +++ b/src/components/Dashboard/PersonalDashboard.tsx @@ -3,7 +3,6 @@ import { useEffect, useState } from 'react'; import type { AllowedProfileVisibility } from '../../api/user.ts'; import { useToast } from '../../hooks/use-toast'; import { cn } from '../../lib/classname.ts'; -import type { GuideFileType } from '../../lib/guide'; import { httpGet } from '../../lib/http'; import type { QuestionGroupType } from '../../lib/question-group'; import type { AllowedRoadmapRenderer } from '../../lib/roadmap.ts'; @@ -21,6 +20,7 @@ import type { ProjectStatusDocument } from '../Projects/ListProjectSolutions'; import type { UserProgress } from '../TeamProgress/TeamProgressPage'; import { useIsPaidUser } from '../../queries/billing.ts'; import { UpgradeAccountModal } from '../Billing/UpgradeAccountModal.tsx'; +import type { OfficialGuideDocument } from '../../queries/official-guide.ts'; const projectGroups = [ { @@ -66,7 +66,7 @@ type PersonalDashboardProps = { builtInSkillRoadmaps?: BuiltInRoadmap[]; builtInBestPractices?: BuiltInRoadmap[]; questionGroups?: QuestionGroupType[]; - guides?: GuideFileType[]; + guides?: OfficialGuideDocument[]; videos?: VideoFileType[]; }; diff --git a/src/pages/dashboard.astro b/src/pages/dashboard.astro index 618550470..b1049fa7c 100644 --- a/src/pages/dashboard.astro +++ b/src/pages/dashboard.astro @@ -6,12 +6,13 @@ import { getAllQuestionGroups } from '../lib/question-group'; import { getRoadmapsByTag } from '../lib/roadmap'; import { getAllGuides } from '../lib/guide'; import { getAllVideos } from '../lib/video'; +import { listOfficialGuides } from '../queries/official-guide'; const roleRoadmaps = await getRoadmapsByTag('role-roadmap'); const skillRoadmaps = await getRoadmapsByTag('skill-roadmap'); const bestPractices = await getAllBestPractices(); const questionGroups = await getAllQuestionGroups(); -const guides = await getAllGuides(); +const guides = await listOfficialGuides(); const videos = await getAllVideos(); const enrichedRoleRoadmaps = roleRoadmaps diff --git a/src/pages/index.astro b/src/pages/index.astro index 252ad59de..bbbd2aab8 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -31,8 +31,9 @@ export const projectGroups = [ const guides = await listOfficialGuides(); const questionGuides = guides.filter( - (guide) => guide.roadmapId === 'questions' && !!guide?.authorId, + (guide) => guide.roadmapId === 'questions', ); + const videos = await getAllVideos(); ---