6e66f707d5
Full restore of the7d854ffsnapshot (2026-06-16 18:05, before the security review). Forward commit, no history rewrite —f8a1310and all later commits remain recoverable in history. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
40 lines
998 B
PHP
40 lines
998 B
PHP
<?php
|
|
|
|
namespace App\Livewire;
|
|
|
|
use Livewire\Component;
|
|
use App\Models\Phase;
|
|
|
|
class PhaseProgress extends Component
|
|
{
|
|
public Phase $phase;
|
|
public $progress;
|
|
public $comment = '';
|
|
|
|
public function mount(Phase $phase)
|
|
{
|
|
$this->phase = $phase->load('progressUpdates');
|
|
$this->progress = $phase->progress_percent;
|
|
}
|
|
|
|
public function updateProgressManual()
|
|
{
|
|
$this->validate(['progress' => 'required|integer|min:0|max:100']);
|
|
$this->phase->progress_percent = $this->progress;
|
|
$this->phase->save();
|
|
|
|
$this->phase->progressUpdates()->create([
|
|
'user_id' => auth()->id(),
|
|
'progress_percent' => $this->progress,
|
|
'comment' => $this->comment,
|
|
]);
|
|
|
|
$this->dispatch('progressUpdated', $this->phase->id, $this->progress);
|
|
session()->flash('message', 'Progreso actualizado');
|
|
}
|
|
|
|
public function render()
|
|
{
|
|
return view('livewire.phase-progress');
|
|
}
|
|
} |