Fix bug with info dialog appearing on the wrong page

This commit is contained in:
zandercymatics 2025-03-27 12:10:18 -06:00
parent 58af877ca1
commit 7e8aad82f0
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7
3 changed files with 17 additions and 22 deletions

View file

@ -216,18 +216,13 @@ export function initPortfolioMemberPage() {
// NOTE: This logic does not trigger when the user is the ONLY admin in the portfolio. // 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. // This is because info alerts are used rather than modals in this case.
if (memberForm && editSelfWarningModal) { if (memberForm && editSelfWarningModal) {
console.log("Test")
// Only show the warning modal when the user is changing their ROLE. // Only show the warning modal when the user is changing their ROLE.
var canSubmit = document.querySelector(`input[name="role"]:checked`)?.value != "organization_member"; 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"]`); let radioButtons = document.querySelectorAll(`input[name="role"]`);
radioButtons.forEach(function (radioButton) { radioButtons.forEach(function (radioButton) {
radioButton.addEventListener("change", function() { radioButton.addEventListener("change", function() {
let selectedValue = radioButton.checked ? radioButton.value : null; let selectedValue = radioButton.checked ? radioButton.value : null;
canSubmit = selectedValue != "organization_member"; canSubmit = selectedValue != "organization_member";
console.log("selected value")
console.log(selectedValue)
}); });
}); });

View file

@ -98,7 +98,7 @@ Organization member
</address> </address>
{% if portfolio_permission %} {% if portfolio_permission %}
{% if is_only_admin %} {% if member and member.id == request.user.id and is_only_admin %}
<div class="usa-alert usa-alert--info usa-alert--slim"> <div class="usa-alert usa-alert--info usa-alert--slim">
<div class="usa-alert__body"> <div class="usa-alert__body">
<p class="usa-alert__text "> <p class="usa-alert__text ">

View file

@ -82,7 +82,7 @@
<h2 class="margin-top-0">Member access</h2> <h2 class="margin-top-0">Member access</h2>
</legend> </legend>
{% if is_only_admin %} {% if member and member.id == request.user.id and is_only_admin %}
<div class="usa-alert usa-alert--info usa-alert--slim margin-top-1 margin-bottom-1"> <div class="usa-alert usa-alert--info usa-alert--slim margin-top-1 margin-bottom-1">
<div class="usa-alert__body"> <div class="usa-alert__body">
<p class="usa-alert__text "> <p class="usa-alert__text ">