Merge branch 'main' into XX/documentation-for-cloning-workflow

This commit is contained in:
Matt-Spence 2025-01-08 10:36:46 -05:00 committed by GitHub
commit 073e405f78
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 925 additions and 3793 deletions

4666
src/package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -17,7 +17,7 @@
"devDependencies": { "devDependencies": {
"@babel/core": "^7.26.0", "@babel/core": "^7.26.0",
"@babel/preset-env": "^7.26.0", "@babel/preset-env": "^7.26.0",
"@uswds/compile": "1.1.0", "@uswds/compile": "1.2.1",
"babel-loader": "^9.2.1", "babel-loader": "^9.2.1",
"sass-loader": "^12.6.0", "sass-loader": "^12.6.0",
"webpack": "^5.96.1", "webpack": "^5.96.1",

View file

@ -13,6 +13,7 @@ export function handleRequestingEntityFieldset() {
const selectParent = select?.parentElement; const selectParent = select?.parentElement;
const suborgContainer = document.getElementById("suborganization-container"); const suborgContainer = document.getElementById("suborganization-container");
const suborgDetailsContainer = document.getElementById("suborganization-container__details"); const suborgDetailsContainer = document.getElementById("suborganization-container__details");
const suborgAddtlInstruction = document.getElementById("suborganization-addtl-instruction");
const subOrgCreateNewOption = document.getElementById("option-to-add-suborg")?.value; const subOrgCreateNewOption = document.getElementById("option-to-add-suborg")?.value;
// Make sure all crucial page elements exist before proceeding. // Make sure all crucial page elements exist before proceeding.
// This more or less ensures that we are on the Requesting Entity page, and not elsewhere. // This more or less ensures that we are on the Requesting Entity page, and not elsewhere.
@ -26,7 +27,13 @@ export function handleRequestingEntityFieldset() {
function toggleSuborganization(radio=null) { function toggleSuborganization(radio=null) {
if (radio != null) requestingSuborganization = radio?.checked && radio.value === "True"; if (radio != null) requestingSuborganization = radio?.checked && radio.value === "True";
requestingSuborganization ? showElement(suborgContainer) : hideElement(suborgContainer); requestingSuborganization ? showElement(suborgContainer) : hideElement(suborgContainer);
requestingNewSuborganization.value = requestingSuborganization && select.value === "other" ? "True" : "False"; if (select.options.length == 2) { // --Select-- and other are the only options
hideElement(selectParent); // Hide the select drop down and indicate requesting new suborg
hideElement(suborgAddtlInstruction); // Hide additional instruction related to the list
requestingNewSuborganization.value = "True";
} else {
requestingNewSuborganization.value = requestingSuborganization && select.value === "other" ? "True" : "False";
}
requestingNewSuborganization.value === "True" ? showElement(suborgDetailsContainer) : hideElement(suborgDetailsContainer); requestingNewSuborganization.value === "True" ? showElement(suborgDetailsContainer) : hideElement(suborgDetailsContainer);
} }

View file

@ -137,7 +137,7 @@ export class MembersTable extends BaseTable {
} }
// This easter egg is only for fixtures that dont have names as we are displaying their emails // This easter egg is only for fixtures that dont have names as we are displaying their emails
// All prod users will have emails linked to their account // All prod users will have emails linked to their account
if (customTableOptions.needsAdditionalColumn) MembersTable.addMemberModal(num_domains, member.email || "Samwise Gamgee", member_delete_url, unique_id, row); if (customTableOptions.needsAdditionalColumn) MembersTable.addMemberDeleteModal(num_domains, member.email || "Samwise Gamgee", member_delete_url, unique_id, row);
} }
/** /**
@ -417,24 +417,21 @@ export class MembersTable extends BaseTable {
* @param {string} submit_delete_url - `${member_type}-${member_id}/delete` * @param {string} submit_delete_url - `${member_type}-${member_id}/delete`
* @param {HTMLElement} wrapper_element - The element to which the modal is appended * @param {HTMLElement} wrapper_element - The element to which the modal is appended
*/ */
static addMemberModal(num_domains, member_email, submit_delete_url, id, wrapper_element) { static addMemberDeleteModal(num_domains, member_email, submit_delete_url, id, wrapper_element) {
let modalHeading = '';
let modalDescription = '';
if (num_domains == 0){ let modalHeading = ``;
let modalDescription = ``;
if (num_domains >= 0){
modalHeading = `Are you sure you want to delete ${member_email}?`; modalHeading = `Are you sure you want to delete ${member_email}?`;
modalDescription = `They will no longer be able to access this organization. modalDescription = `They will no longer be able to access this organization.
This action cannot be undone.`; This action cannot be undone.`;
} else if (num_domains == 1) { 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. 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 Removing them from the organization will remove them from all of their domains. They will no longer be able to
access this organization. This action cannot be undone.`; 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.`;
} }
const modalSubmit = ` const modalSubmit = `

View file

@ -159,9 +159,12 @@ class RequestingEntityYesNoForm(BaseYesNoForm):
"""Extend the initialization of the form from RegistrarForm __init__""" """Extend the initialization of the form from RegistrarForm __init__"""
super().__init__(*args, **kwargs) super().__init__(*args, **kwargs)
if self.domain_request.portfolio: if self.domain_request.portfolio:
choose_text = (
"(choose from list)" if self.domain_request.portfolio.portfolio_suborganizations.exists() else ""
)
self.form_choices = ( self.form_choices = (
(False, self.domain_request.portfolio), (False, self.domain_request.portfolio),
(True, "A suborganization (choose from list)"), (True, f"A suborganization {choose_text}"),
) )
self.fields[self.field_name] = self.get_typed_choice_field() self.fields[self.field_name] = self.get_typed_choice_field()

View file

@ -6,11 +6,7 @@
<ul class="usa-list"> <ul class="usa-list">
<li>Be available </li> <li>Be available </li>
<li>Relate to your organizations name, location, and/or services </li> <li>Relate to your organizations name, location, and/or services </li>
{% if portfolio %}
<li>Be clear to the general public. Your domain name must not be easily confused with other organizations.</li>
{% else %}
<li>Be unlikely to mislead or confuse the general public (even if your domain is only intended for a specific audience) </li> <li>Be unlikely to mislead or confuse the general public (even if your domain is only intended for a specific audience) </li>
{% endif %}
</ul> </ul>
</p> </p>

View file

@ -38,8 +38,9 @@
<div id="suborganization-container" class="margin-top-4"> <div id="suborganization-container" class="margin-top-4">
<h2>Add suborganization information</h2> <h2>Add suborganization information</h2>
<p> <p>
This information will be published in <a class="usa-link usa-link--always-blue" target="_blank" href="{% public_site_url 'about/data' %}">.govs public data</a>. If you dont see your suborganization in the list, This information will be published in <a class="usa-link usa-link--always-blue" target="_blank" href="{% public_site_url 'about/data' %}">.govs public data</a>.
select “other.” <span id="suborganization-addtl-instruction"> If you dont see your suborganization in the list,
select “other.”</span>
</p> </p>
{% with attr_required=True %} {% with attr_required=True %}
{% input_with_errors forms.1.sub_organization %} {% input_with_errors forms.1.sub_organization %}