forked from fa/breadcrumb-the-shire
refactor(user-lifecycle): drop redundant titles and duplicate run-now button
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 <details>-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) <noreply@anthropic.com>
This commit is contained in:
@@ -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 = [
|
||||
?>
|
||||
|
||||
<section class="app-settings-user-lifecycle-audit" data-app-component="settings-user-lifecycle-audit">
|
||||
<?php require templatePath('partials/app-list-titlebar.phtml'); ?>
|
||||
<?php require templatePath('partials/app-list-filters.phtml'); ?>
|
||||
|
||||
<div class="app-list-table">
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
* @var array $settings
|
||||
* @var bool $canUpdateSettings
|
||||
* @var array<int, array<string, mixed>> $kpiTiles
|
||||
* @var string $lastRunSummary
|
||||
* @var array<int, array<string, mixed>> $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
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<?php if ($canUpdateSettings): ?>
|
||||
<details class="app-details-card" name="settings-user-lifecycle-run-now" data-details-key="settings-user-lifecycle-run-now">
|
||||
<summary>
|
||||
<span class="app-details-card-summary-title"><?php e(t('Run lifecycle now')); ?></span>
|
||||
<?php if ($lastRunSummary !== ''): ?>
|
||||
<span class="app-details-card-summary-meta"><?php e($lastRunSummary); ?></span>
|
||||
<?php endif; ?>
|
||||
</summary>
|
||||
<div class="app-details-card-container">
|
||||
<blockquote data-variant="warning">
|
||||
<small><?php e(t('This runs the lifecycle policy immediately and may deactivate or delete users.')); ?></small>
|
||||
</blockquote>
|
||||
<button type="submit" class="danger" formnovalidate
|
||||
formaction="admin/settings/run-user-lifecycle"
|
||||
formmethod="post"
|
||||
data-detail-confirm-message="<?php e(t('Run user lifecycle now?')); ?>"
|
||||
data-detail-action-kind="danger">
|
||||
<?php e(t('Run user lifecycle now')); ?>
|
||||
</button>
|
||||
</div>
|
||||
</details>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php Session::getCsrfInput(); ?>
|
||||
</form>
|
||||
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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',
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user