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:
@@ -429,7 +429,7 @@
|
|||||||
<div class="text-sm text-gray-500">Esta Semana</div>
|
<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 class="text-2xl font-bold text-green-600">{stats.actions_this_week}</div>
|
||||||
</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">
|
<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">
|
<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" />
|
<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}
|
{stats.critical_actions_today}
|
||||||
</div>
|
</div>
|
||||||
<button
|
<button
|
||||||
class="text-xs text-primary-600 hover:text-primary-700 font-medium flex items-center gap-1"
|
type="button"
|
||||||
on:click|stopPropagation={() => filterCriticalActions()}
|
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
|
Ver
|
||||||
<svg class="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
<svg class="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||||
@@ -613,7 +615,7 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody class="bg-white divide-y divide-gray-200">
|
<tbody class="bg-white divide-y divide-gray-200">
|
||||||
{#each logs as log (log.id)}
|
{#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">
|
<td class="px-3 py-2 whitespace-nowrap text-sm text-gray-900">
|
||||||
{formatDateShort(log.created_at)}
|
{formatDateShort(log.created_at)}
|
||||||
</td>
|
</td>
|
||||||
@@ -647,8 +649,9 @@
|
|||||||
</td>
|
</td>
|
||||||
<td class="px-3 py-2 whitespace-nowrap text-right text-sm">
|
<td class="px-3 py-2 whitespace-nowrap text-right text-sm">
|
||||||
<button
|
<button
|
||||||
on:click|stopPropagation={() => viewDetail(log)}
|
type="button"
|
||||||
class="text-primary-600 hover:text-primary-900 font-medium"
|
on:click={() => viewDetail(log)}
|
||||||
|
class="text-primary-600 hover:text-primary-900 font-medium transition-colors"
|
||||||
>
|
>
|
||||||
Ver
|
Ver
|
||||||
</button>
|
</button>
|
||||||
@@ -663,8 +666,7 @@
|
|||||||
<div class="lg:hidden divide-y divide-gray-200">
|
<div class="lg:hidden divide-y divide-gray-200">
|
||||||
{#each logs as log (log.id)}
|
{#each logs as log (log.id)}
|
||||||
<div
|
<div
|
||||||
class="p-4 hover:bg-gray-50 transition-colors cursor-pointer"
|
class="p-4 hover:bg-gray-50 transition-colors"
|
||||||
on:click={() => viewDetail(log)}
|
|
||||||
>
|
>
|
||||||
<div class="flex items-start justify-between gap-3">
|
<div class="flex items-start justify-between gap-3">
|
||||||
<div class="flex items-start gap-3 flex-1 min-w-0">
|
<div class="flex items-start gap-3 flex-1 min-w-0">
|
||||||
@@ -706,8 +708,10 @@
|
|||||||
|
|
||||||
<!-- Botón Ver -->
|
<!-- Botón Ver -->
|
||||||
<button
|
<button
|
||||||
on:click|stopPropagation={() => viewDetail(log)}
|
type="button"
|
||||||
class="flex-shrink-0 text-primary-600 hover:text-primary-900"
|
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">
|
<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" />
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7" />
|
||||||
|
|||||||
Reference in New Issue
Block a user