From ef5f36db7437d9b53b65c6b5fe2d87f6dbdc775b Mon Sep 17 00:00:00 2001 From: yannickmonney Date: Sat, 10 Oct 2026 12:01:24 +0200 Subject: [PATCH] fix(platform): name policy changes in the audit log The policy writer records governance_policy.created and governance_policy.updated, but only the older policy.* actions had labels, so the audit log showed the raw action. Both now read as words in English, German and French; the older labels stay for the rows written under them. --- .../audit-logs/components/audit-log-table.test.tsx | 14 +++++++++++++- services/platform/messages/de/settings.yml | 2 ++ services/platform/messages/en/settings.yml | 2 ++ services/platform/messages/fr/settings.yml | 2 ++ 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/services/platform/app/features/settings/audit-logs/components/audit-log-table.test.tsx b/services/platform/app/features/settings/audit-logs/components/audit-log-table.test.tsx index d22e949e97..8fe609eee8 100644 --- a/services/platform/app/features/settings/audit-logs/components/audit-log-table.test.tsx +++ b/services/platform/app/features/settings/audit-logs/components/audit-log-table.test.tsx @@ -20,6 +20,7 @@ const pauseMetadata = { function renderDetails( metadata: Record, category: AuditLogDoc['category'] = 'ai', + action = 'automation.trigger.paused', ) { const log: AuditLogDoc = { _id: 'log-paused', @@ -27,7 +28,7 @@ function renderDetails( organizationId: 'org-1', actorId: 'system', actorType: 'system', - action: 'automation.trigger.paused', + action, category, resourceType: 'automation_trigger', timestamp: 1_700_000_000_000, @@ -53,6 +54,17 @@ function renderDetails( ); } +describe('AuditLogTable action labels', () => { + it.each([ + ['governance_policy.created', 'Policy created'], + ['governance_policy.updated', 'Policy updated'], + ])('names a policy change (%s) in words', async (action, label) => { + renderDetails({}, 'security', action); + const dialog = await screen.findByRole('dialog'); + expect(within(dialog).getAllByText(label).length).toBeGreaterThan(0); + }); +}); + describe('AuditLogTable metadata details', () => { it('shows the paused schedule failure context and run reference', async () => { renderDetails(pauseMetadata); diff --git a/services/platform/messages/de/settings.yml b/services/platform/messages/de/settings.yml index 4544714a79..80ca267726 100644 --- a/services/platform/messages/de/settings.yml +++ b/services/platform/messages/de/settings.yml @@ -1479,6 +1479,8 @@ logs: project.deleted: Projekt gelöscht policy.created: Richtlinie erstellt policy.updated: Richtlinie aktualisiert + governance_policy.created: Richtlinie erstellt + governance_policy.updated: Richtlinie aktualisiert policy.retention_bounds_proposal_applied: Vorschlag zu Aufbewahrungsgrenzen angewendet policy.retention_bounds_initial_applied: Aufbewahrungsgrenzen erstmalig angewendet retention.run_completed: Aufbewahrungs-Run abgeschlossen diff --git a/services/platform/messages/en/settings.yml b/services/platform/messages/en/settings.yml index 70ab196ce1..36e0ab0750 100644 --- a/services/platform/messages/en/settings.yml +++ b/services/platform/messages/en/settings.yml @@ -1422,6 +1422,8 @@ logs: project.deleted: Project deleted policy.created: Policy created policy.updated: Policy updated + governance_policy.created: Policy created + governance_policy.updated: Policy updated policy.retention_bounds_proposal_applied: Retention bounds proposal applied policy.retention_bounds_initial_applied: Retention bounds initially applied retention.run_completed: Retention run completed diff --git a/services/platform/messages/fr/settings.yml b/services/platform/messages/fr/settings.yml index 4da59607c4..6b9910f1d9 100644 --- a/services/platform/messages/fr/settings.yml +++ b/services/platform/messages/fr/settings.yml @@ -1509,6 +1509,8 @@ logs: project.deleted: Projet supprimé policy.created: Politique créée policy.updated: Politique mise à jour + governance_policy.created: Politique créée + governance_policy.updated: Politique mise à jour policy.retention_bounds_proposal_applied: Proposition de bornes de rétention appliquée policy.retention_bounds_initial_applied: Bornes de rétention initialement appliquées retention.run_completed: Cycle de rétention terminé