diff --git a/src/registrar/assets/js/get-gov-admin.js b/src/registrar/assets/js/get-gov-admin.js index b78362dc6..d4b309a4a 100644 --- a/src/registrar/assets/js/get-gov-admin.js +++ b/src/registrar/assets/js/get-gov-admin.js @@ -177,9 +177,10 @@ function openInNewTab(el, removeAttribute = false){ copyToClipboardAndChangeIcon(button); }); - // Add a class that removes the outline style on click + // Add a class that adds the outline style on click button.addEventListener("mousedown", function() { - this.classList.remove("no-outline-on-click"); + console.log(`applying mousedown on ${this} vs ${button}`); + this.classList.add("no-outline-on-click"); }); // But add it back in after the user clicked, diff --git a/src/registrar/assets/sass/_theme/_admin.scss b/src/registrar/assets/sass/_theme/_admin.scss index 0a29eedff..a4a9fca54 100644 --- a/src/registrar/assets/sass/_theme/_admin.scss +++ b/src/registrar/assets/sass/_theme/_admin.scss @@ -381,14 +381,19 @@ table.dja-user-detail-table { input { // Allow for padding around the copy button - padding-right: 35px; + padding-right: 35px !important; // Match the height of other inputs - min-height: 2.25rem; + min-height: 2.25rem !important; } - .no-outline-on-click:focus { - outline: none !important; +} + +td.font-size-sm { + button.usa-button__icon { + font-size: 16px; } } - +.no-outline-on-click:focus { + outline: none !important; +} diff --git a/src/registrar/templates/django/admin/includes/domain_request_detail_table.html b/src/registrar/templates/django/admin/includes/domain_request_detail_table.html index 32c8aa49a..b1afd6a68 100644 --- a/src/registrar/templates/django/admin/includes/domain_request_detail_table.html +++ b/src/registrar/templates/django/admin/includes/domain_request_detail_table.html @@ -13,34 +13,39 @@ {% else %} Nothing found {% endif %} + {# Placeholder col for actions (like copy) or additional padding #} + Email {% if user.email or user.contact.email %} + {% if user.contact.email %} + {{ user.contact.email }} + {% else %} + {{ user.email }} + {% endif %} + - - {% if user.contact.email %} - {{ user.contact.email }} - - {% else %} - {{ user.email }} - - {% endif %} - - + + + {% else %} Nothing found + {% endif %} @@ -54,6 +59,7 @@ {% else %} Nothing found {% endif %} + diff --git a/src/registrar/templates/django/admin/includes/domain_request_fieldset.html b/src/registrar/templates/django/admin/includes/domain_request_fieldset.html index 11e1e21c6..976969667 100644 --- a/src/registrar/templates/django/admin/includes/domain_request_fieldset.html +++ b/src/registrar/templates/django/admin/includes/domain_request_fieldset.html @@ -62,10 +62,13 @@ This is using a custom implementation fieldset.html (see admin/fieldset.html) {{contact.first_name}} {{contact.last_name}} {{ contact.title }} - - + {{ contact.email }} + {{ contact.phone }} + {# Copy button for the email #} + + - {{ contact.email }} - - {{ contact.phone }} {% endfor %} diff --git a/src/registrar/tests/test_admin.py b/src/registrar/tests/test_admin.py index b29776f81..7bcfc388f 100644 --- a/src/registrar/tests/test_admin.py +++ b/src/registrar/tests/test_admin.py @@ -1304,18 +1304,19 @@ class TestDomainRequestAdmin(MockEppLib): self.assertEqual(response.status_code, 200) self.assertContains(response, domain_request.requested_domain.name) - # Check that the modal has the right content - # Check for the header - # == Check for the creator == # # Check for the right title, email, and phone number in the response. # We only need to check for the end tag # (Otherwise this test will fail if we change classes, etc) + expected_email = "meoward.jones@igorville.gov" expected_creator_fields = [ # Field, expected value ("title", "Treat inspector"), - ("email", "meoward.jones@igorville.gov"), + ("email", f"{expected_email}"), + # Check for the existence of the copy button input. + # Lets keep things simple to minimize future conflicts. + ("email_copy_button_input", f'"), ] self.assert_response_contains_distinct_values(response, expected_creator_fields) @@ -1324,20 +1325,24 @@ class TestDomainRequestAdmin(MockEppLib): self.assertContains(response, "Meoward Jones") # == Check for the submitter == # + expected_email = "mayor@igorville.gov" expected_submitter_fields = [ # Field, expected value ("title", "Admin Tester"), - ("email", "mayor@igorville.gov"), + ("email", f"{expected_email}"), + ("email_copy_button_input", f'"), ] self.assert_response_contains_distinct_values(response, expected_submitter_fields) self.assertContains(response, "Testy2 Tester2") # == Check for the authorizing_official == # + expected_email = "testy@town.com" expected_ao_fields = [ # Field, expected value ("title", "Chief Tester"), - ("email", "testy@town.com"), + ("email", f"{expected_email}"), + ("email_copy_button_input", f'"), ] self.assert_response_contains_distinct_values(response, expected_ao_fields) @@ -1359,10 +1364,12 @@ class TestDomainRequestAdmin(MockEppLib): self.assertContains(response, "Phone", count=3) # == Test the other_employees field == # + expected_email = "testy@town.com" expected_other_employees_fields = [ # Field, expected value ("title", "Another Tester"), - ("email", "testy2@town.com"), + ("email", f"{expected_email}"), + ("email_copy_button_input", f'"), ] self.assert_response_contains_distinct_values(response, expected_other_employees_fields)