mirror of
https://github.com/filamentphp/filament.git
synced 2026-09-24 15:42:09 +08:00
Merge pull request #16875 from nnnnnnnngu/fix/requires-confirmation-overwrites-original-submit-action-label
♻️ require confirmation before setting label in actions
This commit is contained in:
@@ -19,6 +19,8 @@ class DeleteAction extends Action
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
$this->requiresConfirmation();
|
||||
|
||||
$this->label(__('filament-actions::delete.single.label'));
|
||||
|
||||
$this->modalHeading(fn (): string => __('filament-actions::delete.single.modal.heading', ['label' => $this->getRecordTitle()]));
|
||||
@@ -31,8 +33,6 @@ class DeleteAction extends Action
|
||||
|
||||
$this->groupedIcon(FilamentIcon::resolve('actions::delete-action.grouped') ?? 'heroicon-m-trash');
|
||||
|
||||
$this->requiresConfirmation();
|
||||
|
||||
$this->modalIcon(FilamentIcon::resolve('actions::delete-action.modal') ?? 'heroicon-o-trash');
|
||||
|
||||
$this->keyBindings(['mod+d']);
|
||||
|
||||
@@ -19,6 +19,8 @@ class ForceDeleteAction extends Action
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
$this->requiresConfirmation();
|
||||
|
||||
$this->label(__('filament-actions::force-delete.single.label'));
|
||||
|
||||
$this->modalHeading(fn (): string => __('filament-actions::force-delete.single.modal.heading', ['label' => $this->getRecordTitle()]));
|
||||
@@ -29,8 +31,6 @@ class ForceDeleteAction extends Action
|
||||
|
||||
$this->groupedIcon(FilamentIcon::resolve('actions::force-delete-action.grouped') ?? 'heroicon-m-trash');
|
||||
|
||||
$this->requiresConfirmation();
|
||||
|
||||
$this->modalIcon(FilamentIcon::resolve('actions::force-delete-action.modal') ?? 'heroicon-o-trash');
|
||||
|
||||
$this->action(function (): void {
|
||||
|
||||
@@ -19,6 +19,8 @@ class RestoreAction extends Action
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
$this->requiresConfirmation();
|
||||
|
||||
$this->label(__('filament-actions::restore.single.label'));
|
||||
|
||||
$this->modalHeading(fn (): string => __('filament-actions::restore.single.modal.heading', ['label' => $this->getRecordTitle()]));
|
||||
@@ -31,8 +33,6 @@ class RestoreAction extends Action
|
||||
|
||||
$this->groupedIcon(FilamentIcon::resolve('actions::restore-action.grouped') ?? 'heroicon-m-arrow-uturn-left');
|
||||
|
||||
$this->requiresConfirmation();
|
||||
|
||||
$this->modalIcon(FilamentIcon::resolve('actions::restore-action.modal') ?? 'heroicon-o-arrow-uturn-left');
|
||||
|
||||
$this->action(function (Model $record): void {
|
||||
|
||||
@@ -19,6 +19,8 @@ class DeleteAction extends Action
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
$this->requiresConfirmation();
|
||||
|
||||
$this->label(__('filament-actions::delete.single.label'));
|
||||
|
||||
$this->modalHeading(fn (): string => __('filament-actions::delete.single.modal.heading', ['label' => $this->getRecordTitle()]));
|
||||
@@ -31,8 +33,6 @@ class DeleteAction extends Action
|
||||
|
||||
$this->icon(FilamentIcon::resolve('actions::delete-action') ?? 'heroicon-m-trash');
|
||||
|
||||
$this->requiresConfirmation();
|
||||
|
||||
$this->modalIcon(FilamentIcon::resolve('actions::delete-action.modal') ?? 'heroicon-o-trash');
|
||||
|
||||
$this->hidden(static function (Model $record): bool {
|
||||
|
||||
@@ -22,6 +22,8 @@ class DeleteBulkAction extends BulkAction
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
$this->requiresConfirmation();
|
||||
|
||||
$this->label(__('filament-actions::delete.multiple.label'));
|
||||
|
||||
$this->modalHeading(fn (): string => __('filament-actions::delete.multiple.modal.heading', ['label' => $this->getPluralModelLabel()]));
|
||||
@@ -34,8 +36,6 @@ class DeleteBulkAction extends BulkAction
|
||||
|
||||
$this->icon(FilamentIcon::resolve('actions::delete-action') ?? 'heroicon-m-trash');
|
||||
|
||||
$this->requiresConfirmation();
|
||||
|
||||
$this->modalIcon(FilamentIcon::resolve('actions::delete-action.modal') ?? 'heroicon-o-trash');
|
||||
|
||||
$this->action(function (): void {
|
||||
|
||||
@@ -21,6 +21,8 @@ class DetachAction extends Action
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
$this->requiresConfirmation();
|
||||
|
||||
$this->label(__('filament-actions::detach.single.label'));
|
||||
|
||||
$this->modalHeading(fn (): string => __('filament-actions::detach.single.modal.heading', ['label' => $this->getRecordTitle()]));
|
||||
@@ -33,8 +35,6 @@ class DetachAction extends Action
|
||||
|
||||
$this->icon(FilamentIcon::resolve('actions::detach-action') ?? 'heroicon-m-x-mark');
|
||||
|
||||
$this->requiresConfirmation();
|
||||
|
||||
$this->modalIcon(FilamentIcon::resolve('actions::detach-action.modal') ?? 'heroicon-o-x-mark');
|
||||
|
||||
$this->action(function (): void {
|
||||
|
||||
@@ -22,6 +22,8 @@ class DetachBulkAction extends BulkAction
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
$this->requiresConfirmation();
|
||||
|
||||
$this->label(__('filament-actions::detach.multiple.label'));
|
||||
|
||||
$this->modalHeading(fn (): string => __('filament-actions::detach.multiple.modal.heading', ['label' => $this->getPluralModelLabel()]));
|
||||
@@ -34,8 +36,6 @@ class DetachBulkAction extends BulkAction
|
||||
|
||||
$this->icon(FilamentIcon::resolve('actions::detach-action') ?? 'heroicon-m-x-mark');
|
||||
|
||||
$this->requiresConfirmation();
|
||||
|
||||
$this->modalIcon(FilamentIcon::resolve('actions::detach-action.modal') ?? 'heroicon-o-x-mark');
|
||||
|
||||
$this->action(function (): void {
|
||||
|
||||
@@ -21,6 +21,8 @@ class DissociateAction extends Action
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
$this->requiresConfirmation();
|
||||
|
||||
$this->label(__('filament-actions::dissociate.single.label'));
|
||||
|
||||
$this->modalHeading(fn (): string => __('filament-actions::dissociate.single.modal.heading', ['label' => $this->getRecordTitle()]));
|
||||
@@ -33,8 +35,6 @@ class DissociateAction extends Action
|
||||
|
||||
$this->icon(FilamentIcon::resolve('actions::dissociate-action') ?? 'heroicon-m-x-mark');
|
||||
|
||||
$this->requiresConfirmation();
|
||||
|
||||
$this->modalIcon(FilamentIcon::resolve('actions::dissociate-action.modal') ?? 'heroicon-o-x-mark');
|
||||
|
||||
$this->action(function (): void {
|
||||
|
||||
@@ -22,6 +22,8 @@ class DissociateBulkAction extends BulkAction
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
$this->requiresConfirmation();
|
||||
|
||||
$this->label(__('filament-actions::dissociate.multiple.label'));
|
||||
|
||||
$this->modalHeading(fn (): string => __('filament-actions::dissociate.multiple.modal.heading', ['label' => $this->getPluralModelLabel()]));
|
||||
@@ -34,8 +36,6 @@ class DissociateBulkAction extends BulkAction
|
||||
|
||||
$this->icon(FilamentIcon::resolve('actions::dissociate-action') ?? 'heroicon-m-x-mark');
|
||||
|
||||
$this->requiresConfirmation();
|
||||
|
||||
$this->modalIcon(FilamentIcon::resolve('actions::dissociate-action.modal') ?? 'heroicon-o-x-mark');
|
||||
|
||||
$this->action(function (): void {
|
||||
|
||||
@@ -19,6 +19,8 @@ class ForceDeleteAction extends Action
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
$this->requiresConfirmation();
|
||||
|
||||
$this->label(__('filament-actions::force-delete.single.label'));
|
||||
|
||||
$this->modalHeading(fn (): string => __('filament-actions::force-delete.single.modal.heading', ['label' => $this->getRecordTitle()]));
|
||||
@@ -31,8 +33,6 @@ class ForceDeleteAction extends Action
|
||||
|
||||
$this->icon(FilamentIcon::resolve('actions::force-delete-action') ?? 'heroicon-m-trash');
|
||||
|
||||
$this->requiresConfirmation();
|
||||
|
||||
$this->modalIcon(FilamentIcon::resolve('actions::force-delete-action.modal') ?? 'heroicon-o-trash');
|
||||
|
||||
$this->action(function (): void {
|
||||
|
||||
@@ -22,6 +22,8 @@ class ForceDeleteBulkAction extends BulkAction
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
$this->requiresConfirmation();
|
||||
|
||||
$this->label(__('filament-actions::force-delete.multiple.label'));
|
||||
|
||||
$this->modalHeading(fn (): string => __('filament-actions::force-delete.multiple.modal.heading', ['label' => $this->getPluralModelLabel()]));
|
||||
@@ -34,8 +36,6 @@ class ForceDeleteBulkAction extends BulkAction
|
||||
|
||||
$this->icon(FilamentIcon::resolve('actions::force-delete-action') ?? 'heroicon-m-trash');
|
||||
|
||||
$this->requiresConfirmation();
|
||||
|
||||
$this->modalIcon(FilamentIcon::resolve('actions::force-delete-action.modal') ?? 'heroicon-o-trash');
|
||||
|
||||
$this->action(function (): void {
|
||||
|
||||
@@ -19,6 +19,8 @@ class RestoreAction extends Action
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
$this->requiresConfirmation();
|
||||
|
||||
$this->label(__('filament-actions::restore.single.label'));
|
||||
|
||||
$this->modalHeading(fn (): string => __('filament-actions::restore.single.modal.heading', ['label' => $this->getRecordTitle()]));
|
||||
@@ -31,8 +33,6 @@ class RestoreAction extends Action
|
||||
|
||||
$this->icon(FilamentIcon::resolve('actions::restore-action') ?? 'heroicon-m-arrow-uturn-left');
|
||||
|
||||
$this->requiresConfirmation();
|
||||
|
||||
$this->modalIcon(FilamentIcon::resolve('actions::restore-action.modal') ?? 'heroicon-o-arrow-uturn-left');
|
||||
|
||||
$this->action(function (Model $record): void {
|
||||
|
||||
@@ -22,6 +22,8 @@ class RestoreBulkAction extends BulkAction
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
$this->requiresConfirmation();
|
||||
|
||||
$this->label(__('filament-actions::restore.multiple.label'));
|
||||
|
||||
$this->modalHeading(fn (): string => __('filament-actions::restore.multiple.modal.heading', ['label' => $this->getPluralModelLabel()]));
|
||||
@@ -34,8 +36,6 @@ class RestoreBulkAction extends BulkAction
|
||||
|
||||
$this->icon(FilamentIcon::resolve('actions::restore-action') ?? 'heroicon-m-arrow-uturn-left');
|
||||
|
||||
$this->requiresConfirmation();
|
||||
|
||||
$this->modalIcon(FilamentIcon::resolve('actions::restore-action.modal') ?? 'heroicon-o-arrow-uturn-left');
|
||||
|
||||
$this->action(function (): void {
|
||||
|
||||
Reference in New Issue
Block a user