Trening: wznowienie ukonczonej sesji (naprawa pomyly) - endpoint /reopen, akcja w UI, koniec wraca do edycji

This commit is contained in:
Tilumca
2026-10-14 22:37:52 +02:00
parent 9f7a0afdec
commit 931d54a89d
10 changed files with 296 additions and 17 deletions

View File

@@ -24,6 +24,7 @@ export const ACTION_LABELS: Record<string, string> = {
'session.started': 'Sesja rozpoczęta',
'session.completed': 'Sesja zakończona',
'session.abandoned': 'Sesja porzucona',
'session.reopened': 'Sesja wznowiona',
'gym.created': 'Siłownia utworzona',
'gym.updated': 'Siłownia zaktualizowana',
'gym.deleted': 'Siłownia usunięta',
@@ -226,17 +227,32 @@ export default function Logs() {
<table className="w-full text-[0.95rem]">
<thead>
<tr className="border-b border-line text-left text-dim">
<th className="px-4 py-3 text-[10.5px] font-bold uppercase tracking-[0.11em]">Data</th>
<th className="px-4 py-3 text-[10.5px] font-bold uppercase tracking-[0.11em]">Użytkownik</th>
<th className="px-4 py-3 text-[10.5px] font-bold uppercase tracking-[0.11em]">Akcja</th>
<th className="px-4 py-3 text-[10.5px] font-bold uppercase tracking-[0.11em]">Obiekt</th>
<th className="px-4 py-3 text-[10.5px] font-bold uppercase tracking-[0.11em]">Szczegóły</th>
<th className="px-4 py-3 text-[10.5px] font-bold uppercase tracking-[0.11em]">
Data
</th>
<th className="px-4 py-3 text-[10.5px] font-bold uppercase tracking-[0.11em]">
Użytkownik
</th>
<th className="px-4 py-3 text-[10.5px] font-bold uppercase tracking-[0.11em]">
Akcja
</th>
<th className="px-4 py-3 text-[10.5px] font-bold uppercase tracking-[0.11em]">
Obiekt
</th>
<th className="px-4 py-3 text-[10.5px] font-bold uppercase tracking-[0.11em]">
Szczegóły
</th>
</tr>
</thead>
<tbody>
{filtered.map((log) => (
<tr key={log.id} className="border-b border-line/60 transition-colors last:border-b-0 hover:bg-line/20">
<td className="whitespace-nowrap px-4 py-3 font-display text-dim tabular-nums">{formatLogDate(log.createdAt)}</td>
<tr
key={log.id}
className="border-b border-line/60 transition-colors last:border-b-0 hover:bg-line/20"
>
<td className="whitespace-nowrap px-4 py-3 font-display text-dim tabular-nums">
{formatLogDate(log.createdAt)}
</td>
<td className="px-4 py-3">
<div className="font-semibold">{actorName(log)}</div>
<div className="text-[0.875rem] text-dim">{log.actor.email}</div>
@@ -249,7 +265,9 @@ export default function Logs() {
</td>
<td className="px-4 py-3">
<div>{ENTITY_LABELS[log.entityType] ?? log.entityType}</div>
{entityName(log) && <div className="text-[0.875rem] text-dim">{entityName(log)}</div>}
{entityName(log) && (
<div className="text-[0.875rem] text-dim">{entityName(log)}</div>
)}
</td>
<td className="px-4 py-3 text-dim">{detailsText(log) ?? '—'}</td>
</tr>