Skip to content

[RTI][FRONTEND][TEMPLATE-MANAGER] Enhancing template manager#17

Open
sehansi-9 wants to merge 8 commits intoLDFLK:mainfrom
sehansi-9:template-manager
Open

[RTI][FRONTEND][TEMPLATE-MANAGER] Enhancing template manager#17
sehansi-9 wants to merge 8 commits intoLDFLK:mainfrom
sehansi-9:template-manager

Conversation

@sehansi-9
Copy link
Copy Markdown
Member

@sehansi-9 sehansi-9 commented Apr 2, 2026

This pr contains the initial commit with enhanced template manager

  • Using user-friendly HTML elements in the markdown editor for variables
  • Variable dragging and dropping
  • Create new template functionality and CRUD operations

closes #18

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@ChanukaUOJ
Copy link
Copy Markdown
Member

Screenshot 2026-04-04 234359

Take a look! This happens when the user clicks on those H1, H2, etc. buttons

@ChanukaUOJ
Copy link
Copy Markdown
Member

image

These margins should automatically adjust based on the device width.

<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">
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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';
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

X isn't used anywhere.

import { Save, Plus, Move, Trash2, X, Bold, Heading1, Heading2, Type } from 'lucide-react';

export function Templates() {
const [templates, setTemplates] = useState<Template[]>(mockTemplates);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +32 to +52
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;
};
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add Italic to this?

Comment on lines +1 to +6
export interface Template {
id: string;
name: string;
description: string;
content: string;
} No newline at end of file
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<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.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<title>RTI Request Tracker Dashboard</title>
<title>RTI Tracker Tool</title>

@@ -0,0 +1,6 @@
# RTI Tracker
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add where to navigate and start, make it a little bit cleaner

@ChanukaUOJ
Copy link
Copy Markdown
Member

Make sure to write playwright tests for this component as well. (only for desktop screen)

@sehansi-9
Copy link
Copy Markdown
Member Author

Screenshot 2026-04-04 234359 Take a look! This happens when the user clicks on those `H1`, `H2`, etc. buttons

the grammarly browser extension crashes when our custom react code modifies the html inside the contentEditable area.
added data-gramm="false" attribute to the contentEditable div to prevent the extension from interfering with the editor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[RTI][TOOL][UI] Template Manager Enhancements

2 participants