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

Update type definitions for RatingColumn::$width #20

Merged
merged 1 commit into from
Sep 5, 2024

Conversation

Tschucki
Copy link
Contributor

Description

Removed width Method:

  • The width method has been completely removed from Yepsua\Filament\Tables\Components\RatingColumn as it was redundant. The method is identical to the one provided in the base class through the HasWidth trait.

Updated Type Definitions:

  • Adjusted the type definitions for the $width property in Yepsua\Filament\Tables\Components\RatingColumn to ensure compatibility with the base class Filament\Tables\Columns\Column. The types now correctly reflect Closure|string|int|null.

Reason for Changes

  • Redundancy Removal: Removing the duplicate width method simplifies the code. The base class already provides the necessary functionality.
  • Type Compatibility: The type definitions were inconsistent with the base class, leading to errors. This update ensures that the types are aligned, preventing such errors. (Especially when using strict types.)

Testing

  • Manual Testing: Verified that removing the method does not affect functionality, as the base class's method is the same.
  • Type Checking: Ensured that the updated type definitions eliminate the previously encountered errors.

@renderse7en was facing the same issue in #19

@avinmaster
Copy link

Hi Omar @oyepez003 ! Can you please look at this.

@Tschucki
Copy link
Contributor Author

Tschucki commented Sep 5, 2024

@avinmaster
If you encountered the same issue, you may use my branch as dependency.

"repositories": [
    {
        "type": "vcs",
        "url": "https://github.com/Tschucki/filament-rating-field.git"
    }
],

@oyepez003 oyepez003 merged commit 62c4845 into yepsua:master Sep 5, 2024
1 check passed
@oyepez003
Copy link
Member

@Tschucki Thanks for sharing!

A new version has been published: https://github.com/yepsua/filament-rating-field/releases/tag/v0.5.0

@abdosaeedelhassan
Copy link

@Tschucki , there are something missing, need also to update getWidth() function return type to ?string to be compatible

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.

4 participants