Merge pull request #1670 from cisagov/dk/1562-submitted-email-missing-info

Issue #1562: submitted email missing info
This commit is contained in:
dave-kennedy-ecs 2024-01-26 17:37:03 -05:00 committed by GitHub
commit 26650c5f97
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 38 additions and 27 deletions

View file

@ -25,7 +25,7 @@
{% if step == Step.ORGANIZATION_TYPE %} {% if step == Step.ORGANIZATION_TYPE %}
{% namespaced_url 'application' step as application_url %} {% namespaced_url 'application' step as application_url %}
{% if application.organization_type is not None %} {% if application.organization_type is not None %}
{% with title=form_titles|get_item:step value=application.organization_type|get_organization_long_name|default:"Incomplete" %} {% with title=form_titles|get_item:step value=application.get_organization_type_display|default:"Incomplete" %}
{% include "includes/summary_item.html" with title=title value=value heading_level=heading_level editable=True edit_link=application_url %} {% include "includes/summary_item.html" with title=title value=value heading_level=heading_level editable=True edit_link=application_url %}
{% endwith %} {% endwith %}
{% else %} {% else %}

View file

@ -52,8 +52,8 @@
<div class="grid-col desktop:grid-offset-2 maxw-tablet"> <div class="grid-col desktop:grid-offset-2 maxw-tablet">
<h2 class="text-primary-darker"> Summary of your domain request </h2> <h2 class="text-primary-darker"> Summary of your domain request </h2>
{% with heading_level='h3' %} {% with heading_level='h3' %}
{% with long_org_type=domainapplication.organization_type|get_organization_long_name %} {% with org_type=domainapplication.get_organization_type_display %}
{% include "includes/summary_item.html" with title='Type of organization' value=long_org_type heading_level=heading_level %} {% include "includes/summary_item.html" with title='Type of organization' value=org_type heading_level=heading_level %}
{% endwith %} {% endwith %}
{% if domainapplication.tribe_name %} {% if domainapplication.tribe_name %}
@ -74,7 +74,9 @@
{% endif %} {% endif %}
{% if domainapplication.is_election_board %} {% if domainapplication.is_election_board %}
{% include "includes/summary_item.html" with title='Election office' value=domainapplication.is_election_board heading_level=heading_level %} {% with value=domainapplication.is_election_board|yesno:"Yes,No,Incomplete" %}
{% include "includes/summary_item.html" with title='Election office' value=value heading_level=heading_level %}
{% endwith %}
{% endif %} {% endif %}
{% if domainapplication.organization_name %} {% if domainapplication.organization_name %}
@ -109,7 +111,11 @@
{% include "includes/summary_item.html" with title='Your contact information' value=domainapplication.submitter contact='true' heading_level=heading_level %} {% include "includes/summary_item.html" with title='Your contact information' value=domainapplication.submitter contact='true' heading_level=heading_level %}
{% endif %} {% endif %}
{% include "includes/summary_item.html" with title='Other employees from your organization' value=domainapplication.other_contacts.all contact='true' list='true' heading_level=heading_level %} {% if domainapplication.other_contacts.all %}
{% include "includes/summary_item.html" with title='Other employees from your organization' value=domainapplication.other_contacts.all contact='true' list='true' heading_level=heading_level %}
{% else %}
{% include "includes/summary_item.html" with title='Other employees from your organization' value=domainapplication.no_other_contacts_rationale heading_level=heading_level %}
{% endif %}
{% include "includes/summary_item.html" with title='Anything else?' value=domainapplication.anything_else|default:"No" heading_level=heading_level %} {% include "includes/summary_item.html" with title='Anything else?' value=domainapplication.anything_else|default:"No" heading_level=heading_level %}

View file

@ -2,9 +2,22 @@ SUMMARY OF YOUR DOMAIN REQUEST
Type of organization: Type of organization:
{{ application.get_organization_type_display }} {{ application.get_organization_type_display }}
{% if application.show_organization_federal %}
Federal government branch:
{{ application.get_federal_type_display }}
{% elif application.show_tribal_government %}
Tribal government:
{{ application.tribe_name|default:"Incomplete" }}{% if application.federally_recognized_tribe %}
Federally-recognized tribe
{% endif %}{% if application.state_recognized_tribe %}
State-recognized tribe
{% endif %}{% endif %}{% if application.show_organization_election %}
Election office:
{{ application.is_election_board|yesno:"Yes,No,Incomplete" }}
{% endif %}
Organization name and mailing address: Organization name and mailing address:
{% spaceless %}{{ application.organization_name }} {% spaceless %}{{ application.federal_agency }}
{{ application.organization_name }}
{{ application.address_line1 }}{% if application.address_line2 %} {{ application.address_line1 }}{% if application.address_line2 %}
{{ application.address_line2 }}{% endif %} {{ application.address_line2 }}{% endif %}
{{ application.city }}, {{ application.state_territory }} {{ application.city }}, {{ application.state_territory }}
@ -31,11 +44,12 @@ Purpose of your domain:
Your contact information: Your contact information:
{% spaceless %}{% include "emails/includes/contact.txt" with contact=application.submitter %}{% endspaceless %} {% spaceless %}{% include "emails/includes/contact.txt" with contact=application.submitter %}{% endspaceless %}
{% if application.other_contacts.all %}
Other employees from your organization: Other employees from your organization:{% for other in application.other_contacts.all %}
{% for other in application.other_contacts.all %}
{% spaceless %}{% include "emails/includes/contact.txt" with contact=other %}{% endspaceless %} {% spaceless %}{% include "emails/includes/contact.txt" with contact=other %}{% endspaceless %}
{% endfor %}{% endif %}{% if application.anything_else %} {% empty %}
{{ application.no_other_contacts_rationale }}
{% endfor %}{% if application.anything_else %}
Anything else? Anything else?
{{ application.anything_else }} {{ application.anything_else }}
{% endif %} {% endif %}

View file

@ -1,4 +1,7 @@
<address> <address>
{% if organization.federal_agency %}
{{ organization.federal_agency }}<br />
{% endif %}
{% if organization.organization_name %} {% if organization.organization_name %}
{{ organization.organization_name }} {{ organization.organization_name }}
{% endif %} {% endif %}

View file

@ -102,9 +102,9 @@ class TestEmails(TestCase):
application.submit() application.submit()
_, kwargs = self.mock_client.send_email.call_args _, kwargs = self.mock_client.send_email.call_args
body = kwargs["Content"]["Simple"]["Body"]["Text"]["Data"] body = kwargs["Content"]["Simple"]["Body"]["Text"]["Data"]
self.assertNotIn("Other employees from your organization:", body)
# spacing should be right between adjacent elements # spacing should be right between adjacent elements
self.assertRegex(body, r"5556\n\nAnything else") self.assertRegex(body, r"5556\n\nOther employees")
self.assertRegex(body, r"None\n\nAnything else")
@boto3_mocking.patching @boto3_mocking.patching
def test_submission_confirmation_alternative_govdomain_spacing(self): def test_submission_confirmation_alternative_govdomain_spacing(self):

View file

@ -712,7 +712,7 @@ class DomainApplicationTests(TestWithUser, WebTest):
# Review page contains all the previously entered data # Review page contains all the previously entered data
# Let's make sure the long org name is displayed # Let's make sure the long org name is displayed
self.assertContains(review_page, "Federal: an agency of the U.S. government") self.assertContains(review_page, "Federal")
self.assertContains(review_page, "Executive") self.assertContains(review_page, "Executive")
self.assertContains(review_page, "Testorg") self.assertContains(review_page, "Testorg")
self.assertContains(review_page, "address 1") self.assertContains(review_page, "address 1")
@ -2360,18 +2360,6 @@ class DomainApplicationTests(TestWithUser, WebTest):
self.assertContains(type_page, "Federal: an agency of the U.S. government") self.assertContains(type_page, "Federal: an agency of the U.S. government")
def test_long_org_name_in_application_manage(self):
"""
Make sure the long name is displaying in the application summary
page (manage your application)
"""
completed_application(status=DomainApplication.ApplicationStatus.SUBMITTED, user=self.user)
home_page = self.app.get("/")
self.assertContains(home_page, "city.gov")
# click the "Edit" link
detail_page = home_page.click("Manage", index=0)
self.assertContains(detail_page, "Federal: an agency of the U.S. government")
def test_submit_modal_no_domain_text_fallback(self): def test_submit_modal_no_domain_text_fallback(self):
"""When user clicks on submit your domain request and the requested domain """When user clicks on submit your domain request and the requested domain
is null (possible through url direct access to the review page), present is null (possible through url direct access to the review page), present