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

[Bug]: Actions are not configurable #29

Open
CodeWithDennis opened this issue May 30, 2024 · 0 comments
Open

[Bug]: Actions are not configurable #29

CodeWithDennis opened this issue May 30, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@CodeWithDennis
Copy link

CodeWithDennis commented May 30, 2024

What happened?

Actions are not configurable

How to reproduce the bug

When trying to configure actions, such as the edit action, it doesn't seem to work.

For example, using:

AdjacencyList::make('descendants')
    ->label('Subcategories')
    ->editAction(fn(Action $action) => $action->slideOver())
    ->labelKey('name')
    ->relationship('descendants')
    ->form([
        Forms\Components\TextInput::make('name')
            ->required(),
    ]),

Doesn't seem to apply the slideOver() method correctly. However, if you manually add slideOver() to the action in the source code, it works, indicating that something is off with how the configurations are passed through. This issue occurs for all actions.

Here's the relevant source code:

public function getEditAction(): Actions\Action
{
    $action = Actions\EditAction::make()->slideOver(); // Testing here works
    if ($this->modifyEditActionUsing) {
        $action = $this->evaluate($this->modifyEditActionUsing, [
            'action' => $action,
        ]) ?? $action;
    }
    return $action;
}

It seems the configuration isn't being applied as expected when using the method to modify the edit action.

Package Version

v1.22

PHP Version

v8.3.4

Laravel Version

v11.9.2

Which operating systems does with happen with?

macOS

Notes

No response

@CodeWithDennis CodeWithDennis added the bug Something isn't working label May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant