Filtering of roadmaps

pull/5424/head
Kamran Ahmed 1 year ago
parent 40c8bfc312
commit e4e0f9ac98
  1. 121
      src/components/Roadmaps/RoadmapsPage.tsx

@ -25,6 +25,7 @@ type GroupType = {
title: string; title: string;
link: string; link: string;
type: 'role' | 'skill'; type: 'role' | 'skill';
otherGroups?: AllowGroupNames[];
}[]; }[];
}; };
@ -49,7 +50,7 @@ const groups: GroupType[] = [
}, },
{ {
title: 'Full-Stack Developer', title: 'Full-Stack Developer',
link: '/fullstack', link: '/full-stack',
type: 'role', type: 'role',
}, },
], ],
@ -61,11 +62,13 @@ const groups: GroupType[] = [
title: 'Frontend', title: 'Frontend',
link: '/frontend', link: '/frontend',
type: 'role', type: 'role',
otherGroups: ['Web Development'],
}, },
{ {
title: 'Backend', title: 'Backend',
link: '/backend', link: '/backend',
type: 'role', type: 'role',
otherGroups: ['Web Development'],
}, },
{ {
title: 'DevOps', title: 'DevOps',
@ -76,6 +79,7 @@ const groups: GroupType[] = [
title: 'Full Stack', title: 'Full Stack',
link: '/full-stack', link: '/full-stack',
type: 'role', type: 'role',
otherGroups: ['Web Development'],
}, },
{ {
title: 'QA', title: 'QA',
@ -86,6 +90,42 @@ const groups: GroupType[] = [
title: 'GraphQL', title: 'GraphQL',
link: '/graphql', link: '/graphql',
type: 'skill', type: 'skill',
otherGroups: ['Web Development'],
},
],
},
{
group: 'Frameworks',
roadmaps: [
{
title: 'React',
link: '/react',
type: 'skill',
otherGroups: ['Web Development'],
},
{
title: 'Vue',
link: '/vue',
type: 'skill',
otherGroups: ['Web Development'],
},
{
title: 'Angular',
link: '/angular',
type: 'skill',
otherGroups: ['Web Development'],
},
{
title: 'Spring Boot',
link: '/spring-boot',
type: 'skill',
otherGroups: ['Web Development'],
},
{
title: 'ASP.NET Core',
link: '/aspnet-core',
type: 'skill',
otherGroups: ['Web Development'],
}, },
], ],
}, },
@ -96,21 +136,25 @@ const groups: GroupType[] = [
title: 'DevOps', title: 'DevOps',
link: '/devops', link: '/devops',
type: 'role', type: 'role',
otherGroups: ['Web Development'],
}, },
{ {
title: 'Docker', title: 'Docker',
link: '/docker', link: '/docker',
type: 'skill', type: 'skill',
otherGroups: ['Web Development'],
}, },
{ {
title: 'Kubernetes', title: 'Kubernetes',
link: '/kubernetes', link: '/kubernetes',
type: 'skill', type: 'skill',
otherGroups: ['Web Development'],
}, },
{ {
title: 'AWS', title: 'AWS',
link: '/aws', link: '/aws',
type: 'skill', type: 'skill',
otherGroups: ['Web Development'],
}, },
], ],
}, },
@ -121,16 +165,19 @@ const groups: GroupType[] = [
title: 'JavaScript', title: 'JavaScript',
link: '/javascript', link: '/javascript',
type: 'skill', type: 'skill',
otherGroups: ['Web Development', 'DevOps', 'Mobile Development'],
}, },
{ {
title: 'TypeScript', title: 'TypeScript',
link: '/typescript', link: '/typescript',
type: 'skill', type: 'skill',
otherGroups: ['Web Development', 'Mobile Development'],
}, },
{ {
title: 'Node.js', title: 'Node.js',
link: '/nodejs', link: '/nodejs',
type: 'skill', type: 'skill',
otherGroups: ['Web Development', 'DevOps'],
}, },
{ {
title: 'C++', title: 'C++',
@ -141,62 +188,42 @@ const groups: GroupType[] = [
title: 'Go', title: 'Go',
link: '/golang', link: '/golang',
type: 'skill', type: 'skill',
otherGroups: ['Web Development', 'DevOps'],
}, },
{ {
title: 'Rust', title: 'Rust',
link: '/rust', link: '/rust',
type: 'skill', type: 'skill',
otherGroups: ['Web Development', 'DevOps'],
}, },
{ {
title: 'Python', title: 'Python',
link: '/python', link: '/python',
type: 'skill', type: 'skill',
otherGroups: ['Web Development', 'DevOps'],
}, },
{ {
title: 'Java', title: 'Java',
link: '/java', link: '/java',
type: 'skill', type: 'skill',
otherGroups: ['Web Development'],
}, },
{ {
title: 'SQL', title: 'SQL',
link: '/sql', link: '/sql',
type: 'skill', type: 'skill',
otherGroups: ['Web Development', 'Databases', 'DevOps'],
}, },
], ],
}, },
{ {
group: 'Frameworks', group: 'Mobile Development',
roadmaps: [ roadmaps: [
{ {
title: 'React', title: 'Android',
link: '/react', link: '/android',
type: 'skill', type: 'role',
},
{
title: 'Vue',
link: '/vue',
type: 'skill',
},
{
title: 'Angular',
link: '/angular',
type: 'skill',
},
{
title: 'Spring Boot',
link: '/spring-boot',
type: 'skill',
},
{
title: 'ASP.NET Core',
link: '/aspnet-core',
type: 'skill',
}, },
],
},
{
group: 'Mobile Development',
roadmaps: [
{ {
title: 'React Native', title: 'React Native',
link: '/react-native', link: '/react-native',
@ -207,11 +234,6 @@ const groups: GroupType[] = [
link: '/flutter', link: '/flutter',
type: 'role', type: 'role',
}, },
{
title: 'Android',
link: '/android',
type: 'role',
},
], ],
}, },
{ {
@ -221,11 +243,13 @@ const groups: GroupType[] = [
title: 'PostgreSQL', title: 'PostgreSQL',
link: '/postgresql-dba', link: '/postgresql-dba',
type: 'role', type: 'role',
otherGroups: ['Web Development'],
}, },
{ {
title: 'MongoDB', title: 'MongoDB',
link: '/mongodb', link: '/mongodb',
type: 'skill', type: 'skill',
otherGroups: ['Web Development'],
}, },
], ],
}, },
@ -236,31 +260,37 @@ const groups: GroupType[] = [
title: 'Computer Science', title: 'Computer Science',
link: '/computer-science', link: '/computer-science',
type: 'skill', type: 'skill',
otherGroups: ['Web Development'],
}, },
{ {
title: 'Data Structures', title: 'Data Structures',
link: '/data-structures-and-algorithms', link: '/data-structures-and-algorithms',
type: 'skill', type: 'skill',
otherGroups: ['Web Development'],
}, },
{ {
title: 'System Design', title: 'System Design',
link: '/system-design', link: '/system-design',
type: 'skill', type: 'skill',
otherGroups: ['Web Development'],
}, },
{ {
title: 'Design and Architecture', title: 'Design and Architecture',
link: '/software-design-architecture', link: '/software-design-architecture',
type: 'skill', type: 'skill',
otherGroups: ['Web Development'],
}, },
{ {
title: 'Software Architect', title: 'Software Architect',
link: '/software-architect', link: '/software-architect',
type: 'role', type: 'role',
otherGroups: ['Web Development'],
}, },
{ {
title: 'Code Review', title: 'Code Review',
link: '/code-review', link: '/code-review',
type: 'skill', type: 'skill',
otherGroups: ['Web Development'],
}, },
{ {
title: 'Technical Writer', title: 'Technical Writer',
@ -316,6 +346,7 @@ const groups: GroupType[] = [
title: 'Design System', title: 'Design System',
link: '/design-system', link: '/design-system',
type: 'skill', type: 'skill',
otherGroups: ['Web Development'],
}, },
], ],
}, },
@ -368,7 +399,25 @@ export function RoadmapsPage() {
const group = groups.find((group) => group.group === activeGroup); const group = groups.find((group) => group.group === activeGroup);
if (group) { if (group) {
setVisibleGroups([group]); // other groups that have a roadmap that is in the same group
const otherGroups = groups.filter((g) => {
return (
g.group !== group.group &&
g.roadmaps.some((roadmap) => {
return roadmap.otherGroups?.includes(group.group);
})
);
});
setVisibleGroups([
group,
...otherGroups.map((g) => ({
...g,
roadmaps: g.roadmaps.filter((roadmap) =>
roadmap.otherGroups?.includes(group.group),
),
})),
]);
} }
} }
}, [activeGroup]); }, [activeGroup]);

Loading…
Cancel
Save