From efccb67635c2109ec9d91c1fc2a91991855d519c Mon Sep 17 00:00:00 2001 From: javier Date: Wed, 17 Jun 2026 19:02:05 +0200 Subject: [PATCH] feat(user-view): add Details (Ficha) tab as default with basic info + access validity New 'Ficha' tab (first, default) on the user view: basic info card (name/username/email/phone/address/member since) plus the 'Validez de acceso' card and the Empresa card, moved here from the Permissions tab. The Permissions tab now focuses on roles + the direct-permissions form. Co-Authored-By: Claude Opus 4.8 (1M context) --- app/Livewire/UserView.php | 2 +- resources/views/livewire/user-view.blade.php | 84 ++++++++++++++++---- 2 files changed, 68 insertions(+), 18 deletions(-) diff --git a/app/Livewire/UserView.php b/app/Livewire/UserView.php index 538ee9c..f1ae3d3 100644 --- a/app/Livewire/UserView.php +++ b/app/Livewire/UserView.php @@ -16,7 +16,7 @@ use Spatie\Permission\PermissionRegistrar; class UserView extends Component { public User $user; - public string $activeTab = 'permissions'; + public string $activeTab = 'ficha'; // Projects tab public ?int $addProjectId = null; diff --git a/resources/views/livewire/user-view.blade.php b/resources/views/livewire/user-view.blade.php index cb4336f..6145e31 100644 --- a/resources/views/livewire/user-view.blade.php +++ b/resources/views/livewire/user-view.blade.php @@ -131,6 +131,11 @@
+
{{-- ════════════════════════════════════════════════════════════════════ - TAB: PERMISOS + TAB: FICHA ════════════════════════════════════════════════════════════════════ --}} - @if($activeTab === 'permissions') + @if($activeTab === 'ficha')
- {{-- Roles --}} + {{-- Información básica --}}

- - Roles asignados + + Información básica

- @if($user->roles->isEmpty()) -

Sin roles asignados.

- @else -
- @foreach($user->roles as $role) -
- - {{ $role->name }} - -
- @endforeach +
+
+ Nombre + {{ trim(($user->title ? $user->title.' ' : '').($user->first_name ?? '').' '.($user->last_name ?? '')) ?: $user->name }}
- @endif +
+ Usuario + {{ $user->name }} +
+
+ Email + {{ $user->email }} +
+
+ Teléfono + {{ $user->phone ?: '—' }} +
+
+ Dirección + {{ $user->address ?: '—' }} +
+
+ Miembro desde + {{ $user->created_at?->format('d/m/Y') ?? '—' }} +
+
@@ -270,6 +288,38 @@
@endif +
+ @endif + + {{-- ════════════════════════════════════════════════════════════════════ + TAB: PERMISOS + ════════════════════════════════════════════════════════════════════ --}} + @if($activeTab === 'permissions') +
+ + {{-- Roles --}} +
+
+

+ + Roles asignados +

+ @if($user->roles->isEmpty()) +

Sin roles asignados.

+ @else +
+ @foreach($user->roles as $role) +
+ + {{ $role->name }} + +
+ @endforeach +
+ @endif +
+
+ {{-- Permisos directos del usuario --}}