## Summary - Fixes misleading “queued / running in background” message when Review Pack generation request reuses an existing ready pack (fingerprint dedupe). - Improves resilience of Filament/Livewire interactions by ensuring the Livewire intercept shim applies after Livewire initializes. - Aligns Review Pack operation notifications with Ops-UX patterns (queued + completed notifications) and removes the old ReviewPackStatusNotification. ## Key Changes - Review Pack generate action now: - Shows queued toast only when a new pack is actually created/queued. - Shows a “Review pack already available” success notification with a link when dedupe returns an existing pack. ## Tests - `vendor/bin/sail artisan test --compact tests/Feature/ReviewPack/ReviewPackGenerationTest.php` - `vendor/bin/sail artisan test --compact tests/Feature/ReviewPack/ReviewPackResourceTest.php` - `vendor/bin/sail artisan test --compact tests/Feature/LivewireInterceptShimTest.php` ## Notes - No global search behavior changes for ReviewPacks (still excluded). - Destructive actions remain confirmation-gated (`->requiresConfirmation()`). Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de> Reviewed-on: #133
101 lines
3.9 KiB
PHP
101 lines
3.9 KiB
PHP
<?php
|
|
|
|
namespace App\Support;
|
|
|
|
use App\Support\OpsUx\OperationSummaryKeys;
|
|
|
|
final class OperationCatalog
|
|
{
|
|
public const string TYPE_PERMISSION_POSTURE_CHECK = 'permission_posture_check';
|
|
|
|
/**
|
|
* @return array<string, string>
|
|
*/
|
|
public static function labels(): array
|
|
{
|
|
return [
|
|
'policy.sync' => 'Policy sync',
|
|
'policy.sync_one' => 'Policy sync',
|
|
'policy.capture_snapshot' => 'Policy snapshot',
|
|
'policy.delete' => 'Delete policies',
|
|
'policy.unignore' => 'Restore policies',
|
|
'policy.export' => 'Export policies to backup',
|
|
'provider.connection.check' => 'Provider connection check',
|
|
'inventory_sync' => 'Inventory sync',
|
|
'compliance.snapshot' => 'Compliance snapshot',
|
|
'entra_group_sync' => 'Directory groups sync',
|
|
'drift_generate_findings' => 'Drift generation',
|
|
'backup_set.add_policies' => 'Backup set update',
|
|
'backup_set.remove_policies' => 'Backup set update',
|
|
'backup_set.delete' => 'Archive backup sets',
|
|
'backup_set.restore' => 'Restore backup sets',
|
|
'backup_set.force_delete' => 'Delete backup sets',
|
|
'backup_schedule_run' => 'Backup schedule run',
|
|
'backup_schedule_retention' => 'Backup schedule retention',
|
|
'backup_schedule_purge' => 'Backup schedule purge',
|
|
'restore.execute' => 'Restore execution',
|
|
'assignments.fetch' => 'Assignment fetch',
|
|
'assignments.restore' => 'Assignment restore',
|
|
'ops.reconcile_adapter_runs' => 'Reconcile adapter runs',
|
|
'directory_role_definitions.sync' => 'Role definitions sync',
|
|
'restore_run.delete' => 'Delete restore runs',
|
|
'restore_run.restore' => 'Restore restore runs',
|
|
'restore_run.force_delete' => 'Force delete restore runs',
|
|
'tenant.sync' => 'Tenant sync',
|
|
'policy_version.prune' => 'Prune policy versions',
|
|
'policy_version.restore' => 'Restore policy versions',
|
|
'policy_version.force_delete' => 'Delete policy versions',
|
|
'alerts.evaluate' => 'Alerts evaluation',
|
|
'alerts.deliver' => 'Alerts delivery',
|
|
'baseline_capture' => 'Baseline capture',
|
|
'baseline_compare' => 'Baseline compare',
|
|
'permission_posture_check' => 'Permission posture check',
|
|
'entra.admin_roles.scan' => 'Entra admin roles scan',
|
|
'tenant.review_pack.generate' => 'Review pack generation',
|
|
'rbac.health_check' => 'RBAC health check',
|
|
];
|
|
}
|
|
|
|
public static function label(string $operationType): string
|
|
{
|
|
$operationType = trim($operationType);
|
|
|
|
if ($operationType === '') {
|
|
return 'Operation';
|
|
}
|
|
|
|
return self::labels()[$operationType] ?? 'Unknown operation';
|
|
}
|
|
|
|
public static function expectedDurationSeconds(string $operationType): ?int
|
|
{
|
|
return match (trim($operationType)) {
|
|
'policy.sync', 'policy.sync_one' => 90,
|
|
'provider.connection.check' => 30,
|
|
'policy.export' => 120,
|
|
'inventory_sync' => 180,
|
|
'compliance.snapshot' => 180,
|
|
'entra_group_sync' => 120,
|
|
'drift_generate_findings' => 240,
|
|
'assignments.fetch', 'assignments.restore' => 60,
|
|
'ops.reconcile_adapter_runs' => 120,
|
|
'alerts.evaluate', 'alerts.deliver' => 120,
|
|
'baseline_capture' => 120,
|
|
'baseline_compare' => 120,
|
|
'permission_posture_check' => 30,
|
|
'entra.admin_roles.scan' => 60,
|
|
'tenant.review_pack.generate' => 60,
|
|
'rbac.health_check' => 30,
|
|
default => null,
|
|
};
|
|
}
|
|
|
|
/**
|
|
* @return array<int, string>
|
|
*/
|
|
public static function allowedSummaryKeys(): array
|
|
{
|
|
return OperationSummaryKeys::all();
|
|
}
|
|
}
|