Main update
All checks were successful
Deploy / deploy-staging (push) Successful in 25s
Deploy / deploy-production (push) Has been skipped

This commit is contained in:
2026-06-24 02:24:39 +02:00
parent 5ff4c3fb2b
commit d121f74bd0
34 changed files with 2548 additions and 67 deletions

View File

@@ -48,6 +48,7 @@
username: String(user?.username || ''),
display_name: String(user?.display_name || ''),
email: String(user?.email || ''),
group_dns: Array.isArray(user?.group_dns) ? user.group_dns.map((group) => String(group || '')) : [],
search: [
String(user?.username || ''),
String(user?.display_name || ''),
@@ -74,6 +75,35 @@
}
input.dataset.umPickerBound = '1';
const syncGroupSelection = (username) => {
const normalizedUsername = String(username || '').trim().toLowerCase();
host.querySelectorAll('input[name="manual_group_dns[]"]').forEach((checkbox) => {
if (!(checkbox instanceof HTMLInputElement)) {
return;
}
checkbox.checked = false;
});
if (normalizedUsername === '') {
return;
}
const user = normalizedUsers.find((entry) => entry.username.toLowerCase() === normalizedUsername);
if (!user) {
return;
}
const selectedGroups = new Set(user.group_dns);
host.querySelectorAll('input[name="manual_group_dns[]"]').forEach((checkbox) => {
if (!(checkbox instanceof HTMLInputElement)) {
return;
}
checkbox.checked = selectedGroups.has(checkbox.value);
});
};
const renderMatches = () => {
const needle = input.value.trim().toLowerCase();
const matches = normalizedUsers
@@ -109,8 +139,17 @@
input.value = String(option.dataset.userPickerValue || '');
list.hidden = true;
list.innerHTML = '';
syncGroupSelection(input.value);
input.dispatchEvent(new Event('change', { bubbles: true }));
});
input.addEventListener('change', () => {
syncGroupSelection(input.value);
});
if (input.value.trim() !== '') {
syncGroupSelection(input.value);
}
});
if (!host.dataset.umPickerOutsideBound) {