diff --git a/portal/templates/app/project.html b/portal/templates/app/project.html index e26f990..043d784 100644 --- a/portal/templates/app/project.html +++ b/portal/templates/app/project.html @@ -967,10 +967,13 @@ // ---- Organizations ---- let allGlobalOrgs = []; + let _dealOrgsMap = {}; async function loadOrgs() { try { const res = await fetchAPI('/api/projects/' + projectID + '/orgs'); const orgs = await res.json(); + _dealOrgsMap = {}; + if (Array.isArray(orgs)) orgs.forEach(o => { _dealOrgsMap[o.deal_org_id] = o; }); const list = document.getElementById('orgList'); if (!orgs || orgs.length === 0) { list.innerHTML = '
No organizations added yet. Use "+ Add Org" to add parties to this deal.
'; @@ -997,7 +1000,7 @@ ${perms.folder_access === 'all' ? '📂 All folders' : '📂 Assigned only'} - ${members.length > 0 ? `
@@ -1268,6 +1271,12 @@ } // ---- Permissions Modal ---- + function openPermModalById(dealOrgId) { + const o = _dealOrgsMap[dealOrgId]; + if (!o) return; + openPermModal(o.deal_org_id, o.org_id, o.role, o.version || 1, JSON.stringify(o.permissions || {})); + } + function openPermModal(dealOrgId, orgId, role, version, permsJson) { let perms = {}; try { perms = JSON.parse(permsJson) || {}; } catch(e) {}