From 121a16bd798e43e0a321c68d161459a829265c9a Mon Sep 17 00:00:00 2001 From: salam Date: Sat, 31 Oct 2026 20:53:36 +0100 Subject: [PATCH] wip --- app/Filament/Pages/PlayerProps.php | 9 +++++---- app/Filament/Widgets/PlayerPropsDrop.php | 1 + app/Traits/PlayerProps/PlayerQuery.php | 4 ++-- ...m-lockout.blade.php => calculation-spinner.blade.php} | 0 4 files changed, 8 insertions(+), 6 deletions(-) rename resources/views/components/{form-lockout.blade.php => calculation-spinner.blade.php} (100%) diff --git a/app/Filament/Pages/PlayerProps.php b/app/Filament/Pages/PlayerProps.php index c7ad2985..d2361d18 100644 --- a/app/Filament/Pages/PlayerProps.php +++ b/app/Filament/Pages/PlayerProps.php @@ -103,7 +103,7 @@ class PlayerProps extends Page implements HasForms $this->sliderValue(), $this->selectSeason(), $this->dateSplitter(), - View::make('components.form-lockout'), + View::make('components.calculation-spinner'), ]) ->extraAttributes([ 'wire:loading.class' => 'opacity-60 pointer-events-none transition-opacity', @@ -325,11 +325,11 @@ class PlayerProps extends Page implements HasForms $set('mid', null); $set('tid', null); $this->dispatch('clear-all'); - $this->setSeason($state); + $this->setSeasonMode($state); }); } - public function setSeason(string $country_id) + public function setSeasonMode(string $country_id) { $this->season_mode = SofaScoreCategory::where('id', $country_id)->value('season_mode'); $this->dispatch('season_mode-update', season_mode: $this->season_mode); @@ -410,7 +410,8 @@ class PlayerProps extends Page implements HasForms }) ->afterStateUpdated(function (callable $set, $state) { $set('ss_player_id', null); - $this->dispatch('season_selected-update', season_selected: $state); + // cat all values in array to strings + $this->dispatch('season_selected-update', season_selected: array_map('strval', $state)); }); } diff --git a/app/Filament/Widgets/PlayerPropsDrop.php b/app/Filament/Widgets/PlayerPropsDrop.php index 4bec5996..b13a0f4f 100644 --- a/app/Filament/Widgets/PlayerPropsDrop.php +++ b/app/Filament/Widgets/PlayerPropsDrop.php @@ -235,6 +235,7 @@ class PlayerPropsDrop extends Widget public function setSeasonSelected(array $season_selected) { $this->season_selected = $season_selected; + if ($this->player_on_field_counter >= 10) { $this->calculateAspg(); } diff --git a/app/Traits/PlayerProps/PlayerQuery.php b/app/Traits/PlayerProps/PlayerQuery.php index b9d2d438..9239d92b 100644 --- a/app/Traits/PlayerProps/PlayerQuery.php +++ b/app/Traits/PlayerProps/PlayerQuery.php @@ -6,6 +6,7 @@ use App\Models\StatistikoDetail; use App\Models\StatistikoEvent; use App\Models\StatistikoPlayer; use Illuminate\Support\Carbon; +use Illuminate\Support\Facades\Log; trait PlayerQuery { @@ -21,10 +22,9 @@ trait PlayerQuery case 'season': if (! $this->season_selected) { $this->season_selected = $this->getCurrentSeason(); - // dd($this->liga_id, $this->season_selected); } - // Log::debug('season_selected', [$this->liga_id, $this->season_selected]); + Log::debug('season_selected', $this->season_selected); $matches_ids = match ($part) { 1 => StatistikoEvent::where('league_id', $this->liga_id) diff --git a/resources/views/components/form-lockout.blade.php b/resources/views/components/calculation-spinner.blade.php similarity index 100% rename from resources/views/components/form-lockout.blade.php rename to resources/views/components/calculation-spinner.blade.php