Skip to content

Commit

Permalink
Merge pull request #152 from ECFMP/148-flow-measures-filter-by-fir
Browse files Browse the repository at this point in the history
feat(FlowMeasureResource): add filter by FIR
  • Loading branch information
AndyTWF authored Jul 11, 2022
2 parents baf25c1 + 5257c43 commit 7ccefaa
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions app/Filament/Resources/FlowMeasureResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
use App\Filament\Resources\FlowMeasureResource\Widgets\ActiveFlowMeasures;
use Filament\Forms\Components\TextInput;
use Filament\Resources\Pages\EditRecord;
use Filament\Tables\Filters\MultiSelectFilter;

class FlowMeasureResource extends Resource
{
Expand Down Expand Up @@ -237,9 +238,11 @@ public static function table(Table $table): Table
{
return $table
->columns([
Tables\Columns\TextColumn::make('identifier')->sortable(),
Tables\Columns\TextColumn::make('identifier')
->sortable(),
Tables\Columns\TextColumn::make('flightInformationRegion.name')
->label(__('Owner')),
->label(__('Owner'))
->sortable(),
Tables\Columns\BadgeColumn::make('status')
->alignCenter()
->colors([
Expand Down Expand Up @@ -274,6 +277,12 @@ public static function table(Table $table): Table
fn (Builder $query, $date): Builder => $query->whereDate('end_time', '<=', $date),
);
}),
MultiSelectFilter::make('flight_information_region_id')
->label(__('FIR'))
->relationship('flightInformationRegion')
->options(fn (): Collection => FlightInformationRegion::orderBy('identifier')
->get(['id', 'name', 'identifier'])
->mapWithKeys(fn (FlightInformationRegion $fir) => [$fir->id => $fir->identifier_name])),
]);
}

Expand Down

0 comments on commit 7ccefaa

Please sign in to comment.