mirror of
https://github.com/kamranahmedse/developer-roadmap.git
synced 2025-08-29 20:21:50 +02:00
Fix empty guides listing on dashboard
This commit is contained in:
@@ -10,9 +10,9 @@ import { DashboardTabButton } from './DashboardTabButton';
|
|||||||
import { PersonalDashboard, type BuiltInRoadmap } from './PersonalDashboard';
|
import { PersonalDashboard, type BuiltInRoadmap } from './PersonalDashboard';
|
||||||
import { TeamDashboard } from './TeamDashboard';
|
import { TeamDashboard } from './TeamDashboard';
|
||||||
import type { QuestionGroupType } from '../../lib/question-group';
|
import type { QuestionGroupType } from '../../lib/question-group';
|
||||||
import type { GuideFileType } from '../../lib/guide';
|
|
||||||
import type { VideoFileType } from '../../lib/video';
|
import type { VideoFileType } from '../../lib/video';
|
||||||
import { cn } from '../../lib/classname';
|
import { cn } from '../../lib/classname';
|
||||||
|
import type { OfficialGuideDocument } from '../../queries/official-guide';
|
||||||
|
|
||||||
type DashboardPageProps = {
|
type DashboardPageProps = {
|
||||||
builtInRoleRoadmaps?: BuiltInRoadmap[];
|
builtInRoleRoadmaps?: BuiltInRoadmap[];
|
||||||
@@ -20,7 +20,7 @@ type DashboardPageProps = {
|
|||||||
builtInBestPractices?: BuiltInRoadmap[];
|
builtInBestPractices?: BuiltInRoadmap[];
|
||||||
isTeamPage?: boolean;
|
isTeamPage?: boolean;
|
||||||
questionGroups?: QuestionGroupType[];
|
questionGroups?: QuestionGroupType[];
|
||||||
guides?: GuideFileType[];
|
guides?: OfficialGuideDocument[];
|
||||||
videos?: VideoFileType[];
|
videos?: VideoFileType[];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -3,7 +3,6 @@ import { useEffect, useState } from 'react';
|
|||||||
import type { AllowedProfileVisibility } from '../../api/user.ts';
|
import type { AllowedProfileVisibility } from '../../api/user.ts';
|
||||||
import { useToast } from '../../hooks/use-toast';
|
import { useToast } from '../../hooks/use-toast';
|
||||||
import { cn } from '../../lib/classname.ts';
|
import { cn } from '../../lib/classname.ts';
|
||||||
import type { GuideFileType } from '../../lib/guide';
|
|
||||||
import { httpGet } from '../../lib/http';
|
import { httpGet } from '../../lib/http';
|
||||||
import type { QuestionGroupType } from '../../lib/question-group';
|
import type { QuestionGroupType } from '../../lib/question-group';
|
||||||
import type { AllowedRoadmapRenderer } from '../../lib/roadmap.ts';
|
import type { AllowedRoadmapRenderer } from '../../lib/roadmap.ts';
|
||||||
@@ -21,6 +20,7 @@ import type { ProjectStatusDocument } from '../Projects/ListProjectSolutions';
|
|||||||
import type { UserProgress } from '../TeamProgress/TeamProgressPage';
|
import type { UserProgress } from '../TeamProgress/TeamProgressPage';
|
||||||
import { useIsPaidUser } from '../../queries/billing.ts';
|
import { useIsPaidUser } from '../../queries/billing.ts';
|
||||||
import { UpgradeAccountModal } from '../Billing/UpgradeAccountModal.tsx';
|
import { UpgradeAccountModal } from '../Billing/UpgradeAccountModal.tsx';
|
||||||
|
import type { OfficialGuideDocument } from '../../queries/official-guide.ts';
|
||||||
|
|
||||||
const projectGroups = [
|
const projectGroups = [
|
||||||
{
|
{
|
||||||
@@ -66,7 +66,7 @@ type PersonalDashboardProps = {
|
|||||||
builtInSkillRoadmaps?: BuiltInRoadmap[];
|
builtInSkillRoadmaps?: BuiltInRoadmap[];
|
||||||
builtInBestPractices?: BuiltInRoadmap[];
|
builtInBestPractices?: BuiltInRoadmap[];
|
||||||
questionGroups?: QuestionGroupType[];
|
questionGroups?: QuestionGroupType[];
|
||||||
guides?: GuideFileType[];
|
guides?: OfficialGuideDocument[];
|
||||||
videos?: VideoFileType[];
|
videos?: VideoFileType[];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -6,12 +6,13 @@ import { getAllQuestionGroups } from '../lib/question-group';
|
|||||||
import { getRoadmapsByTag } from '../lib/roadmap';
|
import { getRoadmapsByTag } from '../lib/roadmap';
|
||||||
import { getAllGuides } from '../lib/guide';
|
import { getAllGuides } from '../lib/guide';
|
||||||
import { getAllVideos } from '../lib/video';
|
import { getAllVideos } from '../lib/video';
|
||||||
|
import { listOfficialGuides } from '../queries/official-guide';
|
||||||
|
|
||||||
const roleRoadmaps = await getRoadmapsByTag('role-roadmap');
|
const roleRoadmaps = await getRoadmapsByTag('role-roadmap');
|
||||||
const skillRoadmaps = await getRoadmapsByTag('skill-roadmap');
|
const skillRoadmaps = await getRoadmapsByTag('skill-roadmap');
|
||||||
const bestPractices = await getAllBestPractices();
|
const bestPractices = await getAllBestPractices();
|
||||||
const questionGroups = await getAllQuestionGroups();
|
const questionGroups = await getAllQuestionGroups();
|
||||||
const guides = await getAllGuides();
|
const guides = await listOfficialGuides();
|
||||||
const videos = await getAllVideos();
|
const videos = await getAllVideos();
|
||||||
|
|
||||||
const enrichedRoleRoadmaps = roleRoadmaps
|
const enrichedRoleRoadmaps = roleRoadmaps
|
||||||
|
@@ -31,8 +31,9 @@ export const projectGroups = [
|
|||||||
|
|
||||||
const guides = await listOfficialGuides();
|
const guides = await listOfficialGuides();
|
||||||
const questionGuides = guides.filter(
|
const questionGuides = guides.filter(
|
||||||
(guide) => guide.roadmapId === 'questions' && !!guide?.authorId,
|
(guide) => guide.roadmapId === 'questions',
|
||||||
);
|
);
|
||||||
|
|
||||||
const videos = await getAllVideos();
|
const videos = await getAllVideos();
|
||||||
---
|
---
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user