wip
This commit is contained in:
1 parent
3c47c8c922
commit
6662b0a823
11 files changed
+41
-39
No files matched your search
@@ -3,7 +3,6 @@
|
||||
namespace App\Filament\Clusters\StaticData\Resources\SofaScoreTasks\Pages;
|
||||
|
||||
use App\Filament\Clusters\StaticData\Resources\SofaScoreTasks\SofaScoreTaskResource;
|
||||
use Filament\Actions\DeleteAction;
|
||||
use Filament\Resources\Pages\EditRecord;
|
||||
|
||||
class EditSofaScoreTask extends EditRecord
|
||||
@@ -17,12 +16,4 @@ class EditSofaScoreTask extends EditRecord
|
||||
$this->getCancelFormAction()->label('Close Task Manager'), // Renames the button
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
DeleteAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
||||
-11
@@ -3,20 +3,9 @@
|
||||
namespace App\Filament\Clusters\StaticData\Resources\SofaScoreTasks\Pages;
|
||||
|
||||
use App\Filament\Clusters\StaticData\Resources\SofaScoreTasks\SofaScoreTaskResource;
|
||||
use Filament\Actions\CreateAction;
|
||||
use Filament\Resources\Pages\ListRecords;
|
||||
|
||||
class ListSofaScoreTasks extends ListRecords
|
||||
{
|
||||
protected static string $resource = SofaScoreTaskResource::class;
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
CreateAction::make()
|
||||
->label('New Task')
|
||||
->icon('phosphor-plus')
|
||||
->createAnother(false),
|
||||
];
|
||||
}
|
||||
}
|
||||
+19
-16
@@ -13,28 +13,31 @@ class SofaScoreTasksTable
|
||||
{
|
||||
return $table
|
||||
->columns([
|
||||
TextColumn::make('id')->badge()->alignCenter()->width('1rem')
|
||||
->sortable(),
|
||||
TextColumn::make('name')
|
||||
->sortable(),
|
||||
IconColumn::make('id')->alignCenter()->width('1rem')
|
||||
->sortable()->color(fn (string $state): string => match ($state) {
|
||||
'1' => 'info',
|
||||
'3' => 'success',
|
||||
})->icon(fn (string $state): string => match ($state) {
|
||||
'1' => 'phosphor-calendar',
|
||||
'3' => 'phosphor-calendar-dots',
|
||||
}),
|
||||
TextColumn::make('mode')
|
||||
->badge()
|
||||
->color(fn ($record): string => match ($record->id) {
|
||||
1 => 'info',
|
||||
3 => 'success',
|
||||
}),
|
||||
TextColumn::make('name'),
|
||||
IconColumn::make('sport.icon')
|
||||
->label('')
|
||||
->grow(false)
|
||||
->width(30)
|
||||
->icon(fn($record) => $record->sport->icon),
|
||||
->icon(fn ($record) => $record->sport->icon),
|
||||
TextColumn::make('sport.name'),
|
||||
TextColumn::make('mode')
|
||||
->label('Grapping Task')
|
||||
->formatStateUsing(fn(string $state, $record): string => match ($state) {
|
||||
'daily' => 'Daily run',
|
||||
'excel' => 'Import to Excel',
|
||||
'last3days' => $record->day_from,
|
||||
'range' => $record->day_from . ' <=> ' . $record->day_to,
|
||||
}),
|
||||
])
|
||||
->filters([
|
||||
//
|
||||
TextColumn::make('day_from'),
|
||||
TextColumn::make('day_to'),
|
||||
])
|
||||
->paginated(false)
|
||||
->recordActions([
|
||||
EditAction::make()->iconButton()
|
||||
->icon('phosphor-pen-fill'),
|
||||
|
||||
Reference in new issue
Block a user