This commit is contained in:
salam committed 2025-12-28 08:26:49 +01:00
1 parent 75d30353fc
commit 80f50c9eec
11 files changed
+117 -114

No files matched your search

-61
View File
@@ -1,61 +0,0 @@
<?php
namespace App\Livewire;
use Filament\Actions\Concerns\InteractsWithActions;
use Filament\Actions\Contracts\HasActions;
use Filament\Schemas\Concerns\InteractsWithSchemas;
use Filament\Schemas\Contracts\HasSchemas;
use Filament\Tables\Columns\IconColumn;
use Filament\Tables\Columns\TextColumn;
use Filament\Tables\Concerns\InteractsWithTable;
use Filament\Tables\Contracts\HasTable;
use Filament\Tables\Table;
use Livewire\Component;
class MapChecker extends Component implements HasActions, HasSchemas, HasTable
{
use InteractsWithActions;
use InteractsWithSchemas;
use InteractsWithTable;
public $match_id = 0;
public $event_id = 0;
public function table(Table $table): Table
{
return $table
->records(fn (): array => [
1 => [
'title' => 'First item ',
'slug' => 'first-item',
'is_featured' => true,
],
2 => [
'title' => 'Second item',
'slug' => 'second-item',
'is_featured' => false,
],
3 => [
'title' => 'Third item',
'slug' => 'third-item',
'is_featured' => true,
],
])
->columns([
TextColumn::make('title')->label($this->match_id),
TextColumn::make('slug'),
IconColumn::make('is_featured')
->boolean(),
])
->recordActions([
// ...
]);
}
public function render()
{
return view('livewire.mapchecker');
}
}
+21
View File
@@ -4,10 +4,13 @@ namespace App\Livewire;
use App\Filament\Tables\Columns\MapperLeftColumn;
use App\Models\Event;
use App\Models\Mapper;
use Filament\Actions\Action;
use Filament\Actions\Concerns\InteractsWithActions;
use Filament\Actions\Contracts\HasActions;
use Filament\Schemas\Concerns\InteractsWithSchemas;
use Filament\Schemas\Contracts\HasSchemas;
use Filament\Support\Enums\Alignment;
use Filament\Tables\Concerns\InteractsWithTable;
use Filament\Tables\Contracts\HasTable;
use Filament\Tables\Table;
@@ -38,6 +41,24 @@ class MapperLeft extends Component implements HasActions, HasSchemas, HasTable
]);
}
public function leftAction(): Action
{
return Action::make('left')
->modalHeading('Event Mapper')
->modalContent(function (array $arguments) {
$event = Event::where('id', $arguments['match_id'])->first();
$mapper = Mapper::where('event_id', $arguments['event_id'])->first();
return view('livewire.confirm-mapping', ['event' => $event, 'mapper' => $mapper, 'mappermode' => 'linear']);
})
->modalAlignment(Alignment::Center)
->modalFooterActionsAlignment(Alignment::Center)
->modalWidth('2xl')
->modalSubmitActionLabel('Confirm')
->modalSubmitAction();
}
public function render()
{
return view('livewire.mapper-left');
+20 -1
View File
@@ -3,11 +3,14 @@
namespace App\Livewire;
use App\Filament\Tables\Columns\MapperRightColumn;
use App\Models\Event;
use App\Models\Mapper;
use Filament\Actions\Action;
use Filament\Actions\Concerns\InteractsWithActions;
use Filament\Actions\Contracts\HasActions;
use Filament\Schemas\Concerns\InteractsWithSchemas;
use Filament\Schemas\Contracts\HasSchemas;
use Filament\Support\Enums\Alignment;
use Filament\Tables\Concerns\InteractsWithTable;
use Filament\Tables\Contracts\HasTable;
use Filament\Tables\Table;
@@ -34,10 +37,26 @@ class MapperRight extends Component implements HasActions, HasSchemas, HasTable
// ...
])
->toolbarActions([
// ...
]);
}
public function rightAction(): Action
{
return Action::make('right')
->modalHeading('Event Mapper')
->modalContent(function (array $arguments) {
$event = Event::where('id', $arguments['match_id'])->first();
$mapper = Mapper::where('event_id', $arguments['event_id'])->first();
return view('livewire.confirm-mapping', ['event' => $event, 'mapper' => $mapper, 'mappermode' => 'linear']);
})
->modalAlignment(Alignment::Center)
->modalFooterActionsAlignment(Alignment::Center)
->modalWidth('2xl')
->modalSubmitActionLabel('Confirm')
->modalSubmitAction();
}
public function render()
{
return view('livewire.mapper-left');
Generated
+35 -35
View File
@@ -2007,24 +2007,24 @@
},
{
"name": "graham-campbell/result-type",
"version": "v1.1.3",
"version": "v1.1.4",
"source": {
"type": "git",
"url": "https://github.com/GrahamCampbell/Result-Type.git",
"reference": "3ba905c11371512af9d9bdd27d99b782216b6945"
"reference": "e01f4a821471308ba86aa202fed6698b6b695e3b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/3ba905c11371512af9d9bdd27d99b782216b6945",
"reference": "3ba905c11371512af9d9bdd27d99b782216b6945",
"url": "https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/e01f4a821471308ba86aa202fed6698b6b695e3b",
"reference": "e01f4a821471308ba86aa202fed6698b6b695e3b",
"shasum": ""
},
"require": {
"php": "^7.2.5 || ^8.0",
"phpoption/phpoption": "^1.9.3"
"phpoption/phpoption": "^1.9.5"
},
"require-dev": {
"phpunit/phpunit": "^8.5.39 || ^9.6.20 || ^10.5.28"
"phpunit/phpunit": "^8.5.41 || ^9.6.22 || ^10.5.45 || ^11.5.7"
},
"type": "library",
"autoload": {
@@ -2053,7 +2053,7 @@
],
"support": {
"issues": "https://github.com/GrahamCampbell/Result-Type/issues",
"source": "https://github.com/GrahamCampbell/Result-Type/tree/v1.1.3"
"source": "https://github.com/GrahamCampbell/Result-Type/tree/v1.1.4"
},
"funding": [
{
@@ -2065,7 +2065,7 @@
"type": "tidelift"
}
],
"time": "2024-07-20T21:45:45+00:00"
"time": "2025-12-27T19:43:20+00:00"
},
{
"name": "guzzlehttp/guzzle",
@@ -3348,16 +3348,16 @@
},
{
"name": "league/csv",
"version": "9.27.1",
"version": "9.28.0",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/csv.git",
"reference": "26de738b8fccf785397d05ee2fc07b6cd8749797"
"reference": "6582ace29ae09ba5b07049d40ea13eb19c8b5073"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/csv/zipball/26de738b8fccf785397d05ee2fc07b6cd8749797",
"reference": "26de738b8fccf785397d05ee2fc07b6cd8749797",
"url": "https://api.github.com/repos/thephpleague/csv/zipball/6582ace29ae09ba5b07049d40ea13eb19c8b5073",
"reference": "6582ace29ae09ba5b07049d40ea13eb19c8b5073",
"shasum": ""
},
"require": {
@@ -3367,14 +3367,14 @@
"require-dev": {
"ext-dom": "*",
"ext-xdebug": "*",
"friendsofphp/php-cs-fixer": "^3.75.0",
"phpbench/phpbench": "^1.4.1",
"phpstan/phpstan": "^1.12.27",
"friendsofphp/php-cs-fixer": "^3.92.3",
"phpbench/phpbench": "^1.4.3",
"phpstan/phpstan": "^1.12.32",
"phpstan/phpstan-deprecation-rules": "^1.2.1",
"phpstan/phpstan-phpunit": "^1.4.2",
"phpstan/phpstan-strict-rules": "^1.6.2",
"phpunit/phpunit": "^10.5.16 || ^11.5.22 || ^12.3.6",
"symfony/var-dumper": "^6.4.8 || ^7.3.0"
"phpunit/phpunit": "^10.5.16 || ^11.5.22 || ^12.5.4",
"symfony/var-dumper": "^6.4.8 || ^7.4.0 || ^8.0"
},
"suggest": {
"ext-dom": "Required to use the XMLConverter and the HTMLConverter classes",
@@ -3435,7 +3435,7 @@
"type": "github"
}
],
"time": "2025-10-25T08:35:20+00:00"
"time": "2025-12-27T15:18:42+00:00"
},
{
"name": "league/flysystem",
@@ -4908,16 +4908,16 @@
},
{
"name": "phpoption/phpoption",
"version": "1.9.4",
"version": "1.9.5",
"source": {
"type": "git",
"url": "https://github.com/schmittjoh/php-option.git",
"reference": "638a154f8d4ee6a5cfa96d6a34dfbe0cffa9566d"
"reference": "75365b91986c2405cf5e1e012c5595cd487a98be"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/schmittjoh/php-option/zipball/638a154f8d4ee6a5cfa96d6a34dfbe0cffa9566d",
"reference": "638a154f8d4ee6a5cfa96d6a34dfbe0cffa9566d",
"url": "https://api.github.com/repos/schmittjoh/php-option/zipball/75365b91986c2405cf5e1e012c5595cd487a98be",
"reference": "75365b91986c2405cf5e1e012c5595cd487a98be",
"shasum": ""
},
"require": {
@@ -4967,7 +4967,7 @@
],
"support": {
"issues": "https://github.com/schmittjoh/php-option/issues",
"source": "https://github.com/schmittjoh/php-option/tree/1.9.4"
"source": "https://github.com/schmittjoh/php-option/tree/1.9.5"
},
"funding": [
{
@@ -4979,7 +4979,7 @@
"type": "tidelift"
}
],
"time": "2025-08-21T11:53:16+00:00"
"time": "2025-12-27T19:41:33+00:00"
},
{
"name": "pragmarx/google2fa",
@@ -9055,26 +9055,26 @@
},
{
"name": "vlucas/phpdotenv",
"version": "v5.6.2",
"version": "v5.6.3",
"source": {
"type": "git",
"url": "https://github.com/vlucas/phpdotenv.git",
"reference": "24ac4c74f91ee2c193fa1aaa5c249cb0822809af"
"reference": "955e7815d677a3eaa7075231212f2110983adecc"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/24ac4c74f91ee2c193fa1aaa5c249cb0822809af",
"reference": "24ac4c74f91ee2c193fa1aaa5c249cb0822809af",
"url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/955e7815d677a3eaa7075231212f2110983adecc",
"reference": "955e7815d677a3eaa7075231212f2110983adecc",
"shasum": ""
},
"require": {
"ext-pcre": "*",
"graham-campbell/result-type": "^1.1.3",
"graham-campbell/result-type": "^1.1.4",
"php": "^7.2.5 || ^8.0",
"phpoption/phpoption": "^1.9.3",
"symfony/polyfill-ctype": "^1.24",
"symfony/polyfill-mbstring": "^1.24",
"symfony/polyfill-php80": "^1.24"
"phpoption/phpoption": "^1.9.5",
"symfony/polyfill-ctype": "^1.26",
"symfony/polyfill-mbstring": "^1.26",
"symfony/polyfill-php80": "^1.26"
},
"require-dev": {
"bamarni/composer-bin-plugin": "^1.8.2",
@@ -9123,7 +9123,7 @@
],
"support": {
"issues": "https://github.com/vlucas/phpdotenv/issues",
"source": "https://github.com/vlucas/phpdotenv/tree/v5.6.2"
"source": "https://github.com/vlucas/phpdotenv/tree/v5.6.3"
},
"funding": [
{
@@ -9135,7 +9135,7 @@
"type": "tidelift"
}
],
"time": "2025-04-30T23:37:27+00:00"
"time": "2025-12-27T19:49:13+00:00"
},
{
"name": "voku/portable-ascii",
+8
View File
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="100%" height="100%" viewBox="0 0 3334 1667" version="1.1"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve"
xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
<path d="M2957.55,150.93c-17.008,-36.473 -60.428,-52.277 -96.901,-35.269l-2511.23,1171.01c-36.473,17.008 -52.277,60.427 -35.269,96.901l61.632,132.17c17.007,36.473 60.427,52.276 96.901,35.269l2511.23,-1171.01c36.474,-17.008 52.277,-60.428 35.269,-96.901l-61.631,-132.17Z" fill="currentColor"/>
<path d="M3019.18,1383.57c17.008,-36.474 1.205,-79.893 -35.269,-96.901l-2511.23,-1171.01c-36.474,-17.008 -79.894,-1.204 -96.901,35.269l-61.632,132.17c-17.008,36.473 -1.204,79.893 35.269,96.901l2511.23,1171.01c36.473,17.007 79.893,1.204 96.901,-35.269l61.631,-132.17Z" fill="currentColor"/>
</svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

+8
View File
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="100%" height="100%" viewBox="0 0 3334 1667" version="1.1"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve"
xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
<path d="M3125,135.417c0,-40.244 -32.673,-72.917 -72.917,-72.917l-2770.83,-0c-40.244,-0 -72.917,32.673 -72.917,72.917l0,145.833c0,40.244 32.673,72.917 72.917,72.917l2770.83,-0c40.244,-0 72.917,-32.673 72.917,-72.917l0,-145.833Z" fill="currentColor"/>
<path d="M3125,1385.42c0,-40.244 -32.673,-72.917 -72.917,-72.917l-2770.83,0c-40.244,0 -72.917,32.673 -72.917,72.917l0,145.833c0,40.244 32.673,72.917 72.917,72.917l2770.83,-0c40.244,-0 72.917,-32.673 72.917,-72.917l0,-145.833Z" fill="currentColor"/>
</svg>

After

Width:  |  Height:  |  Size: 972 B

@@ -9,11 +9,9 @@
x-on:drop.prevent="
const id = event.dataTransfer.getData('text/plain');
const target = event.target.closest('li');
{{-- console.log(document.getElementById(id).getAttribute('mapper'), id, target.id, target.getAttribute('mapper')); --}}
if(document.getElementById(id).getAttribute('mapper') !=target.getAttribute('mapper'))
$dispatch('mapchecker', { event_id: id, match_id:target.id });"
$wire.mountAction('left', { event_id: id, match_id: target.id });"
draggable="true" mapper="left">
{{-- @livewire('child', ['matchid' => id])" --}}
<div class="w-6 flex-none mx-auto my-auto">
@if ($record->country->iso2)
@@ -10,10 +10,10 @@
x-on:drop.prevent="
const id = event.dataTransfer.getData('text/plain');
const target = event.target.closest('li');
{{-- console.log(document.getElementById(id).getAttribute('mapper'), id, target.id, target.getAttribute('mapper'));" --}}
if(document.getElementById(id).getAttribute('mapper') !=target.getAttribute('mapper'))
$dispatch('mapchecker', { match_id: id, event_id:target.id });"
$wire.mountAction('right', { match_id: id, event_id: target.id });"
draggable="true" mapper="right">
{{-- console.log(document.getElementById(id).getAttribute('mapper'), id, target.id, target.getAttribute('mapper'));" --}}
{{-- $dispatch('map-checker', { match_id: id, event_id:target.id });" --}}
<div class="w-6 flex-none my-auto">
@@ -0,0 +1,22 @@
<div>
<div class="grid grid-cols-3 gap-4 text-center text-xl">
<div>{{ $event->home->name }}</div>
<div class="row-span-2 text-center py-auto">
<div x-data="{ open: false, toggle() { this.open = !this.open } }" x-init="open = true">
<x-filament::button color="gray" outlined @click="toggle()">
<div x-show="open">
<x-icon-paralell class="h-16 w-16 mx-auto" />
</div>
<div x-show="!open">
<x-icon-crossed class="h-16 w-16 mx-auto" />
</div>
</x-filament::button>
</div>
</div>
<div>{{ $mapper->home }}</div>
<div>{{ $event->away->name }}</div>
<div>{{ $mapper->away }}</div>
</div>
</div>
@@ -1,5 +0,0 @@
<div @mapchecker.window="console.log('match_id', $event.detail.match_id, 'event_id', $event.detail.event_id);">
{{ $this->table }}
</div>
{{-- @notify="alert($event.detail.message)" --}}
{{-- @wire.set --}}
@@ -30,13 +30,6 @@
</div>
</x-filament::modal>
{{-- START MAP CHECKER MODAL --}}
<x-filament::modal @mapchecker.window="isOpen = true">
@livewire('mapchecker', ['match_id' => $event . detail . match_id])
</x-filament::modal>
{{-- END MAP CHECKER MODAL --}}
<x-filament::dropdown class="mx-4">
<x-slot name="trigger">
<x-filament::button outlined icon="heroicon-o-adjustments-horizontal" color="gray">