Fix: Corregir funcionalidad del botón Ver en auditoría

- Eliminar click en fila completa que causaba conflicto
- Eliminar stopPropagation innecesario de botones
- Agregar type='button' a todos los botones Ver
- Mejorar hover states y transiciones
- Agregar títulos para accesibilidad
- Simplificar lógica de eventos de click
- Botones Ver ahora funcionan correctamente en tabla y tarjetas
- Tarjeta de vulnerabilidad: solo botón Ver es clickeable
This commit is contained in:
2026-02-16 08:43:03 -07:00
parent 9f973464b9
commit 2cb8b58808

View File

@@ -429,7 +429,7 @@
<div class="text-sm text-gray-500">Esta Semana</div>
<div class="text-2xl font-bold text-green-600">{stats.actions_this_week}</div>
</div>
<div class="bg-white rounded-lg shadow p-4 cursor-pointer hover:shadow-lg transition-shadow" on:click={() => filterCriticalActions()}>
<div class="bg-white rounded-lg shadow p-4 hover:shadow-md transition-shadow">
<div class="flex items-center gap-2 mb-1">
<svg class="w-4 h-4 text-amber-500" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" />
@@ -441,8 +441,10 @@
{stats.critical_actions_today}
</div>
<button
class="text-xs text-primary-600 hover:text-primary-700 font-medium flex items-center gap-1"
on:click|stopPropagation={() => filterCriticalActions()}
type="button"
class="text-xs text-primary-600 hover:text-primary-700 font-medium flex items-center gap-1 px-2 py-1 rounded hover:bg-primary-50 transition-colors"
on:click={() => filterCriticalActions()}
title="Filtrar acciones críticas"
>
Ver
<svg class="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
@@ -613,7 +615,7 @@
</thead>
<tbody class="bg-white divide-y divide-gray-200">
{#each logs as log (log.id)}
<tr class="hover:bg-gray-50 transition-colors cursor-pointer" on:click={() => viewDetail(log)}>
<tr class="hover:bg-gray-50 transition-colors">
<td class="px-3 py-2 whitespace-nowrap text-sm text-gray-900">
{formatDateShort(log.created_at)}
</td>
@@ -647,8 +649,9 @@
</td>
<td class="px-3 py-2 whitespace-nowrap text-right text-sm">
<button
on:click|stopPropagation={() => viewDetail(log)}
class="text-primary-600 hover:text-primary-900 font-medium"
type="button"
on:click={() => viewDetail(log)}
class="text-primary-600 hover:text-primary-900 font-medium transition-colors"
>
Ver
</button>
@@ -663,8 +666,7 @@
<div class="lg:hidden divide-y divide-gray-200">
{#each logs as log (log.id)}
<div
class="p-4 hover:bg-gray-50 transition-colors cursor-pointer"
on:click={() => viewDetail(log)}
class="p-4 hover:bg-gray-50 transition-colors"
>
<div class="flex items-start justify-between gap-3">
<div class="flex items-start gap-3 flex-1 min-w-0">
@@ -706,8 +708,10 @@
<!-- Botón Ver -->
<button
on:click|stopPropagation={() => viewDetail(log)}
class="flex-shrink-0 text-primary-600 hover:text-primary-900"
type="button"
on:click={() => viewDetail(log)}
class="flex-shrink-0 text-primary-600 hover:text-primary-900 transition-colors p-1"
title="Ver detalles"
>
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7" />