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

canRun() only disables the first action of the list #6154

Closed
salvisb opened this issue Jan 19, 2024 · 3 comments
Closed

canRun() only disables the first action of the list #6154

salvisb opened this issue Jan 19, 2024 · 3 comments
Labels
bug Verified bug by the Nova team fix incoming A fix is in review

Comments

@salvisb
Copy link

salvisb commented Jan 19, 2024

  • Laravel Version: 10.40.0
  • Nova Version: 4.32.11
  • PHP Version: 8.2
  • Browser type and version: Google Chrome Version 120.0.6099.216 (Official Build) (arm64)

Description:

Let's say I have three actions and all of them have canRun() defined on them with a return value of "false". canSee() is not defined on any of them. The first issue is that on the detail view only the first action in the list is disabled (grayed out). Rest of the actions are displayed as active and are clickable. If I were to comment out the first action, then the next action will become disabled. And the second issue is in the index view, canRun() method instead of disabling actions hides them (i.e. behavior is not consistent with the detail view).

Detailed steps to reproduce the issue on a fresh Nova installation:

  1. Create three actions and register them on a resource.
  2. Define canRun() method on all of them and make it return "false".
  3. Observe the result in a detail and index view.
@salvisb
Copy link
Author

salvisb commented Jan 23, 2024

Just in case here is a reproduction repository https://github.com/jbumaniss/nova-app/pull/1/files

@crynobone crynobone added fix incoming A fix is in review bug Verified bug by the Nova team labels Feb 12, 2024
@crynobone
Copy link
Member

This has been fix and will be available in the next release.

Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Verified bug by the Nova team fix incoming A fix is in review
Projects
None yet
Development

No branches or pull requests

2 participants