1
0

empty states

This commit is contained in:
2026-03-13 09:49:11 +01:00
parent cb7256aebc
commit 082fa4c9a5
12 changed files with 174 additions and 46 deletions

View File

@@ -157,6 +157,8 @@
"Permission key already exists": "Berechtigungs-Schlüssel existiert bereits",
"Assigned permissions": "Zugewiesene Berechtigungen",
"Select permissions": "Berechtigungen auswählen",
"No permissions available": "Keine Berechtigungen verfügbar",
"No active permissions are configured yet.": "Es sind noch keine aktiven Berechtigungen konfiguriert.",
"Permission denied": "Keine Berechtigung",
"No active tenant assigned": "Kein aktiver Mandant zugewiesen",
"Please select at least one tenant": "Bitte mindestens einen Mandanten auswählen",
@@ -524,9 +526,12 @@
"No departments": "Keine Abteilungen",
"No departments available for this tenant": "Für diesen Mandanten sind keine Abteilungen verfügbar",
"Assign tenants first to select departments": "Bitte zuerst Mandanten zuweisen, um Abteilungen auszuwählen",
"No tenants available": "Keine Mandanten verfügbar",
"No tenant is available in your current scope.": "Im aktuellen Geltungsbereich sind keine Mandanten verfügbar.",
"Department options refresh after save": "Abteilungsoptionen werden nach dem Speichern aktualisiert",
"Role": "Rolle",
"Roles": "Rollen",
"No roles available": "Keine Rollen verfügbar",
"Create role": "Rolle anlegen",
"Edit role": "Rolle bearbeiten",
"Role created": "Rolle erstellt",
@@ -571,6 +576,7 @@
"Support": "Support",
"Support email": "Support-E-Mail",
"Support phone": "Support-Telefon",
"No contact details available": "Keine Kontaktdaten vorhanden",
"VAT ID": "USt-ID",
"Tax number": "Steuernummer",
"Billing email": "Rechnungs-E-Mail",
@@ -579,6 +585,7 @@
"Accounting info": "Buchhaltungsinfo",
"Communication": "Kommunikation",
"Legal": "Rechtliches",
"No legal links configured": "Keine rechtlichen Links konfiguriert",
"Privacy URL": "Datenschutz-URL",
"Imprint URL": "Impressum-URL",
"Region": "Region",
@@ -715,6 +722,8 @@
"More filters": "Weitere Filter",
"Email unverified": "E-Mail nicht verifiziert",
"Password resets": "Passwort-Resets",
"No password reset requests": "Keine Passwort-Reset-Anfragen",
"No reset has been requested for this account yet.": "Für dieses Konto wurde noch kein Reset angefordert.",
"Requested at": "Angefordert am",
"Expires at": "Gültig bis",
"Used at": "Verwendet am",
@@ -723,6 +732,8 @@
"Expired": "Abgelaufen",
"Expired by admin": "Durch Admin abgelaufen",
"Login tokens": "Login-Tokens",
"No login tokens": "Keine Login-Tokens",
"This user is currently not signed in via remember-me.": "Dieser Benutzer ist aktuell nicht per Angemeldet-bleiben eingeloggt.",
"Expire all login tokens": "Alle Login-Tokens ablaufen",
"Expire all login tokens?": "Alle Login-Tokens ablaufen?",
"%d active login tokens": "%d aktive Login-Tokens",
@@ -747,6 +758,8 @@
"IDs": "IDs",
"Pages": "Seiten",
"Permission": "Berechtigung",
"No effective permissions": "Keine effektiven Berechtigungen",
"Assign at least one role to show effective permissions.": "Weisen Sie mindestens eine Rolle zu, um effektive Berechtigungen anzuzeigen.",
"Please verify your email first": "Bitte bestätige zuerst deine E-Mail",
"Toggle search details": "Suchdetails umschalten",
"Toggle sidebar": "Sidebar umschalten",
@@ -923,6 +936,8 @@
"Revoked": "Widerrufen",
"Prefix": "Präfix",
"No API tokens": "Keine API-Tokens",
"Create a token to enable API access for this user.": "Erstellen Sie ein Token, um den API-Zugriff für diesen Benutzer zu aktivieren.",
"No API token has been created for this user yet.": "Für diesen Benutzer wurde noch kein API-Token erstellt.",
"New API token (copy now — shown only once):": "Neues API-Token (jetzt kopieren — wird nur einmal angezeigt):",
"API token created. Copy it now — it will not be shown again.": "API-Token erstellt. Jetzt kopieren — es wird nicht erneut angezeigt.",
"Could not create API token: %s": "API-Token konnte nicht erstellt werden: %s",

View File

@@ -157,6 +157,8 @@
"Permission key already exists": "Permission key already exists",
"Assigned permissions": "Assigned permissions",
"Select permissions": "Select permissions",
"No permissions available": "No permissions available",
"No active permissions are configured yet.": "No active permissions are configured yet.",
"Permission denied": "Permission denied",
"No active tenant assigned": "No active tenant assigned",
"Please select at least one tenant": "Please select at least one tenant",
@@ -524,9 +526,12 @@
"No departments": "No departments",
"No departments available for this tenant": "No departments available for this tenant",
"Assign tenants first to select departments": "Assign tenants first to select departments",
"No tenants available": "No tenants available",
"No tenant is available in your current scope.": "No tenant is available in your current scope.",
"Department options refresh after save": "Department options refresh after save",
"Role": "Role",
"Roles": "Roles",
"No roles available": "No roles available",
"Create role": "Create role",
"Edit role": "Edit role",
"Role created": "Role created",
@@ -571,6 +576,7 @@
"Support": "Support",
"Support email": "Support email",
"Support phone": "Support phone",
"No contact details available": "No contact details available",
"VAT ID": "VAT ID",
"Tax number": "Tax number",
"Billing email": "Billing email",
@@ -579,6 +585,7 @@
"Accounting info": "Accounting info",
"Communication": "Communication",
"Legal": "Legal",
"No legal links configured": "No legal links configured",
"Privacy URL": "Privacy URL",
"Imprint URL": "Imprint URL",
"Region": "Region",
@@ -715,6 +722,8 @@
"More filters": "More filters",
"Email unverified": "Email unverified",
"Password resets": "Password resets",
"No password reset requests": "No password reset requests",
"No reset has been requested for this account yet.": "No reset has been requested for this account yet.",
"Requested at": "Requested at",
"Expires at": "Expires at",
"Used at": "Used at",
@@ -723,6 +732,8 @@
"Expired": "Expired",
"Expired by admin": "Expired by admin",
"Login tokens": "Login tokens",
"No login tokens": "No login tokens",
"This user is currently not signed in via remember-me.": "This user is currently not signed in via remember-me.",
"Expire all login tokens": "Expire all login tokens",
"Expire all login tokens?": "Expire all login tokens?",
"%d active login tokens": "%d active login tokens",
@@ -747,6 +758,8 @@
"IDs": "IDs",
"Pages": "Pages",
"Permission": "Permission",
"No effective permissions": "No effective permissions",
"Assign at least one role to show effective permissions.": "Assign at least one role to show effective permissions.",
"Please verify your email first": "Please verify your email first",
"Toggle search details": "Toggle search details",
"Toggle sidebar": "Toggle sidebar",
@@ -923,6 +936,8 @@
"Revoked": "Revoked",
"Prefix": "Prefix",
"No API tokens": "No API tokens",
"Create a token to enable API access for this user.": "Create a token to enable API access for this user.",
"No API token has been created for this user yet.": "No API token has been created for this user yet.",
"New API token (copy now — shown only once):": "New API token (copy now — shown only once):",
"API token created. Copy it now — it will not be shown again.": "API token created. Copy it now — it will not be shown again.",
"Could not create API token: %s": "Could not create API token: %s",

View File

@@ -71,6 +71,15 @@ $disabledAttr = $isReadOnly ? 'disabled' : '';
</option>
<?php endforeach; ?>
</select>
<?php else: ?>
<?php
$emptyState = [
'message' => t('No tenants available'),
'hint' => t('Please select at least one tenant'),
'size' => 'compact',
];
require templatePath('partials/app-empty-state.phtml');
?>
<?php endif; ?>
</div>

View File

@@ -9,6 +9,7 @@
<div class="app-details-container">
<section>
<?php
$hasTenantOptions = !empty($tenants);
$breadcrumbs = [
['label' => t('Home'), 'path' => 'admin'],
['label' => t('Departments'), 'path' => 'admin/departments'],
@@ -26,6 +27,7 @@
'value' => 'create',
'class' => 'secondary outline',
'label' => t('Create'),
'disabled' => !$hasTenantOptions,
],
[
'form' => 'department-form',
@@ -33,6 +35,7 @@
'value' => 'create_close',
'class' => 'primary',
'label' => t('Create & close'),
'disabled' => !$hasTenantOptions,
],
],
];

View File

@@ -19,6 +19,7 @@ $isReadOnly = !$canUpdateDepartment;
<div class="app-details-container">
<section>
<?php
$hasTenantOptions = !empty($tenants);
$breadcrumbs = [
['label' => t('Home'), 'path' => 'admin'],
['label' => t('Departments'), 'path' => 'admin/departments'],
@@ -36,6 +37,7 @@ $isReadOnly = !$canUpdateDepartment;
'value' => 'save',
'class' => 'secondary outline',
'label' => t('Save'),
'disabled' => !$hasTenantOptions,
],
[
'form' => 'department-form',
@@ -43,6 +45,7 @@ $isReadOnly = !$canUpdateDepartment;
'value' => 'save_close',
'class' => 'primary',
'label' => t('Save & close'),
'disabled' => !$hasTenantOptions,
],
] : [],
];

View File

@@ -24,15 +24,15 @@ $dangerZoneActionLabel = (string) ($dangerZoneActionLabel ?? t('Delete'));
$detailsOpenAttr = $detailsOpenAll ? 'open' : '';
$readonlyAttr = $isReadOnly ? 'readonly' : '';
$disabledAttr = $isReadOnly ? 'disabled' : '';
$permissions = is_array($permissions ?? null) ? $permissions : [];
$selectedPermissionIds = is_array($selectedPermissionIds ?? null) ? $selectedPermissionIds : [];
?>
<form id="<?php e($formId); ?>" method="post" data-standard-detail-form="1">
<div class="app-tabs" data-tabs data-tabs-param="tab" data-tabs-storage-key="admin-role-form">
<div class="app-tabs-nav">
<button type="button" data-tab="basic" data-tab-default><?php e(t('Master data')); ?></button>
<?php if (!empty($permissions)): ?>
<button type="button" data-tab="permissions"><?php e(t('Permissions')); ?></button>
<?php endif; ?>
<button type="button" data-tab="permissions"><?php e(t('Permissions')); ?></button>
<button type="button" data-tab="visibility"><?php e(t('Visibility')); ?></button>
<?php if ($showDangerZone && $dangerZoneDeleteFormId !== ''): ?>
<button type="button" data-tab="danger"><?php e(t('Danger zone')); ?></button>
@@ -54,11 +54,20 @@ $disabledAttr = $isReadOnly ? 'disabled' : '';
</div>
</div>
<?php if (!empty($permissions)): ?>
<div data-tab-panel="permissions">
<?php multiSelectForm('role-permissions', 'permission_ids', 'Assigned permissions', 'Select permissions', $permissions, $selectedPermissionIds ?? [], $isReadOnly, ['description', 'key']); ?>
</div>
<?php endif; ?>
<div data-tab-panel="permissions">
<?php if ($permissions): ?>
<?php multiSelectForm('role-permissions', 'permission_ids', 'Assigned permissions', 'Select permissions', $permissions, $selectedPermissionIds, $isReadOnly, ['description', 'key']); ?>
<?php else: ?>
<?php
$emptyState = [
'message' => t('No permissions available'),
'hint' => t('No active permissions are configured yet.'),
'size' => 'compact',
];
require templatePath('partials/app-empty-state.phtml');
?>
<?php endif; ?>
</div>
<div data-tab-panel="visibility">
<?php

View File

@@ -265,7 +265,19 @@ $openOverrideCard = $detailsOpenAll;
<?php if ($showCustomFieldsTab): ?>
<div data-tab-panel="custom_fields">
<?php if ($customFieldTenantUuid === ''): ?>
<p class="muted"><?php e(t('Save tenant first to manage custom fields')); ?></p>
<?php
$emptyState = [
'message' => t('Save tenant first to manage custom fields'),
'size' => 'compact',
];
if (!$isReadOnly) {
$emptyState['action'] = [
'label' => t('Create'),
'form' => $formId,
];
}
require templatePath('partials/app-empty-state.phtml');
?>
<?php else: ?>
<blockquote data-variant="info">
<?php e(t('Define custom fields here. They appear per user in the "Custom fields" tab and can be maintained there.')); ?>

View File

@@ -229,7 +229,15 @@ $hasFavicon = $avatarUuid !== '' && $tenantFaviconService->hasFavicon($avatarUui
</div>
<?php endif; ?>
<?php else: ?>
<p>-</p>
<?php
$emptyState = [
'message' => t('No contact details available'),
'size' => 'small',
'align' => 'left',
'icon' => false,
];
require templatePath('partials/app-empty-state.phtml');
?>
<?php endif; ?>
</details>
<hr>
@@ -258,7 +266,15 @@ $hasFavicon = $avatarUuid !== '' && $tenantFaviconService->hasFavicon($avatarUui
</div>
<?php endif; ?>
<?php else: ?>
<p>-</p>
<?php
$emptyState = [
'message' => t('No legal links configured'),
'size' => 'small',
'align' => 'left',
'icon' => false,
];
require templatePath('partials/app-empty-state.phtml');
?>
<?php endif; ?>
</details>
<hr>

View File

@@ -315,7 +315,8 @@ foreach ($tenants as $tenant) {
<?php if (!$passwordResets): ?>
<?php
$emptyState = [
'message' => t('No entries found'),
'message' => t('No password reset requests'),
'hint' => t('No reset has been requested for this account yet.'),
'size' => 'compact',
];
require templatePath('partials/app-empty-state.phtml');
@@ -380,7 +381,8 @@ foreach ($tenants as $tenant) {
<?php if (!$rememberTokens): ?>
<?php
$emptyState = [
'message' => t('No entries found'),
'message' => t('No login tokens'),
'hint' => t('This user is currently not signed in via remember-me.'),
'size' => 'compact',
];
require templatePath('partials/app-empty-state.phtml');
@@ -543,10 +545,13 @@ foreach ($tenants as $tenant) {
</table>
</div>
<?php endif; ?>
<?php if (empty($apiTokens) && !$canManageApiTokens): ?>
<?php if (empty($apiTokens)): ?>
<?php
$emptyState = [
'message' => t('No API tokens'),
'hint' => $canManageApiTokens
? t('Create a token to enable API access for this user.')
: t('No API token has been created for this user yet.'),
'size' => 'compact',
];
require templatePath('partials/app-empty-state.phtml');
@@ -563,35 +568,46 @@ foreach ($tenants as $tenant) {
<details name="assignments-tenants" data-details-key="assignments-tenants" open>
<summary><?php e(t('Tenants')); ?></summary>
<hr>
<?php multiSelectForm('user-tenants', 'tenant_ids', 'Assigned tenants', 'Select tenants', $tenants, $selectedTenantIds, $isReadOnly); ?>
<label>
<span>
<?php e(t('Primary tenant')); ?>
</span>
</label>
<?php if ($primaryTenantDisabled && $primaryTenantId > 0): ?>
<input type="hidden" name="primary_tenant_id" value="<?php e((string) $primaryTenantId); ?>">
<?php endif; ?>
<select id="user-primary-tenant" name="primary_tenant_id" <?php e($primaryTenantDisabledAttr); ?>
<?php e($disabledAttr); ?>>
<?php if (count($selectedTenantIds) !== 1): ?>
<option value="">
<?php e(t('Select primary tenant')); ?>
</option>
<?php if (!$tenants): ?>
<?php
$emptyState = [
'message' => t('No tenants available'),
'hint' => t('No tenant is available in your current scope.'),
'size' => 'compact',
];
require templatePath('partials/app-empty-state.phtml');
?>
<?php else: ?>
<?php multiSelectForm('user-tenants', 'tenant_ids', 'Assigned tenants', 'Select tenants', $tenants, $selectedTenantIds, $isReadOnly); ?>
<label>
<span>
<?php e(t('Primary tenant')); ?>
</span>
</label>
<?php if ($primaryTenantDisabled && $primaryTenantId > 0): ?>
<input type="hidden" name="primary_tenant_id" value="<?php e((string) $primaryTenantId); ?>">
<?php endif; ?>
<?php foreach ($tenants as $tenant): ?>
<?php
$tenantId = (int) ($tenant['id'] ?? 0);
if (!in_array($tenantId, $selectedTenantIds ?? [], true)) {
continue;
}
$selected = $tenantId === $primaryTenantId ? 'selected' : '';
?>
<option value="<?php e((string) $tenantId); ?>" <?php e($selected); ?>>
<?php e($tenant['description'] ?? ''); ?>
</option>
<?php endforeach; ?>
</select>
<select id="user-primary-tenant" name="primary_tenant_id" <?php e($primaryTenantDisabledAttr); ?>
<?php e($disabledAttr); ?>>
<?php if (count($selectedTenantIds) !== 1): ?>
<option value="">
<?php e(t('Select primary tenant')); ?>
</option>
<?php endif; ?>
<?php foreach ($tenants as $tenant): ?>
<?php
$tenantId = (int) ($tenant['id'] ?? 0);
if (!in_array($tenantId, $selectedTenantIds ?? [], true)) {
continue;
}
$selected = $tenantId === $primaryTenantId ? 'selected' : '';
?>
<option value="<?php e((string) $tenantId); ?>" <?php e($selected); ?>>
<?php e($tenant['description'] ?? ''); ?>
</option>
<?php endforeach; ?>
</select>
<?php endif; ?>
</details>
<hr>
<?php endif; ?>
@@ -655,7 +671,18 @@ foreach ($tenants as $tenant) {
<details name="assignments-roles" data-details-key="assignments-roles">
<summary><?php e(t('Roles')); ?></summary>
<hr>
<?php multiSelectForm('user-roles', 'role_ids', 'Assigned roles', 'Select roles', $roles, $selectedRoleIds, $isReadOnly); ?>
<?php if (!$roles): ?>
<?php
$emptyState = [
'message' => t('No roles available'),
'hint' => t('No active roles are configured yet.'),
'size' => 'compact',
];
require templatePath('partials/app-empty-state.phtml');
?>
<?php else: ?>
<?php multiSelectForm('user-roles', 'role_ids', 'Assigned roles', 'Select roles', $roles, $selectedRoleIds, $isReadOnly); ?>
<?php endif; ?>
</details>
<?php endif; ?>
<?php endif; ?>
@@ -667,7 +694,8 @@ foreach ($tenants as $tenant) {
<?php if (!$permissionRows): ?>
<?php
$emptyState = [
'message' => t('No entries found'),
'message' => t('No effective permissions'),
'hint' => t('Assign at least one role to show effective permissions.'),
'size' => 'compact',
];
require templatePath('partials/app-empty-state.phtml');

View File

@@ -175,7 +175,7 @@ if ($canViewSecurityArtifacts) {
$apiTokens = $apiTokenService->listForUser($userId);
}
$canManageApiTokens = $canManageApiTokens && $canViewSecurityArtifacts;
$showApiTokens = $canViewSecurityArtifacts && (!empty($apiTokens) || $canManageApiTokens);
$showApiTokens = $canViewSecurityArtifacts;
if ($request->isMethod('POST') && !Session::checkCsrfToken()) {
Flash::error(t('Form expired, please try again'), $editTarget, 'csrf_expired');

View File

@@ -35,6 +35,7 @@ $adminNavGroups = [
[
'key' => 'admin-organization',
'label' => t('Organization'),
'icon' => 'bi-building',
'visible' => $hasOrganization,
'items' => [
[
@@ -63,6 +64,7 @@ $adminNavGroups = [
[
'key' => 'admin-roles-permissions',
'label' => t('Roles & permissions'),
'icon' => 'bi-shield-lock',
'visible' => $hasUsersSection,
'items' => [
[
@@ -84,6 +86,7 @@ $adminNavGroups = [
[
'key' => 'admin-automation',
'label' => t('Automation & integrations'),
'icon' => 'bi-plug',
'visible' => $hasAutomationSection,
'items' => [
[
@@ -112,6 +115,7 @@ $adminNavGroups = [
[
'key' => 'admin-monitoring',
'label' => t('Monitoring'),
'icon' => 'bi-graph-up',
'visible' => $hasMonitoringSection,
'items' => [
[
@@ -126,6 +130,7 @@ $adminNavGroups = [
[
'key' => 'admin-logs',
'label' => t('Logs'),
'icon' => 'bi-journal-text',
'visible' => $hasLogsSection,
'items' => [
[
@@ -168,6 +173,7 @@ $adminNavGroups = [
[
'key' => 'admin-system',
'label' => t('System'),
'icon' => 'bi-sliders',
'visible' => $hasSystemSection,
'items' => [
[
@@ -214,6 +220,7 @@ $renderAdminNavGroup = static function (array $group, string $tenantQueryParam):
<li class="app-sidebar-group app-sidebar-admin-group">
<details data-details-key="<?php e($groupKey); ?>"<?php if ($groupIsActive): ?> open<?php endif; ?>>
<summary>
<?php if (!empty($group['icon'])): ?><i class="bi <?php e($group['icon']); ?>"></i> <?php endif; ?>
<span><?php e($group['label'] ?? ''); ?></span>
</summary>
<ul>

View File

@@ -8,7 +8,7 @@
--app-sidebar-tenant-size: 14px;
--app-sidebar-titlebar-height: 30px;
--app-sidebar-border-width: 2px;
--app-sidebar-summary-max-width: 157px;
--app-sidebar-summary-max-width: 142px;
--app-sidebar-section-gap: 2rem;
--app-sidebar-section-space: 5px;
--app-sidebar-hover-bg: transparent;
@@ -36,6 +36,17 @@
display: block;
}
.app-sidebar-group.app-sidebar-admin-group details summary i {
font-size: 10px;
position: relative;
top: -4px;
margin-right: 3px;
}
aside.app-sidebar li:has(> .app-empty-state) {
padding-inline: 19px;
}
.app-sidebar .app-sidebar-panel[hidden] {
display: none !important;
}