100 lines
3.1 KiB
PHP
100 lines
3.1 KiB
PHP
<?php
|
|
|
|
namespace App\Filament\Resources\Monitoring\IssueManagements\Tables;
|
|
|
|
use App\Enums\IssueSentiment;
|
|
use App\Filament\Actions\Cheerful\DeleteAction;
|
|
use App\Filament\Actions\Cheerful\EditAction;
|
|
use App\Filament\Actions\Cheerful\ForceDeleteAction;
|
|
use App\Filament\Actions\Cheerful\RestoreAction;
|
|
use App\Filament\Actions\DefaultBulkActions;
|
|
use App\Filament\Columns\TimestampColumns;
|
|
use Filament\Actions\BulkActionGroup;
|
|
use Filament\Support\Icons\Heroicon;
|
|
use Filament\Tables\Columns\TextColumn;
|
|
use Filament\Tables\Filters\SelectFilter;
|
|
use Filament\Tables\Filters\TrashedFilter;
|
|
use Filament\Tables\Table;
|
|
|
|
class IssueManagementTable
|
|
{
|
|
public static function configure(Table $table): Table
|
|
{
|
|
return $table
|
|
->columns([
|
|
TextColumn::make('mediaMonitoring.title')
|
|
->label('Judul Berita')
|
|
->limit(30)
|
|
->searchable()
|
|
->sortable(),
|
|
|
|
TextColumn::make('issue')
|
|
->label('Isu')
|
|
->badge()
|
|
->searchable()
|
|
->sortable(),
|
|
|
|
TextColumn::make('response')
|
|
->label('Respon')
|
|
->badge()
|
|
->searchable()
|
|
->sortable(),
|
|
|
|
TextColumn::make('location.name')
|
|
->label('Lokus')
|
|
->searchable()
|
|
->sortable(),
|
|
|
|
TextColumn::make('subLocation.name')
|
|
->label('Sub Lokus')
|
|
->searchable()
|
|
->sortable(),
|
|
|
|
TextColumn::make('classification.name')
|
|
->label('Klasifikasi')
|
|
->searchable()
|
|
->sortable(),
|
|
|
|
TextColumn::make('subClassification.name')
|
|
->label('Sub Klasifikasi')
|
|
->searchable()
|
|
->sortable(),
|
|
|
|
...TimestampColumns::make(),
|
|
])
|
|
->filters([
|
|
TrashedFilter::make()
|
|
->native(false)
|
|
->visible(fn () => auth()->user()?->hasRole('Developer')),
|
|
|
|
SelectFilter::make('issue')
|
|
->label('Filter Isu')
|
|
->options(IssueSentiment::class)
|
|
->native(false),
|
|
|
|
SelectFilter::make('response')
|
|
->label('Filter Respon')
|
|
->options(IssueSentiment::class)
|
|
->native(false),
|
|
])
|
|
->recordActions([
|
|
EditAction::make(),
|
|
|
|
DeleteAction::make(),
|
|
|
|
RestoreAction::make(),
|
|
|
|
ForceDeleteAction::make(),
|
|
])
|
|
->toolbarActions([
|
|
BulkActionGroup::make([
|
|
...DefaultBulkActions::make('Manajemen Isu'),
|
|
]),
|
|
])
|
|
->emptyStateIcon(Heroicon::ExclamationCircle)
|
|
->emptyStateDescription('Setelah Anda membubat data pertama, maka akan muncul disini.')
|
|
->defaultSort('created_at', 'desc')
|
|
->deferFilters(false);
|
|
}
|
|
}
|