Skip to content

Commit

Permalink
fix: sort solo endorsement table by expires_at by default (#3940)
Browse files Browse the repository at this point in the history
  • Loading branch information
AxonC authored Dec 30, 2024
1 parent 4983be6 commit 66e04b9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/Filament/Resources/SoloEndorsementResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public static function table(Table $table): Table
Tables\Columns\TextColumn::make('endorsable.description')->label('Position'),
Tables\Columns\TextColumn::make('duration')->getStateUsing(fn ($record) => $record->expires_at->diffInDays($record->created_at).' days')->label('Duration'),
Tables\Columns\TextColumn::make('created_at')->label('Started At')->isoDateTimeFormat('lll'),
Tables\Columns\TextColumn::make('expires_at')->label('Expires At')->isoDateTimeFormat('lll'),
Tables\Columns\TextColumn::make('expires_at')->label('Expires At')->isoDateTimeFormat('lll')->sortable(),
Tables\Columns\TextColumn::make('status')->label('Status')->badge()
->getStateUsing(fn ($record) => $record->expires_at->isPast() ? 'Expired' : 'Active')
->color(
Expand All @@ -56,6 +56,7 @@ public static function table(Table $table): Table
}
),
])
->defaultSort('expires_at', 'desc')
->filters([
Tables\Filters\TernaryFilter::make('expires_at')
->label('Endorsement Expiry Status')
Expand Down

0 comments on commit 66e04b9

Please sign in to comment.