From de17d686e3f73234c81915dabab88961e4f37a55 Mon Sep 17 00:00:00 2001 From: zandercymatics <141044360+zandercymatics@users.noreply.github.com> Date: Wed, 28 Feb 2024 15:30:23 -0700 Subject: [PATCH 01/17] Add basic on hold modal --- src/registrar/assets/js/get-gov-admin.js | 2 +- .../django/admin/domain_change_form.html | 84 +++++++++++++++++-- 2 files changed, 77 insertions(+), 9 deletions(-) diff --git a/src/registrar/assets/js/get-gov-admin.js b/src/registrar/assets/js/get-gov-admin.js index ff73acb65..096f7a626 100644 --- a/src/registrar/assets/js/get-gov-admin.js +++ b/src/registrar/assets/js/get-gov-admin.js @@ -29,7 +29,7 @@ function openInNewTab(el, removeAttribute = false){ */ (function (){ function createPhantomModalFormButtons(){ - let submitButtons = document.querySelectorAll('.usa-modal button[type="submit"]'); + let submitButtons = document.querySelectorAll('.usa-modal button[type="submit"].dja-form-placeholder'); form = document.querySelector("form") submitButtons.forEach((button) => { diff --git a/src/registrar/templates/django/admin/domain_change_form.html b/src/registrar/templates/django/admin/domain_change_form.html index 67c5ac291..e38583eb8 100644 --- a/src/registrar/templates/django/admin/domain_change_form.html +++ b/src/registrar/templates/django/admin/domain_change_form.html @@ -11,18 +11,15 @@
+ When a domain is on hold: +
++ This action can be reversed, if needed. +
+
+ {# Acts as a
#}
+
+ When a domain request is in ineligible status, the registrant's permissions within the registrar are restricted as follows: +
++ This action can be reversed, if needed. +
+
+ {# Acts as a
#}
+
+ When a domain is removed from the registry: +
++ This action cannot be undone. +
+
+ {# Acts as a
#}
+
styling in django admin + line-height: 1.5; + margin-bottom: 0; + margin-top: 0; + max-width: 68ex; +} diff --git a/src/registrar/templates/django/admin/domain_change_form.html b/src/registrar/templates/django/admin/domain_change_form.html index 9d7b1d5de..61007c3d4 100644 --- a/src/registrar/templates/django/admin/domain_change_form.html +++ b/src/registrar/templates/django/admin/domain_change_form.html @@ -54,7 +54,7 @@ {# Create a modal for the _extend_expiration_date button #}
+ Domain: {{ original.name }}
{# Acts as a
#}
This action cannot be undone.
+ Domain: {{ original.name }}
{# Acts as a
#}
- When a domain request is in ineligible status, the registrant's permissions within the registrar are restricted as follows: -
-- This action can be reversed, if needed. -
-
- {# Acts as a
#}
-
+ When a domain request is in ineligible status, the registrant's permissions within the registrar are restricted as follows: +
++ The restrictions will not take effect until you “save” the changes for this domain request. + This action can be reversed, if needed. +
+
+ {# Acts as a
#}
+
The restrictions will not take effect until you “save” the changes for this domain request. diff --git a/src/registrar/templates/django/admin/domain_change_form.html b/src/registrar/templates/django/admin/domain_change_form.html index 61007c3d4..393983e32 100644 --- a/src/registrar/templates/django/admin/domain_change_form.html +++ b/src/registrar/templates/django/admin/domain_change_form.html @@ -133,9 +133,9 @@ When a domain is on hold:
This action can be reversed, if needed. From 0ef72ad016a975f73922286723e0c5f0ebd3bd29 Mon Sep 17 00:00:00 2001 From: zandercymatics <141044360+zandercymatics@users.noreply.github.com> Date: Thu, 29 Feb 2024 12:05:19 -0700 Subject: [PATCH 06/17] Add custom desc on delete button --- src/registrar/admin.py | 12 +++++++++++ src/registrar/assets/js/get-gov-admin.js | 1 - .../admin/domain_application_change_form.html | 4 ++-- .../django/admin/domain_change_form.html | 4 ++-- .../admin/domain_delete_confirmation.html | 21 +++++++++++++++++++ 5 files changed, 37 insertions(+), 5 deletions(-) create mode 100644 src/registrar/templates/django/admin/domain_delete_confirmation.html diff --git a/src/registrar/admin.py b/src/registrar/admin.py index 942ae6162..fd6ce45a7 100644 --- a/src/registrar/admin.py +++ b/src/registrar/admin.py @@ -1339,6 +1339,18 @@ class DomainAdmin(ListHeaderAdmin): # Table ordering ordering = ["name"] + def delete_view(self, request, object_id, extra_context=None): + """ + Custom delete_view to perform additional actions or customize the template. + """ + + # Set the delete template to a custom one + self.delete_confirmation_template = "django/admin/domain_delete_confirmation.html" + + response = super().delete_view(request, object_id, extra_context=extra_context) + + return response + def changeform_view(self, request, object_id=None, form_url="", extra_context=None): """Custom changeform implementation to pass in context information""" if extra_context is None: diff --git a/src/registrar/assets/js/get-gov-admin.js b/src/registrar/assets/js/get-gov-admin.js index ebcca16d7..8ecf2cbee 100644 --- a/src/registrar/assets/js/get-gov-admin.js +++ b/src/registrar/assets/js/get-gov-admin.js @@ -76,7 +76,6 @@ function openInNewTab(el, removeAttribute = false){ // it will not be affected by the createPhantomModalFormButtons() function. let cancelButton = document.querySelector('button[name="_cancel_application_ineligible"]'); if (cancelButton){ - console.log(`This is the previous val: ${previousValue}`) cancelButton.addEventListener('click', function() { // Revert the dropdown to its previous value statusDropdown.value = previousValue; diff --git a/src/registrar/templates/django/admin/domain_application_change_form.html b/src/registrar/templates/django/admin/domain_application_change_form.html index 6e6ab3723..f0e4cfe4f 100644 --- a/src/registrar/templates/django/admin/domain_application_change_form.html +++ b/src/registrar/templates/django/admin/domain_application_change_form.html @@ -48,10 +48,10 @@ This action can be reversed, if needed.
+ Domain: {{ original.requested_domain.name }}
{# Acts as a
#}
When a domain is removed from the registry:
+ +This action cannot be undone.
+ +{{ block.super }} +{% endblock %} From 8408ea0f68452a7c4840991ca6195c39bf5945f1 Mon Sep 17 00:00:00 2001 From: zandercymatics <141044360+zandercymatics@users.noreply.github.com> Date: Fri, 1 Mar 2024 14:37:20 -0700 Subject: [PATCH 07/17] Add some test cases --- src/registrar/tests/test_admin.py | 143 +++++++++++++++++++++++++++++- 1 file changed, 142 insertions(+), 1 deletion(-) diff --git a/src/registrar/tests/test_admin.py b/src/registrar/tests/test_admin.py index d76f12f35..3c5861ee1 100644 --- a/src/registrar/tests/test_admin.py +++ b/src/registrar/tests/test_admin.py @@ -230,6 +230,20 @@ class TestDomainAdmin(MockEppLib, WebTest): ) mock_add_message.assert_has_calls([expected_call], 1) + def test_custom_delete_confirmation_page(self): + """Tests if we override the delete confirmation page for custom content""" + # Create a ready domain with a preset expiration date + domain, _ = Domain.objects.get_or_create(name="fake.gov", state=Domain.State.READY) + + domain_change_page = self.app.get(reverse("admin:registrar_domain_change", args=[domain.pk])) + + self.assertContains(domain_change_page, "fake.gov") + # click the "Manage" link + confirmation_page = domain_change_page.click("Delete", index=0) + + content_slice = "When a domain is removed from the registry:
" + self.assertContains(confirmation_page, content_slice) + def test_short_org_name_in_domains_list(self): """ Make sure the short name is displaying in admin on the list page @@ -309,6 +323,17 @@ class TestDomainAdmin(MockEppLib, WebTest): self.assertEqual(response.status_code, 200) self.assertContains(response, domain.name) self.assertContains(response, "Remove from registry") + + # The contents of the modal should exist before and after the post. + # Check for the header + self.assertContains(response, "Are you sure you want to remove this domain from the registry?") + + # Check for some of its body + self.assertContains(response, "When a domain is removed from the registry:") + + # Check for some of the button content + self.assertContains(response, "Yes, remove from registry") + # Test the info dialog request = self.factory.post( "/admin/registrar/domain/{}/change/".format(domain.pk), @@ -325,8 +350,60 @@ class TestDomainAdmin(MockEppLib, WebTest): extra_tags="", fail_silently=False, ) + + # The modal should still exist + self.assertContains(response, "Are you sure you want to remove this domain from the registry?") + self.assertContains(response, "When a domain is removed from the registry:") + self.assertContains(response, "Yes, remove from registry") + self.assertEqual(domain.state, Domain.State.DELETED) + def test_on_hold_is_successful_web_test(self): + """ + Scenario: Domain on_hold is successful through webtest + """ + with less_console_noise(): + domain = create_ready_domain() + + response = self.app.get(reverse("admin:registrar_domain_change", args=[domain.pk])) + + # Check the contents of the modal + # Check for the header + self.assertContains(response, "Are you sure you want to place this domain on hold?") + + # Check for some of its body + self.assertContains(response, "When a domain is on hold:") + + # Check for some of the button content + self.assertContains(response, "Yes, place hold") + + # Grab the form to submit + form = response.forms["domain_form"] + + # Submit the form + response = form.submit("_place_client_hold") + + # Follow the response + response = response.follow() + + self.assertEqual(response.status_code, 200) + self.assertContains(response, domain.name) + self.assertContains(response, "Remove hold") + + # The modal should still exist + # Check for the header + self.assertContains(response, "Are you sure you want to place this domain on hold?") + + # Check for some of its body + self.assertContains(response, "When a domain is on hold:") + + # Check for some of the button content + self.assertContains(response, "Yes, place hold") + + # Web test has issues grabbing up to date data from the db, so we can test + # the returned view instead + self.assertContains(response, 'When a domain is removed from the registry:
+ +This action cannot be undone.
+ +{{ block.super }} +{% endblock %} \ No newline at end of file From 27cd468bcafb303590546909316272bd2dc718fb Mon Sep 17 00:00:00 2001 From: zandercymatics <141044360+zandercymatics@users.noreply.github.com> Date: Mon, 4 Mar 2024 11:33:25 -0700 Subject: [PATCH 10/17] Add better confirmation messages --- src/registrar/assets/sass/_theme/_admin.scss | 9 +++++ .../admin/domain_delete_confirmation.html | 38 ++++++++++-------- .../domain_delete_selected_confirmation.html | 39 +++++++++++-------- 3 files changed, 54 insertions(+), 32 deletions(-) diff --git a/src/registrar/assets/sass/_theme/_admin.scss b/src/registrar/assets/sass/_theme/_admin.scss index 46e4a10d4..9f6db0c46 100644 --- a/src/registrar/assets/sass/_theme/_admin.scss +++ b/src/registrar/assets/sass/_theme/_admin.scss @@ -311,3 +311,12 @@ input.admin-confirm-button { margin-top: 0; max-width: 68ex; } + +.django-admin-custom-bullets { + // Set list-style-type to inherit without modifying text size + list-style-type: inherit; +} + +.usa-summary-box__dhs-color { + color: $dhs-blue-70; +} diff --git a/src/registrar/templates/django/admin/domain_delete_confirmation.html b/src/registrar/templates/django/admin/domain_delete_confirmation.html index 793a28c4c..5a9bef5b0 100644 --- a/src/registrar/templates/django/admin/domain_delete_confirmation.html +++ b/src/registrar/templates/django/admin/domain_delete_confirmation.html @@ -2,20 +2,26 @@ {% load i18n static %} {% block content %} -{# TODO modify the "Are you sure?" to the text content below.. #} -{% comment %} -When a domain is removed from the registry:
- -This action cannot be undone.
- -{{ block.super }} +You should probably remove this domain from the registry instead of deleting it.
+This action cannot be undone.
+When a domain is removed from the registry:
- -This action cannot be undone.
- -{{ block.super }} +You should probably remove these domains from the registry instead of deleting them.
+This action cannot be undone.
+You should probably remove these domains from the registry instead of deleting them.
+You should probably remove these domains from the registry instead.
This action cannot be undone.
From 7e4dc38b40e7ce92cf9ed426f49a7e4c6ebc345d Mon Sep 17 00:00:00 2001 From: zandercymatics <141044360+zandercymatics@users.noreply.github.com> Date: Mon, 4 Mar 2024 11:50:03 -0700 Subject: [PATCH 12/17] Change bullet list style --- src/registrar/assets/sass/_theme/_admin.scss | 2 +- .../templates/django/admin/domain_delete_confirmation.html | 2 +- .../django/admin/domain_delete_selected_confirmation.html | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/registrar/assets/sass/_theme/_admin.scss b/src/registrar/assets/sass/_theme/_admin.scss index 9f6db0c46..88675cb32 100644 --- a/src/registrar/assets/sass/_theme/_admin.scss +++ b/src/registrar/assets/sass/_theme/_admin.scss @@ -312,7 +312,7 @@ input.admin-confirm-button { max-width: 68ex; } -.django-admin-custom-bullets { +.django-admin-custom-bullets ul > li { // Set list-style-type to inherit without modifying text size list-style-type: inherit; } diff --git a/src/registrar/templates/django/admin/domain_delete_confirmation.html b/src/registrar/templates/django/admin/domain_delete_confirmation.html index 5a9bef5b0..2836c32f7 100644 --- a/src/registrar/templates/django/admin/domain_delete_confirmation.html +++ b/src/registrar/templates/django/admin/domain_delete_confirmation.html @@ -11,7 +11,7 @@When a domain is removed from the registry:
" + content_slice = "When a domain is deleted:" self.assertContains(confirmation_page, content_slice) def test_short_org_name_in_domains_list(self): @@ -350,7 +350,7 @@ class TestDomainAdmin(MockEppLib, WebTest): extra_tags="", fail_silently=False, ) - + # The modal should still exist self.assertContains(response, "Are you sure you want to remove this domain from the registry?") self.assertContains(response, "When a domain is removed from the registry:") @@ -364,7 +364,7 @@ class TestDomainAdmin(MockEppLib, WebTest): """ with less_console_noise(): domain = create_ready_domain() - + response = self.app.get(reverse("admin:registrar_domain_change", args=[domain.pk])) # Check the contents of the modal @@ -389,7 +389,7 @@ class TestDomainAdmin(MockEppLib, WebTest): self.assertEqual(response.status_code, 200) self.assertContains(response, domain.name) self.assertContains(response, "Remove hold") - + # The modal should still exist # Check for the header self.assertContains(response, "Are you sure you want to place this domain on hold?") @@ -1180,8 +1180,7 @@ class TestDomainApplicationAdmin(MockEppLib): # Create a mock request request = self.factory.post( - "/admin/registrar/domainapplication/{}/change/".format(application.pk), - follow=True + "/admin/registrar/domainapplication/{}/change/".format(application.pk), follow=True ) with boto3_mocking.clients.handler_for("sesv2", self.mock_client): @@ -1214,7 +1213,6 @@ class TestDomainApplicationAdmin(MockEppLib): self.assertEqual(response.status_code, 200) self.assertContains(response, application.requested_domain.name) - # Check that the modal has the right content # Check for the header self.assertContains(response, "Are you sure you want to select ineligible status?") @@ -1227,8 +1225,7 @@ class TestDomainApplicationAdmin(MockEppLib): # Create a mock request request = self.factory.post( - "/admin/registrar/domainapplication/{}/change/".format(application.pk), - follow=True + "/admin/registrar/domainapplication/{}/change/".format(application.pk), follow=True ) with boto3_mocking.clients.handler_for("sesv2", self.mock_client): # Modify the application's property From 747af8834791b1fa1fee8c0694088eb3964fbef2 Mon Sep 17 00:00:00 2001 From: zandercymatics <141044360+zandercymatics@users.noreply.github.com> Date: Mon, 4 Mar 2024 14:18:59 -0700 Subject: [PATCH 14/17] Add missing unit test + linting --- src/registrar/tests/common.py | 28 ++++++++++++++++++++++++---- src/registrar/tests/test_admin.py | 25 +++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 4 deletions(-) diff --git a/src/registrar/tests/common.py b/src/registrar/tests/common.py index ee1ab8b68..1825d38fd 100644 --- a/src/registrar/tests/common.py +++ b/src/registrar/tests/common.py @@ -97,7 +97,7 @@ def less_console_noise(output_stream=None): class GenericTestHelper(TestCase): """A helper class that contains various helper functions for TestCases""" - def __init__(self, admin, model=None, url=None, user=None, factory=None, **kwargs): + def __init__(self, admin, model=None, url=None, user=None, factory=None, client=None, **kwargs): """ Parameters: admin (ModelAdmin): The Django ModelAdmin instance associated with the model. @@ -112,6 +112,7 @@ class GenericTestHelper(TestCase): self.admin = admin self.model = model self.url = url + self.client = client def assert_table_sorted(self, o_index, sort_fields): """ @@ -147,9 +148,7 @@ class GenericTestHelper(TestCase): dummy_request.user = self.user # Mock a user request - middleware = SessionMiddleware(lambda req: req) - middleware.process_request(dummy_request) - dummy_request.session.save() + dummy_request = self._mock_user_request_for_factory(dummy_request) expected_sort_order = list(self.model.objects.order_by(*sort_fields)) @@ -160,6 +159,27 @@ class GenericTestHelper(TestCase): self.assertEqual(expected_sort_order, returned_sort_order) + def _mock_user_request_for_factory(self, request): + """Adds sessionmiddleware when using factory to associate session information""" + middleware = SessionMiddleware(lambda req: req) + middleware.process_request(request) + request.session.save() + return request + + def get_table_delete_confirmation_page(self, selected_across: str, index: str): + """ + Grabs the response for the delete confirmation page (generated from the actions toolbar). + selected_across and index must both be numbers encoded as str, e.g. "0" rather than 0 + """ + + response = self.client.post( + self.url, + {"action": "delete_selected", "select_across": selected_across, "index": index, "_selected_action": "23"}, + follow=True, + ) + print(f"what is the response? {response}") + return response + class MockUserLogin: def __init__(self, get_response): diff --git a/src/registrar/tests/test_admin.py b/src/registrar/tests/test_admin.py index f85396f10..7e032ff5c 100644 --- a/src/registrar/tests/test_admin.py +++ b/src/registrar/tests/test_admin.py @@ -61,6 +61,16 @@ class TestDomainAdmin(MockEppLib, WebTest): self.factory = RequestFactory() self.app.set_user(self.superuser.username) self.client.force_login(self.superuser) + + # Contains some test tools + self.test_helper = GenericTestHelper( + factory=self.factory, + user=self.superuser, + admin=self.admin, + url=reverse("admin:registrar_domain_changelist"), + model=Domain, + client=self.client, + ) super().setUp() @skip("TODO for another ticket. This test case is grabbing old db data.") @@ -244,6 +254,21 @@ class TestDomainAdmin(MockEppLib, WebTest): content_slice = "When a domain is deleted:" self.assertContains(confirmation_page, content_slice) + def test_custom_delete_confirmation_page_table(self): + """Tests if we override the delete confirmation page for custom content on the table""" + # Create a ready domain + domain, _ = Domain.objects.get_or_create(name="fake.gov", state=Domain.State.READY) + + # Get the index. The post expects the index to be encoded as a string + index = f"{domain.id}" + + # Simulate selecting a single record, then clicking "Delete selected domains" + response = self.test_helper.get_table_delete_confirmation_page("0", index) + + # Check that our content exists + content_slice = "When a domain is deleted:" + self.assertContains(response, content_slice) + def test_short_org_name_in_domains_list(self): """ Make sure the short name is displaying in admin on the list page From 454cac951ab6cf9f5cb51103092c3bb849f54408 Mon Sep 17 00:00:00 2001 From: zandercymatics <141044360+zandercymatics@users.noreply.github.com> Date: Fri, 8 Mar 2024 13:41:40 -0700 Subject: [PATCH 15/17] Bug fix for PR --- src/registrar/assets/js/get-gov-admin.js | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/registrar/assets/js/get-gov-admin.js b/src/registrar/assets/js/get-gov-admin.js index 4ed1a0d28..8170e4bd0 100644 --- a/src/registrar/assets/js/get-gov-admin.js +++ b/src/registrar/assets/js/get-gov-admin.js @@ -61,18 +61,19 @@ function openInNewTab(el, removeAttribute = false){ * This intentionally does not interact with createPhantomModalFormButtons() */ (function (){ - function displayModalOnDropdownClick(linkClickedDisplaysModal, statusDropdown, cancelButton, valueToCheck){ + function displayModalOnDropdownClick(linkClickedDisplaysModal, statusDropdown, actionButton, valueToCheck){ // If these exist all at the same time, we're on the right page if (linkClickedDisplaysModal && statusDropdown && statusDropdown.value){ + + // Set the previous value in the event the user cancels. + let previousValue = statusDropdown.value; + if (actionButton){ - if (cancelButton){ - // Store the previous value in the event the user cancels. - // We only need to do this if cancel button is specified. - let previousValue = statusDropdown.value; - cancelButton.addEventListener('click', function() { + // Otherwise, if the confirmation buttion is pressed, set it to that + actionButton.addEventListener('click', function() { // Revert the dropdown to its previous value - statusDropdown.value = previousValue; + statusDropdown.value = valueToCheck; }); }else { console.log("displayModalOnDropdownClick() -> Cancel button was null") @@ -82,6 +83,10 @@ function openInNewTab(el, removeAttribute = false){ statusDropdown.addEventListener('change', function() { // Check if "Ineligible" is selected if (this.value && this.value.toLowerCase() === valueToCheck) { + // Set the old value in the event the user cancels, + // or otherwise exists the dropdown. + statusDropdown.value = previousValue + // Display the modal. linkClickedDisplaysModal.click() } @@ -98,9 +103,9 @@ function openInNewTab(el, removeAttribute = false){ // Because the modal button does not have the class "dja-form-placeholder", // it will not be affected by the createPhantomModalFormButtons() function. - let cancelButton = document.querySelector('button[name="_cancel_application_ineligible"]'); + let actionButton = document.querySelector('button[name="_set_application_ineligible"]'); let valueToCheck = "ineligible" - displayModalOnDropdownClick(modalButton, statusDropdown, cancelButton, valueToCheck); + displayModalOnDropdownClick(modalButton, statusDropdown, actionButton, valueToCheck); } hookModalToIneligibleStatus() From f31d6ee0735e1014d3dd7c7e553c213ff48fac7d Mon Sep 17 00:00:00 2001 From: zandercymatics <141044360+zandercymatics@users.noreply.github.com> Date: Tue, 12 Mar 2024 16:44:56 -0600 Subject: [PATCH 16/17] Update test_admin.py --- src/registrar/tests/test_admin.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/registrar/tests/test_admin.py b/src/registrar/tests/test_admin.py index fb7e7af5e..8d983dcb7 100644 --- a/src/registrar/tests/test_admin.py +++ b/src/registrar/tests/test_admin.py @@ -1224,7 +1224,7 @@ class TestDomainRequestAdmin(MockEppLib): EMAIL = "mayor@igorville.gov" User.objects.filter(email=EMAIL).delete() - # Create a sample application + # Create a sample domain request domain_request = completed_domain_request(status=DomainRequest.DomainRequestStatus.IN_REVIEW) p = "userpass" @@ -1261,7 +1261,7 @@ class TestDomainRequestAdmin(MockEppLib): # Test that approved domain exists and equals requested domain self.assertEqual(domain_request.creator.status, "restricted") - # 'Get' to the application again + # 'Get' to the domain request again response = self.client.get( "/admin/registrar/domainrequest/{}/change/".format(domain_request.pk), follow=True, @@ -1282,7 +1282,7 @@ class TestDomainRequestAdmin(MockEppLib): EMAIL = "mayor@igorville.gov" User.objects.filter(email=EMAIL).delete() - # Create a sample application + # Create a sample domain request domain_request = completed_domain_request(status=DomainRequest.DomainRequestStatus.IN_REVIEW) p = "userpass" @@ -1310,7 +1310,7 @@ class TestDomainRequestAdmin(MockEppLib): "/admin/registrar/domainrequest/{}/change/".format(domain_request.pk), follow=True ) with boto3_mocking.clients.handler_for("sesv2", self.mock_client): - # Modify the application's property + # Modify the domain request's property domain_request.status = DomainRequest.DomainRequestStatus.INELIGIBLE # Use the model admin's save_model method @@ -1319,7 +1319,7 @@ class TestDomainRequestAdmin(MockEppLib): # Test that approved domain exists and equals requested domain self.assertEqual(domain_request.creator.status, "restricted") - # 'Get' to the application again + # 'Get' to the domain request again response = self.client.get( "/admin/registrar/domainrequest/{}/change/".format(domain_request.pk), follow=True, From 763a1c51fc52367e11d371a16793c535c9c45198 Mon Sep 17 00:00:00 2001 From: zandercymatics <141044360+zandercymatics@users.noreply.github.com> Date: Wed, 13 Mar 2024 11:53:30 -0600 Subject: [PATCH 17/17] Merge conflict fixes --- src/registrar/assets/js/get-gov-admin.js | 4 +- .../admin/domain_application_change_form.html | 8 +-- src/registrar/tests/test_admin.py | 58 ------------------- 3 files changed, 6 insertions(+), 64 deletions(-) diff --git a/src/registrar/assets/js/get-gov-admin.js b/src/registrar/assets/js/get-gov-admin.js index 8170e4bd0..4ed00c33f 100644 --- a/src/registrar/assets/js/get-gov-admin.js +++ b/src/registrar/assets/js/get-gov-admin.js @@ -57,7 +57,7 @@ function openInNewTab(el, removeAttribute = false){ createPhantomModalFormButtons(); })(); -/** An IIFE for DomainApplication to hook a modal to a dropdown option. +/** An IIFE for DomainRequest to hook a modal to a dropdown option. * This intentionally does not interact with createPhantomModalFormButtons() */ (function (){ @@ -103,7 +103,7 @@ function openInNewTab(el, removeAttribute = false){ // Because the modal button does not have the class "dja-form-placeholder", // it will not be affected by the createPhantomModalFormButtons() function. - let actionButton = document.querySelector('button[name="_set_application_ineligible"]'); + let actionButton = document.querySelector('button[name="_set_domain_request_ineligible"]'); let valueToCheck = "ineligible" displayModalOnDropdownClick(modalButton, statusDropdown, actionButton, valueToCheck); } diff --git a/src/registrar/templates/django/admin/domain_application_change_form.html b/src/registrar/templates/django/admin/domain_application_change_form.html index f0e4cfe4f..95392da1e 100644 --- a/src/registrar/templates/django/admin/domain_application_change_form.html +++ b/src/registrar/templates/django/admin/domain_application_change_form.html @@ -27,7 +27,7 @@ class="usa-modal" id="toggle-set-ineligible" aria-labelledby="Are you sure you want to select ineligible status?" - aria-describedby="This application will be marked as ineligible." + aria-describedby="This request will be marked as ineligible." >