Address feedback

This commit is contained in:
Rebecca Hsieh 2024-09-10 08:48:33 -07:00
parent 96811baa34
commit d0ae331f4a
No known key found for this signature in database
5 changed files with 15 additions and 53 deletions

View file

@ -70,7 +70,7 @@ This is using a custom implementation fieldset.html (see admin/fieldset.html)
<div class="readonly textarea-wrapper"> <div class="readonly textarea-wrapper">
<div id="action_needed_reason_email_readonly" class="dja-readonly-textarea-container padding-1 margin-top-0 padding-top-0 margin-bottom-1 thin-border collapse--dgsimple collapsed"> <div id="action_needed_reason_email_readonly" class="dja-readonly-textarea-container padding-1 margin-top-0 padding-top-0 margin-bottom-1 thin-border collapse--dgsimple collapsed">
<label class="max-full" for="action_needed_reason_email_view_more"> <label class="max-full" for="action_needed_reason_email_view_more">
<strong>Sent to {% if has_profile_feature_flag %}creator{%else%}creator{%endif%}</strong> <strong>Sent to creator</strong>
</label> </label>
<textarea id="action_needed_reason_email_view_more" cols="40" rows="20" class="{% if not original_object.action_needed_reason %}display-none{% endif %}" readonly> <textarea id="action_needed_reason_email_view_more" cols="40" rows="20" class="{% if not original_object.action_needed_reason %}display-none{% endif %}" readonly>
{{ original_object.action_needed_reason_email }} {{ original_object.action_needed_reason_email }}
@ -287,11 +287,6 @@ This is using a custom implementation fieldset.html (see admin/fieldset.html)
{% if not skip_additional_contact_info %} {% if not skip_additional_contact_info %}
{% include "django/admin/includes/user_detail_list.html" with user=original_object.creator no_title_top_padding=field.is_readonly %} {% include "django/admin/includes/user_detail_list.html" with user=original_object.creator no_title_top_padding=field.is_readonly %}
{% endif%} {% endif%}
{% elif field.field.name == "creator" %}
<div class="flex-container tablet:margin-top-2">
<label aria-label="Creator contact details"></label>
{% include "django/admin/includes/contact_detail_list.html" with user=original_object.creator no_title_top_padding=field.is_readonly %}
</div>
{% elif field.field.name == "senior_official" %} {% elif field.field.name == "senior_official" %}
<div class="flex-container"> <div class="flex-container">
<label aria-label="Senior official contact details"></label> <label aria-label="Senior official contact details"></label>

View file

@ -109,7 +109,7 @@
{% include "includes/summary_item.html" with title='Purpose of your domain' value=DomainRequest.purpose heading_level=heading_level %} {% include "includes/summary_item.html" with title='Purpose of your domain' value=DomainRequest.purpose heading_level=heading_level %}
{% endif %} {% endif %}
{% if DomainRequest.creator and not has_profile_feature_flag %} {% if DomainRequest.creator %}
{% include "includes/summary_item.html" with title='Your contact information' value=DomainRequest.creator contact='true' heading_level=heading_level %} {% include "includes/summary_item.html" with title='Your contact information' value=DomainRequest.creator contact='true' heading_level=heading_level %}
{% endif %} {% endif %}

View file

@ -1,37 +0,0 @@
{% extends "domain_base.html" %}
{% load static field_helpers %}
{% block title %}Your contact information | {{ domain.name }} | {% endblock %}
{% block domain_content %}
{% include "includes/form_errors.html" with form=form %}
<h1>Your contact information</h1>
<p>If youd like us to use a different name, email, or phone number you can make those changes below. <strong>Updating your contact information here will update the contact information for all domains in your account.</strong> Changing your information here wont affect your Login.gov account information. The contact information you provide here wont be made public and will only be used for the .gov program.
</p>
{% include "includes/required_fields.html" %}
<form class="usa-form usa-form--large" method="post" novalidate id="form-container">
{% csrf_token %}
{% input_with_errors form.first_name %}
{% input_with_errors form.middle_name %}
{% input_with_errors form.last_name %}
{% input_with_errors form.title %}
{% input_with_errors form.email %}
{% input_with_errors form.phone %}
<button
type="submit"
class="usa-button"
>Save</button>
</form>
{% endblock %} {# domain_content #}

View file

@ -663,11 +663,13 @@ class TestDomainRequestAdmin(MockEppLib):
"""When an action needed reason is set, an email is sent out and help@get.gov """When an action needed reason is set, an email is sent out and help@get.gov
is BCC'd in production""" is BCC'd in production"""
# Create fake creator # Create fake creator
EMAIL = "meoward.jones@igorville.gov"
_creator = User.objects.create( _creator = User.objects.create(
username="MrMeoward", username="MrMeoward",
first_name="Meoward", first_name="Meoward",
last_name="Jones", last_name="Jones",
email="meoward.jones@igorville.gov", email=EMAIL,
phone="(555) 123 12345", phone="(555) 123 12345",
title="Treat inspector", title="Treat inspector",
) )
@ -819,12 +821,14 @@ class TestDomainRequestAdmin(MockEppLib):
Also test that the default email set in settings is NOT BCCd on non-prod whenever Also test that the default email set in settings is NOT BCCd on non-prod whenever
an email does go out.""" an email does go out."""
EMAIL = "meoward.jones@igorville.gov"
# Create fake creator # Create fake creator
_creator = User.objects.create( _creator = User.objects.create(
username="MrMeoward", username="MrMeoward",
first_name="Meoward", first_name="Meoward",
last_name="Jones", last_name="Jones",
email="meoward.jones@igorville.gov", email=EMAIL,
phone="(555) 123 12345", phone="(555) 123 12345",
title="Treat inspector", title="Treat inspector",
) )
@ -1106,11 +1110,13 @@ class TestDomainRequestAdmin(MockEppLib):
"""When transitioning to rejected on a domain request, an email is sent """When transitioning to rejected on a domain request, an email is sent
explaining why when the reason is contacts or org legitimacy.""" explaining why when the reason is contacts or org legitimacy."""
# Create fake creator # Create fake creator
EMAIL = "meoward.jones@igorville.gov"
_creator = User.objects.create( _creator = User.objects.create(
username="MrMeoward", username="MrMeoward",
first_name="Meoward", first_name="Meoward",
last_name="Jones", last_name="Jones",
email="meoward.jones@igorville.gov", email=EMAIL,
phone="(555) 123 12345", phone="(555) 123 12345",
title="Treat inspector", title="Treat inspector",
) )

View file

@ -262,7 +262,7 @@ class TestDomainRequest(TestCase):
msg = "Create a domain request and submit it and see if email was sent." msg = "Create a domain request and submit it and see if email was sent."
domain_request = completed_domain_request(user=self.dummy_user_2) domain_request = completed_domain_request(user=self.dummy_user_2)
self.check_email_sent( self.check_email_sent(
domain_request, msg, "submit", 1, expected_content="Hi", expected_email=self.dummy_user_2.email domain_request, msg, "submit", 1, expected_content="Hello", expected_email=self.dummy_user_2.email
) )
@override_flag("profile_feature", active=True) @override_flag("profile_feature", active=True)
@ -272,7 +272,7 @@ class TestDomainRequest(TestCase):
msg = "Create a domain request and submit it and see if email was sent when the feature flag is on." msg = "Create a domain request and submit it and see if email was sent when the feature flag is on."
domain_request = completed_domain_request(user=self.dummy_user_2) domain_request = completed_domain_request(user=self.dummy_user_2)
self.check_email_sent( self.check_email_sent(
domain_request, msg, "submit", 1, expected_content="Lava", expected_email="intern@igorville.com" domain_request, msg, "submit", 1, expected_content="Hello", expected_email="intern@igorville.com"
) )
@less_console_noise_decorator @less_console_noise_decorator
@ -306,16 +306,14 @@ class TestDomainRequest(TestCase):
msg = "Create a domain request and withdraw it and see if email was sent." msg = "Create a domain request and withdraw it and see if email was sent."
user, _ = User.objects.get_or_create(username="testy") user, _ = User.objects.get_or_create(username="testy")
domain_request = completed_domain_request(status=DomainRequest.DomainRequestStatus.IN_REVIEW, user=user) domain_request = completed_domain_request(status=DomainRequest.DomainRequestStatus.IN_REVIEW, user=user)
self.check_email_sent( self.check_email_sent(domain_request, msg, "withdraw", 1, expected_content="Hello", expected_email=user.email)
domain_request, msg, "withdraw", 1, expected_content="withdrawn", expected_email=user.email
)
@less_console_noise_decorator @less_console_noise_decorator
def test_reject_sends_email(self): def test_reject_sends_email(self):
msg = "Create a domain request and reject it and see if email was sent." msg = "Create a domain request and reject it and see if email was sent."
user, _ = User.objects.get_or_create(username="testy") user, _ = User.objects.get_or_create(username="testy")
domain_request = completed_domain_request(status=DomainRequest.DomainRequestStatus.APPROVED, user=user) domain_request = completed_domain_request(status=DomainRequest.DomainRequestStatus.APPROVED, user=user)
self.check_email_sent(domain_request, msg, "reject", 1, expected_content="rejected", expected_email=user.email) self.check_email_sent(domain_request, msg, "reject", 1, expected_content="Hello", expected_email=user.email)
@less_console_noise_decorator @less_console_noise_decorator
def test_reject_with_prejudice_does_not_send_email(self): def test_reject_with_prejudice_does_not_send_email(self):