Update portfolio-member-page.js

This commit is contained in:
zandercymatics 2025-03-27 11:07:28 -06:00
parent 0f1509fe73
commit c0b68eebe8
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7

View file

@ -215,14 +215,19 @@ export function initPortfolioMemberPage() {
// The dom will include these elements when this occurs.
// NOTE: This logic does not trigger when the user is the ONLY admin in the portfolio.
// This is because info alerts are used rather than modals in this case.
if (memberForm && editSelfWarningModal && editSelfWarningModalConfirm) {
if (memberForm && editSelfWarningModal) {
console.log("Test")
// Only show the warning modal when the user is changing their ROLE.
var canSubmit = document.querySelector(`input[name="role"]:checked`)?.value != "organization_member";
console.log("can submit")
console.log(canSubmit)
let radioButtons = document.querySelectorAll(`input[name="role"]`);
radioButtons.forEach(function (radioButton) {
radioButton.addEventListener("change", function() {
selectedValue = radioButton.checked ? radioButton.value : null;
canSubmit = selectedValue != "organization_member";
console.log("selected value")
console.log(selectedValue)
});
});