@@ -3,7 +3,8 @@ import { Link } from 'react-router-dom';
33import useSeo from '../../hooks/useSeo' ;
44import { ArrowLeftIcon , KanbanIcon , ListBulletsIcon , FunnelIcon } from '@phosphor-icons/react' ;
55import CustomDropdown from '../../components/CustomDropdown' ;
6- import RoadmapCard from '../../components/RoadmapCard' ; // Added import for RoadmapCard
6+ import RoadmapCard from '../../components/roadmap/RoadmapCard' ; // Added import for RoadmapCard
7+ import piml from 'piml' ; // Import piml
78
89const RoadmapViewerPage = ( ) => {
910 useSeo ( {
@@ -19,16 +20,19 @@ const RoadmapViewerPage = () => {
1920 twitterImage : 'https://fezcode.github.io/logo512.png' ,
2021 } ) ;
2122
22- const [ appsData , setAppsData ] = useState ( [ ] ) ;
23+ const [ issuesData , setIssuesData ] = useState ( [ ] ) ;
2324 const [ viewMode , setViewMode ] = useState ( 'roadmap' ) ; // 'roadmap' or 'table'
2425
2526 useEffect ( ( ) => {
2627 const fetchRoadmap = async ( ) => {
2728 try {
28- const response = await fetch ( '/roadmap/roadmap.json' ) ;
29- const data = await response . json ( ) ;
30- // Roadmap.json is a flat array, no need to flatten categories
31- setAppsData ( data ) ;
29+ const pimlResponse = await fetch ( '/roadmap/roadmap.piml' ) ;
30+ if ( ! pimlResponse . ok ) {
31+ throw new Error ( `HTTP error! status: ${ pimlResponse . status } ` ) ;
32+ }
33+ const issuesPimlText = await pimlResponse . text ( ) ;
34+ const issuesData = piml . parse ( issuesPimlText ) ;
35+ setIssuesData ( issuesData . issues ) ;
3236 } catch ( error ) {
3337 console . error ( 'Failed to fetch roadmap data:' , error ) ;
3438 }
@@ -46,8 +50,8 @@ const RoadmapViewerPage = () => {
4650 borderColor = 'border-blue-700' ;
4751 break ;
4852 case 'In Progress' :
49- bgColor = 'bg-yellow -500' ;
50- borderColor = 'border-yellow -700' ;
53+ bgColor = 'bg-orange -500' ;
54+ borderColor = 'border-orange -700' ;
5155 break ;
5256 case 'Completed' :
5357 bgColor = 'bg-green-500' ;
@@ -92,8 +96,13 @@ const RoadmapViewerPage = () => {
9296 return classes . split ( ' ' ) [ 0 ] ; // Returns only the bgColor class (e.g., "bg-blue-500")
9397 } ;
9498
99+ const statusTextColor = ( status ) => {
100+ if ( status === 'Planned' ) return 'text-white' ;
101+ return 'text-black' ;
102+ } ;
103+
95104 const RoadmapView = ( ) => {
96- const groupedApps = appsData . reduce ( ( acc , app ) => {
105+ const groupedApps = issuesData . reduce ( ( acc , app ) => {
97106 const status = app . status || 'Planned' ; // Default to Planned if not specified
98107 if ( ! acc [ status ] ) {
99108 acc [ status ] = [ ] ;
@@ -112,7 +121,7 @@ const RoadmapViewerPage = () => {
112121 className = { `text-lg font-mono tracking-wider mb-4 flex items-center gap-2 text-white` }
113122 >
114123 < span
115- className = { `w-3 h-3 rounded-full ${ getOnlyBgStatusColor ( status ) } ` }
124+ className = { `w-3 h-3 rounded-full ${ getOnlyBgStatusColor ( status ) } ${ statusTextColor ( status ) } ` }
116125 > </ span >
117126 { status } ({ groupedApps [ status ] ?. length || 0 } )
118127 </ h3 >
@@ -132,7 +141,7 @@ const RoadmapViewerPage = () => {
132141 const [ sortOrder , setSortOrder ] = useState ( 'asc' ) ; // 'asc' or 'desc'
133142 const [ filterStatus , setFilterStatus ] = useState ( 'All' ) ;
134143
135- const filteredApps = appsData . filter ( ( app ) =>
144+ const filteredApps = issuesData . filter ( ( app ) =>
136145 filterStatus === 'All' ? true : ( app . status || 'Planned' ) === filterStatus ,
137146 ) ;
138147
@@ -248,14 +257,14 @@ const RoadmapViewerPage = () => {
248257 </ td >
249258 < td className = "px-6 py-4 whitespace-nowrap" >
250259 < span
251- className = { `px-2 py-0 inline-flex text-xs font-mono font-semibold rounded-md shadow-sm border ${ getStatusClasses ( app . status || 'Planned' ) } text-white ` }
260+ className = { `px-2 py-0 inline-flex text-xs font-mono font-semibold rounded-md shadow-sm border ${ getStatusClasses ( app . status ) } ${ statusTextColor ( app . status ) } ` }
252261 >
253262 { app . status || 'Planned' }
254263 </ span >
255264 </ td >
256265 < td className = "px-6 py-4 whitespace-nowrap" >
257266 < span
258- className = { `px-2 py-0 inline-flex text-xs font-mono font-semibold rounded-md shadow-sm border ${ getPriorityClasses ( app . priority || 'Low' ) } ` }
267+ className = { `px-2 py-0 inline-flex text-xs font-mono font-semibold rounded-md shadow-sm border ${ getPriorityClasses ( app . priority ) } ` }
259268 >
260269 { app . priority || 'Low' }
261270 </ span >
0 commit comments