Summary Consolidates the “Tenant Operate Hub” work (Spec 085) and the follow-up adjustments from the 086 session merge into a single branch ready to merge into dev. Primary focus: stabilize Ops/Operate Hub UX flows, tighten/align authorization semantics, and make the full Sail test suite green. Key Changes Ops UX / Verification Readonly members can view verification operation runs (reports) while starting verification remains restricted. Normalized failure reason-code handling and aligned UX expectations with the provider reason-code taxonomy. Onboarding wizard UX “Start verification” CTA is hidden while a verification run is active; “Refresh” is shown during in-progress runs. Treats provider_permission_denied as a blocking reason (while keeping legacy compatibility). Test + fixture hardening Standardized use of default provider connection fixtures in tests where sync/restore flows require it. Fixed multiple Filament URL/tenant-context test cases to avoid 404s and reduce tenancy routing brittleness. Policy sync / restore safety Enrollment configuration type collision classification tests now exercise the real sync path (with required provider connection present). Restore edge-case safety tests updated to reflect current provider-connection requirements. Testing vendor/bin/sail artisan test --compact (green) vendor/bin/sail bin pint --dirty (green) Notes Includes merged 086 session work already (no separate PR needed). Co-authored-by: Ahmed Darrazi <ahmeddarrazi@ebc83aaa-d947-4a08-b88e-bd72ac9645f7.fritz.box> Co-authored-by: Ahmed Darrazi <ahmeddarrazi@MacBookPro.fritz.box> Co-authored-by: Ahmed Darrazi <ahmeddarrazi@adsmac.fritz.box> Reviewed-on: #103
79 lines
2.8 KiB
PHP
79 lines
2.8 KiB
PHP
<?php
|
|
|
|
namespace App\Support;
|
|
|
|
use App\Support\OpsUx\OperationSummaryKeys;
|
|
|
|
final class OperationCatalog
|
|
{
|
|
/**
|
|
* @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',
|
|
'directory_groups.sync' => 'Directory groups sync',
|
|
'drift.generate' => '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_now' => 'Backup schedule run',
|
|
'backup_schedule.retry' => 'Backup schedule retry',
|
|
'backup_schedule.scheduled' => 'Backup schedule run',
|
|
'restore.execute' => 'Restore execution',
|
|
'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',
|
|
];
|
|
}
|
|
|
|
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,
|
|
'directory_groups.sync' => 120,
|
|
'drift.generate' => 240,
|
|
default => null,
|
|
};
|
|
}
|
|
|
|
/**
|
|
* @return array<int, string>
|
|
*/
|
|
public static function allowedSummaryKeys(): array
|
|
{
|
|
return OperationSummaryKeys::all();
|
|
}
|
|
}
|