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:
@@ -4,13 +4,13 @@ namespace App\Livewire\Issues;
|
||||
|
||||
use App\Models\Issue;
|
||||
use App\Models\IssueChecklistTemplate;
|
||||
use App\Models\IssueComment;
|
||||
use App\Models\IssueTask;
|
||||
use App\Models\Media;
|
||||
use App\Models\Project;
|
||||
use App\Notifications\IssueCommentedNotification;
|
||||
use App\Notifications\IssueStatusChangedNotification;
|
||||
use App\Notifications\IssueTaskAssignedNotification;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
use Livewire\Attributes\Layout;
|
||||
use Livewire\Component;
|
||||
@@ -22,19 +22,24 @@ class IssueDetail extends Component
|
||||
use WithFileUploads;
|
||||
|
||||
public Project $project;
|
||||
|
||||
public Issue $issue;
|
||||
|
||||
// New task form
|
||||
public string $newTaskTitle = '';
|
||||
|
||||
public $newTaskAssignee = '';
|
||||
|
||||
public $newTaskDue = '';
|
||||
|
||||
// Checklist templates
|
||||
public $checklistTemplates = [];
|
||||
|
||||
public $applyTemplateId = '';
|
||||
|
||||
// New comment form
|
||||
public string $newComment = '';
|
||||
|
||||
public $commentPhoto = null; // single optional photo on a comment
|
||||
|
||||
// Issue-level photos
|
||||
@@ -61,6 +66,7 @@ class IssueDetail extends Component
|
||||
private function canAccessProject(): bool
|
||||
{
|
||||
$user = Auth::user();
|
||||
|
||||
return $user->can('manage all')
|
||||
|| $this->project->users()->where('user_id', $user->id)->exists();
|
||||
}
|
||||
@@ -97,17 +103,17 @@ class IssueDetail extends Component
|
||||
{
|
||||
abort_unless($this->canEdit(), 403);
|
||||
$this->validate([
|
||||
'newTaskTitle' => 'required|string|max:255',
|
||||
'newTaskTitle' => 'required|string|max:255',
|
||||
'newTaskAssignee' => 'nullable|exists:users,id',
|
||||
'newTaskDue' => 'nullable|date',
|
||||
'newTaskDue' => 'nullable|date',
|
||||
]);
|
||||
|
||||
$task = $this->issue->tasks()->create([
|
||||
'title' => $this->newTaskTitle,
|
||||
'title' => $this->newTaskTitle,
|
||||
'assigned_to' => $this->newTaskAssignee ?: null,
|
||||
'due_date' => $this->newTaskDue ?: null,
|
||||
'order' => ((int) $this->issue->tasks()->max('order')) + 1,
|
||||
'uuid' => (string) \Illuminate\Support\Str::uuid(),
|
||||
'due_date' => $this->newTaskDue ?: null,
|
||||
'order' => ((int) $this->issue->tasks()->max('order')) + 1,
|
||||
'uuid' => (string) Str::uuid(),
|
||||
]);
|
||||
|
||||
// Notify the assignee (unless they assigned it to themselves).
|
||||
@@ -134,7 +140,7 @@ class IssueDetail extends Component
|
||||
$this->issue->tasks()->create([
|
||||
'title' => $title,
|
||||
'order' => ++$order,
|
||||
'uuid' => (string) \Illuminate\Support\Str::uuid(),
|
||||
'uuid' => (string) Str::uuid(),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -170,7 +176,7 @@ class IssueDetail extends Component
|
||||
{
|
||||
// Anyone who can view the issue (and is a member) may comment / report progress.
|
||||
$this->validate([
|
||||
'newComment' => 'nullable|string|max:5000',
|
||||
'newComment' => 'nullable|string|max:5000',
|
||||
'commentPhoto' => 'nullable|image|max:20480', // 20 MB
|
||||
]);
|
||||
|
||||
@@ -182,8 +188,8 @@ class IssueDetail extends Component
|
||||
|
||||
$comment = $this->issue->comments()->create([
|
||||
'user_id' => Auth::id(),
|
||||
'body' => trim($this->newComment) ?: '(foto)',
|
||||
'uuid' => (string) \Illuminate\Support\Str::uuid(),
|
||||
'body' => trim($this->newComment) ?: '(foto)',
|
||||
'uuid' => (string) Str::uuid(),
|
||||
]);
|
||||
|
||||
if ($this->commentPhoto) {
|
||||
@@ -215,7 +221,7 @@ class IssueDetail extends Component
|
||||
|
||||
public function deleteMedia($mediaId): void
|
||||
{
|
||||
$media = \App\Models\Media::findOrFail($mediaId);
|
||||
$media = Media::findOrFail($mediaId);
|
||||
$user = Auth::user();
|
||||
abort_unless($user->can('delete media') || $media->uploaded_by === $user->id, 403);
|
||||
$media->delete();
|
||||
@@ -230,14 +236,14 @@ class IssueDetail extends Component
|
||||
$path = $file->store("uploads/issues/{$this->issue->id}/{$entity}", 'public');
|
||||
|
||||
$parent->media()->create([
|
||||
'name' => $file->getClientOriginalName(),
|
||||
'file_path' => $path,
|
||||
'file_type' => $mime,
|
||||
'name' => $file->getClientOriginalName(),
|
||||
'file_path' => $path,
|
||||
'file_type' => $mime,
|
||||
'file_extension' => $file->getClientOriginalExtension(),
|
||||
'file_size' => $file->getSize(),
|
||||
'category' => str_starts_with($mime, 'image/') ? 'image' : 'document',
|
||||
'uploaded_by' => Auth::id(),
|
||||
'uuid' => (string) \Illuminate\Support\Str::uuid(),
|
||||
'file_size' => $file->getSize(),
|
||||
'category' => str_starts_with($mime, 'image/') ? 'image' : 'document',
|
||||
'uploaded_by' => Auth::id(),
|
||||
'uuid' => (string) Str::uuid(),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -256,8 +262,8 @@ class IssueDetail extends Component
|
||||
{
|
||||
abort_unless($this->canEdit(), 403);
|
||||
$this->issue->update([
|
||||
'status' => 'resolved',
|
||||
'resolved_at' => $this->issue->resolved_at ?? now(),
|
||||
'status' => 'resolved',
|
||||
'resolved_at' => $this->issue->resolved_at ?? now(),
|
||||
'resolution_notes' => $this->resolutionNotes ?: null,
|
||||
]);
|
||||
$this->notifyStakeholders(new IssueStatusChangedNotification($this->issue, 'resolved'));
|
||||
@@ -269,7 +275,7 @@ class IssueDetail extends Component
|
||||
{
|
||||
abort_unless($this->canEdit(), 403);
|
||||
$this->issue->update([
|
||||
'status' => 'closed',
|
||||
'status' => 'closed',
|
||||
'resolved_at' => $this->issue->resolved_at ?? now(),
|
||||
]);
|
||||
$this->notifyStakeholders(new IssueStatusChangedNotification($this->issue, 'closed'));
|
||||
|
||||
Reference in New Issue
Block a user