From 157eb186109655626d03f472010c3d837c11291f Mon Sep 17 00:00:00 2001 From: fs Date: Sun, 26 Apr 2026 20:38:15 +0200 Subject: [PATCH] refactor(user-lifecycle): drop redundant titles and duplicate run-now button MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cleans up two leftover redundancies after the Phase-1 cockpit foundation landed in cc2cf3a: * The audit-list panel embedded inside the settings page rendered its own "User lifecycle logs" titlebar — a redundant heading below the page-level titlebar that already says exactly that. The embedded panel now renders the filter toolbar + grid directly. Page-level title carries the context. * The Run-Now action existed twice — inline in a
-card inside the form and again in the aside Quick-Actions list. The inline version is gone; aside is the single discoverable home for policy-level danger actions, consistent with how Phase 1 introduced Purge logs there too. * The orphan $lastRunSummary string in the action and view stays removed accordingly. KPI tile "Last run" still carries the relative-time + status hint, so no information is lost — just surfaced once instead of twice. Three architecture-test lists updated to match the panel's new shape, each with an inline comment so future readers see why the panel is intentionally absent: * DetailActionPolicyContractFiles.migratedConfirmFiles drops the user-lifecycle settings view (its danger action delegates to the aside-actions partial, already in this list). * ListUiSharedPartialsContractTest.purgeTitlebarTemplateFiles drops the panel (no titlebar of its own anymore). * ListTitlebarContractFiles.titlebarTemplateFiles drops the panel for the same reason. All six quality gates green; behaviour-identical to a user with the required permission (purge + run-now both still available, just sourced from the aside). Co-Authored-By: Claude Opus 4.7 (1M context) --- .../settings-user-lifecycle-panel.phtml | 11 -------- pages/admin/settings/user-lifecycle().php | 12 --------- .../settings/user-lifecycle(default).phtml | 25 ------------------- .../DetailActionPolicyContractFiles.php | 5 +++- .../ListTitlebarContractFiles.php | 4 ++- .../ListUiSharedPartialsContractTest.php | 5 +++- 6 files changed, 11 insertions(+), 51 deletions(-) diff --git a/modules/audit/templates/settings-user-lifecycle-panel.phtml b/modules/audit/templates/settings-user-lifecycle-panel.phtml index e47e532..e310762 100644 --- a/modules/audit/templates/settings-user-lifecycle-panel.phtml +++ b/modules/audit/templates/settings-user-lifecycle-panel.phtml @@ -147,16 +147,6 @@ $filterChipMeta = [ ], ]; -$listTitle = t('User lifecycle logs'); -ob_start(); -$listPurgeEnabled = $canPurge; -$listPurgeFormId = 'settings-user-lifecycle-audit-purge-form'; -$listPurgeAction = endpointUrl('admin/settings/user-lifecycle/audit-purge'); -$listPurgeConfirmMessage = t('Purge entries older than 365 days?'); -$listPurgeButtonLabel = t('Purge user lifecycle logs'); -require templatePath('partials/app-list-purge-action.phtml'); -$listTitleActionsHtml = ob_get_clean(); - $filterUiNamespace = 'settings-user-lifecycle'; $filterToolbarId = 'settings-user-lifecycle-audit-toolbar'; $filterDrawerToolbarId = 'settings-user-lifecycle-audit-drawer-toolbar'; @@ -182,7 +172,6 @@ $pageConfig = [ ?>
-
diff --git a/pages/admin/settings/user-lifecycle().php b/pages/admin/settings/user-lifecycle().php index 5ca2402..141031b 100644 --- a/pages/admin/settings/user-lifecycle().php +++ b/pages/admin/settings/user-lifecycle().php @@ -120,18 +120,6 @@ if ($lastRunAt !== null) { } } -$lastRunSummary = ''; -if ($lastRunAt !== null) { - $lastRunSummary = sprintf( - '%s: %s%s', - t('Last run'), - $lastRunRelative, - $lastRunStatusLabel !== '' ? ' · ' . $lastRunStatusLabel : '' - ); -} else { - $lastRunSummary = t('No runs yet'); -} - $lastRunTooltip = $lastRunStatusLabel !== '' ? $lastRunStatusLabel : t('No runs yet'); $pendingDisabled = ($deactivateDays <= 0 || $deleteDays <= 0); diff --git a/pages/admin/settings/user-lifecycle(default).phtml b/pages/admin/settings/user-lifecycle(default).phtml index e70def5..2bfdc4b 100644 --- a/pages/admin/settings/user-lifecycle(default).phtml +++ b/pages/admin/settings/user-lifecycle(default).phtml @@ -5,7 +5,6 @@ * @var array $settings * @var bool $canUpdateSettings * @var array> $kpiTiles - * @var string $lastRunSummary * @var array> $asideActions */ @@ -21,7 +20,6 @@ $canUpdateSettings = (bool) ($canUpdateSettings ?? false); $isReadOnly = !$canUpdateSettings; $readonlyAttr = $isReadOnly ? 'readonly' : ''; $kpiTiles = is_array($kpiTiles ?? null) ? $kpiTiles : []; -$lastRunSummary = (string) ($lastRunSummary ?? ''); $asideActions = is_array($asideActions ?? null) ? $asideActions : []; $layoutAuth = is_array($viewAuth['layout'] ?? null) ? $viewAuth['layout'] : []; $layoutNav = is_array($layoutNav ?? null) ? $layoutNav : []; @@ -78,29 +76,6 @@ $moduleLifecyclePanelSlots = is_array($moduleSlots['settings.user_lifecycle.pane
- -
- - - - - - -
-
- -
- -
-
- - diff --git a/tests/Architecture/DetailActionPolicyContractFiles.php b/tests/Architecture/DetailActionPolicyContractFiles.php index a2bfbe4..7ddaaa3 100644 --- a/tests/Architecture/DetailActionPolicyContractFiles.php +++ b/tests/Architecture/DetailActionPolicyContractFiles.php @@ -22,7 +22,10 @@ final class DetailActionPolicyContractFiles // destructive buttons (general/audit/telemetry/email/sso/branding) // are deliberately excluded. 'pages/admin/settings/account-access(default).phtml', - 'pages/admin/settings/user-lifecycle(default).phtml', + // user-lifecycle settings delegates its only danger action + // (Run-Now) to the aside-actions partial, which is already + // in this list. Inline confirm-attributes are no longer + // required in the view source. 'pages/admin/settings/api(default).phtml', 'templates/partials/app-details-titlebar.phtml', 'templates/partials/app-details-aside-actions.phtml', diff --git a/tests/Architecture/ListTitlebarContractFiles.php b/tests/Architecture/ListTitlebarContractFiles.php index 7e164ad..27255ef 100644 --- a/tests/Architecture/ListTitlebarContractFiles.php +++ b/tests/Architecture/ListTitlebarContractFiles.php @@ -19,7 +19,9 @@ final class ListTitlebarContractFiles 'pages/admin/scheduled-jobs/index(default).phtml', 'modules/audit/pages/audit/api-audit/index(default).phtml', 'modules/audit/pages/audit/import-audit/index(default).phtml', - 'modules/audit/templates/settings-user-lifecycle-panel.phtml', + // settings-user-lifecycle-panel.phtml is embedded inside the + // settings page, which has its own titlebar — the panel + // intentionally renders no titlebar of its own. 'modules/audit/pages/audit/system-audit/index(default).phtml', 'modules/addressbook/pages/address-book/index(default).phtml', 'pages/search/index(default).phtml', diff --git a/tests/Architecture/ListUiSharedPartialsContractTest.php b/tests/Architecture/ListUiSharedPartialsContractTest.php index 8254a8a..9a61a68 100644 --- a/tests/Architecture/ListUiSharedPartialsContractTest.php +++ b/tests/Architecture/ListUiSharedPartialsContractTest.php @@ -24,11 +24,14 @@ class ListUiSharedPartialsContractTest extends TestCase */ private function purgeTitlebarTemplateFiles(): array { + // Note: settings-user-lifecycle-panel.phtml is intentionally absent. + // The panel is embedded inside the user-lifecycle settings page and + // delegates its purge action to the aside-actions partial — it has + // no titlebar of its own. return [ 'pages/admin/scheduled-jobs/index(default).phtml', 'modules/audit/pages/audit/api-audit/index(default).phtml', 'modules/audit/pages/audit/import-audit/index(default).phtml', - 'modules/audit/templates/settings-user-lifecycle-panel.phtml', 'modules/audit/pages/audit/system-audit/index(default).phtml', ]; }