refactor(admin-lists): slim tenant + user grids, Stripe-style pagination

Tenant list:
- Drop the avatar/logo column — the list now shows only Tenant name
  and user count. Also drop the logo-hasLogo server lookup and the
  initials/placeholder markup.

User list (13 → 4 columns, Stripe pattern):
- User (compound: avatar + Name + email subtitle, click opens drawer)
- Tenants (badges, primary tooltip)
- Last login (relative badge)
- State (active/inactive badge)
- UUID hidden at the last column for cells[uuidIndex].data
- Everything else (departments, roles, phone, mobile, short_dial,
  created, modified) lives in the detail drawer.
- Document the off-by-one gotcha: with row selection enabled gridjs
  prepends a checkbox cell, so runtime cells[] are shifted by +1;
  uuidIndex is 5 (column position 4 + selection offset).
- New .grid-user-profile css mirrors .grid-tenant-profile (avatar +
  stacked name/email) with ellipsis and primary-color hover affordance.

Pagination (all Grid.js lists):
- Non-current page buttons now use the neutral-chip secondary-outline
  tokens (--app-button-neutral-*) plus the raised box-shadow — matches
  the rest of the button system in both light and dark themes.
- Current page stays distinctly primary-filled with the filled-shadow;
  focus-visible combines the chip shadow with the primary focus ring.
- Disabled pager buttons remain neutral but lose the lift shadow.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-24 21:52:44 +02:00
parent fa86009e3f
commit 874a90d8f8
6 changed files with 117 additions and 129 deletions

View File

@@ -19,11 +19,10 @@ $order = $filters['order'];
$dir = $filters['dir'];
$computedOrderKeys = ['users'];
$userTenantRepository = app(\MintyPHP\Repository\Tenant\UserTenantRepository::class);
$tenantLogoService = app(\MintyPHP\Service\Tenant\TenantLogoService::class);
$settingsDefaultsGateway = app(\MintyPHP\Service\Settings\SettingsDefaultsGateway::class);
$gridUserCountEnricher = app(\MintyPHP\Service\Data\GridUserCountEnricher::class);
$fetchRows = static function (array $tenantRows) use ($userTenantRepository, $tenantLogoService, $settingsDefaultsGateway, $gridUserCountEnricher): array {
$fetchRows = static function (array $tenantRows) use ($userTenantRepository, $settingsDefaultsGateway, $gridUserCountEnricher): array {
$userCounts = $gridUserCountEnricher->computeCounts(
$tenantRows,
$userTenantRepository->countUsersByTenantIds(...),
@@ -47,10 +46,6 @@ $fetchRows = static function (array $tenantRows) use ($userTenantRepository, $te
'status_badge' => $tenantStatus->badgeVariant(),
'status_label' => t($tenantStatus->labelToken()),
'total_users' => $counts['active_users'] + $counts['inactive_users'],
'has_logo' => $tenantUuid !== '' && (
$tenantLogoService->hasLogo($tenantUuid, \MintyPHP\Service\Tenant\TenantLogoService::THEME_LIGHT)
|| $tenantLogoService->hasLogo($tenantUuid, \MintyPHP\Service\Tenant\TenantLogoService::THEME_DARK)
),
];
}

View File

@@ -43,7 +43,6 @@ $pageConfig = [
'filterChipMeta' => $filterChipMeta,
'gridLang' => $gridLang,
'labels' => [
'logo' => t('Logo'),
'tenant' => t('Tenant'),
'users' => t('Users'),
],

View File

@@ -117,19 +117,9 @@ $pageConfig = [
'csrf' => $gridCsrf,
'gridLang' => $gridLang,
'labels' => [
'avatar' => t('Avatar'),
'firstName' => t('First name'),
'lastName' => t('Last name'),
'email' => t('Email'),
'user' => t('User'),
'state' => t('State'),
'tenants' => t('Tenants'),
'departments' => t('Departments'),
'roles' => t('Roles'),
'phone' => t('Phone'),
'mobile' => t('Mobile'),
'shortDial' => t('Short dial'),
'created' => t('Created'),
'modified' => t('Modified'),
'lastLogin' => t('Last login'),
'selectAll' => t('Select all'),
'active' => t('Active'),