Standardize global empty-state UI component
This commit is contained in:
@@ -257,7 +257,7 @@ require templatePath('partials/app-breadcrumb.phtml');
|
||||
</tbody>
|
||||
</table>
|
||||
<?php else: ?>
|
||||
<small class="muted"><?php e(t('No entries found')); ?></small>
|
||||
<?php $emptyState = ['message' => t('No entries found'), 'size' => 'compact']; require templatePath('partials/app-empty-state.phtml'); ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="app-stats-table">
|
||||
@@ -291,7 +291,7 @@ require templatePath('partials/app-breadcrumb.phtml');
|
||||
</tbody>
|
||||
</table>
|
||||
<?php else: ?>
|
||||
<small class="muted"><?php e(t('No entries found')); ?></small>
|
||||
<?php $emptyState = ['message' => t('No entries found'), 'size' => 'compact']; require templatePath('partials/app-empty-state.phtml'); ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
@@ -546,7 +546,7 @@ require templatePath('partials/app-breadcrumb.phtml');
|
||||
</table>
|
||||
<?php else: ?>
|
||||
<div class="app-stats-table-empty">
|
||||
<small class="muted"><?php e(t('No entries found')); ?></small>
|
||||
<?php $emptyState = ['message' => t('No entries found'), 'size' => 'compact']; require templatePath('partials/app-empty-state.phtml'); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php elseif ($canViewUserLifecycleAudit && $userLifecycleAuditStatsAvailable): ?>
|
||||
@@ -569,12 +569,12 @@ require templatePath('partials/app-breadcrumb.phtml');
|
||||
</table>
|
||||
<?php else: ?>
|
||||
<div class="app-stats-table-empty">
|
||||
<small class="muted"><?php e(t('No entries found')); ?></small>
|
||||
<?php $emptyState = ['message' => t('No entries found'), 'size' => 'compact']; require templatePath('partials/app-empty-state.phtml'); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php else: ?>
|
||||
<div class="app-stats-table-empty">
|
||||
<small class="muted"><?php e(t('No entries found')); ?></small>
|
||||
<?php $emptyState = ['message' => t('No entries found'), 'size' => 'compact']; require templatePath('partials/app-empty-state.phtml'); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
@@ -625,7 +625,7 @@ require templatePath('partials/app-breadcrumb.phtml');
|
||||
</table>
|
||||
<?php else: ?>
|
||||
<div class="app-stats-table-empty">
|
||||
<small class="muted"><?php e(t('No entries found')); ?></small>
|
||||
<?php $emptyState = ['message' => t('No entries found'), 'size' => 'compact']; require templatePath('partials/app-empty-state.phtml'); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php elseif ($canViewSystemAudit && $systemAuditStatsAvailable): ?>
|
||||
@@ -650,12 +650,12 @@ require templatePath('partials/app-breadcrumb.phtml');
|
||||
</table>
|
||||
<?php else: ?>
|
||||
<div class="app-stats-table-empty">
|
||||
<small class="muted"><?php e(t('No entries found')); ?></small>
|
||||
<?php $emptyState = ['message' => t('No entries found'), 'size' => 'compact']; require templatePath('partials/app-empty-state.phtml'); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php else: ?>
|
||||
<div class="app-stats-table-empty">
|
||||
<small class="muted"><?php e(t('No entries found')); ?></small>
|
||||
<?php $emptyState = ['message' => t('No entries found'), 'size' => 'compact']; require templatePath('partials/app-empty-state.phtml'); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
@@ -806,7 +806,7 @@ require templatePath('partials/app-breadcrumb.phtml');
|
||||
</table>
|
||||
<?php else: ?>
|
||||
<div class="app-stats-table-empty">
|
||||
<small class="muted"><?php e(t('No entries found')); ?></small>
|
||||
<?php $emptyState = ['message' => t('No entries found'), 'size' => 'compact']; require templatePath('partials/app-empty-state.phtml'); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="app-stats-table-explanation">
|
||||
@@ -916,7 +916,7 @@ require templatePath('partials/app-breadcrumb.phtml');
|
||||
</table>
|
||||
<?php else: ?>
|
||||
<div class="app-stats-table-empty">
|
||||
<small class="muted"><?php e(t('No entries found')); ?></small>
|
||||
<?php $emptyState = ['message' => t('No entries found'), 'size' => 'compact']; require templatePath('partials/app-empty-state.phtml'); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
@@ -948,7 +948,7 @@ require templatePath('partials/app-breadcrumb.phtml');
|
||||
</table>
|
||||
<?php else: ?>
|
||||
<div class="app-stats-table-empty">
|
||||
<small class="muted"><?php e(t('No entries found')); ?></small>
|
||||
<?php $emptyState = ['message' => t('No entries found'), 'size' => 'compact']; require templatePath('partials/app-empty-state.phtml'); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
@@ -1068,7 +1068,7 @@ require templatePath('partials/app-breadcrumb.phtml');
|
||||
</table>
|
||||
<?php else: ?>
|
||||
<div class="app-stats-table-empty">
|
||||
<small class="muted"><?php e(t('No entries found')); ?></small>
|
||||
<?php $emptyState = ['message' => t('No entries found'), 'size' => 'compact']; require templatePath('partials/app-empty-state.phtml'); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
@@ -1109,7 +1109,7 @@ require templatePath('partials/app-breadcrumb.phtml');
|
||||
</table>
|
||||
<?php else: ?>
|
||||
<div class="app-stats-table-empty">
|
||||
<small class="muted"><?php e(t('No entries found')); ?></small>
|
||||
<?php $emptyState = ['message' => t('No entries found'), 'size' => 'compact']; require templatePath('partials/app-empty-state.phtml'); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
@@ -1137,7 +1137,7 @@ require templatePath('partials/app-breadcrumb.phtml');
|
||||
</table>
|
||||
<?php else: ?>
|
||||
<div class="app-stats-table-empty">
|
||||
<small class="muted"><?php e(t('No entries found')); ?></small>
|
||||
<?php $emptyState = ['message' => t('No entries found'), 'size' => 'compact']; require templatePath('partials/app-empty-state.phtml'); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
@@ -282,7 +282,13 @@ $ssoSyncNeedsGraph = !empty($ssoUiState['sync_needs_graph']);
|
||||
</details>
|
||||
<hr>
|
||||
<?php if (!$customFieldDefinitions): ?>
|
||||
<p class="muted"><?php e(t('No custom fields configured yet')); ?></p>
|
||||
<?php
|
||||
$emptyState = [
|
||||
'message' => t('No custom fields configured yet'),
|
||||
'size' => 'compact',
|
||||
];
|
||||
require templatePath('partials/app-empty-state.phtml');
|
||||
?>
|
||||
<?php endif; ?>
|
||||
<?php foreach ($customFieldDefinitions as $definition): ?>
|
||||
<?php
|
||||
|
||||
@@ -678,15 +678,25 @@ foreach ($tenants as $tenant) {
|
||||
<p class="muted"><?php e(t('Assign tenants first to edit custom fields')); ?></p>
|
||||
<?php else: ?>
|
||||
<?php $hasRenderedCustomFields = false; ?>
|
||||
<?php $hasConfiguredTenantDefinitions = false; ?>
|
||||
<?php foreach ($customFieldTenantMap as $tenantId => $tenant): ?>
|
||||
<?php $tenantDefinitions = $customFieldDefinitionsByTenant[$tenantId] ?? []; ?>
|
||||
<?php if ($tenantDefinitions): ?>
|
||||
<?php $hasConfiguredTenantDefinitions = true; ?>
|
||||
<?php endif; ?>
|
||||
<details name="custom-fields-tenant" data-details-key="custom-fields-tenant-<?php e((string) $tenantId); ?>">
|
||||
<summary>
|
||||
<?php e((string) ($tenant['description'] ?? t('Custom fields for tenant'))); ?>
|
||||
</summary>
|
||||
<hr>
|
||||
<?php if (!$tenantDefinitions): ?>
|
||||
<p class="muted"><?php e(t('No custom fields configured for this tenant')); ?></p>
|
||||
<?php
|
||||
$emptyState = [
|
||||
'message' => t('No custom fields configured for this tenant'),
|
||||
'size' => 'compact',
|
||||
];
|
||||
require templatePath('partials/app-empty-state.phtml');
|
||||
?>
|
||||
<?php else: ?>
|
||||
<div>
|
||||
<?php foreach ($tenantDefinitions as $definition): ?>
|
||||
@@ -829,8 +839,14 @@ foreach ($tenants as $tenant) {
|
||||
</details>
|
||||
<hr>
|
||||
<?php endforeach; ?>
|
||||
<?php if (!$hasRenderedCustomFields): ?>
|
||||
<p class="muted"><?php e(t('No custom fields configured for selected tenants')); ?></p>
|
||||
<?php if (!$hasRenderedCustomFields && $hasConfiguredTenantDefinitions): ?>
|
||||
<?php
|
||||
$emptyState = [
|
||||
'message' => t('No custom fields configured for selected tenants'),
|
||||
'size' => 'compact',
|
||||
];
|
||||
require templatePath('partials/app-empty-state.phtml');
|
||||
?>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user