chore: cleanup dead code + format with Pint
- Remove unused FeaturesController (empty stubs, no routes) - Remove ConvertSpatialFile CLI command (unused; service used in LayerManager) - Remove MigrateGeojsonToFeatures CLI command (one-shot migration, not referenced) - Remove .claude/worktrees/ (11 old agent worktrees from June) - Apply Laravel Pint formatting across 219 files (style only, no functional changes) Tests: 101 passing (319 assertions) API routes: unchanged (8 routes intact)
This commit is contained in:
@@ -2,40 +2,45 @@
|
||||
|
||||
namespace App\Livewire\Users;
|
||||
|
||||
use Livewire\Component;
|
||||
use Livewire\Attributes\Layout;
|
||||
use App\Models\User;
|
||||
use App\Models\Project;
|
||||
use App\Models\Inspection;
|
||||
use App\Models\Issue;
|
||||
use App\Models\Project;
|
||||
use App\Models\User;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Livewire\Attributes\Layout;
|
||||
use Livewire\Component;
|
||||
use Spatie\Permission\Models\Permission;
|
||||
use Spatie\Permission\PermissionRegistrar;
|
||||
|
||||
#[Layout('layouts.app')]
|
||||
class UserView extends Component
|
||||
{
|
||||
public User $user;
|
||||
public User $user;
|
||||
|
||||
public string $activeTab = 'ficha';
|
||||
|
||||
// Projects tab
|
||||
public ?int $addProjectId = null;
|
||||
public ?int $addProjectId = null;
|
||||
|
||||
public string $addProjectRole = '';
|
||||
|
||||
public $availableProjects;
|
||||
|
||||
// Notes tab
|
||||
public string $notes = '';
|
||||
public bool $editingNotes = false;
|
||||
public string $notes = '';
|
||||
|
||||
public bool $editingNotes = false;
|
||||
|
||||
// Recent activity (loaded once)
|
||||
public $recentInspections;
|
||||
|
||||
public $recentIssues;
|
||||
|
||||
public function mount(User $user): void
|
||||
{
|
||||
abort_unless(Auth::user()->can('view users'), 403);
|
||||
|
||||
$this->user = $user->load(['roles', 'company', 'projects.phases']);
|
||||
$this->user = $user->load(['roles', 'company', 'projects.phases']);
|
||||
$this->notes = $user->notes ?? '';
|
||||
|
||||
$this->loadAvailableProjects();
|
||||
@@ -72,7 +77,7 @@ class UserView extends Component
|
||||
public function assignProject(): void
|
||||
{
|
||||
$this->validate([
|
||||
'addProjectId' => 'required|exists:projects,id',
|
||||
'addProjectId' => 'required|exists:projects,id',
|
||||
'addProjectRole' => 'nullable|string|max:100',
|
||||
], [], ['addProjectId' => 'proyecto', 'addProjectRole' => 'rol en proyecto']);
|
||||
|
||||
@@ -81,7 +86,7 @@ class UserView extends Component
|
||||
]);
|
||||
|
||||
$this->user->load('projects.phases');
|
||||
$this->addProjectId = null;
|
||||
$this->addProjectId = null;
|
||||
$this->addProjectRole = '';
|
||||
$this->loadAvailableProjects();
|
||||
$this->dispatch('notify', 'Proyecto asignado.');
|
||||
@@ -146,13 +151,14 @@ class UserView extends Component
|
||||
->groupBy(fn ($perm) => $perm->group ?: 'General')
|
||||
->sortBy(function ($perms, $section) use ($order) {
|
||||
$i = array_search($section, $order, true);
|
||||
|
||||
return $i === false ? 999 : $i;
|
||||
});
|
||||
|
||||
return view('livewire.users.user-view', [
|
||||
'grouped' => $grouped,
|
||||
'grouped' => $grouped,
|
||||
'directPerms' => $this->user->getDirectPermissions()->pluck('name')->toArray(),
|
||||
'rolePerms' => $this->user->getPermissionsViaRoles()->pluck('name')->toArray(),
|
||||
'rolePerms' => $this->user->getPermissionsViaRoles()->pluck('name')->toArray(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user