[RTI][FRONTEND][TEMPLATE-MANAGER] Enhancing template manager#17
[RTI][FRONTEND][TEMPLATE-MANAGER] Enhancing template manager#17sehansi-9 wants to merge 8 commits intoLDFLK:mainfrom
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces the frontend application for the RTI Tracker, including the project structure, configuration files, UI components, and core pages for managing RTI requests, senders, receivers, and templates. The review feedback highlights a need to update the ESLint plugins to better align with the current TypeScript version and suggests replacing the deprecated document.caretRangeFromPoint method in the template editor with a more modern approach for handling drag-and-drop insertions.
| <Sidebar /> | ||
| <main className="flex-1 flex flex-col min-w-0 overflow-hidden"> | ||
| <div className="flex-1 overflow-y-auto p-6"> | ||
| <div className="max-w-7xl mx-auto"> |
There was a problem hiding this comment.
This max-w-7xl limits the width of the right-side panel.
|
|
||
| <div className="p-4 border-t border-gray-200 text-xs text-gray-500"> | ||
| <p>System Version 1.0.0</p> | ||
| <p className="mt-1">Open-Data Protocol</p> |
There was a problem hiding this comment.
Remove this Open-Data Protocol
| import { mockTemplates } from '../data/mockData'; | ||
| import { Template } from '../types/rti'; | ||
| import { Button } from '../components/Button'; | ||
| import { Save, Plus, Move, Trash2, X, Bold, Heading1, Heading2, Type } from 'lucide-react'; |
| import { Save, Plus, Move, Trash2, X, Bold, Heading1, Heading2, Type } from 'lucide-react'; | ||
|
|
||
| export function Templates() { | ||
| const [templates, setTemplates] = useState<Template[]>(mockTemplates); |
There was a problem hiding this comment.
Instead of initializing the mokTemplates here, it's better to get them in the same way we retrieve the data from the API. So when we wire up the APIs, we have to add only the API call there.
| const parseMarkdownToHtml = (markdown: string) => { | ||
| let html = markdown; | ||
|
|
||
| // 1. Handle Bold | ||
| html = html.replace(/\*\*([^*]+)\*\*/g, '<strong>$1</strong>'); | ||
|
|
||
| // 2. Handle Headings (simplified line-based) | ||
| html = html.split('\n').map(line => { | ||
| if (line.startsWith('# ')) return `<h1>${line.slice(2)}</h1>`; | ||
| if (line.startsWith('## ')) return `<h2>${line.slice(3)}</h2>`; | ||
| return line; | ||
| }).join('<br>'); | ||
|
|
||
| // 3. Handle variables (pills) | ||
| html = html.replace(/{{([^}]+)}}/g, (match, p1) => { | ||
| const name = p1.replace(/_/g, ' '); | ||
| return createPillHtml(match, name); | ||
| }); | ||
|
|
||
| return html; | ||
| }; |
| export interface Template { | ||
| id: string; | ||
| name: string; | ||
| description: string; | ||
| content: string; | ||
| } No newline at end of file |
There was a problem hiding this comment.
Put all the attributes from the rti_template table. There is nothing called name. title is there.
| <div className="h-[calc(100vh-3rem)] flex flex-col space-y-4"> | ||
| <div className="flex justify-between items-end"> | ||
| <div> | ||
| <h1 className="text-2xl font-bold text-gray-900">Template Manager</h1> |
There was a problem hiding this comment.
| <h1 className="text-2xl font-bold text-gray-900">Template Manager</h1> | |
| <h1 className="text-2xl font-bold text-gray-900">RTI Template Manager</h1> |
| <div> | ||
| <h1 className="text-2xl font-bold text-gray-900">Template Manager</h1> | ||
| <p className="text-sm text-gray-600 mt-1"> | ||
| Manage Markdown templates for RTI generation. |
There was a problem hiding this comment.
| Manage Markdown templates for RTI generation. | |
| Manage RTI templates for RTI generation. |
| <meta charset="UTF-8" /> | ||
| <link rel="icon" type="image/svg+xml" href="/vite.svg" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
| <title>RTI Request Tracker Dashboard</title> |
There was a problem hiding this comment.
| <title>RTI Request Tracker Dashboard</title> | |
| <title>RTI Tracker Tool</title> |
| @@ -0,0 +1,6 @@ | |||
| # RTI Tracker | |||
There was a problem hiding this comment.
Add where to navigate and start, make it a little bit cleaner
|
Make sure to write playwright tests for this component as well. (only for desktop screen) |



This pr contains the initial commit with enhanced template manager
closes #18