Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

No way to select an item in index when authorizedToDelete() = false and you have sole() actions. #6157

Closed
ekateiva opened this issue Jan 19, 2024 · 3 comments
Labels
needs more info More information is required

Comments

@ekateiva
Copy link

  • Laravel Version: 10.18.0
  • Nova Version: v4.26.4 (Silver Surfer)
  • PHP Version: 8.2.14
  • Browser type and version: Chrome 120.0.6099.216

Description:

I want to have sole() actions that I expect I could select from index. However, I also want the resource to be not deletable. When we have this scenario, there is no select checkboxes for the resources in the inde.

Screenshot 2024-01-19 at 15 28 38

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

  • In the resource, make an item not available to delete by authorizedToDelete() returning false.
  • Create an action for the resource as sole() action.

E.g.:

...

public function authorizedToDelete(Request $request): bool
{
    return false;
}

public function actions(NovaRequest $request): array
{
    return [
        SomeSoleAction::make()
            ->sole(),
    ];
}
...
@crynobone crynobone added the pending Issues that are pending triage label Feb 12, 2024
@crynobone
Copy link
Member

Unable to reproduce the issue, please provide full reproducing repository based on fresh installation as suggested in the bug report template (or you can refer to https://github.com/nova-issues for example)

@crynobone crynobone added needs more info More information is required and removed pending Issues that are pending triage labels Feb 25, 2024
ekateiva added a commit to ekateiva/laravel-nova-issue-6157 that referenced this issue Feb 29, 2024
@ekateiva
Copy link
Author

ekateiva commented Feb 29, 2024

Unable to reproduce the issue, please provide full reproducing repository based on fresh installation as suggested in the bug report template (or you can refer to https://github.com/nova-issues for example)

@crynobone
Please, see the repository, where I reproduce the issue: https://github.com/ekateiva/laravel-nova-issue-6157
I added there in README the information how to reproduce the issue.

Basically, this is the code that reproduces the issue:
https://github.com/ekateiva/laravel-nova-issue-6157/blob/main/app/Nova/OrderItem.php#L56-L74

Let me know if you need any more info, but it should be clear now.

@crynobone
Copy link
Member

This is something that can't easily be fixed without reducing the performance of Index page and I would suggest displaying "Sole" action to show as inline for now: https://nova.laravel.com/docs/actions/registering-actions.html#inline-actions

@laravel laravel locked and limited conversation to collaborators Mar 5, 2024
@crynobone crynobone converted this issue into discussion #6255 Mar 5, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
needs more info More information is required
Projects
None yet
Development

No branches or pull requests

2 participants