mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-08-13 21:19:42 +02:00
updates
This commit is contained in:
commit
c605dcbd5a
5 changed files with 7 additions and 33 deletions
|
@ -2926,6 +2926,8 @@ document.addEventListener("DOMContentLoaded", () => {
|
||||||
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 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.
|
||||||
|
// This more or less ensures that we are on the Requesting Entity page, and not elsewhere.
|
||||||
if (!radios || !select || !selectParent || !suborgContainer || !suborgDetailsContainer) return;
|
if (!radios || !select || !selectParent || !suborgContainer || !suborgDetailsContainer) return;
|
||||||
|
|
||||||
// requestingSuborganization: This just broadly determines if they're requesting a suborg at all
|
// requestingSuborganization: This just broadly determines if they're requesting a suborg at all
|
||||||
|
@ -2937,14 +2939,6 @@ document.addEventListener("DOMContentLoaded", () => {
|
||||||
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";
|
requestingNewSuborganization.value = requestingSuborganization && select.value === "other" ? "True" : "False";
|
||||||
|
|
||||||
if (requestingNewSuborganization.value === "True") {
|
|
||||||
selectParent.classList.add("padding-bottom-2");
|
|
||||||
showElement(suborgDetailsContainer);
|
|
||||||
}else {
|
|
||||||
selectParent.classList.remove("padding-bottom-2");
|
|
||||||
hideElement(suborgDetailsContainer);
|
|
||||||
}
|
|
||||||
requestingNewSuborganization.value === "True" ? showElement(suborgDetailsContainer) : hideElement(suborgDetailsContainer);
|
requestingNewSuborganization.value === "True" ? showElement(suborgDetailsContainer) : hideElement(suborgDetailsContainer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,7 @@
|
||||||
{% comment %} This will be toggled if a special value, "other", is selected.
|
{% comment %} This will be toggled if a special value, "other", is selected.
|
||||||
Otherwise this field is invisible.
|
Otherwise this field is invisible.
|
||||||
{% endcomment %}
|
{% endcomment %}
|
||||||
<div id="suborganization-container__details">
|
<div id="suborganization-container__details" class="padding-top-2 margin-top-0">
|
||||||
{% with attr_required=True %}
|
{% with attr_required=True %}
|
||||||
{% input_with_errors forms.1.requested_suborganization %}
|
{% input_with_errors forms.1.requested_suborganization %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
|
|
|
@ -34,7 +34,6 @@
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<ul class="usa-nav__primary usa-accordion">
|
<ul class="usa-nav__primary usa-accordion">
|
||||||
{% if not hide_domains %}
|
|
||||||
<li class="usa-nav__primary-item">
|
<li class="usa-nav__primary-item">
|
||||||
{% if has_any_domains_portfolio_permission %}
|
{% if has_any_domains_portfolio_permission %}
|
||||||
{% url 'domains' as url %}
|
{% url 'domains' as url %}
|
||||||
|
@ -45,14 +44,13 @@
|
||||||
Domains
|
Domains
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
{% endif %}
|
|
||||||
<!-- <li class="usa-nav__primary-item">
|
<!-- <li class="usa-nav__primary-item">
|
||||||
<a href="#" class="usa-nav-link">
|
<a href="#" class="usa-nav-link">
|
||||||
Domain groups
|
Domain groups
|
||||||
</a>
|
</a>
|
||||||
</li> -->
|
</li> -->
|
||||||
|
|
||||||
{% if has_organization_requests_flag and not hide_requests %}
|
{% if has_organization_requests_flag %}
|
||||||
<li class="usa-nav__primary-item">
|
<li class="usa-nav__primary-item">
|
||||||
<!-- user has one of the view permissions plus the edit permission, show the dropdown -->
|
<!-- user has one of the view permissions plus the edit permission, show the dropdown -->
|
||||||
{% if has_edit_request_portfolio_permission %}
|
{% if has_edit_request_portfolio_permission %}
|
||||||
|
@ -93,7 +91,7 @@
|
||||||
</li>
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if has_organization_members_flag and not hide_members %}
|
{% if has_organization_members_flag %}
|
||||||
<li class="usa-nav__primary-item">
|
<li class="usa-nav__primary-item">
|
||||||
<a href="{% url 'members' %}" class="usa-nav-link {% if path|is_members_subpage %} usa-current{% endif %}">
|
<a href="{% url 'members' %}" class="usa-nav-link {% if path|is_members_subpage %} usa-current{% endif %}">
|
||||||
Members
|
Members
|
||||||
|
|
|
@ -3205,11 +3205,6 @@ class TestDomainRequestWizard(TestWithUser, WebTest):
|
||||||
expected_url = reverse("domain-request:portfolio_requesting_entity", kwargs={"id": domain_request.id})
|
expected_url = reverse("domain-request:portfolio_requesting_entity", kwargs={"id": domain_request.id})
|
||||||
# This returns the entire url, thus "in"
|
# This returns the entire url, thus "in"
|
||||||
self.assertIn(expected_url, detail_page.request.url)
|
self.assertIn(expected_url, detail_page.request.url)
|
||||||
|
|
||||||
# We shouldn't show the "domains" and "domain requests" buttons
|
|
||||||
# on this page.
|
|
||||||
self.assertNotContains(detail_page, "Domains")
|
|
||||||
self.assertNotContains(detail_page, "<span>Domain requests")
|
|
||||||
else:
|
else:
|
||||||
self.fail(f"Expected a redirect, but got a different response: {response}")
|
self.fail(f"Expected a redirect, but got a different response: {response}")
|
||||||
|
|
||||||
|
|
|
@ -317,15 +317,7 @@ class DomainRequestWizard(DomainRequestWizardPermissionView, TemplateView):
|
||||||
# Clear context so the prop getter won't create a request here.
|
# Clear context so the prop getter won't create a request here.
|
||||||
# Creating a request will be handled in the post method for the
|
# Creating a request will be handled in the post method for the
|
||||||
# intro page.
|
# intro page.
|
||||||
return render(
|
return render(request, "domain_request_intro.html")
|
||||||
request,
|
|
||||||
"domain_request_intro.html",
|
|
||||||
{
|
|
||||||
"hide_requests": False,
|
|
||||||
"hide_domains": False,
|
|
||||||
"hide_members": False,
|
|
||||||
},
|
|
||||||
)
|
|
||||||
else:
|
else:
|
||||||
return self.goto(self.steps.first)
|
return self.goto(self.steps.first)
|
||||||
|
|
||||||
|
@ -487,12 +479,7 @@ class DomainRequestWizard(DomainRequestWizardPermissionView, TemplateView):
|
||||||
"user": self.request.user,
|
"user": self.request.user,
|
||||||
"requested_domain__name": requested_domain_name,
|
"requested_domain__name": requested_domain_name,
|
||||||
}
|
}
|
||||||
|
|
||||||
# Hides the requests and domains buttons in the navbar
|
|
||||||
context["hide_requests"] = self.is_portfolio
|
|
||||||
context["hide_domains"] = self.is_portfolio
|
|
||||||
context["domain_request_id"] = self.domain_request.id
|
context["domain_request_id"] = self.domain_request.id
|
||||||
|
|
||||||
return context
|
return context
|
||||||
|
|
||||||
def get_step_list(self) -> list:
|
def get_step_list(self) -> list:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue