diff --git a/src/registrar/assets/src/js/getgov/main.js b/src/registrar/assets/src/js/getgov/main.js index 21efd492e..f077448aa 100644 --- a/src/registrar/assets/src/js/getgov/main.js +++ b/src/registrar/assets/src/js/getgov/main.js @@ -10,7 +10,7 @@ import { initDomainRequestsTable } from './table-domain-requests.js'; import { initMembersTable } from './table-members.js'; import { initMemberDomainsTable } from './table-member-domains.js'; import { initEditMemberDomainsTable } from './table-edit-member-domains.js'; -import { initPortfolioNewMemberPageToggle, initAddNewMemberPageListeners, initPortfolioMemberPage } from './portfolio-member-page.js'; +import { initPortfolioNewMemberPageToggle, initAddNewMemberPageListeners, initPortfolioMemberPageRadio } from './portfolio-member-page.js'; import { initDomainRequestForm } from './domain-request-form.js'; import { initDomainManagersPage } from './domain-managers.js'; import { initDomainDSData } from './domain-dsdata.js'; @@ -56,10 +56,8 @@ initDomainDNSSEC(); initFormErrorHandling(); -// Init the portfolio member page -initPortfolioMemberPage(); - // Init the portfolio new member page +initPortfolioMemberPageRadio(); initPortfolioNewMemberPageToggle(); initAddNewMemberPageListeners(); diff --git a/src/registrar/assets/src/js/getgov/portfolio-member-page.js b/src/registrar/assets/src/js/getgov/portfolio-member-page.js index 6dfb4c041..96961e5dc 100644 --- a/src/registrar/assets/src/js/getgov/portfolio-member-page.js +++ b/src/registrar/assets/src/js/getgov/portfolio-member-page.js @@ -193,14 +193,10 @@ export function initAddNewMemberPageListeners() { } // Initalize the radio for the member pages -export function initPortfolioMemberPage() { +export function initPortfolioMemberPageRadio() { document.addEventListener("DOMContentLoaded", () => { let memberForm = document.getElementById("member_form"); - let newMemberForm = document.getElementById("add_member_form"); - let editSelfWarningModal = document.getElementById("toggle-member-permissions-edit-self"); - let editSelfWarningModalConfirm = document.getElementById("member-permissions-edit-self"); - - // Init the radio + let newMemberForm = document.getElementById("add_member_form") if (memberForm || newMemberForm) { hookupRadioTogglerListener( 'role', @@ -210,23 +206,5 @@ export function initPortfolioMemberPage() { } ); } - - // Init the "edit self" warning modal - if (memberForm && editSelfWarningModal) { - var canSubmit = false; - memberForm.addEventListener("submit", function(e) { - if (!canSubmit) { - e.preventDefault(); - } - editSelfWarningModal.click(); - }); - - if (editSelfWarningModalConfirm) { - editSelfWarningModalConfirm.addEventListener("click", function() { - canSubmit = true; - memberForm.submit(); - }); - } - } }); } diff --git a/src/registrar/templates/portfolio_member_permissions.html b/src/registrar/templates/portfolio_member_permissions.html index 5558786c3..e5ae5864e 100644 --- a/src/registrar/templates/portfolio_member_permissions.html +++ b/src/registrar/templates/portfolio_member_permissions.html @@ -109,26 +109,4 @@ - -{% comment %} If an admin is trying to edit themselves, show a modal {% endcomment %} - {% if member and member.id == request.user.id %} - Edit self -