feat: Add is_system column to notes and update task note handling for system notes

This commit is contained in:
Chop
2025-06-19 22:12:07 +02:00
parent d40af1ff31
commit 3762f2e6f8
5 changed files with 93 additions and 36 deletions

View File

@@ -516,9 +516,7 @@ export default function ProjectTasksSection({ projectId }) {
</div>
</td>
</tr>
)}
{/* Notes row (expandable) */}
)} {/* Notes row (expandable) */}
{expandedNotes[task.id] && (
<tr className="bg-gray-50">
<td colSpan="6" className="px-4 py-4">
@@ -534,9 +532,20 @@ export default function ProjectTasksSection({ projectId }) {
{taskNotes[task.id].map((note) => (
<div
key={note.note_id}
className="bg-white p-3 rounded border flex justify-between items-start"
className={`p-3 rounded border flex justify-between items-start ${
note.is_system
? 'bg-blue-50 border-blue-200'
: 'bg-white border-gray-200'
}`}
>
<div className="flex-1">
<div className="flex items-center gap-2 mb-1">
{note.is_system && (
<span className="px-2 py-1 text-xs bg-blue-100 text-blue-700 rounded-full font-medium">
System
</span>
)}
</div>
<p className="text-sm text-gray-800">
{note.note}
</p>
@@ -550,18 +559,20 @@ export default function ProjectTasksSection({ projectId }) {
).toLocaleTimeString()}
</p>
</div>
<button
onClick={() =>
handleDeleteNote(
note.note_id,
task.id
)
}
className="ml-2 text-red-500 hover:text-red-700 text-xs font-bold"
title="Delete note"
>
×
</button>
{!note.is_system && (
<button
onClick={() =>
handleDeleteNote(
note.note_id,
task.id
)
}
className="ml-2 text-red-500 hover:text-red-700 text-xs font-bold"
title="Delete note"
>
×
</button>
)}
</div>
))}
</div>