diff --git a/src/registrar/assets/js/get-gov.js b/src/registrar/assets/js/get-gov.js index 3aa3a736b..27090d747 100644 --- a/src/registrar/assets/js/get-gov.js +++ b/src/registrar/assets/js/get-gov.js @@ -315,7 +315,6 @@ function prepareDeleteButtons(formLabel) { if (isNameserversForm && forms.length < 3) { // Hide the delete buttons on the remaining nameservers Array.from(form.querySelectorAll('.delete-record')).forEach((deleteButton) => { - // deleteButton.classList.add("display-none"); deleteButton.setAttribute("disabled", "true"); }); } @@ -345,6 +344,11 @@ function prepareDeleteButtons(formLabel) { formLabel = "DS Data record"; } + // On load: Disable the add more button if we have 13 forms + if (isNameserversForm && document.querySelectorAll(".repeatable-form").length == 13) { + addButton.setAttribute("disabled", "true"); + } + // Attach click event listener on the delete buttons of the existing forms prepareDeleteButtons(formLabel); @@ -361,7 +365,7 @@ function prepareDeleteButtons(formLabel) { let formExampleRegex = RegExp(`ns(\\d){1}`, 'g'); // Some Nameserver form checks since the delete can mess up the source object we're copying - // in regards to required fileds and hidden delete buttons + // in regards to required fields and hidden delete buttons if (isNameserversForm) { // If the source element we're copying has required on an input, @@ -383,7 +387,6 @@ function prepareDeleteButtons(formLabel) { // enable that button let deleteButton= newForm.querySelector('.delete-record'); if (deleteButton.hasAttribute("disabled")) { - // newForm.querySelector('.delete-record').classList.remove("display-none"); deleteButton.removeAttribute("disabled"); } } @@ -439,7 +442,6 @@ function prepareDeleteButtons(formLabel) { // Disable the add more button if we have 13 forms if (isNameserversForm && formNum == 13) { - // addButton.classList.add("display-none"); addButton.setAttribute("disabled", "true"); } @@ -447,7 +449,6 @@ function prepareDeleteButtons(formLabel) { // Enable the delete buttons on the nameservers forms.forEach((form, index) => { Array.from(form.querySelectorAll('.delete-record')).forEach((deleteButton) => { - // deleteButton.classList.remove("display-none"); deleteButton.removeAttribute("disabled"); }); }); diff --git a/src/registrar/forms/domain.py b/src/registrar/forms/domain.py index e486a66a2..a6173d376 100644 --- a/src/registrar/forms/domain.py +++ b/src/registrar/forms/domain.py @@ -42,7 +42,7 @@ class DomainNameserverForm(forms.Form): # add custom error messages self.fields["server"].error_messages.update( { - "required": "A minimum of 2 Name Servers are required.", + "required": "A minimum of 2 name servers are required.", } ) diff --git a/src/registrar/templates/domain_nameservers.html b/src/registrar/templates/domain_nameservers.html index 76e78d7ac..55519ef67 100644 --- a/src/registrar/templates/domain_nameservers.html +++ b/src/registrar/templates/domain_nameservers.html @@ -81,7 +81,7 @@ type="submit" class="usa-button usa-button--outline" name="btn-cancel-click" - aria-label="Reset the data in the Name Server form to the registry state (undo changes)" + aria-label="Reset the data in the name server form to the registry state (undo changes)" >Cancel diff --git a/src/registrar/tests/test_views.py b/src/registrar/tests/test_views.py index 94d407a40..02f19cff0 100644 --- a/src/registrar/tests/test_views.py +++ b/src/registrar/tests/test_views.py @@ -1466,7 +1466,7 @@ class TestDomainNameservers(TestDomainOverview): # the required field. form requires a minimum of 2 name servers self.assertContains( result, - "A minimum of 2 Name Servers are required.", + "A minimum of 2 name servers are required.", count=2, status_code=200, ) @@ -1639,7 +1639,7 @@ class TestDomainNameservers(TestDomainOverview): # once around each required field. self.assertContains( result, - "A minimum of 2 Name Servers are required.", + "A minimum of 2 name servers are required.", count=4, status_code=200, ) @@ -1810,7 +1810,11 @@ class TestDomainSecurityEmail(TestDomainOverview): ( "RegistryError", form_data_registry_error, - "Update failed. Cannot contact the registry.", + """ +We’re experiencing a system connection error. Please wait a few minutes +and try again. If you continue to receive this error after a few tries, +contact help@get.gov + """, ), ("ContactError", form_data_contact_error, "Value entered was wrong."), ( @@ -1845,7 +1849,7 @@ class TestDomainSecurityEmail(TestDomainOverview): self.assertEqual(len(messages), 1) message = messages[0] self.assertEqual(message.tags, message_tag) - self.assertEqual(message.message, expected_message) + self.assertEqual(message.message.strip(), expected_message.strip()) def test_domain_overview_blocked_for_ineligible_user(self): """We could easily duplicate this test for all domain management diff --git a/src/registrar/utility/errors.py b/src/registrar/utility/errors.py index c1d3c5849..5d62953ac 100644 --- a/src/registrar/utility/errors.py +++ b/src/registrar/utility/errors.py @@ -39,9 +39,11 @@ class GenericError(Exception): """ _error_mapping = { - GenericErrorCodes.CANNOT_CONTACT_REGISTRY: ( - "Update failed. Cannot contact the registry." - ), + GenericErrorCodes.CANNOT_CONTACT_REGISTRY: """ +We’re experiencing a system connection error. Please wait a few minutes +and try again. If you continue to receive this error after a few tries, +contact help@get.gov + """, GenericErrorCodes.GENERIC_ERROR: ("Value entered was wrong."), }