Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prebuilt Actions - Global Settings is not working #14003

Closed
dharen008 opened this issue Aug 20, 2024 · 4 comments
Closed

Prebuilt Actions - Global Settings is not working #14003

dharen008 opened this issue Aug 20, 2024 · 4 comments
Labels

Comments

@dharen008
Copy link

dharen008 commented Aug 20, 2024

Package

filament/filament

Package Version

3.1

Laravel Version

11

Livewire Version

3

PHP Version

8.2

Problem description

There are a few functions that are not working in the global settings within the AppServiceProvider boot method.

We tested it on the following actions: DeleteAction, RestoreAction, ForceDeleteAction, AttachAction, DetachAction, DeleteBulkAction, RestoreBulkAction, and ForceDeleteBulkAction. None of these actions are functioning as expected, and there may be other functions that are also not working.

This is just one example. For more examples of other Prebuilt Actions, you can check my demo repository.

DeleteAction::configureUsing( function ( DeleteAction $deleteAction ): void {
$deleteAction
->successNotificationTitle( 'Custom Title' )
->successNotification( fn () => dump( 'Custom Notification' ) )
->modalHeading( 'Custom heading' )
->modalDescription( 'Custom description' );
} );

Expected behavior

Global settings for Prebuilt Actions should be working as expected. Please check other functions as well, beyond those I've provided in my demo repository.

Steps to reproduce

Check my demo repository in AppServiceProvider and try the Prebuilt Actions on the Country resource. They will not work as expected.

Reproduction repository (issue will be closed if this is not valid)

https://github.com/dharen008/demo

Relevant log output

No response

Donate 💰 to fund this issue

  • You can donate funding to this issue. We receive the money once the issue is completed & confirmed by you.
  • 100% of the funding will be distributed between the Filament core team to run all aspects of the project.
  • Thank you in advance for helping us make maintenance sustainable!
Fund with Polar
@danharrin
Copy link
Member

try isImportant: true on the configureUsing() to override what happens in the setUp() method

@danharrin danharrin closed this as not planned Won't fix, can't repro, duplicate, stale Aug 21, 2024
@dharen008
Copy link
Author

dharen008 commented Aug 21, 2024

Thanks @danharrin! This works! Hopefully, there will be documentation about this in the panel builder in the future.

I'm curious about the $during function. Would it be possible to provide an example of how to use it?

Actions\DetachAction::configureUsing( function ( DetachAction $detachAction ): void {
	$detachAction
		->modalHeading( 'Custom heading' )
		->modalDescription( 'Custom description' );
}, null, true );

@danharrin
Copy link
Member

it applies the configurations only for the duration of the function, and then reverts them

@dharen008
Copy link
Author

Noted, ill just try to figure it out how it works, anyway many thanks for the help! good job on filament by the way!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

No branches or pull requests

2 participants