diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b0cf24..15330e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ All notable changes to this project are documented here. Format loosely follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/); versions correspond to git tags (`vX.Y.Z`) and `nodejs/package.json`'s `version`. +## [1.8.1] - 2026-07-28 + +### Fixed +- **The resource modal's "Associated LDAP Groups" autocomplete went empty after the first Add/Edit** — `loadLdapGroups()`'s fetch-once cache guard (`if (ldapGroupsCache) return;`) also skipped repopulating the `` on every call after the first, but the modal body (including that ``) is rebuilt fresh and empty on every `app.modal.open()`. Now the fetch is still cached, but the datalist is always repopulated. + ## [1.8.0] - 2026-07-28 ### Added diff --git a/nodejs/package.json b/nodejs/package.json index 9c13b84..502e514 100755 --- a/nodejs/package.json +++ b/nodejs/package.json @@ -1,6 +1,6 @@ { "name": "t42-sso-manager", - "version": "1.8.0", + "version": "1.8.1", "description": "A very simple LDAP management and SSO system", "author": [ { diff --git a/nodejs/views/directory.ejs b/nodejs/views/directory.ejs index d3ca838..e9aa7b6 100644 --- a/nodejs/views/directory.ejs +++ b/nodejs/views/directory.ejs @@ -563,10 +563,15 @@ var ldapGroupsCache = null; async function loadLdapGroups() { - if (ldapGroupsCache) return; try { - const res = await app.api.get('group'); - ldapGroupsCache = res.results; + if (!ldapGroupsCache) { + const res = await app.api.get('group'); + ldapGroupsCache = res.results; + } + // Re-populate every call, not just the first -- #ldap-groups-datalist + // is rebuilt fresh (empty) on every app.modal.open(), so returning + // early here on a cache hit left the second and later modal opens + // with no autocomplete options at all. const $datalist = $('#ldap-groups-datalist'); $datalist.empty(); for (const cn of ldapGroupsCache) {