feat/004-assignments-scope-tags #4
@ -46,6 +46,25 @@ public function table(Table $table): Table
|
||||
->label('Policy ID')
|
||||
->copyable(),
|
||||
Tables\Columns\TextColumn::make('platform')->badge(),
|
||||
Tables\Columns\TextColumn::make('metadata.assignment_count')
|
||||
->label('Assignments')
|
||||
->default('0')
|
||||
->badge()
|
||||
->color('info'),
|
||||
Tables\Columns\TextColumn::make('metadata.scope_tag_names')
|
||||
->label('Scope Tags')
|
||||
->badge()
|
||||
->separator(',')
|
||||
->default('—')
|
||||
->formatStateUsing(function ($state) {
|
||||
if (empty($state)) {
|
||||
return '—';
|
||||
}
|
||||
if (is_array($state)) {
|
||||
return implode(', ', $state);
|
||||
}
|
||||
return $state;
|
||||
}),
|
||||
Tables\Columns\TextColumn::make('captured_at')->dateTime(),
|
||||
Tables\Columns\TextColumn::make('created_at')->since(),
|
||||
])
|
||||
@ -70,6 +89,7 @@ public function table(Table $table): Table
|
||||
|
||||
return Policy::query()
|
||||
->where('tenant_id', $tenantId)
|
||||
->where('last_synced_at', '>', now()->subDays(7)) // Hide deleted policies (Feature 005 workaround)
|
||||
->when($existing, fn (Builder $query) => $query->whereNotIn('id', $existing))
|
||||
->orderBy('display_name')
|
||||
->pluck('display_name', 'id');
|
||||
|
||||
Loading…
Reference in New Issue
Block a user