diff --git a/src/registrar/assets/js/get-gov.js b/src/registrar/assets/js/get-gov.js index 17d4c4d6a..4b5ff5e31 100644 --- a/src/registrar/assets/js/get-gov.js +++ b/src/registrar/assets/js/get-gov.js @@ -279,17 +279,6 @@ function prepareDeleteButtons() { let formNum2 = forms.length; totalForms.setAttribute('value', `${formNum2}`); - // We need to fix the indicies of every existing form otherwise - // the frontend and backend will not match and will error on submit - // let formNumberRegex = RegExp(`form-(\\d){1}-`,'g'); - // let formLabelRegex = RegExp(`DS Data record (\\d){1}`, 'g'); - // forms.forEach((form, index) => { - // form.innerHTML = form.innerHTML.replace(formNumberRegex, `form-${index}-`); - // form.innerHTML = form.innerHTML.replace(formLabelRegex, `DS Data Record ${index+1}`); - // }); - - - let formNumberRegex = RegExp(`form-(\\d){1}-`, 'g'); let formLabelRegex = RegExp(`DS Data record (\\d){1}`, 'g'); @@ -311,10 +300,6 @@ function prepareDeleteButtons() { }); }); - - - - } } @@ -331,9 +316,8 @@ function prepareDeleteButtons() { // Attach click event listener on the delete buttons of the existing forms prepareDeleteButtons(); - if (addButton) { + if (addButton) addButton.addEventListener('click', addForm); - } function addForm(e){ let forms = document.querySelectorAll(".ds-record"); @@ -389,84 +373,6 @@ function prepareDeleteButtons() { // Attach click event listener on the delete buttons of the new form prepareDeleteButtons(); - - // We need to fix the indicies of every existing form otherwise - // the frontend and backend will not match and will error on submit - // forms.forEach((form, index) => { - // form.innerHTML = form.innerHTML.replace(formNumberRegex, `form-${index}-`); - // form.innerHTML = form.innerHTML.replace(formLabelRegex, `DS Data Record ${index+1}`); - // }); } })(); - - -// (function prepareCancelButtons() { -// const cancelButton = document.querySelector('.btn-cancel'); - -// if (cancelButton) { -// cancelButton.addEventListener('click', () => { - -// // Option 2: Redirect to another page (e.g., the homepage) - -// localStorage.clear(); // Clear all localStorage data -// sessionStorage.clear(); // Clear all sessionStorage data - -// location.reload(); -// }); -// } -// })(); - - -// /** -// * An IIFE that attaches a click handler on form cancel buttons -// * -// */ -// (function prepareCancelButtons() { -// const cancelButton = document.querySelector('.btn-cancel'); - -// const formsetContainer = document.querySelector('#form-container'); -// const originalFormHTML = document.querySelector('.ds-record').innerHTML; -// const numberOfFormsToReset = document.querySelectorAll('.ds-record').length; -// const addNewRecordButton = document.querySelector('#add-ds-form'); -// const submitButton = document.querySelector('button[type="submit"]'); - -// if (cancelButton) { -// cancelButton.addEventListener('click', () => { -// // Reset the form to its initial values -// const form = document.querySelector('form'); -// resetForm(form); -// }); -// } - -// function resetForm(form) { - -// // Remove all existing forms within the container -// formsetContainer.innerHTML = ''; -// for (let i = 0; i < numberOfFormsToReset; i++) { -// formsetContainer.innerHTML += originalFormHTML; -// } -// formsetContainer.innerHTML += addNewRecordButton -// formsetContainer.innerHTML += submitButton - -// const dsRecords = form.querySelectorAll('.ds-record'); - -// dsRecords.forEach((record) => { -// const initialValuesField = record.querySelector('.initial-values'); -// const formFields = record.querySelectorAll('input, textarea, select'); - -// if (initialValuesField) { -// const initialValues = JSON.parse(initialValuesField.value); - -// formFields.forEach((field) => { -// const fieldName = field.name; -// if (fieldName in initialValues) { -// field.value = initialValues[fieldName]; -// } else { -// field.value = ''; // Set to empty if no initial value -// } -// }); -// } -// }); -// } -// })(); \ No newline at end of file diff --git a/src/registrar/assets/sass/_theme/_buttons.scss b/src/registrar/assets/sass/_theme/_buttons.scss index 45ea6620c..f4c72f4fa 100644 --- a/src/registrar/assets/sass/_theme/_buttons.scss +++ b/src/registrar/assets/sass/_theme/_buttons.scss @@ -24,6 +24,14 @@ a.breadcrumb__back { a.usa-button { text-decoration: none; + color: color('white'); +} + +a.usa-button:visited, +a.usa-button:hover, +a.usa-button:focus, +a.usa-button:active { + color: color('white'); } a.usa-button--outline, diff --git a/src/registrar/forms/common.py b/src/registrar/forms/common.py index 377f59797..159113488 100644 --- a/src/registrar/forms/common.py +++ b/src/registrar/forms/common.py @@ -1,7 +1,8 @@ # common.py -# +# # ALGORITHM_CHOICES are options for alg attribute in DS Data and Key Data -# reference: https://www.iana.org/assignments/dns-sec-alg-numbers/dns-sec-alg-numbers.xhtml +# reference: +# https://www.iana.org/assignments/dns-sec-alg-numbers/dns-sec-alg-numbers.xhtml ALGORITHM_CHOICES = [ (1, "(1) ERSA/MD5 [RSAMD5]"), (2, "(2) Diffie-Hellman [DH]"), diff --git a/src/registrar/forms/domain.py b/src/registrar/forms/domain.py index 6ebaa3be9..4ee17a72d 100644 --- a/src/registrar/forms/domain.py +++ b/src/registrar/forms/domain.py @@ -7,7 +7,13 @@ from django.forms import formset_factory from phonenumber_field.widgets import RegionalPhoneNumberWidget from ..models import Contact, DomainInformation -from .common import ALGORITHM_CHOICES, DIGEST_TYPE_CHOICES, FLAG_CHOICES, PROTOCOL_CHOICES +from .common import ( + ALGORITHM_CHOICES, + DIGEST_TYPE_CHOICES, + FLAG_CHOICES, + PROTOCOL_CHOICES, +) + class DomainAddUserForm(forms.Form): @@ -154,27 +160,30 @@ class DomainDsdataForm(forms.Form): required=True, label="Key tag", validators=[ - MinValueValidator(0, "Value must be between 0 and 65535"), - MaxValueValidator(65535, "Value must be between 0 and 65535"), + MinValueValidator(0, message="Value must be between 0 and 65535"), + MaxValueValidator(65535, message="Value must be between 0 and 65535"), ], + error_messages={"required": ("Key tag is required.")}, ) - + algorithm = forms.TypedChoiceField( required=True, label="Algorithm", - choices=[(None, "--Select--")] + ALGORITHM_CHOICES, + choices=[(None, "--Select--")] + ALGORITHM_CHOICES, # type: ignore + error_messages={"required": ("Algorithm is required.")}, ) digest_type = forms.TypedChoiceField( required=True, label="Digest Type", - choices=[(None, "--Select--")] + DIGEST_TYPE_CHOICES, + choices=[(None, "--Select--")] + DIGEST_TYPE_CHOICES, # type: ignore + error_messages={"required": ("Digest Type is required.")}, ) digest = forms.CharField( required=True, label="Digest", - # TODO: Validation of digests in registrar? + error_messages={"required": ("Digest is required.")}, ) @@ -193,23 +202,27 @@ class DomainKeydataForm(forms.Form): required=True, label="Flag", choices=FLAG_CHOICES, + error_messages={"required": ("Flag is required.")}, ) protocol = forms.TypedChoiceField( required=True, label="Protocol", choices=PROTOCOL_CHOICES, + error_messages={"required": ("Protocol is required.")}, ) algorithm = forms.TypedChoiceField( required=True, label="Algorithm", - choices=[(None, "--Select--")] + ALGORITHM_CHOICES, + choices=[(None, "--Select--")] + ALGORITHM_CHOICES, # type: ignore + error_messages={"required": ("Algorithm is required.")}, ) - + pub_key = forms.CharField( required=True, label="Pub key", + error_messages={"required": ("Pub key is required.")}, ) @@ -217,4 +230,4 @@ DomainKeydataFormset = formset_factory( DomainKeydataForm, extra=0, can_delete=True, -) \ No newline at end of file +) diff --git a/src/registrar/migrations/0033_domain_dnssec_enabled.py b/src/registrar/migrations/0033_domain_dnssec_enabled.py deleted file mode 100644 index a4695a02b..000000000 --- a/src/registrar/migrations/0033_domain_dnssec_enabled.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 4.2.1 on 2023-10-03 06:36 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ("registrar", "0032_alter_transitiondomain_status"), - ] - - operations = [ - migrations.AddField( - model_name="domain", - name="dnssec_enabled", - field=models.BooleanField( - default=False, help_text="Boolean indicating if dnssec is enabled" - ), - ), - ] diff --git a/src/registrar/migrations/0034_domain_dnssec_ds_confirmed_and_more.py b/src/registrar/migrations/0034_domain_dnssec_ds_confirmed_and_more.py deleted file mode 100644 index 72513a401..000000000 --- a/src/registrar/migrations/0034_domain_dnssec_ds_confirmed_and_more.py +++ /dev/null @@ -1,28 +0,0 @@ -# Generated by Django 4.2.1 on 2023-10-03 17:34 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ("registrar", "0033_domain_dnssec_enabled"), - ] - - operations = [ - migrations.AddField( - model_name="domain", - name="dnssec_ds_confirmed", - field=models.BooleanField( - default=False, - help_text="Boolean indicating if DS record adding is confirmed", - ), - ), - migrations.AddField( - model_name="domain", - name="dnssec_key_confirmed", - field=models.BooleanField( - default=False, - help_text="Boolean indicating if Key record adding is confirmed", - ), - ), - ] diff --git a/src/registrar/templates/domain_dnssec.html b/src/registrar/templates/domain_dnssec.html index e21bb9458..6a0a15389 100644 --- a/src/registrar/templates/domain_dnssec.html +++ b/src/registrar/templates/domain_dnssec.html @@ -5,46 +5,64 @@ {% block domain_content %} -
DNSSEC, or DNS Security Extensions, is additional security layer to protect your website. Enabling DNSSEC ensures that when someone visits your website, they can be certain that it's connecting to the correct server, preventing potential hijacking or tampering with your domain's records. Read more about DNSSEC and why it is important.
+DNSSEC, or DNS Security Extensions, is additional security layer to protect your website. Enabling DNSSEC ensures that when someone visits your website, they can be certain that it's connecting to the correct server, preventing potential hijacking or tampering with your domain's records.
+ +In order to enable DNSSEC and add DS records, you must first configure it with your DNS hosting service. Your configuration will determine whether you need to add DS Data or Key Data. Contact your DNS hosting provider if you are unsure which record type to add.