feat(admin): progressive disclosure for LDAP config in tenant edit

Hide LDAP connection, search/bind, and attribute mapping cards until
the "Enable LDAP login" toggle is activated — same UX pattern as the
Microsoft SSO section using data-tenant-ldap-* attributes and a
mirrored JS toggle component.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-25 07:43:57 +01:00
parent 80f48f4aba
commit 6be97205f3
3 changed files with 107 additions and 3 deletions

View File

@@ -811,10 +811,11 @@ $openOverrideCard = $detailsOpenAll;
</button>
<span id="ldap-test-connection-result" aria-live="polite"></span>
</p>
</div>
</div>
</details>
<details class="app-details-card" name="tenant-ldap-search" <?php e($detailsOpenAll ? 'open' : ''); ?>>
<details class="app-details-card" name="tenant-ldap-search" data-tenant-ldap-when-enabled <?php e($detailsOpenAll ? 'open' : ''); ?>>
<summary>
<span class="app-details-card-summary-title"><?php e(t('Search and bind settings')); ?></span>
</summary>
@@ -862,7 +863,7 @@ $openOverrideCard = $detailsOpenAll;
</div>
</details>
<details class="app-details-card" name="tenant-ldap-mapping" <?php e($detailsOpenAll ? 'open' : ''); ?>>
<details class="app-details-card" name="tenant-ldap-mapping" data-tenant-ldap-when-enabled <?php e($detailsOpenAll ? 'open' : ''); ?>>
<summary>
<span class="app-details-card-summary-title"><?php e(t('Attribute mapping and sync')); ?></span>
</summary>
@@ -890,11 +891,12 @@ $openOverrideCard = $detailsOpenAll;
<hr>
<label class="app-field">
<input type="checkbox" role="switch" name="ldap_sync_profile_on_login" value="1"
data-tenant-ldap-sync-toggle
<?php e($ldapSyncProfileOnLogin ? 'checked' : ''); ?> <?php e($disabledAttr); ?>>
<span><?php e(t('Profile sync on LDAP login')); ?></span>
</label>
<small class="muted"><?php e(t('User profile fields are global and affect all tenants of this user')); ?></small>
<div class="grid grid-1-1">
<div data-tenant-ldap-sync-fields class="grid grid-1-1">
<?php foreach ($ldapSyncFieldOptions as $syncFieldKey => $syncFieldLabel): ?>
<label class="app-field">
<input type="checkbox" name="ldap_sync_profile_fields[]"
@@ -920,6 +922,7 @@ $openOverrideCard = $detailsOpenAll;
</label>
</div>
</details>
</div>
</div>
<?php endif; ?>