From 875593c0c2b923dd891dbd6c43cf4df99c8e4863 Mon Sep 17 00:00:00 2001 From: James Date: Tue, 17 Mar 2026 21:01:19 -0400 Subject: [PATCH] =?UTF-8?q?feat:=20remove=20org=20from=20deal=20=E2=80=94?= =?UTF-8?q?=20=E2=8B=AF=20menu=20on=20org=20card=20with=20Permissions=20+?= =?UTF-8?q?=20Remove=20from=20deal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- portal/templates/app/project.html | 47 +++++++++++++++++++++++++++++-- 1 file changed, 45 insertions(+), 2 deletions(-) diff --git a/portal/templates/app/project.html b/portal/templates/app/project.html index b3dd0b6..38e8c21 100644 --- a/portal/templates/app/project.html +++ b/portal/templates/app/project.html @@ -1240,8 +1240,21 @@ })()} - +
+ +
+ + +
+
@@ -1847,6 +1860,36 @@ }); // ---- Permissions Modal ---- + // ---- Org card menu ---- + function toggleOrgMenu(dealOrgId) { + const drop = document.getElementById('orgMenuDrop_' + dealOrgId); + if (!drop) return; + const isHidden = drop.classList.contains('hidden'); + // Close all other open org menus + document.querySelectorAll('[id^="orgMenuDrop_"]').forEach(d => d.classList.add('hidden')); + if (isHidden) drop.classList.remove('hidden'); + } + + function closeOrgMenu(dealOrgId) { + const drop = document.getElementById('orgMenuDrop_' + dealOrgId); + if (drop) drop.classList.add('hidden'); + } + + document.addEventListener('click', e => { + if (!e.target.closest('[id^="orgMenu_"]')) { + document.querySelectorAll('[id^="orgMenuDrop_"]').forEach(d => d.classList.add('hidden')); + } + }); + + async function removeDealOrg(dealOrgId, orgName) { + if (!confirm('Remove ' + orgName + ' from this deal? Their access will be revoked.')) return; + try { + const res = await fetchAPI('/api/projects/' + projectID + '/entries/' + dealOrgId, { method: 'DELETE' }); + if (!res.ok) { const d = await res.json(); throw new Error(d.error || 'Failed to remove org'); } + loadOrgs(); + } catch(e) { alert(e.message); } + } + function openPermModalById(dealOrgId) { const o = _dealOrgsMap[dealOrgId]; if (!o) return;