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] Fix filtering on healthy in results table #1936

Merged
merged 2 commits into from
Dec 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions app/Filament/Resources/ResultResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ public static function form(Form $form): Form
->content(fn (Result $result): ?string => $result->comments),
Forms\Components\Checkbox::make('scheduled'),
Forms\Components\Checkbox::make('healthy'),

])
->columns(1)
->columnSpan([
Expand Down Expand Up @@ -318,6 +317,7 @@ public static function table(Table $table): Table
->boolean()
->toggleable()
->toggledHiddenByDefault()
->sortable()
->alignment(Alignment::Center),
Tables\Columns\TextColumn::make('created_at')
->dateTime(config('app.datetime_format'))
Expand Down Expand Up @@ -365,7 +365,12 @@ public static function table(Table $table): Table
Tables\Filters\TernaryFilter::make('healthy')
->nullable()
->trueLabel('Only healthy speedtests')
->falseLabel('Only unhealthy speedtests'),
->falseLabel('Only unhealthy speedtests')
->queries(
true: fn (Builder $query) => $query->where('healthy', true),
false: fn (Builder $query) => $query->where('healthy', false),
blank: fn (Builder $query) => $query,
),
])
->actions([
Tables\Actions\ActionGroup::make([
Expand Down