mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-23 19:20:47 +02:00
Slight refactor to remove code duplication.
This commit is contained in:
parent
dbc2816ce5
commit
5e8eb13bcf
1 changed files with 11 additions and 14 deletions
|
@ -417,24 +417,21 @@ export class MembersTable extends BaseTable {
|
|||
* @param {string} submit_delete_url - `${member_type}-${member_id}/delete`
|
||||
* @param {HTMLElement} wrapper_element - The element to which the modal is appended
|
||||
*/
|
||||
static addMemberModal(num_domains, member_email, submit_delete_url, id, wrapper_element) {
|
||||
let modalHeading = '';
|
||||
let modalDescription = '';
|
||||
static addMemberDeleteModal(num_domains, member_email, submit_delete_url, id, wrapper_element) {
|
||||
|
||||
if (num_domains == 0){
|
||||
let modalHeading = ``;
|
||||
let modalDescription = ``;
|
||||
|
||||
if (num_domains >= 0){
|
||||
modalHeading = `Are you sure you want to delete ${member_email}?`;
|
||||
modalDescription = `They will no longer be able to access this organization.
|
||||
This action cannot be undone.`;
|
||||
} else if (num_domains == 1) {
|
||||
modalHeading = `Are you sure you want to delete ${member_email}?`;
|
||||
modalDescription = `<b>${member_email}</b> currently manages ${num_domains} domain in the organization.
|
||||
Removing them from the organization will remove all of their domains. They will no longer be able to
|
||||
access this organization. This action cannot be undone.`;
|
||||
} else if (num_domains > 1) {
|
||||
modalHeading = `Are you sure you want to delete ${member_email}?`;
|
||||
modalDescription = `<b>${member_email}</b> currently manages ${num_domains} domains in the organization.
|
||||
Removing them from the organization will remove all of their domains. They will no longer be able to
|
||||
access this organization. This action cannot be undone.`;
|
||||
if (num_domains >= 1)
|
||||
{
|
||||
modalDescription = `<b>${member_email}</b> currently manages ${num_domains} domain${num_domains > 1 ? "s": ""} in the organization.
|
||||
Removing them from the organization will remove all of their domains. They will no longer be able to
|
||||
access this organization. This action cannot be undone.`;
|
||||
}
|
||||
}
|
||||
|
||||
const modalSubmit = `
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue