Fix data exports UI and scope format
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Filament\Resources\DataExportResource\Tables;
|
||||
|
||||
use App\Enums\DataExportScope;
|
||||
use App\Jobs\GenerateDataExport;
|
||||
use App\Models\DataExport;
|
||||
use App\Services\Audit\SuperAdminAuditLogger;
|
||||
@@ -14,6 +15,15 @@ use Illuminate\Support\Number;
|
||||
|
||||
class DataExportTable
|
||||
{
|
||||
public static function formatScope(DataExportScope|string|null $state): string
|
||||
{
|
||||
if ($state instanceof DataExportScope) {
|
||||
$state = $state->value;
|
||||
}
|
||||
|
||||
return $state ? __('admin.data_exports.scope.'.$state) : '—';
|
||||
}
|
||||
|
||||
public static function configure(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
@@ -31,7 +41,7 @@ class DataExportTable
|
||||
TextColumn::make('scope')
|
||||
->label(__('admin.data_exports.fields.scope'))
|
||||
->badge()
|
||||
->formatStateUsing(fn (?string $state) => $state ? __('admin.data_exports.scope.'.$state) : '—'),
|
||||
->formatStateUsing(fn (DataExportScope|string|null $state): string => self::formatScope($state)),
|
||||
TextColumn::make('status')
|
||||
->label(__('admin.data_exports.fields.status'))
|
||||
->badge()
|
||||
|
||||
Reference in New Issue
Block a user