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:
@@ -14,13 +14,18 @@ use Livewire\Component;
|
||||
class FeatureManager extends Component
|
||||
{
|
||||
public Project $project;
|
||||
|
||||
public $featureTypes = [];
|
||||
|
||||
// Edit modal
|
||||
public bool $showForm = false;
|
||||
|
||||
public $editingId = null;
|
||||
|
||||
public string $name = '';
|
||||
|
||||
public $featureTypeId = '';
|
||||
|
||||
public bool $isActive = true;
|
||||
|
||||
public function mount(Project $project)
|
||||
@@ -33,6 +38,7 @@ class FeatureManager extends Component
|
||||
private function canManage(): bool
|
||||
{
|
||||
$user = Auth::user();
|
||||
|
||||
return $user->can('manage all')
|
||||
|| ($user->can('edit layers') && $this->project->users()->where('user_id', $user->id)->exists());
|
||||
}
|
||||
@@ -42,10 +48,10 @@ class FeatureManager extends Component
|
||||
{
|
||||
abort_unless($this->canManage(), 403);
|
||||
$feature = $this->findFeature($id);
|
||||
$this->editingId = $feature->id;
|
||||
$this->name = $feature->name ?? '';
|
||||
$this->editingId = $feature->id;
|
||||
$this->name = $feature->name ?? '';
|
||||
$this->featureTypeId = $feature->feature_type_id ?? '';
|
||||
$this->isActive = (bool) $feature->is_active;
|
||||
$this->isActive = (bool) $feature->is_active;
|
||||
$this->resetErrorBag();
|
||||
$this->showForm = true;
|
||||
}
|
||||
@@ -54,14 +60,14 @@ class FeatureManager extends Component
|
||||
{
|
||||
abort_unless($this->canManage(), 403);
|
||||
$this->validate([
|
||||
'name' => 'required|string|max:255',
|
||||
'name' => 'required|string|max:255',
|
||||
'featureTypeId' => 'nullable|exists:feature_types,id',
|
||||
]);
|
||||
|
||||
$this->findFeature($this->editingId)->update([
|
||||
'name' => $this->name,
|
||||
'name' => $this->name,
|
||||
'feature_type_id' => $this->featureTypeId ?: null,
|
||||
'is_active' => $this->isActive,
|
||||
'is_active' => $this->isActive,
|
||||
]);
|
||||
|
||||
$this->showForm = false;
|
||||
|
||||
Reference in New Issue
Block a user