Move save buttons to the top.

This commit is contained in:
notCharles 2024-05-13 19:58:01 -04:00
parent 68195ab0b7
commit 35ac1f863a
5 changed files with 21 additions and 5 deletions

View File

@ -206,9 +206,15 @@ class EditEgg extends EditRecord
->color('primary') ->color('primary')
// TODO uses old admin panel export service // TODO uses old admin panel export service
->url(fn (Egg $egg): string => route('admin.eggs.export', ['egg' => $egg['id']])), ->url(fn (Egg $egg): string => route('admin.eggs.export', ['egg' => $egg['id']])),
$this->getSaveFormAction()->formId('form'),
]; ];
} }
protected function getFormActions(): array
{
return [];
}
public function getRelationManagers(): array public function getRelationManagers(): array
{ {
return [ return [

View File

@ -2,7 +2,6 @@
namespace App\Filament\Resources\EggResource\RelationManagers; namespace App\Filament\Resources\EggResource\RelationManagers;
use App\Filament\Resources\EggResource;
use App\Models\Server; use App\Models\Server;
use Filament\Resources\RelationManagers\RelationManager; use Filament\Resources\RelationManagers\RelationManager;
use Filament\Tables; use Filament\Tables;

View File

@ -98,6 +98,12 @@ class EditMount extends EditRecord
{ {
return [ return [
Actions\DeleteAction::make(), Actions\DeleteAction::make(),
$this->getSaveFormAction()->formId('form'),
]; ];
} }
protected function getFormActions(): array
{
return [];
}
} }

View File

@ -191,18 +191,17 @@ class EditNode extends EditRecord
return $data; return $data;
} }
protected function getSteps(): array protected function getFormActions(): array
{ {
return [ return [];
];
} }
protected function getHeaderActions(): array protected function getHeaderActions(): array
{ {
return [ return [
Actions\DeleteAction::make() Actions\DeleteAction::make()
->disabled(fn (Node $node) => $node->servers()->count() > 0) ->disabled(fn (Node $node) => $node->servers()->count() > 0)
->label(fn (Node $node) => $node->servers()->count() > 0 ? 'Node Has Servers' : 'Delete'), ->label(fn (Node $node) => $node->servers()->count() > 0 ? 'Node Has Servers' : 'Delete'),
$this->getSaveFormAction()->formId('form'),
]; ];
} }

View File

@ -67,6 +67,12 @@ class EditUser extends EditRecord
{ {
return [ return [
Actions\DeleteAction::make(), Actions\DeleteAction::make(),
$this->getSaveFormAction()->formId('form'),
]; ];
} }
protected function getFormActions(): array
{
return [];
}
} }