Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
asaki222 committed Nov 25, 2024
2 parents 7e0cdb8 + 0b69a5b commit c605dcb
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 33 deletions.
12 changes: 3 additions & 9 deletions src/registrar/assets/js/get-gov.js
Original file line number Diff line number Diff line change
Expand Up @@ -2926,6 +2926,8 @@ document.addEventListener("DOMContentLoaded", () => {
const suborgContainer = document.getElementById("suborganization-container");
const suborgDetailsContainer = document.getElementById("suborganization-container__details");
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;

// requestingSuborganization: This just broadly determines if they're requesting a suborg at all
Expand All @@ -2937,15 +2939,7 @@ document.addEventListener("DOMContentLoaded", () => {
if (radio != null) requestingSuborganization = radio?.checked && radio.value === "True";
requestingSuborganization ? showElement(suborgContainer) : hideElement(suborgContainer);
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);
}

// Add fake "other" option to sub_organization select
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ <h2>Add suborganization information</h2>
{% comment %} This will be toggled if a special value, "other", is selected.
Otherwise this field is invisible.
{% endcomment %}
<div id="suborganization-container__details">
<div id="suborganization-container__details" class="padding-top-2 margin-top-0">
{% with attr_required=True %}
{% input_with_errors forms.1.requested_suborganization %}
{% endwith %}
Expand Down
6 changes: 2 additions & 4 deletions src/registrar/templates/includes/header_extended.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
</ul>
</div>
<ul class="usa-nav__primary usa-accordion">
{% if not hide_domains %}
<li class="usa-nav__primary-item">
{% if has_any_domains_portfolio_permission %}
{% url 'domains' as url %}
Expand All @@ -45,14 +44,13 @@
Domains
</a>
</li>
{% endif %}
<!-- <li class="usa-nav__primary-item">
<a href="#" class="usa-nav-link">
Domain groups
</a>
</li> -->

{% if has_organization_requests_flag and not hide_requests %}
{% if has_organization_requests_flag %}
<li class="usa-nav__primary-item">
<!-- user has one of the view permissions plus the edit permission, show the dropdown -->
{% if has_edit_request_portfolio_permission %}
Expand Down Expand Up @@ -93,7 +91,7 @@
</li>
{% endif %}

{% if has_organization_members_flag and not hide_members %}
{% if has_organization_members_flag %}
<li class="usa-nav__primary-item">
<a href="{% url 'members' %}" class="usa-nav-link {% if path|is_members_subpage %} usa-current{% endif %}">
Members
Expand Down
5 changes: 0 additions & 5 deletions src/registrar/tests/test_views_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -3205,11 +3205,6 @@ def test_wizard_steps_portfolio(self):
expected_url = reverse("domain-request:portfolio_requesting_entity", kwargs={"id": domain_request.id})
# This returns the entire url, thus "in"
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:
self.fail(f"Expected a redirect, but got a different response: {response}")

Expand Down
15 changes: 1 addition & 14 deletions src/registrar/views/domain_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,15 +317,7 @@ def get(self, request, *args, **kwargs):
# Clear context so the prop getter won't create a request here.
# Creating a request will be handled in the post method for the
# intro page.
return render(
request,
"domain_request_intro.html",
{
"hide_requests": False,
"hide_domains": False,
"hide_members": False,
},
)
return render(request, "domain_request_intro.html")
else:
return self.goto(self.steps.first)

Expand Down Expand Up @@ -487,12 +479,7 @@ def get_context_data(self):
"user": self.request.user,
"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

return context

def get_step_list(self) -> list:
Expand Down

0 comments on commit c605dcb

Please sign in to comment.