-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into dependabot/composer/laravel/pint-1.19.0
- Loading branch information
Showing
23 changed files
with
1,135 additions
and
575 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
<?php | ||
|
||
namespace App\Filament\Resources; | ||
|
||
use App\Filament\Resources\RosterUpdates\Pages\ListRosterUpdates; | ||
use App\Filament\Resources\RosterUpdates\Pages\ViewRosterUpdate; | ||
use App\Models\RosterUpdate; | ||
use App\Models\Training\WaitingList; | ||
use Filament\Forms\Components\DatePicker; | ||
use Filament\Forms\Components\Section; | ||
use Filament\Forms\Components\TextInput; | ||
use Filament\Forms\Form; | ||
use Filament\Resources\Resource; | ||
use Filament\Tables\Actions\ViewAction; | ||
use Filament\Tables\Columns\TextColumn; | ||
use Filament\Tables\Table; | ||
|
||
class RosterUpdateResource extends Resource | ||
{ | ||
protected static ?string $model = RosterUpdate::class; | ||
|
||
protected static ?string $navigationIcon = 'heroicon-o-list-bullet'; | ||
|
||
protected static ?string $navigationGroup = 'User Management'; | ||
|
||
protected static ?int $navigationSort = 2; | ||
|
||
public static function form(Form $form): Form | ||
{ | ||
return $form | ||
->schema([ | ||
Section::make('Details')->schema([ | ||
DatePicker::make('created_at')->label('Ran'), | ||
DatePicker::make('period_start'), | ||
DatePicker::make('period_end'), | ||
]), | ||
Section::make('Data') | ||
->statePath('data') | ||
->schema([ | ||
TextInput::make('meetHourRequirement')->label('Controllers meeting requirement'), | ||
TextInput::make('ganderControllers')->label('Eligible Gander/Oceanic controllers'), | ||
TextInput::make('removeFromRoster')->label('Removed from roster'), | ||
TextInput::make('homeRemovals')->label('Home members removed from roster'), | ||
TextInput::make('visitingAndTransferringRemovals')->label('V/T removed from roster'), | ||
TextInput::make('removeFromWaitingList')->label('Removed from waiting lists') | ||
->formatStateUsing(fn ($state) => collect($state)->map(function ($value, $key) { | ||
$waitingList = WaitingList::withTrashed()->where('id', '=', $key)?->first(); | ||
|
||
return "$waitingList?->name: $value"; | ||
})->implode('; ')), | ||
]), | ||
]); | ||
} | ||
|
||
public static function table(Table $table): Table | ||
{ | ||
return $table | ||
->columns([ | ||
TextColumn::make('created_at')->label('Ran'), | ||
TextColumn::make('period_start'), | ||
TextColumn::make('period_end'), | ||
]) | ||
->actions([ | ||
ViewAction::make(), | ||
])->defaultSort('created_at', 'DESC'); | ||
} | ||
|
||
public static function getRelations(): array | ||
{ | ||
return [ | ||
// | ||
]; | ||
} | ||
|
||
public static function getPages(): array | ||
{ | ||
return [ | ||
'index' => ListRosterUpdates::route('/'), | ||
'view' => ViewRosterUpdate::route('/{record}'), | ||
]; | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
app/Filament/Resources/RosterUpdates/Pages/ListRosterUpdates.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
namespace App\Filament\Resources\RosterUpdates\Pages; | ||
|
||
use App\Filament\Helpers\Pages\BaseListRecordsPage; | ||
use App\Filament\Resources\RosterUpdateResource; | ||
|
||
class ListRosterUpdates extends BaseListRecordsPage | ||
{ | ||
protected static string $resource = RosterUpdateResource::class; | ||
|
||
protected function getHeaderActions(): array | ||
{ | ||
return []; | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
app/Filament/Resources/RosterUpdates/Pages/ViewRosterUpdate.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
namespace App\Filament\Resources\RosterUpdates\Pages; | ||
|
||
use App\Filament\Helpers\Pages\BaseViewRecordPage; | ||
use App\Filament\Resources\RosterUpdateResource; | ||
|
||
class ViewRosterUpdate extends BaseViewRecordPage | ||
{ | ||
protected static string $resource = RosterUpdateResource::class; | ||
|
||
protected function getHeaderActions(): array | ||
{ | ||
return []; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
namespace App\Models; | ||
|
||
use Illuminate\Database\Eloquent\Factories\HasFactory; | ||
|
||
class RosterUpdate extends Model | ||
{ | ||
use HasFactory; | ||
|
||
protected $fillable = ['period_start', 'period_end', 'data']; | ||
|
||
protected $casts = [ | ||
'data' => 'json', | ||
]; | ||
} |
Oops, something went wrong.