Fix notifications for DeleteAction on EditEgg page (#2165)

This commit is contained in:
Boy132
2026-02-04 22:20:22 +01:00
committed by GitHub
parent 159bfe2210
commit 7a9deba0e1
2 changed files with 1 additions and 15 deletions

View File

@@ -450,17 +450,7 @@ class EditEgg extends EditRecord
return [ return [
DeleteAction::make() DeleteAction::make()
->disabled(fn (Egg $egg): bool => $egg->servers()->count() > 0) ->disabled(fn (Egg $egg): bool => $egg->servers()->count() > 0)
->tooltip(fn (Egg $egg): string => $egg->servers()->count() <= 0 ? trans('filament-actions::delete.single.label') : trans('admin/egg.in_use')) ->tooltip(fn (Egg $egg): string => $egg->servers()->count() <= 0 ? trans('filament-actions::delete.single.label') : trans('admin/egg.in_use')),
->successNotification(fn (Egg $egg) => Notification::make()
->success()
->title(trans('admin/egg.delete_success'))
->body(trans('admin/egg.deleted', ['egg' => $egg->name]))
)
->failureNotification(fn (Egg $egg) => Notification::make()
->danger()
->title(trans('admin/egg.delete_failed'))
->body(trans('admin/egg.could_not_delete', ['egg' => $egg->name]))
),
ExportEggAction::make(), ExportEggAction::make(),
ImportEggAction::make() ImportEggAction::make()
->multiple(false), ->multiple(false),

View File

@@ -115,10 +115,6 @@ return [
'no_update_url' => 'The following eggs do not have a working update URL set: :eggs', 'no_update_url' => 'The following eggs do not have a working update URL set: :eggs',
'cannot_delete' => 'Cannot delete :count egg(s)', 'cannot_delete' => 'Cannot delete :count egg(s)',
'eggs_have_servers' => 'The following eggs have servers and cannot be deleted: :eggs', 'eggs_have_servers' => 'The following eggs have servers and cannot be deleted: :eggs',
'delete_success' => 'Egg deleted successfully',
'deleted' => 'Deleted: :egg',
'delete_failed' => 'Failed to delete egg',
'could_not_delete' => 'Could not delete: :egg',
'updated_from' => 'Successfully updated from: :url', 'updated_from' => 'Successfully updated from: :url',
'update_error' => 'Error: :error', 'update_error' => 'Error: :error',
'updated_eggs' => 'Updated: :eggs', 'updated_eggs' => 'Updated: :eggs',