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

Prevent header errors in most conditions #109

Closed
wants to merge 3 commits into from

Conversation

margarizaldi
Copy link
Contributor

@margarizaldi margarizaldi commented Mar 17, 2024

This fix is intended to address some inconveniences that cause errors:

  • The use of headers() is now optional.
  • We can define only what we need (fill the array with nulls to adjust the column position).
  • We can define as array of strings to change the labels.
  • This is not a breaking change and has been manually tested.
TableRepeater::make('childrens')
    ->headers([
        null,
        Header::make('Agent Code')->align('center'),
        'Registered at',
    ])
    ->schema([
        TextInput::make('name'),
        TextInput::make('code'),
        TextInput::make('created_at'),
        TextInput::make('updated_at'),
    ])

@margarizaldi
Copy link
Contributor Author

will check the test failure soon

@awcodes
Copy link
Owner

awcodes commented Mar 20, 2024

There is going to have to be a lot more checks in the getHeaders() method. See the 2.x branch. This is why it was changed in v3 to make it more explicit.

@margarizaldi
Copy link
Contributor Author

Hi @awcodes, yes indeed, I've been using this plugin since v2. If that's your concern, I really appreciate that.

I was just thinking that filament itself does a lot of checks to just work, so adding a couple more checks won't make any noticeable impact. And similar to our experience in creating filament table.

The decision is yours after all...

@awcodes awcodes closed this Apr 1, 2024
@margarizaldi margarizaldi deleted the fix-header-error branch April 1, 2024 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants