mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-18 18:39:21 +02:00
Add bizniz logic for incomplete forms and red colour coding on review page
This commit is contained in:
parent
7f42ecb867
commit
ee90567700
5 changed files with 191 additions and 91 deletions
|
@ -33,7 +33,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.incomplete {
|
.incomplete {
|
||||||
color: red;
|
color: #950E24;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -84,13 +84,6 @@
|
||||||
value="save_and_return"
|
value="save_and_return"
|
||||||
class="usa-button usa-button--outline"
|
class="usa-button usa-button--outline"
|
||||||
>Save and return to manage your domains</button>
|
>Save and return to manage your domains</button>
|
||||||
<!-- {% elif form_is_not_complete %}
|
|
||||||
<button
|
|
||||||
type="submit"
|
|
||||||
name="submit_button"
|
|
||||||
value="save_and_return"
|
|
||||||
class="usa-button usa-button--outline"
|
|
||||||
>Return to manage your domains</button> -->
|
|
||||||
{% else %}
|
{% else %}
|
||||||
<a
|
<a
|
||||||
href="#toggle-submit-domain-request"
|
href="#toggle-submit-domain-request"
|
||||||
|
@ -112,19 +105,9 @@
|
||||||
aria-describedby="Are you sure you want to submit a domain request?"
|
aria-describedby="Are you sure you want to submit a domain request?"
|
||||||
data-force-action
|
data-force-action
|
||||||
>
|
>
|
||||||
{% include 'includes/modal.html' with modal_heading=modal_heading|safe modal_description="Once you submit this request, you won’t be able to edit it until we review it. You’ll only be able to withdraw your request." modal_button=modal_button|safe %}
|
{% include 'includes/modal.html' with review_form_is_complete=review_form_is_complete modal_heading=modal_heading|safe modal_description=modal_description|safe modal_button=modal_button|safe %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- <div
|
|
||||||
class="usa-modal"
|
|
||||||
id="toggle-incomplete-domain-request"
|
|
||||||
aria-labelledby="You can’t submit this request because it’s incomplete."
|
|
||||||
aria-describedby="You can’t submit this request because it’s incomplete."
|
|
||||||
data-force-action
|
|
||||||
>
|
|
||||||
{% include 'includes/modal.html' with modal_heading=modal_heading|safe modal_description="You can’t submit this request because it’s incomplete. Click return to request and complete the sections that are missing information." modal_button=modal_button|safe %}
|
|
||||||
</div> -->
|
|
||||||
|
|
||||||
{% block after_form_content %}{% endblock %}
|
{% block after_form_content %}{% endblock %}
|
||||||
|
|
||||||
</main>
|
</main>
|
||||||
|
|
|
@ -25,11 +25,11 @@
|
||||||
{% if step == Step.ORGANIZATION_TYPE %}
|
{% if step == Step.ORGANIZATION_TYPE %}
|
||||||
{% namespaced_url 'domain-request' step as domain_request_url %}
|
{% namespaced_url 'domain-request' step as domain_request_url %}
|
||||||
{% if domain_request.generic_org_type is not None %}
|
{% if domain_request.generic_org_type is not None %}
|
||||||
{% with title=form_titles|get_item:step value=domain_request.get_generic_org_type_display|default:"Incomplete" %}
|
{% with title=form_titles|get_item:step value=domain_request.get_generic_org_type_display|default:"<span class='incomplete'>Incomplete</span>"|safe %}
|
||||||
{% include "includes/summary_item.html" with title=title value=value heading_level=heading_level editable=True edit_link=domain_request_url %}
|
{% include "includes/summary_item.html" with title=title value=value heading_level=heading_level editable=True edit_link=domain_request_url %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
{% else %}
|
{% else %}
|
||||||
{% with title=form_titles|get_item:step value="Incomplete" %}
|
{% with title=form_titles|get_item:step value="<span class='incomplete'>Incomplete</span>"|safe %}
|
||||||
{% include "includes/summary_item.html" with title=title value=value heading_level=heading_level editable=True edit_link=domain_request_url %}
|
{% include "includes/summary_item.html" with title=title value=value heading_level=heading_level editable=True edit_link=domain_request_url %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -47,7 +47,7 @@
|
||||||
|
|
||||||
{% if step == Step.ORGANIZATION_FEDERAL %}
|
{% if step == Step.ORGANIZATION_FEDERAL %}
|
||||||
{% namespaced_url 'domain-request' step as domain_request_url %}
|
{% namespaced_url 'domain-request' step as domain_request_url %}
|
||||||
{% with title=form_titles|get_item:step value=domain_request.get_federal_type_display|default:"Incomplete" %}
|
{% with title=form_titles|get_item:step value=domain_request.get_federal_type_display|default:"<span class='incomplete'>Incomplete</span>"|safe %}
|
||||||
{% include "includes/summary_item.html" with title=title value=value heading_level=heading_level editable=True edit_link=domain_request_url %}
|
{% include "includes/summary_item.html" with title=title value=value heading_level=heading_level editable=True edit_link=domain_request_url %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -66,7 +66,7 @@
|
||||||
{% include "includes/summary_item.html" with title=title value=value heading_level=heading_level editable=True edit_link=domain_request_url address='true' %}
|
{% include "includes/summary_item.html" with title=title value=value heading_level=heading_level editable=True edit_link=domain_request_url address='true' %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
{% else %}
|
{% else %}
|
||||||
{% with title=form_titles|get_item:step value='Incomplete' %}
|
{% with title=form_titles|get_item:step value="<span class='incomplete'>Incomplete</span>"|safe %}
|
||||||
{% include "includes/summary_item.html" with title=title value=value heading_level=heading_level editable=True edit_link=domain_request_url %}
|
{% include "includes/summary_item.html" with title=title value=value heading_level=heading_level editable=True edit_link=domain_request_url %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -74,7 +74,7 @@
|
||||||
|
|
||||||
{% if step == Step.ABOUT_YOUR_ORGANIZATION %}
|
{% if step == Step.ABOUT_YOUR_ORGANIZATION %}
|
||||||
{% namespaced_url 'domain-request' step as domain_request_url %}
|
{% namespaced_url 'domain-request' step as domain_request_url %}
|
||||||
{% with title=form_titles|get_item:step value=domain_request.about_your_organization|default:"Incomplete" %}
|
{% with title=form_titles|get_item:step value=domain_request.about_your_organization|default:"<span class='incomplete'>Incomplete</span>"|safe %}
|
||||||
{% include "includes/summary_item.html" with title=title value=value heading_level=heading_level editable=True edit_link=domain_request_url %}
|
{% include "includes/summary_item.html" with title=title value=value heading_level=heading_level editable=True edit_link=domain_request_url %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -86,7 +86,7 @@
|
||||||
{% include "includes/summary_item.html" with title=title value=value heading_level=heading_level editable=True edit_link=domain_request_url contact='true' %}
|
{% include "includes/summary_item.html" with title=title value=value heading_level=heading_level editable=True edit_link=domain_request_url contact='true' %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
{% else %}
|
{% else %}
|
||||||
{% with title=form_titles|get_item:step value="Incomplete" %}
|
{% with title=form_titles|get_item:step value="<span class='incomplete'>Incomplete</span>"|safe %}
|
||||||
{% include "includes/summary_item.html" with title=title value=value heading_level=heading_level editable=True edit_link=domain_request_url %}
|
{% include "includes/summary_item.html" with title=title value=value heading_level=heading_level editable=True edit_link=domain_request_url %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -107,7 +107,7 @@
|
||||||
|
|
||||||
{% if step == Step.DOTGOV_DOMAIN %}
|
{% if step == Step.DOTGOV_DOMAIN %}
|
||||||
{% namespaced_url 'domain-request' step as domain_request_url %}
|
{% namespaced_url 'domain-request' step as domain_request_url %}
|
||||||
{% with title=form_titles|get_item:step value=domain_request.requested_domain.name|default:"Incomplete" %}
|
{% with title=form_titles|get_item:step value=domain_request.requested_domain.name|default:"<span class='incomplete'>Incomplete</span>"|safe%}
|
||||||
{% include "includes/summary_item.html" with title=title value=value heading_level=heading_level editable=True edit_link=domain_request_url %}
|
{% include "includes/summary_item.html" with title=title value=value heading_level=heading_level editable=True edit_link=domain_request_url %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
|
|
||||||
|
@ -123,7 +123,7 @@
|
||||||
|
|
||||||
{% if step == Step.PURPOSE %}
|
{% if step == Step.PURPOSE %}
|
||||||
{% namespaced_url 'domain-request' step as domain_request_url %}
|
{% namespaced_url 'domain-request' step as domain_request_url %}
|
||||||
{% with title=form_titles|get_item:step value=domain_request.purpose|default:"Incomplete" %}
|
{% with title=form_titles|get_item:step value=domain_request.purpose|default:"<span class='incomplete'>Incomplete</span>"|safe %}
|
||||||
{% include "includes/summary_item.html" with title=title value=value heading_level=heading_level editable=True edit_link=domain_request_url %}
|
{% include "includes/summary_item.html" with title=title value=value heading_level=heading_level editable=True edit_link=domain_request_url %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -135,7 +135,7 @@
|
||||||
{% include "includes/summary_item.html" with title=title value=value heading_level=heading_level editable=True edit_link=domain_request_url contact='true' %}
|
{% include "includes/summary_item.html" with title=title value=value heading_level=heading_level editable=True edit_link=domain_request_url contact='true' %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
{% else %}
|
{% else %}
|
||||||
{% with title=form_titles|get_item:step value="Incomplete" %}
|
{% with title=form_titles|get_item:step value="<span class='incomplete'>Incomplete</span>"|safe %}
|
||||||
{% include "includes/summary_item.html" with title=title value=value heading_level=heading_level editable=True edit_link=domain_request_url %}
|
{% include "includes/summary_item.html" with title=title value=value heading_level=heading_level editable=True edit_link=domain_request_url %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -148,7 +148,7 @@
|
||||||
{% include "includes/summary_item.html" with title=title value=value heading_level=heading_level editable=True edit_link=domain_request_url contact='true' list='true' %}
|
{% include "includes/summary_item.html" with title=title value=value heading_level=heading_level editable=True edit_link=domain_request_url contact='true' list='true' %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
{% else %}
|
{% else %}
|
||||||
{% with title=form_titles|get_item:step value=domain_request.no_other_contacts_rationale|default:"Incomplete" %}
|
{% with title=form_titles|get_item:step value=domain_request.no_other_contacts_rationale|default:"<span class='incomplete'>Incomplete</span>"|safe %}
|
||||||
{% include "includes/summary_item.html" with title=title value=value heading_level=heading_level editable=True edit_link=domain_request_url %}
|
{% include "includes/summary_item.html" with title=title value=value heading_level=heading_level editable=True edit_link=domain_request_url %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -157,7 +157,7 @@
|
||||||
|
|
||||||
{% if step == Step.ADDITIONAL_DETAILS %}
|
{% if step == Step.ADDITIONAL_DETAILS %}
|
||||||
{% namespaced_url 'domain-request' step as domain_request_url %}
|
{% namespaced_url 'domain-request' step as domain_request_url %}
|
||||||
{% with title=form_titles|get_item:step value=domain_request.requested_domain.name|default:"Incomplete" %}
|
{% with title=form_titles|get_item:step value=domain_request.requested_domain.name|default:"<span class='incomplete'>Incomplete</span>"|safe %}
|
||||||
{% include "includes/summary_item.html" with title=title sub_header_text='CISA regional representative' value=domain_request.cisa_representative_email heading_level=heading_level editable=True edit_link=domain_request_url custom_text_for_value_none='No' %}
|
{% include "includes/summary_item.html" with title=title sub_header_text='CISA regional representative' value=domain_request.cisa_representative_email heading_level=heading_level editable=True edit_link=domain_request_url custom_text_for_value_none='No' %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
Cancel
|
Cancel
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
{% else %}
|
{% elif review_form_is_complete %}
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
class="usa-button usa-button--unstyled padding-105 text-center"
|
class="usa-button usa-button--unstyled padding-105 text-center"
|
||||||
|
|
|
@ -374,76 +374,187 @@ class DomainRequestWizard(DomainRequestWizardPermissionView, TemplateView):
|
||||||
}
|
}
|
||||||
return [key for key, value in history_dict.items() if value]
|
return [key for key, value in history_dict.items() if value]
|
||||||
|
|
||||||
|
def _is_federal_complete(self):
|
||||||
|
# Federal -> "Federal government branch" page can't be empty + Federal Agency selection can't be None
|
||||||
|
return not (self.domain_request.federal_type is None or self.domain_request.federal_agency is None)
|
||||||
|
|
||||||
|
def _is_interstate_complete(self):
|
||||||
|
# Interstate -> "About your organization" page can't be empty
|
||||||
|
return self.domain_request.about_your_organization is not None
|
||||||
|
|
||||||
|
def _is_state_or_territory_complete(self):
|
||||||
|
# State -> ""Election office" page can't be empty
|
||||||
|
return self.domain_request.is_election_board is not None
|
||||||
|
|
||||||
|
def _is_tribal_complete(self):
|
||||||
|
# Tribal -> "Tribal name" and "Election office" page can't be empty
|
||||||
|
return self.domain_request.tribe_name is not None and self.domain_request.is_election_board is not None
|
||||||
|
|
||||||
|
def _is_county_complete(self):
|
||||||
|
# County -> "Election office" page can't be empty
|
||||||
|
return self.domain_request.is_election_board is not None
|
||||||
|
|
||||||
|
def _is_city_complete(self):
|
||||||
|
# City -> "Election office" page can't be empty
|
||||||
|
return self.domain_request.is_election_board is not None
|
||||||
|
|
||||||
|
def _is_special_district_complete(self):
|
||||||
|
# Special District -> "Election office" and "About your organization" page can't be empty
|
||||||
|
return (
|
||||||
|
self.domain_request.is_election_board is not None
|
||||||
|
and self.domain_request.about_your_organization is not None
|
||||||
|
)
|
||||||
|
|
||||||
|
def _is_organization_name_and_address_complete(self):
|
||||||
|
return not (
|
||||||
|
self.domain_request.organization_name is None
|
||||||
|
or self.domain_request.address_line1 is None
|
||||||
|
or self.domain_request.city is None
|
||||||
|
or self.domain_request.state_territory is None
|
||||||
|
or self.domain_request.zipcode is None
|
||||||
|
)
|
||||||
|
|
||||||
|
def _is_authorizing_official_complete(self):
|
||||||
|
return self.domain_request.authorizing_official is not None
|
||||||
|
|
||||||
|
def _is_requested_domain_complete(self):
|
||||||
|
return self.domain_request.requested_domain is not None
|
||||||
|
|
||||||
|
def _is_purpose_complete(self):
|
||||||
|
return self.domain_request.purpose is not None
|
||||||
|
|
||||||
|
def _is_submitter_complete(self):
|
||||||
|
return self.domain_request.submitter is not None
|
||||||
|
|
||||||
|
def _is_other_contacts_complete(self):
|
||||||
|
return self.domain_request.other_contacts is not None
|
||||||
|
|
||||||
|
def _is_additional_details_complete(self):
|
||||||
|
return not (
|
||||||
|
self.domain_request.has_cisa_representative is None
|
||||||
|
or self.domain_request.has_anything_else_text is None
|
||||||
|
# RARE EDGE CASE: You click yes on having a cisa rep, but you dont type in email (should block in form)
|
||||||
|
or (
|
||||||
|
self.domain_request.has_cisa_representative is True
|
||||||
|
and self.domain_request.cisa_representative_email is None
|
||||||
|
)
|
||||||
|
or self.domain_request.is_policy_acknowledged is None
|
||||||
|
)
|
||||||
|
|
||||||
|
def _is_general_form_complete(self):
|
||||||
|
return (
|
||||||
|
self._is_organization_name_and_address_complete()
|
||||||
|
and self._is_authorizing_official_complete()
|
||||||
|
and self._is_requested_domain_complete()
|
||||||
|
and self._is_purpose_complete()
|
||||||
|
and self._is_submitter_complete()
|
||||||
|
and self._is_other_contacts_complete()
|
||||||
|
and self._is_additional_details_complete()
|
||||||
|
)
|
||||||
|
|
||||||
def _form_complete(self):
|
def _form_complete(self):
|
||||||
# So in theory each part of the form individually should be already doing the check, correct?
|
if self.domain_request.generic_org_type == DomainRequest.OrganizationChoices.FEDERAL:
|
||||||
# In theory, that means we just only need to check for the title pages that are completed which is
|
is_complete = self._is_federal_complete()
|
||||||
# Technically some of these don't even show up at all depending on which "state" its in or chosen
|
elif self.domain_request.generic_org_type == DomainRequest.OrganizationChoices.INTERSTATE:
|
||||||
|
is_complete = self._is_interstate_complete()
|
||||||
# If we choose Federal -> check "Federal government branch (has defaults)
|
elif self.domain_request.generic_org_type == DomainRequest.OrganizationChoices.STATE_OR_TERRITORY:
|
||||||
# If we choose Interstate -> check "About your organization"
|
is_complete = self._is_state_or_territory_complete()
|
||||||
# If we choose State -> check "Election office" (has default)
|
elif self.domain_request.generic_org_type == DomainRequest.OrganizationChoices.TRIBAL:
|
||||||
# If we choose Tribal -> check "Tribal name" and "Election office"
|
is_complete = self._is_tribal_complete()
|
||||||
# County -> "Election office"
|
elif self.domain_request.generic_org_type == DomainRequest.OrganizationChoices.COUNTY:
|
||||||
# City -> "Election office"
|
is_complete = self._is_county_complete()
|
||||||
# Special district -> "Election office" and "About your organization"
|
elif self.domain_request.generic_org_type == DomainRequest.OrganizationChoices.CITY:
|
||||||
# School district -> clears common
|
is_complete = self._is_city_complete()
|
||||||
|
elif self.domain_request.generic_org_type == DomainRequest.OrganizationChoices.SPECIAL_DISTRICT:
|
||||||
|
is_complete = self._is_special_district_complete()
|
||||||
if (
|
else:
|
||||||
# (self.domain_request.tribe_name is None)
|
is_complete = False
|
||||||
(self.domain_request.generic_org_type is None)
|
|
||||||
or (self.domain_request.tribe_name is None)
|
|
||||||
or (self.domain_request.federal_type is None)
|
|
||||||
or (self.domain_request.is_election_board is None)
|
|
||||||
or (
|
|
||||||
self.domain_request.federal_agency is None
|
|
||||||
or self.domain_request.organization_name is None
|
|
||||||
or self.domain_request.address_line1 is None
|
|
||||||
or self.domain_request.city is None
|
|
||||||
or self.domain_request.state_territory is None
|
|
||||||
or self.domain_request.zipcode is None
|
|
||||||
or self.domain_request.urbanization is None
|
|
||||||
) # organization contact
|
|
||||||
or (self.domain_request.about_your_organization is None)
|
|
||||||
or (self.domain_request.authorizing_official is None)
|
|
||||||
or (
|
|
||||||
self.domain_request.current_websites.exists() or self.domain_request.requested_domain is None
|
|
||||||
) # for current_sites
|
|
||||||
or (self.domain_request.requested_domain is None) # for dotgov_domain
|
|
||||||
or (self.domain_request.purpose is None)
|
|
||||||
or (self.domain_request.submitter is None) # your_contact
|
|
||||||
or (self.domain_request.other_contacts is None)
|
|
||||||
or (
|
|
||||||
(self.domain_request.anything_else is None and self.domain_request.cisa_representative_email)
|
|
||||||
or self.domain_request.is_policy_acknowledged is None
|
|
||||||
) # additional detail
|
|
||||||
or (self.domain_request.is_policy_acknowledged is None) # review
|
|
||||||
):
|
|
||||||
# print("!!!!!! self.domain_request.tribe_name is", self.domain_request.tribe_name)
|
|
||||||
# context = self.get_context_data()
|
|
||||||
# context["forms"] = self.get_forms()
|
|
||||||
# context["form_is_not_complete"] = False
|
|
||||||
|
|
||||||
|
if not is_complete or not self._is_general_form_complete():
|
||||||
|
print("!!!! We are in the False if statement - form is not complete")
|
||||||
return False
|
return False
|
||||||
else:
|
|
||||||
# print("!!!!!! self.domain_request.tribe_name is", self.domain_request.tribe_name)
|
|
||||||
return True
|
|
||||||
|
|
||||||
# return None
|
print("!!!! We are in the True if statement - form is complete")
|
||||||
|
return True
|
||||||
|
|
||||||
|
# def _form_complete(self):
|
||||||
|
# if (
|
||||||
|
# (
|
||||||
|
# self.domain_request.generic_org_type == DomainRequest.OrganizationChoices.FEDERAL
|
||||||
|
# and (self.domain_request.federal_type is None or self.domain_request.federal_agency is None)
|
||||||
|
# )
|
||||||
|
# or (
|
||||||
|
# self.domain_request.generic_org_type == DomainRequest.OrganizationChoices.INTERSTATE
|
||||||
|
# and self.domain_request.about_your_organization is None
|
||||||
|
# ) # State -> ""Election office" page can't be empty
|
||||||
|
# or (
|
||||||
|
# self.domain_request.generic_org_type == DomainRequest.OrganizationChoices.STATE_OR_TERRITORY
|
||||||
|
# and self.domain_request.is_election_board is None
|
||||||
|
# ) # Tribal -> "Tribal name" and "Election office" page can't be empty
|
||||||
|
# or (
|
||||||
|
# self.domain_request.generic_org_type == DomainRequest.OrganizationChoices.TRIBAL
|
||||||
|
# and (self.domain_request.tribe_name is None or self.domain_request.is_election_board is None)
|
||||||
|
# ) # County -> "Election office" page can't be empty
|
||||||
|
# or (
|
||||||
|
# self.domain_request.generic_org_type == DomainRequest.OrganizationChoices.COUNTY
|
||||||
|
# and self.domain_request.is_election_board is None
|
||||||
|
# ) # City -> "Election office" page can't be empty
|
||||||
|
# or (
|
||||||
|
# self.domain_request.generic_org_type == DomainRequest.OrganizationChoices.CITY
|
||||||
|
# and self.domain_request.is_election_board is None
|
||||||
|
# ) # Special District -> "Election office" and "About your organization" page can't be empty
|
||||||
|
# or (
|
||||||
|
# self.domain_request.generic_org_type == DomainRequest.OrganizationChoices.SPECIAL_DISTRICT
|
||||||
|
# and (
|
||||||
|
# self.domain_request.is_election_board is None or self.domain_request.about_your_organization is None
|
||||||
|
# )
|
||||||
|
# ) # all other logics
|
||||||
|
# or (self.domain_request.generic_org_type is None)
|
||||||
|
# # or (self.domain_request.tribe_name is None) -- Dont need bc above
|
||||||
|
# # or (self.domain_request.federal_type is None) -- Dont need bc not every is federal type
|
||||||
|
# # or (self.domain_request.is_election_board is None) -- Dont need bc above
|
||||||
|
# or (
|
||||||
|
# # self.domain_request.federal_agency is None or -- Dont need bc above
|
||||||
|
# self.domain_request.organization_name is None
|
||||||
|
# or self.domain_request.address_line1 is None
|
||||||
|
# or self.domain_request.city is None
|
||||||
|
# or self.domain_request.state_territory is None
|
||||||
|
# or self.domain_request.zipcode is None
|
||||||
|
# ) # for organization contact
|
||||||
|
# # or (self.domain_request.about_your_organization is None) - Dont need bc above
|
||||||
|
# or (self.domain_request.authorizing_official is None)
|
||||||
|
# # # or (
|
||||||
|
# # # self.domain_request.current_websites.exists() or self.domain_request.requested_domain is None
|
||||||
|
# # # ) # for current_sites -- don't need current site bc not required
|
||||||
|
# or (self.domain_request.requested_domain is None) # for dotgov_domain
|
||||||
|
# or (self.domain_request.purpose is None)
|
||||||
|
# or (self.domain_request.submitter is None) # for your_contact
|
||||||
|
# or (self.domain_request.other_contacts is None)
|
||||||
|
# or (self.domain_request.has_cisa_representative is None)
|
||||||
|
# or (self.domain_request.has_anything_else_text is None)
|
||||||
|
# # you click yes on having a cisa rep but you dont type in email -- this is insanely rare if not impossible edge case
|
||||||
|
# or (self.domain_request.has_cisa_representative is True and self.domain_request.cisa_representative_email is None)
|
||||||
|
# or (self.domain_request.is_policy_acknowledged is None) # for review
|
||||||
|
# # logger.debug(function name found missing org type conditional)
|
||||||
|
# ):
|
||||||
|
# print("!!!! We are in the False if statement - form is not complete")
|
||||||
|
|
||||||
|
# return False
|
||||||
|
# else:
|
||||||
|
# print("!!!! We are in the True if statement - form is complete")
|
||||||
|
# return True
|
||||||
|
|
||||||
|
# # return None
|
||||||
|
|
||||||
def get_context_data(self):
|
def get_context_data(self):
|
||||||
"""Define context for access on all wizard pages."""
|
"""Define context for access on all wizard pages."""
|
||||||
# Build the submit button that we'll pass to the modal.
|
# Build the submit button that we'll pass to the modal.
|
||||||
modal_button = '<button type="submit" ' 'class="usa-button" ' ">Submit request</button>"
|
|
||||||
# Concatenate the modal header that we'll pass to the modal.
|
# Concatenate the modal header that we'll pass to the modal.
|
||||||
|
|
||||||
# TODO: Still need to log!
|
|
||||||
context_stuff = {}
|
context_stuff = {}
|
||||||
print("!!!!!!!!! before form complete")
|
|
||||||
print("!!!!!!!!! self.form_complete is", self._form_complete())
|
|
||||||
if self._form_complete():
|
if self._form_complete():
|
||||||
print("!!!!!!!in form complete section")
|
print("!!!!!!!in form complete section")
|
||||||
|
modal_button = '<button type="submit" ' 'class="usa-button" ' ">Submit request</button>"
|
||||||
context_stuff = {
|
context_stuff = {
|
||||||
"form_titles": self.TITLES,
|
"form_titles": self.TITLES,
|
||||||
"steps": self.steps,
|
"steps": self.steps,
|
||||||
|
@ -453,20 +564,24 @@ class DomainRequestWizard(DomainRequestWizardPermissionView, TemplateView):
|
||||||
"modal_button": modal_button,
|
"modal_button": modal_button,
|
||||||
"modal_heading": "You are about to submit a domain request for "
|
"modal_heading": "You are about to submit a domain request for "
|
||||||
+ str(self.domain_request.requested_domain),
|
+ str(self.domain_request.requested_domain),
|
||||||
|
"modal_description": "Once you submit this request, you won’t be able to edit it until we review it.\
|
||||||
|
You’ll only be able to withdraw your request.",
|
||||||
|
"review_form_is_complete": True,
|
||||||
}
|
}
|
||||||
else: # form is not complete
|
else: # form is not complete
|
||||||
print("!!!!!!! form is not complete")
|
print("!!!!!!! form is not complete")
|
||||||
|
modal_button = '<button type="button" ' 'class="usa-button" ' " data-close-modal>Return to request</button>"
|
||||||
context_stuff = {
|
context_stuff = {
|
||||||
"form_titles": self.TITLES,
|
"form_titles": self.TITLES,
|
||||||
"steps": self.steps,
|
"steps": self.steps,
|
||||||
# Add information about which steps should be unlocked
|
|
||||||
"visited": self.storage.get("step_history", []),
|
"visited": self.storage.get("step_history", []),
|
||||||
"is_federal": self.domain_request.is_federal(),
|
"is_federal": self.domain_request.is_federal(),
|
||||||
# "modal_button": We'll have to set some kind of go back button
|
"modal_button": modal_button,
|
||||||
# And fix wording in text for domain_request_form
|
|
||||||
"modal_heading": "You can’t submit this request",
|
"modal_heading": "You can’t submit this request",
|
||||||
|
"modal_description": "You can’t submit this request because it’s incomplete.\
|
||||||
|
Click return to request and complete the sections that are missing information.",
|
||||||
|
"review_form_is_complete": False,
|
||||||
}
|
}
|
||||||
|
|
||||||
return context_stuff
|
return context_stuff
|
||||||
|
|
||||||
def get_step_list(self) -> list:
|
def get_step_list(self) -> list:
|
||||||
|
@ -727,6 +842,8 @@ class Review(DomainRequestWizard):
|
||||||
forms = [] # type: ignore
|
forms = [] # type: ignore
|
||||||
|
|
||||||
def get_context_data(self):
|
def get_context_data(self):
|
||||||
|
if self._form_complete() is False:
|
||||||
|
logger.warning("User arrived at review page with an incomplete form.")
|
||||||
context = super().get_context_data()
|
context = super().get_context_data()
|
||||||
context["Step"] = Step.__members__
|
context["Step"] = Step.__members__
|
||||||
context["domain_request"] = self.domain_request
|
context["domain_request"] = self.domain_request
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue