diff --git a/app/Livewire/MapChecker.php b/app/Livewire/MapChecker.php deleted file mode 100644 index 63d7581e..00000000 --- a/app/Livewire/MapChecker.php +++ /dev/null @@ -1,61 +0,0 @@ -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'); - } -} diff --git a/app/Livewire/MapperLeft.php b/app/Livewire/MapperLeft.php index ce06c1a1..99fdcf2a 100644 --- a/app/Livewire/MapperLeft.php +++ b/app/Livewire/MapperLeft.php @@ -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'); diff --git a/app/Livewire/MapperRight.php b/app/Livewire/MapperRight.php index 5f6e57b5..0f8bc281 100644 --- a/app/Livewire/MapperRight.php +++ b/app/Livewire/MapperRight.php @@ -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'); diff --git a/composer.lock b/composer.lock index de8e7119..78a36073 100644 --- a/composer.lock +++ b/composer.lock @@ -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", diff --git a/resources/svg/crossed.svg b/resources/svg/crossed.svg new file mode 100644 index 00000000..f9fa7d7f --- /dev/null +++ b/resources/svg/crossed.svg @@ -0,0 +1,8 @@ + + \ No newline at end of file diff --git a/resources/svg/paralell.svg b/resources/svg/paralell.svg new file mode 100644 index 00000000..183f0e96 --- /dev/null +++ b/resources/svg/paralell.svg @@ -0,0 +1,8 @@ + + \ No newline at end of file diff --git a/resources/views/filament/tables/columns/mapper-left-column.blade.php b/resources/views/filament/tables/columns/mapper-left-column.blade.php index 5f020842..c7c41445 100644 --- a/resources/views/filament/tables/columns/mapper-left-column.blade.php +++ b/resources/views/filament/tables/columns/mapper-left-column.blade.php @@ -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])" --}}