|
| 1 | +import React from 'react'; |
| 2 | +import { DocsHelp } from '~/components/DocsHelp'; |
| 3 | +import { getLayout } from '~/components/Sidebar'; |
| 4 | +import Head from 'next/head'; |
| 5 | +import { Headline1 } from '~/components/Headlines'; |
| 6 | +import { SectionContext } from '~/context'; |
| 7 | +import roadmap from '~/data/roadmap.json'; |
| 8 | + |
| 9 | +const statusColors = { |
| 10 | + 'In Progress': 'bg-green-600 text-white dark:bg-green-500', |
| 11 | + Done: 'bg-purple-600 text-white dark:bg-purple-500', |
| 12 | + Planned: 'bg-blue-600 text-white dark:bg-blue-500', |
| 13 | + Paused: 'bg-red-600 text-white dark:bg-red-500', |
| 14 | + Deferred: 'bg-blue-600 text-white dark:bg-blue-500', |
| 15 | + Unknown: 'bg-gray-600 text-white dark:bg-gray-500', |
| 16 | +}; |
| 17 | + |
| 18 | +const effortColors = { |
| 19 | + Low: 'bg-green-600 text-white dark:bg-green-500', |
| 20 | + Medium: 'bg-yellow-600 text-white dark:bg-yellow-500', |
| 21 | + High: 'bg-red-600 text-white dark:bg-red-500', |
| 22 | + 'Low-medium': 'bg-green-600 text-white dark:bg-green-500', |
| 23 | + Unknown: 'bg-gray-600 text-white dark:bg-gray-500', |
| 24 | +}; |
| 25 | + |
| 26 | +const impactColors = { |
| 27 | + Low: 'bg-red-600 text-white dark:bg-red-500', |
| 28 | + Medium: 'bg-yellow-600 text-white dark:bg-yellow-500', |
| 29 | + High: 'bg-green-600 text-white dark:bg-green-500', |
| 30 | + 'Medium-high': 'bg-yellow-600 text-white dark:bg-yellow-500', |
| 31 | + 'Low-medium': 'bg-red-600 text-white dark:bg-red-500', |
| 32 | + Unknown: 'bg-gray-600 text-white dark:bg-gray-500', |
| 33 | +}; |
| 34 | + |
| 35 | +export default function Roadmap() { |
| 36 | + const newTitle = 'JSON Schema Roadmap'; |
| 37 | + const markdownFile = '_indexPage'; |
| 38 | + |
| 39 | + return ( |
| 40 | + <SectionContext.Provider value='docs'> |
| 41 | + <Head> |
| 42 | + <title>{newTitle}</title> |
| 43 | + </Head> |
| 44 | + <Headline1>{newTitle}</Headline1> |
| 45 | + <div className='text-md'> |
| 46 | + Our "Roadmap" section displays our key objectives for the long term. |
| 47 | + While this roadmap provides a detailed outlook for the near future, |
| 48 | + please note that it might be subject to change. In fact, we are |
| 49 | + currently{' '} |
| 50 | + <a |
| 51 | + className='text-blue-600 underline' |
| 52 | + href='https://github.com/orgs/json-schema-org/discussions/813' |
| 53 | + > |
| 54 | + discussing |
| 55 | + </a>{' '} |
| 56 | + the new priorities for the next 24-month cycle, which will lead to |
| 57 | + relevant changes. Please consider joining the discussion to become an |
| 58 | + active part of JSON Schema's future! |
| 59 | + </div> |
| 60 | + <div className='text-gray-900 dark:text-white'> |
| 61 | + <div className='container mt-14 mx-auto px-4'> |
| 62 | + <div className='relative'> |
| 63 | + <div className='absolute left-0 top-0 bottom-0 w-0.5 bg-blue-600'></div> |
| 64 | + |
| 65 | + {roadmap.map((item) => { |
| 66 | + const status = |
| 67 | + item.fieldValues.nodes.find( |
| 68 | + (node) => node.field?.name === 'Status', |
| 69 | + )?.name || 'Unknown'; |
| 70 | + const category = |
| 71 | + item.fieldValues.nodes.find( |
| 72 | + (node) => node.field?.name === 'Category', |
| 73 | + )?.name || 'Uncategorized'; |
| 74 | + const effort = |
| 75 | + item.fieldValues.nodes.find( |
| 76 | + (node) => node.field?.name === 'Effort', |
| 77 | + )?.name || 'Unknown'; |
| 78 | + const impact = |
| 79 | + item.fieldValues.nodes.find( |
| 80 | + (node) => node.field?.name === 'Impact', |
| 81 | + )?.name || 'Unknown'; |
| 82 | + |
| 83 | + const effortClass = |
| 84 | + effortColors[effort as keyof typeof effortColors] || |
| 85 | + effortColors['Unknown']; |
| 86 | + const impactClass = |
| 87 | + impactColors[impact as keyof typeof impactColors] || |
| 88 | + impactColors['Unknown']; |
| 89 | + const statusClass = |
| 90 | + statusColors[status as keyof typeof statusColors] || |
| 91 | + statusColors['Unknown']; |
| 92 | + |
| 93 | + return ( |
| 94 | + <div key={item.id} className='relative z-10 mb-12 pl-8'> |
| 95 | + <div className='absolute -left-4 top-6 w-8 h-8 bg-blue-600 rounded-full z-10 flex items-center justify-center'> |
| 96 | + <div className='w-4 h-4 bg-white dark:bg-gray-800 rounded-full'></div> |
| 97 | + </div> |
| 98 | + |
| 99 | + <div className='bg-white dark:bg-gray-800 relative z-10 w-full rounded-lg overflow-hidden border border-gray-200 dark:border-gray-700 shadow-lg'> |
| 100 | + <div className='p-6'> |
| 101 | + <span className='inline-block px-3 py-1 text-sm font-semibold text-white bg-blue-600 rounded-full mb-4'> |
| 102 | + {category} |
| 103 | + </span> |
| 104 | + <h2 className='text-2xl font-bold mb-3'> |
| 105 | + {item.content.title} |
| 106 | + </h2> |
| 107 | + |
| 108 | + <div className='flex flex-wrap items-center gap-2 text-sm'> |
| 109 | + <span |
| 110 | + className={`px-2 py-1 rounded whitespace-nowrap ${effortClass}`} |
| 111 | + > |
| 112 | + Effort: {effort} |
| 113 | + </span> |
| 114 | + <span |
| 115 | + className={`px-2 py-1 rounded whitespace-nowrap ${impactClass}`} |
| 116 | + > |
| 117 | + Impact: {impact} |
| 118 | + </span> |
| 119 | + </div> |
| 120 | + </div> |
| 121 | + <div className={`px-6 py-3 ${statusClass}`}> |
| 122 | + <span className='text-sm font-semibold text-white uppercase'> |
| 123 | + {status} |
| 124 | + </span> |
| 125 | + </div> |
| 126 | + </div> |
| 127 | + </div> |
| 128 | + ); |
| 129 | + })} |
| 130 | + </div> |
| 131 | + </div> |
| 132 | + </div> |
| 133 | + <DocsHelp markdownFile={markdownFile} /> |
| 134 | + </SectionContext.Provider> |
| 135 | + ); |
| 136 | +} |
| 137 | + |
| 138 | +Roadmap.getLayout = getLayout; |
0 commit comments