Attention!
diff --git a/src/registrar/templates/domain_sidebar.html b/src/registrar/templates/domain_sidebar.html
index ac3461b5e..1e4cd1882 100644
--- a/src/registrar/templates/domain_sidebar.html
+++ b/src/registrar/templates/domain_sidebar.html
@@ -4,8 +4,8 @@
From 3cfa7f8b034854ed529f1da8d9809138328ebd0d Mon Sep 17 00:00:00 2001
From: zandercymatics <141044360+zandercymatics@users.noreply.github.com>
Date: Thu, 31 Aug 2023 13:15:40 -0600
Subject: [PATCH 33/40] Changed permission flow for mixins / Made logging a bit
more detailed
---
src/registrar/views/domain.py | 21 +++--
src/registrar/views/utility/mixins.py | 92 +++++++++++--------
.../views/utility/permission_views.py | 24 +++--
3 files changed, 82 insertions(+), 55 deletions(-)
diff --git a/src/registrar/views/domain.py b/src/registrar/views/domain.py
index 559ea4517..dd4b9d791 100644
--- a/src/registrar/views/domain.py
+++ b/src/registrar/views/domain.py
@@ -83,10 +83,10 @@ class DomainOrgNameAddressView(DomainPermissionView, FormMixin):
# Q: Is there a more efficent way to do this?
# It would be ideal if we didn't have to repeat this.
if self.request.user.is_staff or self.request.user.is_superuser:
- changes = {field: form.cleaned_data[field] for field in form.changed_data}
# if they are editing from an '/admin' redirect, log their actions
+ changes = {field: form.cleaned_data[field] for field in form.changed_data}
self.log_analyst_form_actions(
- self.form_class.__name__, self.get_object().domain_info, changes
+ self.form_class.__name__, self.get_object().domain_info, changes, obj=self.get_object()
)
# superclass has the redirect
@@ -134,8 +134,9 @@ class DomainAuthorizingOfficialView(DomainPermissionView, FormMixin):
if self.request.user.is_staff or self.request.user.is_superuser:
# if they are editing from an '/admin' redirect, log their actions
+ changes = {field: form.cleaned_data[field] for field in form.changed_data}
self.log_analyst_form_actions(
- self.form_class.__name__, self.get_object().domain_info
+ self.form_class.__name__, self.get_object().domain_info, changes, obj=self.get_object()
)
# superclass has the redirect
@@ -207,8 +208,9 @@ class DomainNameserversView(DomainPermissionView, FormMixin):
if self.request.user.is_staff or self.request.user.is_superuser:
# if they are editing from an '/admin' redirect, log their actions
+ changes = {field: formset.cleaned_data[field] for field in formset.changed_data}
self.log_analyst_form_actions(
- self.form_class.__name__, self.get_object().domain_info
+ self.form_class.__name__, self.get_object().domain_info, changes, obj=self.get_object()
)
# superclass has the redirect
@@ -254,8 +256,9 @@ class DomainYourContactInformationView(DomainPermissionView, FormMixin):
if self.request.user.is_staff or self.request.user.is_superuser:
# if they are editing from an '/admin' redirect, log their actions
+ changes = {field: form.cleaned_data[field] for field in form.changed_data}
self.log_analyst_form_actions(
- self.form_class.__name__, self.get_object().domain_info
+ self.form_class.__name__, self.get_object().domain_info, changes, obj=self.get_object()
)
# superclass has the redirect
@@ -306,8 +309,9 @@ class DomainSecurityEmailView(DomainPermissionView, FormMixin):
if self.request.user.is_staff or self.request.user.is_superuser:
# if they are editing from an '/admin' redirect, log their actions
+ changes = {field: form.cleaned_data[field] for field in form.changed_data}
self.log_analyst_form_actions(
- self.form_class.__name__, self.get_object().domain_info
+ self.form_class.__name__, self.get_object().domain_info, changes, obj=self.get_object()
)
# superclass has the redirect
@@ -388,7 +392,7 @@ class DomainAddUserView(DomainPermissionView, FormMixin):
if self.request.user.is_staff or self.request.user.is_superuser:
# if they are editing from an '/admin' redirect, log their actions
self.log_analyst_form_actions(
- self.form_class.__name__, self.get_object().domain_info
+ self.form_class.__name__, self.get_object().domain_info, obj=self.get_object()
)
return redirect(self.get_success_url())
@@ -414,8 +418,9 @@ class DomainAddUserView(DomainPermissionView, FormMixin):
if self.request.user.is_staff or self.request.user.is_superuser:
# if they are editing from an '/admin' redirect, log their actions
+ changes = {field: form.cleaned_data[field] for field in form.changed_data}
self.log_analyst_form_actions(
- self.form_class.__name__, self.get_object().domain_info
+ self.form_class.__name__, self.get_object().domain_info, changes, obj=self.get_object()
)
return redirect(self.get_success_url())
diff --git a/src/registrar/views/utility/mixins.py b/src/registrar/views/utility/mixins.py
index aff82699a..9a19d78d1 100644
--- a/src/registrar/views/utility/mixins.py
+++ b/src/registrar/views/utility/mixins.py
@@ -36,27 +36,55 @@ class DomainPermission(PermissionsLoginMixin):
if not self.request.user.is_authenticated:
return False
+ if self.request.user.is_restricted():
+ return False
+
pk = self.kwargs["pk"]
# If pk is none then something went very wrong...
if pk is None:
raise ValueError("Primary key is None")
+ # ticket 806
+ if self.can_access_other_user_domains(pk):
+ return True
+
# user needs to have a role on the domain,
# and user cannot be restricted
- if (
- UserDomainRole.objects.filter(
- user=self.request.user, domain__id=pk
- ).exists()
- and not self.request.user.is_restricted()
- ):
- return True
- elif self.request.user.is_restricted():
+ if not UserDomainRole.objects.filter(
+ user=self.request.user, domain__id=pk
+ ).exists():
return False
- # ticket 806
- requested_domain = None
- if DomainInformation.objects.filter(id=pk).exists():
- requested_domain = DomainInformation.objects.get(id=pk)
+ # if we need to check more about the nature of role, do it here.
+ return True
+
+ def can_access_other_user_domains(self, pk):
+ """Checks to see if an authorized user (staff or superuser)
+ can access a domain that they did not create or was invited to.
+ """
+
+ # Check if the user is permissioned...
+ user_is_analyst_or_superuser = (
+ self.request.user.is_staff or self.request.user.is_superuser
+ )
+ logger.debug(f"is auth {user_is_analyst_or_superuser}")
+
+ if not user_is_analyst_or_superuser:
+ return False
+
+ # Check if the user is attempting a valid edit action.
+ # In other words, if the analyst/admin did not click
+ # the 'Manage Domain' button in /admin,
+ # then they cannot access this page.
+ session = self.request.session
+ can_do_action = (
+ "analyst_action" in session
+ and "analyst_action_location" in session
+ and session["analyst_action_location"] == pk
+ )
+ logger.debug(f"can do {can_do_action}")
+ if not can_do_action:
+ return False
# Analysts may manage domains, when they are in these statuses:
valid_domain_statuses = [
@@ -64,37 +92,23 @@ class DomainPermission(PermissionsLoginMixin):
DomainApplication.IN_REVIEW,
DomainApplication.REJECTED,
DomainApplication.ACTION_NEEDED,
+ # Edge case - some domains do not have
+ # a status or DomainInformation... aka a status of 'None'.
+ # It is necessary to access those to correct errors.
+ None,
]
- # Check if the user is permissioned...
- user_is_analyst_or_superuser = (
- self.request.user.is_staff or self.request.user.is_superuser
- )
+ requested_domain = None
+ if DomainInformation.objects.filter(id=pk).exists():
+ requested_domain = DomainInformation.objects.get(id=pk)
- session = self.request.session
- # Check if the user is attempting a valid edit action.
- can_do_action = (
- "analyst_action" in session
- and "analyst_action_location" in session
- and session["analyst_action_location"] == pk
- )
+ if not requested_domain.domain_application.status in valid_domain_statuses:
+ return False
- # Edge case - some domains do not have
- # a status or DomainInformation... aka a status of 'None'
- # This checks that it has a status, before checking if it does
- # Otherwise, analysts can edit these domains
- if requested_domain is not None:
- can_do_action = (
- can_do_action
- and requested_domain.domain_application.status in valid_domain_statuses
- )
- # If the valid session keys exist, if the user is permissioned,
- # and if its in a valid status
- if can_do_action and user_is_analyst_or_superuser:
- return True
-
- # if we need to check more about the nature of role, do it here.
- return False
+ # Valid session keys exist,
+ # the user is permissioned,
+ # and it is in a valid status
+ return True
class DomainApplicationPermission(PermissionsLoginMixin):
diff --git a/src/registrar/views/utility/permission_views.py b/src/registrar/views/utility/permission_views.py
index a42238150..920ec6212 100644
--- a/src/registrar/views/utility/permission_views.py
+++ b/src/registrar/views/utility/permission_views.py
@@ -3,9 +3,9 @@
import abc # abstract base class
from django.views.generic import DetailView, DeleteView, TemplateView
-
+from django.contrib.contenttypes.models import ContentType
from registrar.models import Domain, DomainApplication, DomainInvitation
-
+from django.contrib.admin.models import LogEntry, CHANGE
from .mixins import (
DomainPermission,
@@ -48,7 +48,7 @@ class DomainPermissionView(DomainPermission, DetailView, abc.ABC):
return context
def log_analyst_form_actions(
- self, form_class_name, printable_object_info, changes=None
+ self, form_class_name, printable_object_info, changes=None, obj=None
):
"""Generates a log for when key 'analyst_action' exists on the session.
Follows this format:
@@ -72,12 +72,20 @@ class DomainPermissionView(DomainPermission, DetailView, abc.ABC):
# or 'copy', for instance.
match action:
case "edit":
- # Q: do we want to be logging on every changed field?
- # I could see that becoming spammy log-wise,
- # but it may also be important.
+ if obj is not None:
+ content_type = ContentType.objects.get_for_model(obj)
+ LogEntry.objects.log_action(
+ user_id=self.request.user.id,
+ content_type_id=content_type.pk,
+ object_id=obj.id,
+ object_repr=str(obj),
+ action_flag=CHANGE,
+ )
+
if changes is not None:
- # Logs every change made to the domain field
- # noqa for readability/format
+ # Logs every change made to the domain field.
+ # noqa for readability/format.
+ # Used to manually capture changes, if need be.
for field, new_value in changes.items():
logger.info(
f"""
From 11bed39dd8a0e2d2d209027d755dc005f75f0ca5 Mon Sep 17 00:00:00 2001
From: zandercymatics <141044360+zandercymatics@users.noreply.github.com>
Date: Fri, 1 Sep 2023 14:16:44 -0600
Subject: [PATCH 34/40] Remove custom logging / cleanup
---
src/registrar/assets/js/get-gov-admin.js | 17 ++++--
src/registrar/views/domain.py | 49 +----------------
src/registrar/views/utility/mixins.py | 8 +--
.../views/utility/permission_views.py | 55 -------------------
4 files changed, 16 insertions(+), 113 deletions(-)
diff --git a/src/registrar/assets/js/get-gov-admin.js b/src/registrar/assets/js/get-gov-admin.js
index d7d589214..d193b2fb6 100644
--- a/src/registrar/assets/js/get-gov-admin.js
+++ b/src/registrar/assets/js/get-gov-admin.js
@@ -27,11 +27,16 @@ function openInNewTab(el, removeAttribute = false){
* Currently only appends target="_blank" to the domain_form object,
* but this can be expanded.
*/
-(function prepareDjangoAdmin(){
- let domainFormElement = document.getElementById("domain_form");
- let domainSubmitButton = document.getElementById("manageDomainSubmitButton");
- if(domainSubmitButton && domainFormElement){
- domainSubmitButton.addEventListener("mouseover", () => openInNewTab(domainFormElement, true));
- domainSubmitButton.addEventListener("mouseout", () => openInNewTab(domainFormElement, false));
+(function (){
+ // Keep scope tight and allow for scalability
+ function prepareDjangoAdmin() {
+ let domainFormElement = document.getElementById("domain_form");
+ let domainSubmitButton = document.getElementById("manageDomainSubmitButton");
+ if(domainSubmitButton && domainFormElement){
+ domainSubmitButton.addEventListener("mouseover", () => openInNewTab(domainFormElement, true));
+ domainSubmitButton.addEventListener("mouseout", () => openInNewTab(domainFormElement, false));
+ }
}
+
+ prepareDjangoAdmin();
})();
\ No newline at end of file
diff --git a/src/registrar/views/domain.py b/src/registrar/views/domain.py
index dd4b9d791..29d06da39 100644
--- a/src/registrar/views/domain.py
+++ b/src/registrar/views/domain.py
@@ -80,15 +80,6 @@ class DomainOrgNameAddressView(DomainPermissionView, FormMixin):
self.request, "The organization name and mailing address has been updated."
)
- # Q: Is there a more efficent way to do this?
- # It would be ideal if we didn't have to repeat this.
- if self.request.user.is_staff or self.request.user.is_superuser:
- # if they are editing from an '/admin' redirect, log their actions
- changes = {field: form.cleaned_data[field] for field in form.changed_data}
- self.log_analyst_form_actions(
- self.form_class.__name__, self.get_object().domain_info, changes, obj=self.get_object()
- )
-
# superclass has the redirect
return super().form_valid(form)
@@ -132,12 +123,7 @@ class DomainAuthorizingOfficialView(DomainPermissionView, FormMixin):
self.request, "The authorizing official for this domain has been updated."
)
- if self.request.user.is_staff or self.request.user.is_superuser:
- # if they are editing from an '/admin' redirect, log their actions
- changes = {field: form.cleaned_data[field] for field in form.changed_data}
- self.log_analyst_form_actions(
- self.form_class.__name__, self.get_object().domain_info, changes, obj=self.get_object()
- )
+
# superclass has the redirect
return super().form_valid(form)
@@ -206,13 +192,6 @@ class DomainNameserversView(DomainPermissionView, FormMixin):
self.request, "The name servers for this domain have been updated."
)
- if self.request.user.is_staff or self.request.user.is_superuser:
- # if they are editing from an '/admin' redirect, log their actions
- changes = {field: formset.cleaned_data[field] for field in formset.changed_data}
- self.log_analyst_form_actions(
- self.form_class.__name__, self.get_object().domain_info, changes, obj=self.get_object()
- )
-
# superclass has the redirect
return super().form_valid(formset)
@@ -254,13 +233,6 @@ class DomainYourContactInformationView(DomainPermissionView, FormMixin):
self.request, "Your contact information for this domain has been updated."
)
- if self.request.user.is_staff or self.request.user.is_superuser:
- # if they are editing from an '/admin' redirect, log their actions
- changes = {field: form.cleaned_data[field] for field in form.changed_data}
- self.log_analyst_form_actions(
- self.form_class.__name__, self.get_object().domain_info, changes, obj=self.get_object()
- )
-
# superclass has the redirect
return super().form_valid(form)
@@ -307,13 +279,6 @@ class DomainSecurityEmailView(DomainPermissionView, FormMixin):
self.request, "The security email for this domain have been updated."
)
- if self.request.user.is_staff or self.request.user.is_superuser:
- # if they are editing from an '/admin' redirect, log their actions
- changes = {field: form.cleaned_data[field] for field in form.changed_data}
- self.log_analyst_form_actions(
- self.form_class.__name__, self.get_object().domain_info, changes, obj=self.get_object()
- )
-
# superclass has the redirect
return redirect(self.get_success_url())
@@ -389,11 +354,7 @@ class DomainAddUserView(DomainPermissionView, FormMixin):
messages.success(
self.request, f"Invited {email_address} to this domain."
)
- if self.request.user.is_staff or self.request.user.is_superuser:
- # if they are editing from an '/admin' redirect, log their actions
- self.log_analyst_form_actions(
- self.form_class.__name__, self.get_object().domain_info, obj=self.get_object()
- )
+
return redirect(self.get_success_url())
def form_valid(self, form):
@@ -416,12 +377,6 @@ class DomainAddUserView(DomainPermissionView, FormMixin):
messages.success(self.request, f"Added user {requested_email}.")
- if self.request.user.is_staff or self.request.user.is_superuser:
- # if they are editing from an '/admin' redirect, log their actions
- changes = {field: form.cleaned_data[field] for field in form.changed_data}
- self.log_analyst_form_actions(
- self.form_class.__name__, self.get_object().domain_info, changes, obj=self.get_object()
- )
return redirect(self.get_success_url())
diff --git a/src/registrar/views/utility/mixins.py b/src/registrar/views/utility/mixins.py
index 9a19d78d1..57bb97be6 100644
--- a/src/registrar/views/utility/mixins.py
+++ b/src/registrar/views/utility/mixins.py
@@ -10,6 +10,7 @@ from registrar.models import (
)
import logging
+
logger = logging.getLogger(__name__)
@@ -44,12 +45,10 @@ class DomainPermission(PermissionsLoginMixin):
if pk is None:
raise ValueError("Primary key is None")
- # ticket 806
if self.can_access_other_user_domains(pk):
return True
- # user needs to have a role on the domain,
- # and user cannot be restricted
+ # user needs to have a role on the domain
if not UserDomainRole.objects.filter(
user=self.request.user, domain__id=pk
).exists():
@@ -67,7 +66,6 @@ class DomainPermission(PermissionsLoginMixin):
user_is_analyst_or_superuser = (
self.request.user.is_staff or self.request.user.is_superuser
)
- logger.debug(f"is auth {user_is_analyst_or_superuser}")
if not user_is_analyst_or_superuser:
return False
@@ -82,7 +80,7 @@ class DomainPermission(PermissionsLoginMixin):
and "analyst_action_location" in session
and session["analyst_action_location"] == pk
)
- logger.debug(f"can do {can_do_action}")
+
if not can_do_action:
return False
diff --git a/src/registrar/views/utility/permission_views.py b/src/registrar/views/utility/permission_views.py
index 920ec6212..aa4c79690 100644
--- a/src/registrar/views/utility/permission_views.py
+++ b/src/registrar/views/utility/permission_views.py
@@ -47,61 +47,6 @@ class DomainPermissionView(DomainPermission, DetailView, abc.ABC):
return context
- def log_analyst_form_actions(
- self, form_class_name, printable_object_info, changes=None, obj=None
- ):
- """Generates a log for when key 'analyst_action' exists on the session.
- Follows this format:
-
- for field, new_value in changes.items():
- "{user_type} '{self.request.user}'
- set field '{field}': '{new_value}'
- under class '{form_class_name}'
- in domain '{printable_object_info}'"
- """
- if "analyst_action" in self.request.session:
- action = self.request.session["analyst_action"]
-
- user_type = "Analyst"
- if self.request.user.is_superuser:
- user_type = "Superuser"
-
- # Template for potential future expansion,
- # in the event we want more logging granularity.
- # Could include things such as 'view'
- # or 'copy', for instance.
- match action:
- case "edit":
- if obj is not None:
- content_type = ContentType.objects.get_for_model(obj)
- LogEntry.objects.log_action(
- user_id=self.request.user.id,
- content_type_id=content_type.pk,
- object_id=obj.id,
- object_repr=str(obj),
- action_flag=CHANGE,
- )
-
- if changes is not None:
- # Logs every change made to the domain field.
- # noqa for readability/format.
- # Used to manually capture changes, if need be.
- for field, new_value in changes.items():
- logger.info(
- f"""
- An analyst or superuser made alterations to a domain:
- {user_type} '{self.request.user}'
- set field '{field}': '{new_value}'
- under class '{form_class_name}'
- in domain '{printable_object_info}'
- """ # noqa
- )
- else:
- # noqa here as breaking this up further leaves it hard to read
- logger.info(
- f"{user_type} {self.request.user} edited {form_class_name} in {printable_object_info}" # noqa
- )
-
# Abstract property enforces NotImplementedError on an attribute.
@property
@abc.abstractmethod
From 6617ecb8a0cb4901458d67ee6583d0e7d5a0a985 Mon Sep 17 00:00:00 2001
From: Rachid Mrad
Date: Fri, 1 Sep 2023 17:39:58 -0400
Subject: [PATCH 35/40] concatenate the value + extracted text for both label
for attribute and checkbox id attribute
---
src/registrar/templates/admin/change_list_results.html | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/registrar/templates/admin/change_list_results.html b/src/registrar/templates/admin/change_list_results.html
index 831350888..1d0c70c30 100644
--- a/src/registrar/templates/admin/change_list_results.html
+++ b/src/registrar/templates/admin/change_list_results.html
@@ -60,12 +60,11 @@ Load our custom filters to extract info from the django generated markup.
{{ result.form.non_field_errors }} |
{% endif %}
-
{% with result_value=result.0|extract_value %}
{% with result_label=result.1|extract_a_text %}
-
-
+
+
|
{% endwith %}
{% endwith %}
From 7a5438e3d000834952241fec2d32e019e7a7b6ce Mon Sep 17 00:00:00 2001
From: rachidatecs <107004823+rachidatecs@users.noreply.github.com>
Date: Tue, 5 Sep 2023 11:59:33 -0400
Subject: [PATCH 36/40] Update
src/registrar/templates/admin/change_list_results.html
Co-authored-by: Neil MartinsenBurrell
---
src/registrar/templates/admin/change_list_results.html | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/registrar/templates/admin/change_list_results.html b/src/registrar/templates/admin/change_list_results.html
index 1d0c70c30..4ced73eb3 100644
--- a/src/registrar/templates/admin/change_list_results.html
+++ b/src/registrar/templates/admin/change_list_results.html
@@ -63,8 +63,8 @@ Load our custom filters to extract info from the django generated markup.
{% with result_value=result.0|extract_value %}
{% with result_label=result.1|extract_a_text %}
-
-
+
+
|
{% endwith %}
{% endwith %}
From 6d2b397a1bf71be3695c80003a07909e7b3428b5 Mon Sep 17 00:00:00 2001
From: zandercymatics <141044360+zandercymatics@users.noreply.github.com>
Date: Tue, 5 Sep 2023 14:07:35 -0600
Subject: [PATCH 37/40] Linter fixes
---
src/registrar/views/domain.py | 3 ---
src/registrar/views/utility/mixins.py | 2 +-
src/registrar/views/utility/permission_views.py | 2 --
3 files changed, 1 insertion(+), 6 deletions(-)
diff --git a/src/registrar/views/domain.py b/src/registrar/views/domain.py
index 29d06da39..f945bc443 100644
--- a/src/registrar/views/domain.py
+++ b/src/registrar/views/domain.py
@@ -123,8 +123,6 @@ class DomainAuthorizingOfficialView(DomainPermissionView, FormMixin):
self.request, "The authorizing official for this domain has been updated."
)
-
-
# superclass has the redirect
return super().form_valid(form)
@@ -377,7 +375,6 @@ class DomainAddUserView(DomainPermissionView, FormMixin):
messages.success(self.request, f"Added user {requested_email}.")
-
return redirect(self.get_success_url())
diff --git a/src/registrar/views/utility/mixins.py b/src/registrar/views/utility/mixins.py
index 57bb97be6..fd58b3475 100644
--- a/src/registrar/views/utility/mixins.py
+++ b/src/registrar/views/utility/mixins.py
@@ -100,7 +100,7 @@ class DomainPermission(PermissionsLoginMixin):
if DomainInformation.objects.filter(id=pk).exists():
requested_domain = DomainInformation.objects.get(id=pk)
- if not requested_domain.domain_application.status in valid_domain_statuses:
+ if requested_domain.domain_application.status not in valid_domain_statuses:
return False
# Valid session keys exist,
diff --git a/src/registrar/views/utility/permission_views.py b/src/registrar/views/utility/permission_views.py
index aa4c79690..417ee8417 100644
--- a/src/registrar/views/utility/permission_views.py
+++ b/src/registrar/views/utility/permission_views.py
@@ -3,9 +3,7 @@
import abc # abstract base class
from django.views.generic import DetailView, DeleteView, TemplateView
-from django.contrib.contenttypes.models import ContentType
from registrar.models import Domain, DomainApplication, DomainInvitation
-from django.contrib.admin.models import LogEntry, CHANGE
from .mixins import (
DomainPermission,
From 48e56724acbe5ccb544d2b776c4142818b9b0aae Mon Sep 17 00:00:00 2001
From: zandercymatics <141044360+zandercymatics@users.noreply.github.com>
Date: Wed, 6 Sep 2023 10:00:37 -0600
Subject: [PATCH 38/40] Added comments on get-gov-admin.js
---
src/registrar/assets/js/get-gov-admin.js | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/registrar/assets/js/get-gov-admin.js b/src/registrar/assets/js/get-gov-admin.js
index d193b2fb6..3b9f19a49 100644
--- a/src/registrar/assets/js/get-gov-admin.js
+++ b/src/registrar/assets/js/get-gov-admin.js
@@ -28,7 +28,15 @@ function openInNewTab(el, removeAttribute = false){
* but this can be expanded.
*/
(function (){
- // Keep scope tight and allow for scalability
+ /*
+ On mouseover, appends target="_blank" on domain_form under the Domain page.
+ The reason for this is that the template has a form that contains multiple buttons.
+ The structure of that template complicates seperating those buttons
+ out of the form (while maintaining the same position on the page).
+ However, if we want to open one of those submit actions to a new tab -
+ such as the manage domain button - we need to dynamically append target.
+ As there is no built-in django method which handles this, we do it here.
+ */
function prepareDjangoAdmin() {
let domainFormElement = document.getElementById("domain_form");
let domainSubmitButton = document.getElementById("manageDomainSubmitButton");
From d663e46fbbcd9678e5f531cab3418546474e4b17 Mon Sep 17 00:00:00 2001
From: Gaby Disarli
Date: Wed, 6 Sep 2023 17:12:28 -0700
Subject: [PATCH 39/40] changes to domain contact information
---
src/registrar/templates/domain_your_contact_information.html | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/registrar/templates/domain_your_contact_information.html b/src/registrar/templates/domain_your_contact_information.html
index e18deeb50..1976a6def 100644
--- a/src/registrar/templates/domain_your_contact_information.html
+++ b/src/registrar/templates/domain_your_contact_information.html
@@ -7,7 +7,8 @@
Domain contact information
- If you’d like us to use a different name, email, or phone number you can make those changes below. Changing your contact information here won’t affect your Login.gov account information.
+If you’d like us to use a different name, email, or phone number you can make those changes below. Please note that updating your contact information here will update the contact information for all domains in your account. However, it won’t affect your Login.gov account information.
+
{% include "includes/required_fields.html" %}
From b77bffd4835cf263dfc384dc571120dd987a5ed8 Mon Sep 17 00:00:00 2001
From: Gaby Disarli
Date: Thu, 7 Sep 2023 08:56:02 -0700
Subject: [PATCH 40/40] remove 'please note that'
---
src/registrar/templates/domain_your_contact_information.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/registrar/templates/domain_your_contact_information.html b/src/registrar/templates/domain_your_contact_information.html
index 1976a6def..81c62584c 100644
--- a/src/registrar/templates/domain_your_contact_information.html
+++ b/src/registrar/templates/domain_your_contact_information.html
@@ -7,7 +7,7 @@
Domain contact information
-If you’d like us to use a different name, email, or phone number you can make those changes below. Please note that updating your contact information here will update the contact information for all domains in your account. However, it won’t affect your Login.gov account information.
+
If you’d like us to use a different name, email, or phone number you can make those changes below. Updating your contact information here will update the contact information for all domains in your account. However, it won’t affect your Login.gov account information.
{% include "includes/required_fields.html" %}