PR suggestions

This commit is contained in:
zandercymatics 2024-04-22 09:18:17 -06:00
parent 8ae6e3e30e
commit 438095e669
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7
6 changed files with 43 additions and 62 deletions

View file

@ -1285,6 +1285,7 @@ class DomainRequestAdmin(ListHeaderAdmin):
"no_other_contacts_rationale",
"anything_else",
"is_policy_acknowledged",
"cisa_representative_email",
]
autocomplete_fields = [
"approved_domain",

View file

@ -213,6 +213,7 @@ function HookupYesNoListener(radioButtonName, elementIdToShowIfYes, elementIdToS
// Check if the element exists before accessing its value
let selectedValue = radioButtonChecked ? radioButtonChecked.value : null;
if (elementIdToShowIfYes && elementIdToShowIfNo){
switch (selectedValue) {
case 'True':
toggleTwoDomElements(elementIdToShowIfYes, elementIdToShowIfNo, 1);
@ -225,6 +226,9 @@ function HookupYesNoListener(radioButtonName, elementIdToShowIfYes, elementIdToS
default:
toggleTwoDomElements(elementIdToShowIfYes, elementIdToShowIfNo, 0);
}
}else {
console.log("No elements to show")
}
}
if (radioButtons.length) {

View file

@ -156,7 +156,19 @@
{% if step == Step.ADDITIONAL_DETAILS %}
{% include "includes/summary_additional_details.html" with domainRequest=domain_request %}
{% namespaced_url 'domain-request' step as domain_request_url %}
{% with title=form_titles|get_item:step value=domain_request.requested_domain.name|default:"Incomplete" %}
{% include "includes/summary_item.html" with title=title sub_header_text='CISA regions representative' value=domain_request.cisa_representative_email heading_level=heading_level editable=True edit_link=domain_request_url %}
{% endwith %}
<h3 class="register-form-review-header">Anything else</h3>
<ul class="usa-list usa-list--unstyled margin-top-0">
{% if domain_request.has_anything_else_text %}
{{domain_request.anything_else}}
{% else %}
No
{% endif %}
</ul>
{% endif %}

View file

@ -116,7 +116,18 @@
{% include "includes/summary_item.html" with title='Other employees from your organization' value=DomainRequest.no_other_contacts_rationale heading_level=heading_level %}
{% endif %}
{% include "includes/summary_additional_details.html" with domainRequest=DomainRequest %}
{% if DomainRequest.has_cisa_representative or domain_request.has_anything_else_text %}
{% include "includes/summary_item.html" with title='Additional details' sub_header_text='CISA regions representative' value=domain_request.cisa_representative_email heading_level=heading_level %}
<h3 class="register-form-review-header">Anything else</h3>
<ul class="usa-list usa-list--unstyled margin-top-0">
{% if domain_request.has_anything_else_text %}
{{domain_request.anything_else}}
{% else %}
No
{% endif %}
</ul>
{% endif %}
{% endwith %}
</div>

View file

@ -1,50 +0,0 @@
{% load static url_helpers %}
<!-- TODO (future ticket?): create a template that allows us to easily display nested forms.
It is a little complex because we will have to formulate how to aggregate form pairings.
(eg. yes/no radio forms plus the information they toggle need to be linked somehow
and condense down into one subsection) -->
<section class="summary-item margin-top-3">
<hr class="" aria-hidden="true" />
<div class="display-flex flex-justify">
<div>
<h2
class="summary-item__title
font-sans-md
text-primary-dark text-semibold
margin-top-0 margin-bottom-05
padding-right-1"
>
Additional details
</h2>
{% if domainRequest is not none %}
<dl class="usa-list usa-list--unstyled margin-top-0">
<dt>
CISA regions representative
</dt>
<dd>
{% if domainRequest.has_cisa_representative %}
{{domainRequest.cisa_representative_email}}
{% else %}
(none)
{% endif %}
</dd>
<dt>
Anything else
</dt>
<dd>
{% if domainRequest.has_anything_else_text %}
{{domainRequest.anything_else}}
{% else %}
No
{% endif %}
</dd>
</dl>
{% else %}
ERROR Please contact technical support/dev
{% endif %}
</div>
</div>
</section>

View file

@ -20,6 +20,9 @@
</{{ heading_level }}>
{% else %}
</h2>
{% endif %}
{% if sub_header_text %}
<h3 class="register-form-review-header">{{ sub_header_text }}</h3>
{% endif %}
{% if address %}
{% include "includes/organization_address.html" with organization=value %}