diff --git a/.github/workflows/delete-and-recreate-db.yaml b/.github/workflows/delete-and-recreate-db.yaml
new file mode 100644
index 000000000..979f20826
--- /dev/null
+++ b/.github/workflows/delete-and-recreate-db.yaml
@@ -0,0 +1,90 @@
+# This workflow can be run from the CLI
+# gh workflow run reset-db.yaml -f environment=ENVIRONMENT
+
+name: Delete and Recreate database
+run-name: Delete and Recreate for ${{ github.event.inputs.environment }}
+
+on:
+ workflow_dispatch:
+ inputs:
+ environment:
+ type: choice
+ description: Which environment should we flush and re-load data for?
+ options:
+ - el
+ - ad
+ - ms
+ - ag
+ - litterbox
+ - hotgov
+ - cb
+ - bob
+ - meoward
+ - backup
+ - ky
+ - es
+ - nl
+ - rh
+ - za
+ - gd
+ - rb
+ - ko
+ - ab
+ - rjm
+ - dk
+
+jobs:
+ reset-db:
+ runs-on: ubuntu-latest
+ env:
+ CF_USERNAME: CF_${{ github.event.inputs.environment }}_USERNAME
+ CF_PASSWORD: CF_${{ github.event.inputs.environment }}_PASSWORD
+ DESTINATION_ENVIRONMENT: ${{ github.event.inputs.environment}}
+ steps:
+ - name: Delete and Recreate Database
+ env:
+ cf_username: ${{ secrets[env.CF_USERNAME] }}
+ cf_password: ${{ secrets[env.CF_PASSWORD] }}
+ run: |
+ # install cf cli and other tools
+ wget -q -O - https://packages.cloudfoundry.org/debian/cli.cloudfoundry.org.key | sudo gpg --dearmor -o /usr/share/keyrings/cli.cloudfoundry.org.gpg
+ echo "deb [signed-by=/usr/share/keyrings/cli.cloudfoundry.org.gpg] https://packages.cloudfoundry.org/debian stable main" | sudo tee /etc/apt/sources.list.d/cloudfoundry-cli.list
+
+ sudo apt-get update
+ sudo apt-get install cf8-cli
+ cf api api.fr.cloud.gov
+ cf auth "$cf_username" "$cf_password"
+ cf target -o cisa-dotgov -s $DESTINATION_ENVIRONMENT
+
+
+
+ # unbind the service
+ cf unbind-service getgov-$DESTINATION_ENVIRONMENT getgov-$DESTINATION_ENVIRONMENT-database
+ #delete the service key
+ yes Y | cf delete-service-key getgov-$DESTINATION_ENVIRONMENT-database SERVICE_CONNECT
+ # delete the service
+ yes Y | cf delete-service getgov-$DESTINATION_ENVIRONMENT-database
+ # create it again
+ cf create-service aws-rds micro-psql getgov-$DESTINATION_ENVIRONMENT-database
+ # wait for it be created (up to 5 mins)
+ # this checks the creation cf service getgov-$DESTINATION_ENVIRONMENT-database
+ # the below command with check “status” line using cf service command mentioned above. if it says “create in progress” it will keep waiting otherwise the next steps fail
+
+ timeout 480 bash -c "until cf service getgov-$DESTINATION_ENVIRONMENT-database | grep -q 'The service instance status is succeeded'
+ do
+ echo 'Database not up yet, waiting...'
+ sleep 30
+ done"
+
+ # rebind the service
+ cf bind-service getgov-$DESTINATION_ENVIRONMENT getgov-$DESTINATION_ENVIRONMENT-database
+ #restage the app or it will not connect to the database right for the next commands
+ cf restage getgov-$DESTINATION_ENVIRONMENT
+ # wait for the above command to finish
+ # if it is taking way to long and the annoying “instance starting” line that keeps repeating, then run following two commands in a separate window. This will interrupt the death loop where it keeps hitting an error with it failing health checks
+ # create the cache table and run migrations
+ cf run-task getgov-$DESTINATION_ENVIRONMENT --command 'python manage.py createcachetable' --name createcachetable
+ cf run-task getgov-$DESTINATION_ENVIRONMENT --wait --command 'python manage.py migrate' --name migrate
+
+ # load fixtures
+ cf run-task getgov-$DESTINATION_ENVIRONMENT --wait --command 'python manage.py load' --name loaddata
diff --git a/docs/developer/workflows/README.md b/docs/developer/workflows/README.md
new file mode 100644
index 000000000..6cff81add
--- /dev/null
+++ b/docs/developer/workflows/README.md
@@ -0,0 +1,7 @@
+# Workflows Docs
+
+========================
+
+This directory contains files related to workflows
+
+Delete And Recreate Database is in [docs/ops](../workflows/delete-and-recreate-db.md/).
\ No newline at end of file
diff --git a/docs/developer/workflows/delete-and-recreate-db.md b/docs/developer/workflows/delete-and-recreate-db.md
new file mode 100644
index 000000000..7b378ce47
--- /dev/null
+++ b/docs/developer/workflows/delete-and-recreate-db.md
@@ -0,0 +1,13 @@
+## Delete And Recreate Database
+
+This script destroys and recreates a database. This is another troubleshooting tool for issues with the database.
+
+1. unbinds the database
+2. deletes it
+3. recreates it
+4. binds it back to the sandbox
+5. runs migrations
+
+Addition Info in this slack thread:
+
+- [Slack thread](https://cisa-corp.slack.com/archives/C05BGB4L5NF/p1725495150772119)
diff --git a/docs/operations/data_migration.md b/docs/operations/data_migration.md
index cdef3dba7..8185922a4 100644
--- a/docs/operations/data_migration.md
+++ b/docs/operations/data_migration.md
@@ -914,7 +914,8 @@ Example (only requests): `./manage.py create_federal_portfolio --branch "executi
| 3 | **both** | If True, runs parse_requests and parse_domains. |
| 4 | **parse_requests** | If True, then the created portfolio is added to all related DomainRequests. |
| 5 | **parse_domains** | If True, then the created portfolio is added to all related Domains. |
-| 6 | **skip_existing_portfolios** | If True, then the script will only create suborganizations, modify DomainRequest, and modify DomainInformation records only when creating a new portfolio. Use this flag when you do not want to modify existing records. |
+| 6 | **add_managers** | If True, then the created portfolio will add all managers of the portfolio domains as members of the portfolio, including invited managers. |
+| 7 | **skip_existing_portfolios** | If True, then the script will only create suborganizations, modify DomainRequest, and modify DomainInformation records only when creating a new portfolio. Use this flag when you do not want to modify existing records. |
- Parameters #1-#2: Either `--agency_name` or `--branch` must be specified. Not both.
- Parameters #2-#3, you cannot use `--both` while using these. You must specify either `--parse_requests` or `--parse_domains` seperately. While all of these parameters are optional in that you do not need to specify all of them,
diff --git a/ops/manifests/manifest-ab.yaml b/ops/manifests/manifest-ab.yaml
index 3ca800392..f5a3e2c3c 100644
--- a/ops/manifests/manifest-ab.yaml
+++ b/ops/manifests/manifest-ab.yaml
@@ -21,6 +21,8 @@ applications:
DJANGO_BASE_URL: https://getgov-ab.app.cloud.gov
# Tell Django how much stuff to log
DJANGO_LOG_LEVEL: INFO
+ # tell django what log format to use: console or json. See settings.py for more details.
+ DJANGO_LOG_FORMAT: console
# default public site location
GETGOV_PUBLIC_SITE_URL: https://get.gov
# Flag to disable/enable features in prod environments
diff --git a/ops/manifests/manifest-ad.yaml b/ops/manifests/manifest-ad.yaml
index 73d6f96ff..6975f9f50 100644
--- a/ops/manifests/manifest-ad.yaml
+++ b/ops/manifests/manifest-ad.yaml
@@ -21,6 +21,8 @@ applications:
DJANGO_BASE_URL: https://getgov-ad.app.cloud.gov
# Tell Django how much stuff to log
DJANGO_LOG_LEVEL: INFO
+ # tell django what log format to use: console or json. See settings.py for more details.
+ DJANGO_LOG_FORMAT: console
# default public site location
GETGOV_PUBLIC_SITE_URL: https://get.gov
# Flag to disable/enable features in prod environments
diff --git a/ops/manifests/manifest-ag.yaml b/ops/manifests/manifest-ag.yaml
index 68d630f3e..192b58edb 100644
--- a/ops/manifests/manifest-ag.yaml
+++ b/ops/manifests/manifest-ag.yaml
@@ -21,6 +21,8 @@ applications:
DJANGO_BASE_URL: https://getgov-ag.app.cloud.gov
# Tell Django how much stuff to log
DJANGO_LOG_LEVEL: INFO
+ # tell django what log format to use: console or json. See settings.py for more details.
+ DJANGO_LOG_FORMAT: console
# default public site location
GETGOV_PUBLIC_SITE_URL: https://get.gov
# Flag to disable/enable features in prod environments
diff --git a/ops/manifests/manifest-backup.yaml b/ops/manifests/manifest-backup.yaml
index ab9e36d68..194b6e91c 100644
--- a/ops/manifests/manifest-backup.yaml
+++ b/ops/manifests/manifest-backup.yaml
@@ -21,6 +21,8 @@ applications:
DJANGO_BASE_URL: https://getgov-backup.app.cloud.gov
# Tell Django how much stuff to log
DJANGO_LOG_LEVEL: INFO
+ # tell django what log format to use: console or json. See settings.py for more details.
+ DJANGO_LOG_FORMAT: console
# default public site location
GETGOV_PUBLIC_SITE_URL: https://get.gov
# Flag to disable/enable features in prod environments
diff --git a/ops/manifests/manifest-bob.yaml b/ops/manifests/manifest-bob.yaml
index f39d9e145..7af7e1df5 100644
--- a/ops/manifests/manifest-bob.yaml
+++ b/ops/manifests/manifest-bob.yaml
@@ -21,6 +21,8 @@ applications:
DJANGO_BASE_URL: https://getgov-bob.app.cloud.gov
# Tell Django how much stuff to log
DJANGO_LOG_LEVEL: INFO
+ # tell django what log format to use: console or json. See settings.py for more details.
+ DJANGO_LOG_FORMAT: console
# default public site location
GETGOV_PUBLIC_SITE_URL: https://get.gov
# Flag to disable/enable features in prod environments
diff --git a/ops/manifests/manifest-cb.yaml b/ops/manifests/manifest-cb.yaml
index b9be98d27..e08f800fa 100644
--- a/ops/manifests/manifest-cb.yaml
+++ b/ops/manifests/manifest-cb.yaml
@@ -21,6 +21,8 @@ applications:
DJANGO_BASE_URL: https://getgov-cb.app.cloud.gov
# Tell Django how much stuff to log
DJANGO_LOG_LEVEL: INFO
+ # tell django what log format to use: console or json. See settings.py for more details.
+ DJANGO_LOG_FORMAT: console
# default public site location
GETGOV_PUBLIC_SITE_URL: https://get.gov
# Flag to disable/enable features in prod environments
diff --git a/ops/manifests/manifest-development.yaml b/ops/manifests/manifest-development.yaml
index 23558ba4c..957cb0227 100644
--- a/ops/manifests/manifest-development.yaml
+++ b/ops/manifests/manifest-development.yaml
@@ -21,6 +21,8 @@ applications:
DJANGO_BASE_URL: https://getgov-development.app.cloud.gov
# Tell Django how much stuff to log
DJANGO_LOG_LEVEL: INFO
+ # tell django what log format to use: console or json. See settings.py for more details.
+ DJANGO_LOG_FORMAT: console
# default public site location
GETGOV_PUBLIC_SITE_URL: https://get.gov
# Flag to disable/enable features in prod environments
diff --git a/ops/manifests/manifest-dk.yaml b/ops/manifests/manifest-dk.yaml
index 071efb416..6afbe9321 100644
--- a/ops/manifests/manifest-dk.yaml
+++ b/ops/manifests/manifest-dk.yaml
@@ -21,6 +21,8 @@ applications:
DJANGO_BASE_URL: https://getgov-dk.app.cloud.gov
# Tell Django how much stuff to log
DJANGO_LOG_LEVEL: INFO
+ # tell django what log format to use: console or json. See settings.py for more details.
+ DJANGO_LOG_FORMAT: console
# default public site location
GETGOV_PUBLIC_SITE_URL: https://get.gov
# Flag to disable/enable features in prod environments
diff --git a/ops/manifests/manifest-el.yaml b/ops/manifests/manifest-el.yaml
index 4c7d4d4e4..ee5673700 100644
--- a/ops/manifests/manifest-el.yaml
+++ b/ops/manifests/manifest-el.yaml
@@ -21,6 +21,8 @@ applications:
DJANGO_BASE_URL: https://getgov-el.app.cloud.gov
# Tell Django how much stuff to log
DJANGO_LOG_LEVEL: INFO
+ # tell django what log format to use: console or json. See settings.py for more details.
+ DJANGO_LOG_FORMAT: console
# default public site location
GETGOV_PUBLIC_SITE_URL: https://get.gov
# Flag to disable/enable features in prod environments
diff --git a/ops/manifests/manifest-es.yaml b/ops/manifests/manifest-es.yaml
index 7fd19b7a0..f0fc73d7e 100644
--- a/ops/manifests/manifest-es.yaml
+++ b/ops/manifests/manifest-es.yaml
@@ -21,6 +21,8 @@ applications:
DJANGO_BASE_URL: https://getgov-es.app.cloud.gov
# Tell Django how much stuff to log
DJANGO_LOG_LEVEL: INFO
+ # tell django what log format to use: console or json. See settings.py for more details.
+ DJANGO_LOG_FORMAT: console
# default public site location
GETGOV_PUBLIC_SITE_URL: https://get.gov
# Flag to disable/enable features in prod environments
diff --git a/ops/manifests/manifest-gd.yaml b/ops/manifests/manifest-gd.yaml
index 89a7c2169..5c4f83cc5 100644
--- a/ops/manifests/manifest-gd.yaml
+++ b/ops/manifests/manifest-gd.yaml
@@ -21,6 +21,8 @@ applications:
DJANGO_BASE_URL: https://getgov-gd.app.cloud.gov
# Tell Django how much stuff to log
DJANGO_LOG_LEVEL: INFO
+ # tell django what log format to use: console or json. See settings.py for more details.
+ DJANGO_LOG_FORMAT: console
# default public site location
GETGOV_PUBLIC_SITE_URL: https://get.gov
# Flag to disable/enable features in prod environments
diff --git a/ops/manifests/manifest-hotgov.yaml b/ops/manifests/manifest-hotgov.yaml
index 70cc97ee7..2aa37817a 100644
--- a/ops/manifests/manifest-hotgov.yaml
+++ b/ops/manifests/manifest-hotgov.yaml
@@ -21,6 +21,8 @@ applications:
DJANGO_BASE_URL: https://getgov-hotgov.app.cloud.gov
# Tell Django how much stuff to log
DJANGO_LOG_LEVEL: INFO
+ # tell django what log format to use: console or json. See settings.py for more details.
+ DJANGO_LOG_FORMAT: console
# default public site location
GETGOV_PUBLIC_SITE_URL: https://get.gov
# Flag to disable/enable features in prod environments
diff --git a/ops/manifests/manifest-ko.yaml b/ops/manifests/manifest-ko.yaml
index a69493f9b..adc3dcc89 100644
--- a/ops/manifests/manifest-ko.yaml
+++ b/ops/manifests/manifest-ko.yaml
@@ -21,6 +21,8 @@ applications:
DJANGO_BASE_URL: https://getgov-ko.app.cloud.gov
# Tell Django how much stuff to log
DJANGO_LOG_LEVEL: INFO
+ # tell django what log format to use: console or json. See settings.py for more details.
+ DJANGO_LOG_FORMAT: console
# default public site location
GETGOV_PUBLIC_SITE_URL: https://get.gov
# Flag to disable/enable features in prod environments
diff --git a/ops/manifests/manifest-ky.yaml b/ops/manifests/manifest-ky.yaml
index f416d7385..292b0575c 100644
--- a/ops/manifests/manifest-ky.yaml
+++ b/ops/manifests/manifest-ky.yaml
@@ -21,6 +21,8 @@ applications:
DJANGO_BASE_URL: https://getgov-ky.app.cloud.gov
# Tell Django how much stuff to log
DJANGO_LOG_LEVEL: INFO
+ # tell django what log format to use: console or json. See settings.py for more details.
+ DJANGO_LOG_FORMAT: console
# default public site location
GETGOV_PUBLIC_SITE_URL: https://get.gov
# Flag to disable/enable features in prod environments
diff --git a/ops/manifests/manifest-litterbox.yaml b/ops/manifests/manifest-litterbox.yaml
index ae899ef3a..e2ab5489c 100644
--- a/ops/manifests/manifest-litterbox.yaml
+++ b/ops/manifests/manifest-litterbox.yaml
@@ -21,6 +21,8 @@ applications:
DJANGO_BASE_URL: https://getgov-litterbox.app.cloud.gov
# Tell Django how much stuff to log
DJANGO_LOG_LEVEL: INFO
+ # tell django what log format to use: console or json. See settings.py for more details.
+ DJANGO_LOG_FORMAT: console
# default public site location
GETGOV_PUBLIC_SITE_URL: https://get.gov
# Flag to disable/enable features in prod environments
diff --git a/ops/manifests/manifest-meoward.yaml b/ops/manifests/manifest-meoward.yaml
index c47d9529d..ba452684e 100644
--- a/ops/manifests/manifest-meoward.yaml
+++ b/ops/manifests/manifest-meoward.yaml
@@ -21,6 +21,8 @@ applications:
DJANGO_BASE_URL: https://getgov-meoward.app.cloud.gov
# Tell Django how much stuff to log
DJANGO_LOG_LEVEL: INFO
+ # tell django what log format to use: console or json. See settings.py for more details.
+ DJANGO_LOG_FORMAT: console
# default public site location
GETGOV_PUBLIC_SITE_URL: https://get.gov
# Flag to disable/enable features in prod environments
diff --git a/ops/manifests/manifest-ms.yaml b/ops/manifests/manifest-ms.yaml
index ac46f5d92..0068dfa02 100644
--- a/ops/manifests/manifest-ms.yaml
+++ b/ops/manifests/manifest-ms.yaml
@@ -21,6 +21,8 @@ applications:
DJANGO_BASE_URL: https://getgov-ms.app.cloud.gov
# Tell Django how much stuff to log
DJANGO_LOG_LEVEL: DEBUG
+ # tell django what log format to use: console or json. See settings.py for more details.
+ DJANGO_LOG_FORMAT: console
# default public site location
GETGOV_PUBLIC_SITE_URL: https://get.gov
# Flag to disable/enable features in prod environments
diff --git a/ops/manifests/manifest-nl.yaml b/ops/manifests/manifest-nl.yaml
index d74174e7d..fbf3b0f5f 100644
--- a/ops/manifests/manifest-nl.yaml
+++ b/ops/manifests/manifest-nl.yaml
@@ -21,6 +21,8 @@ applications:
DJANGO_BASE_URL: https://getgov-nl.app.cloud.gov
# Tell Django how much stuff to log
DJANGO_LOG_LEVEL: INFO
+ # tell django what log format to use: console or json. See settings.py for more details.
+ DJANGO_LOG_FORMAT: console
# default public site location
GETGOV_PUBLIC_SITE_URL: https://get.gov
# Flag to disable/enable features in prod environments
diff --git a/ops/manifests/manifest-rb.yaml b/ops/manifests/manifest-rb.yaml
index 570b49dde..02b099bdd 100644
--- a/ops/manifests/manifest-rb.yaml
+++ b/ops/manifests/manifest-rb.yaml
@@ -21,6 +21,8 @@ applications:
DJANGO_BASE_URL: https://getgov-rb.app.cloud.gov
# Tell Django how much stuff to log
DJANGO_LOG_LEVEL: INFO
+ # tell django what log format to use: console or json. See settings.py for more details.
+ DJANGO_LOG_FORMAT: console
# default public site location
GETGOV_PUBLIC_SITE_URL: https://get.gov
# Flag to disable/enable features in prod environments
diff --git a/ops/manifests/manifest-rh.yaml b/ops/manifests/manifest-rh.yaml
index f44894ce8..abce35140 100644
--- a/ops/manifests/manifest-rh.yaml
+++ b/ops/manifests/manifest-rh.yaml
@@ -21,6 +21,8 @@ applications:
DJANGO_BASE_URL: https://getgov-rh.app.cloud.gov
# Tell Django how much stuff to log
DJANGO_LOG_LEVEL: INFO
+ # tell django what log format to use: console or json. See settings.py for more details.
+ DJANGO_LOG_FORMAT: console
# default public site location
GETGOV_PUBLIC_SITE_URL: https://get.gov
# Flag to disable/enable features in prod environments
diff --git a/ops/manifests/manifest-rjm.yaml b/ops/manifests/manifest-rjm.yaml
index 048b44e95..b51db1b95 100644
--- a/ops/manifests/manifest-rjm.yaml
+++ b/ops/manifests/manifest-rjm.yaml
@@ -21,6 +21,8 @@ applications:
DJANGO_BASE_URL: https://getgov-rjm.app.cloud.gov
# Tell Django how much stuff to log
DJANGO_LOG_LEVEL: INFO
+ # tell django what log format to use: console or json. See settings.py for more details.
+ DJANGO_LOG_FORMAT: console
# default public site location
GETGOV_PUBLIC_SITE_URL: https://get.gov
# Flag to disable/enable features in prod environments
diff --git a/ops/manifests/manifest-stable.yaml b/ops/manifests/manifest-stable.yaml
index 80c97339f..438a012a9 100644
--- a/ops/manifests/manifest-stable.yaml
+++ b/ops/manifests/manifest-stable.yaml
@@ -21,6 +21,8 @@ applications:
DJANGO_BASE_URL: https://manage.get.gov
# Tell Django how much stuff to log
DJANGO_LOG_LEVEL: INFO
+ # tell django what log format to use: console or json. See settings.py for more details.
+ DJANGO_LOG_FORMAT: json
# default public site location
GETGOV_PUBLIC_SITE_URL: https://get.gov
# Which OIDC provider to use
diff --git a/ops/manifests/manifest-staging.yaml b/ops/manifests/manifest-staging.yaml
index 38099cf17..7679b7248 100644
--- a/ops/manifests/manifest-staging.yaml
+++ b/ops/manifests/manifest-staging.yaml
@@ -21,6 +21,8 @@ applications:
DJANGO_BASE_URL: https://getgov-staging.app.cloud.gov
# Tell Django how much stuff to log
DJANGO_LOG_LEVEL: INFO
+ # tell django what log format to use: console or json. See settings.py for more details.
+ DJANGO_LOG_FORMAT: json
# default public site location
GETGOV_PUBLIC_SITE_URL: https://get.gov
# Flag to disable/enable features in prod environments
diff --git a/ops/scripts/manifest-sandbox-template.yaml b/ops/scripts/manifest-sandbox-template.yaml
index f0aee9664..ddd1860e1 100644
--- a/ops/scripts/manifest-sandbox-template.yaml
+++ b/ops/scripts/manifest-sandbox-template.yaml
@@ -21,6 +21,8 @@ applications:
DJANGO_BASE_URL: https://getgov-ENVIRONMENT.app.cloud.gov
# Tell Django how much stuff to log
DJANGO_LOG_LEVEL: INFO
+ # tell django what log format to use: console or json. See settings.py for more details.
+ DJANGO_LOG_FORMAT: console
# default public site location
GETGOV_PUBLIC_SITE_URL: https://get.gov
# Flag to disable/enable features in prod environments
diff --git a/src/docker-compose.yml b/src/docker-compose.yml
index 5ad6d0ce6..09bf8243e 100644
--- a/src/docker-compose.yml
+++ b/src/docker-compose.yml
@@ -79,6 +79,8 @@ services:
- POSTGRES_DB=app
- POSTGRES_USER=user
- POSTGRES_PASSWORD=feedabee
+ ports:
+ - "5432:5432"
node:
build:
diff --git a/src/registrar/admin.py b/src/registrar/admin.py
index 928ead442..2d2b90a5f 100644
--- a/src/registrar/admin.py
+++ b/src/registrar/admin.py
@@ -11,6 +11,7 @@ from django.db.models import (
Value,
When,
)
+
from django.db.models.functions import Concat, Coalesce
from django.http import HttpResponseRedirect
from registrar.models.federal_agency import FederalAgency
@@ -24,7 +25,7 @@ from registrar.utility.admin_helpers import (
from django.conf import settings
from django.contrib.messages import get_messages
from django.contrib.admin.helpers import AdminForm
-from django.shortcuts import redirect
+from django.shortcuts import redirect, get_object_or_404
from django_fsm import get_available_FIELD_transitions, FSMField
from registrar.models import DomainInformation, Portfolio, UserPortfolioPermission, DomainInvitation
from registrar.models.utility.portfolio_helper import UserPortfolioPermissionChoices, UserPortfolioRoleChoices
@@ -1381,9 +1382,13 @@ class UserDomainRoleAdmin(ListHeaderAdmin, ImportExportModelAdmin):
change_form_template = "django/admin/user_domain_role_change_form.html"
+ # Override for the delete confirmation page on the domain table (bulk delete action)
+ delete_selected_confirmation_template = "django/admin/user_domain_role_delete_selected_confirmation.html"
+
# Fixes a bug where non-superusers are redirected to the main page
def delete_view(self, request, object_id, extra_context=None):
"""Custom delete_view implementation that specifies redirect behaviour"""
+ self.delete_confirmation_template = "django/admin/user_domain_role_delete_confirmation.html"
response = super().delete_view(request, object_id, extra_context)
if isinstance(response, HttpResponseRedirect) and not request.user.has_perm("registrar.full_access_permission"):
@@ -1518,6 +1523,8 @@ class DomainInvitationAdmin(BaseInvitationAdmin):
autocomplete_fields = ["domain"]
change_form_template = "django/admin/domain_invitation_change_form.html"
+ # Override for the delete confirmation page on the domain table (bulk delete action)
+ delete_selected_confirmation_template = "django/admin/domain_invitation_delete_selected_confirmation.html"
# Select domain invitations to change -> Domain invitations
def changelist_view(self, request, extra_context=None):
@@ -1527,6 +1534,37 @@ class DomainInvitationAdmin(BaseInvitationAdmin):
# Get the filtered values
return super().changelist_view(request, extra_context=extra_context)
+ def change_view(self, request, object_id, form_url="", extra_context=None):
+ """Override the change_view to add the invitation obj for the change_form_object_tools template"""
+
+ if extra_context is None:
+ extra_context = {}
+
+ # Get the domain invitation object
+ invitation = get_object_or_404(DomainInvitation, id=object_id)
+ extra_context["invitation"] = invitation
+
+ if request.method == "POST" and "cancel_invitation" in request.POST:
+ if invitation.status == DomainInvitation.DomainInvitationStatus.INVITED:
+ invitation.cancel_invitation()
+ invitation.save(update_fields=["status"])
+ messages.success(request, _("Invitation canceled successfully."))
+
+ # Redirect back to the change view
+ return redirect(reverse("admin:registrar_domaininvitation_change", args=[object_id]))
+
+ return super().change_view(request, object_id, form_url, extra_context)
+
+ 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_invitation_delete_confirmation.html"
+ response = super().delete_view(request, object_id, extra_context=extra_context)
+
+ return response
+
def save_model(self, request, obj, form, change):
"""
Override the save_model method.
@@ -1535,6 +1573,7 @@ class DomainInvitationAdmin(BaseInvitationAdmin):
which will be successful if a single User exists for that email; otherwise, will
just continue to create the invitation.
"""
+
if not change:
domain = obj.domain
domain_org = getattr(domain.domain_info, "portfolio", None)
diff --git a/src/registrar/assets/js/get-gov-reports.js b/src/registrar/assets/js/get-gov-reports.js
deleted file mode 100644
index 92bba4a1f..000000000
--- a/src/registrar/assets/js/get-gov-reports.js
+++ /dev/null
@@ -1,130 +0,0 @@
-/** An IIFE for admin in DjangoAdmin to listen to clicks on the growth report export button,
- * attach the seleted start and end dates to a url that'll trigger the view, and finally
- * redirect to that url.
- *
- * This function also sets the start and end dates to match the url params if they exist
-*/
-(function () {
- // Function to get URL parameter value by name
- function getParameterByName(name, url) {
- if (!url) url = window.location.href;
- name = name.replace(/[\[\]]/g, '\\$&');
- var regex = new RegExp('[?&]' + name + '(=([^]*)|&|#|$)'),
- results = regex.exec(url);
- if (!results) return null;
- if (!results[2]) return '';
- return decodeURIComponent(results[2].replace(/\+/g, ' '));
- }
-
- // Get the current date in the format YYYY-MM-DD
- let currentDate = new Date().toISOString().split('T')[0];
-
- // Default the value of the start date input field to the current date
- let startDateInput = document.getElementById('start');
-
- // Default the value of the end date input field to the current date
- let endDateInput = document.getElementById('end');
-
- let exportButtons = document.querySelectorAll('.exportLink');
-
- if (exportButtons.length > 0) {
- // Check if start and end dates are present in the URL
- let urlStartDate = getParameterByName('start_date');
- let urlEndDate = getParameterByName('end_date');
-
- // Set input values based on URL parameters or current date
- startDateInput.value = urlStartDate || currentDate;
- endDateInput.value = urlEndDate || currentDate;
-
- exportButtons.forEach((btn) => {
- btn.addEventListener('click', function () {
- // Get the selected start and end dates
- let startDate = startDateInput.value;
- let endDate = endDateInput.value;
- let exportUrl = btn.dataset.exportUrl;
-
- // Build the URL with parameters
- exportUrl += "?start_date=" + startDate + "&end_date=" + endDate;
-
- // Redirect to the export URL
- window.location.href = exportUrl;
- });
- });
- }
-
-})();
-
-
-/** An IIFE to initialize the analytics page
-*/
-(function () {
- function createComparativeColumnChart(canvasId, title, labelOne, labelTwo) {
- var canvas = document.getElementById(canvasId);
- if (!canvas) {
- return
- }
-
- var ctx = canvas.getContext("2d");
-
- var listOne = JSON.parse(canvas.getAttribute('data-list-one'));
- var listTwo = JSON.parse(canvas.getAttribute('data-list-two'));
-
- var data = {
- labels: ["Total", "Federal", "Interstate", "State/Territory", "Tribal", "County", "City", "Special District", "School District", "Election Board"],
- datasets: [
- {
- label: labelOne,
- backgroundColor: "rgba(255, 99, 132, 0.2)",
- borderColor: "rgba(255, 99, 132, 1)",
- borderWidth: 1,
- data: listOne,
- },
- {
- label: labelTwo,
- backgroundColor: "rgba(75, 192, 192, 0.2)",
- borderColor: "rgba(75, 192, 192, 1)",
- borderWidth: 1,
- data: listTwo,
- },
- ],
- };
-
- var options = {
- responsive: true,
- maintainAspectRatio: false,
- plugins: {
- legend: {
- position: 'top',
- },
- title: {
- display: true,
- text: title
- }
- },
- scales: {
- y: {
- beginAtZero: true,
- },
- },
- };
-
- new Chart(ctx, {
- type: "bar",
- data: data,
- options: options,
- });
- }
-
- function initComparativeColumnCharts() {
- document.addEventListener("DOMContentLoaded", function () {
- createComparativeColumnChart("myChart1", "Managed domains", "Start Date", "End Date");
- createComparativeColumnChart("myChart2", "Unmanaged domains", "Start Date", "End Date");
- createComparativeColumnChart("myChart3", "Deleted domains", "Start Date", "End Date");
- createComparativeColumnChart("myChart4", "Ready domains", "Start Date", "End Date");
- createComparativeColumnChart("myChart5", "Submitted requests", "Start Date", "End Date");
- createComparativeColumnChart("myChart6", "All requests", "Start Date", "End Date");
- });
- };
-
- initComparativeColumnCharts();
-})();
diff --git a/src/registrar/assets/src/js/getgov-admin/analytics.js b/src/registrar/assets/src/js/getgov-admin/analytics.js
new file mode 100644
index 000000000..47bc81388
--- /dev/null
+++ b/src/registrar/assets/src/js/getgov-admin/analytics.js
@@ -0,0 +1,177 @@
+import { debounce } from '../getgov/helpers.js';
+import { getParameterByName } from './helpers-admin.js';
+
+/** This function also sets the start and end dates to match the url params if they exist
+*/
+function initAnalyticsExportButtons() {
+ // Get the current date in the format YYYY-MM-DD
+ let currentDate = new Date().toISOString().split('T')[0];
+
+ // Default the value of the start date input field to the current date
+ let startDateInput = document.getElementById('start');
+
+ // Default the value of the end date input field to the current date
+ let endDateInput = document.getElementById('end');
+
+ let exportButtons = document.querySelectorAll('.exportLink');
+
+ if (exportButtons.length > 0) {
+ // Check if start and end dates are present in the URL
+ let urlStartDate = getParameterByName('start_date');
+ let urlEndDate = getParameterByName('end_date');
+
+ // Set input values based on URL parameters or current date
+ startDateInput.value = urlStartDate || currentDate;
+ endDateInput.value = urlEndDate || currentDate;
+
+ exportButtons.forEach((btn) => {
+ btn.addEventListener('click', function () {
+ // Get the selected start and end dates
+ let startDate = startDateInput.value;
+ let endDate = endDateInput.value;
+ let exportUrl = btn.dataset.exportUrl;
+
+ // Build the URL with parameters
+ exportUrl += "?start_date=" + startDate + "&end_date=" + endDate;
+
+ // Redirect to the export URL
+ window.location.href = exportUrl;
+ });
+ });
+ }
+};
+
+/**
+ * Creates a diagonal stripe pattern for chart.js
+ * Inspired by https://stackoverflow.com/questions/28569667/fill-chart-js-bar-chart-with-diagonal-stripes-or-other-patterns
+ * and https://github.com/ashiguruma/patternomaly
+ * @param {string} backgroundColor - Background color of the pattern
+ * @param {string} [lineColor="white"] - Color of the diagonal lines
+ * @param {boolean} [rightToLeft=false] - Direction of the diagonal lines
+ * @param {number} [lineGap=1] - Gap between lines
+ * @returns {CanvasPattern} A canvas pattern object for use with backgroundColor
+ */
+function createDiagonalPattern(backgroundColor, lineColor, rightToLeft=false, lineGap=1) {
+ // Define the canvas and the 2d context so we can draw on it
+ let shape = document.createElement("canvas");
+ shape.width = 20;
+ shape.height = 20;
+ let context = shape.getContext("2d");
+
+ // Fill with specified background color
+ context.fillStyle = backgroundColor;
+ context.fillRect(0, 0, shape.width, shape.height);
+
+ // Set stroke properties
+ context.strokeStyle = lineColor;
+ context.lineWidth = 2;
+
+ // Rotate canvas for a right-to-left pattern
+ if (rightToLeft) {
+ context.translate(shape.width, 0);
+ context.rotate(90 * Math.PI / 180);
+ };
+
+ // First diagonal line
+ let halfSize = shape.width / 2;
+ context.moveTo(halfSize - lineGap, -lineGap);
+ context.lineTo(shape.width + lineGap, halfSize + lineGap);
+
+ // Second diagonal line (x,y are swapped)
+ context.moveTo(-lineGap, halfSize - lineGap);
+ context.lineTo(halfSize + lineGap, shape.width + lineGap);
+
+ context.stroke();
+ return context.createPattern(shape, "repeat");
+}
+
+function createComparativeColumnChart(id, title, labelOne, labelTwo) {
+ var canvas = document.getElementById(id);
+ if (!canvas) {
+ return
+ }
+
+ var ctx = canvas.getContext("2d");
+ var listOne = JSON.parse(canvas.getAttribute('data-list-one'));
+ var listTwo = JSON.parse(canvas.getAttribute('data-list-two'));
+
+ var data = {
+ labels: ["Total", "Federal", "Interstate", "State/Territory", "Tribal", "County", "City", "Special District", "School District", "Election Board"],
+ datasets: [
+ {
+ label: labelOne,
+ backgroundColor: "rgba(255, 99, 132, 0.3)",
+ borderColor: "rgba(255, 99, 132, 1)",
+ borderWidth: 1,
+ data: listOne,
+ // Set this line style to be rightToLeft for visual distinction
+ backgroundColor: createDiagonalPattern('rgba(255, 99, 132, 0.3)', 'white', true)
+ },
+ {
+ label: labelTwo,
+ backgroundColor: "rgba(75, 192, 192, 0.3)",
+ borderColor: "rgba(75, 192, 192, 1)",
+ borderWidth: 1,
+ data: listTwo,
+ backgroundColor: createDiagonalPattern('rgba(75, 192, 192, 0.3)', 'white')
+ },
+ ],
+ };
+
+ var options = {
+ responsive: true,
+ maintainAspectRatio: false,
+ plugins: {
+ legend: {
+ position: 'top',
+ },
+ title: {
+ display: true,
+ text: title
+ }
+ },
+ scales: {
+ y: {
+ beginAtZero: true,
+ },
+ },
+ };
+ return new Chart(ctx, {
+ type: "bar",
+ data: data,
+ options: options,
+ });
+}
+
+/** An IIFE to initialize the analytics page
+*/
+export function initAnalyticsDashboard() {
+ const analyticsPageContainer = document.querySelector('.analytics-dashboard-charts');
+ if (analyticsPageContainer) {
+ document.addEventListener("DOMContentLoaded", function () {
+ initAnalyticsExportButtons();
+
+ // Create charts and store each instance of it
+ const chartInstances = new Map();
+ const charts = [
+ { id: "managed-domains-chart", title: "Managed domains" },
+ { id: "unmanaged-domains-chart", title: "Unmanaged domains" },
+ { id: "deleted-domains-chart", title: "Deleted domains" },
+ { id: "ready-domains-chart", title: "Ready domains" },
+ { id: "submitted-requests-chart", title: "Submitted requests" },
+ { id: "all-requests-chart", title: "All requests" }
+ ];
+ charts.forEach(chart => {
+ if (chartInstances.has(chart.id)) chartInstances.get(chart.id).destroy();
+ chartInstances.set(chart.id, createComparativeColumnChart(chart.id, chart.title, "Start Date", "End Date"));
+ });
+
+ // Add resize listener to each chart
+ window.addEventListener("resize", debounce(() => {
+ chartInstances.forEach((chart) => {
+ if (chart?.canvas) chart.resize();
+ });
+ }, 200));
+ });
+ }
+};
diff --git a/src/registrar/assets/src/js/getgov-admin/helpers-admin.js b/src/registrar/assets/src/js/getgov-admin/helpers-admin.js
index ff618a67d..8055e29d3 100644
--- a/src/registrar/assets/src/js/getgov-admin/helpers-admin.js
+++ b/src/registrar/assets/src/js/getgov-admin/helpers-admin.js
@@ -22,3 +22,13 @@ export function addOrRemoveSessionBoolean(name, add){
sessionStorage.removeItem(name);
}
}
+
+export function getParameterByName(name, url) {
+ if (!url) url = window.location.href;
+ name = name.replace(/[\[\]]/g, '\\$&');
+ var regex = new RegExp('[?&]' + name + '(=([^]*)|&|#|$)'),
+ results = regex.exec(url);
+ if (!results) return null;
+ if (!results[2]) return '';
+ return decodeURIComponent(results[2].replace(/\+/g, ' '));
+}
diff --git a/src/registrar/assets/src/js/getgov-admin/main.js b/src/registrar/assets/src/js/getgov-admin/main.js
index 64be572b2..5c6de20ab 100644
--- a/src/registrar/assets/src/js/getgov-admin/main.js
+++ b/src/registrar/assets/src/js/getgov-admin/main.js
@@ -15,6 +15,7 @@ import { initDomainFormTargetBlankButtons } from './domain-form.js';
import { initDynamicPortfolioFields } from './portfolio-form.js';
import { initDynamicDomainInformationFields } from './domain-information-form.js';
import { initDynamicDomainFields } from './domain-form.js';
+import { initAnalyticsDashboard } from './analytics.js';
// General
initModals();
@@ -41,3 +42,6 @@ initDynamicPortfolioFields();
// Domain information
initDynamicDomainInformationFields();
+
+// Analytics dashboard
+initAnalyticsDashboard();
diff --git a/src/registrar/assets/src/js/getgov/portfolio-member-page.js b/src/registrar/assets/src/js/getgov/portfolio-member-page.js
index c96677ebc..95723fc7e 100644
--- a/src/registrar/assets/src/js/getgov/portfolio-member-page.js
+++ b/src/registrar/assets/src/js/getgov/portfolio-member-page.js
@@ -128,7 +128,7 @@ export function initAddNewMemberPageListeners() {
});
} else {
// for admin users, the permissions are always the same
- appendPermissionInContainer('Domains', 'Viewer, all', permissionDetailsContainer);
+ appendPermissionInContainer('Domains', 'Viewer', permissionDetailsContainer);
appendPermissionInContainer('Domain requests', 'Creator', permissionDetailsContainer);
appendPermissionInContainer('Members', 'Manager', permissionDetailsContainer);
}
diff --git a/src/registrar/assets/src/js/getgov/table-domain-requests.js b/src/registrar/assets/src/js/getgov/table-domain-requests.js
index f667a96b5..8556b714f 100644
--- a/src/registrar/assets/src/js/getgov/table-domain-requests.js
+++ b/src/registrar/assets/src/js/getgov/table-domain-requests.js
@@ -116,10 +116,10 @@ export class DomainRequestsTable extends BaseTable {
+ {% include "admin/analytics_graph_table.html" with data=data property_name="deleted_domains" %}
+
+
+
+
+
+
+
+
+ Details for ready domains
+
+ {% include "admin/analytics_graph_table.html" with data=data property_name="ready_domains" %}
+
+
+
-
-
-
-
-
-
-
-
+ {% comment %} Requests {% endcomment %}
+
+
+
+
+
+ Details for submitted requests
+
+ {% include "admin/analytics_graph_table.html" with data=data property_name="submitted_requests" %}
+
+
+
+
+
+
+
+
+ Details for all requests
+
+ {% include "admin/analytics_graph_table.html" with data=data property_name="requests" %}
+
+
+
+
diff --git a/src/registrar/templates/admin/analytics_graph_table.html b/src/registrar/templates/admin/analytics_graph_table.html
new file mode 100644
index 000000000..5f10da93a
--- /dev/null
+++ b/src/registrar/templates/admin/analytics_graph_table.html
@@ -0,0 +1,26 @@
+
+
+
+
Type
+
Start date {{ data.start_date }}
+
End date {{ data.end_date }}
+
+
+
+ {% comment %}
+ This ugly notation is equivalent to data.property_name.start_date_count.index.
+ Or represented in the pure python way: data[property_name]["start_date_count"][index]
+ {% endcomment %}
+ {% with start_counts=data|get_item:property_name|get_item:"start_date_count" end_counts=data|get_item:property_name|get_item:"end_date_count" %}
+ {% for org_count_type in data.org_count_types %}
+ {% with index=forloop.counter %}
+
{{ block.super }}
-{% endblock %}
+{% endblock %}
\ No newline at end of file
diff --git a/src/registrar/templates/django/admin/domain_invitation_delete_confirmation.html b/src/registrar/templates/django/admin/domain_invitation_delete_confirmation.html
new file mode 100644
index 000000000..215bf5ada
--- /dev/null
+++ b/src/registrar/templates/django/admin/domain_invitation_delete_confirmation.html
@@ -0,0 +1,16 @@
+{% extends 'admin/delete_confirmation.html' %}
+{% load i18n static %}
+
+{% block content_subtitle %}
+
+
+
+ If you cancel the domain invitation here, it won't trigger any emails. It also won't remove
+ their domain management privileges if they already have that role assigned. Go to the
+ User Domain Roles table
+ if you want to remove the user from a domain.
+
+ If you cancel the domain invitation here, it won't trigger any emails. It also won't remove
+ their domain management privileges if they already have that role assigned. Go to the
+ User Domain Roles table
+ if you want to remove the user from a domain.
+
+ If you remove someone from a domain here, it won't trigger any emails when you click "save."
+
+
+
+ {{ block.super }}
+{% endblock %}
diff --git a/src/registrar/templates/domain_detail.html b/src/registrar/templates/domain_detail.html
index 758c43366..57749f038 100644
--- a/src/registrar/templates/domain_detail.html
+++ b/src/registrar/templates/domain_detail.html
@@ -35,7 +35,7 @@
{# UNKNOWN domains would not have an expiration date and thus would show 'Expired' #}
{% if domain.is_expired and domain.state != domain.State.UNKNOWN %}
Expired
- {% elif has_domain_renewal_flag and domain.is_expiring %}
+ {% elif domain.is_expiring %}
Expiring soon
{% elif domain.state == domain.State.UNKNOWN or domain.state == domain.State.DNS_NEEDED %}
DNS needed
@@ -46,17 +46,17 @@
{% if domain.get_state_help_text %}
- {% if has_domain_renewal_flag and domain.is_expired and is_domain_manager %}
+ {% if domain.is_expired and is_domain_manager %}
This domain has expired, but it is still online.
{% url 'domain-renewal' pk=domain.id as url %}
Renew to maintain access.
- {% elif has_domain_renewal_flag and domain.is_expiring and is_domain_manager %}
+ {% elif domain.is_expiring and is_domain_manager %}
This domain will expire soon.
{% url 'domain-renewal' pk=domain.id as url %}
Renew to maintain access.
- {% elif has_domain_renewal_flag and domain.is_expiring and is_portfolio_user %}
+ {% elif domain.is_expiring and is_portfolio_user %}
This domain will expire soon. Contact one of the listed domain managers to renew the domain.
- {% elif has_domain_renewal_flag and domain.is_expired and is_portfolio_user %}
+ {% elif domain.is_expired and is_portfolio_user %}
This domain has expired, but it is still online. Contact one of the listed domain managers to renew the domain.
{% else %}
{{ domain.get_state_help_text }}
diff --git a/src/registrar/templates/domain_sidebar.html b/src/registrar/templates/domain_sidebar.html
index 5946b6859..3302a6a79 100644
--- a/src/registrar/templates/domain_sidebar.html
+++ b/src/registrar/templates/domain_sidebar.html
@@ -81,7 +81,7 @@
{% endwith %}
- {% if has_domain_renewal_flag and is_domain_manager%}
+ {% if is_domain_manager%}
{% if domain.is_expiring or domain.is_expired %}
{% with url_name="domain-renewal" %}
{% include "includes/domain_sidenav_item.html" with item_text="Renewal form" %}
diff --git a/src/registrar/templates/emails/action_needed_reasons/bad_name.txt b/src/registrar/templates/emails/action_needed_reasons/bad_name.txt
index ac563b549..40e5ed899 100644
--- a/src/registrar/templates/emails/action_needed_reasons/bad_name.txt
+++ b/src/registrar/templates/emails/action_needed_reasons/bad_name.txt
@@ -17,7 +17,7 @@ Domains should uniquely identify a government organization and be clear to the g
ACTION NEEDED
-First, we need you to identify a new domain name that meets our naming requirements for your type of organization. Then, log in to the registrar and update the name in your domain request. Once you submit your updated request, we’ll resume the adjudication process.
+First, we need you to identify a new domain name that meets our naming requirements for your type of organization. Then, log in to the registrar and update the name in your domain request. <{{ manage_url }}> Once you submit your updated request, we’ll resume the adjudication process.
If you have questions or want to discuss potential domain names, reply to this email.
diff --git a/src/registrar/templates/emails/action_needed_reasons/questionable_senior_official.txt b/src/registrar/templates/emails/action_needed_reasons/questionable_senior_official.txt
index ef05e17d7..40d068cd9 100644
--- a/src/registrar/templates/emails/action_needed_reasons/questionable_senior_official.txt
+++ b/src/registrar/templates/emails/action_needed_reasons/questionable_senior_official.txt
@@ -21,7 +21,7 @@ We expect a senior official to be someone in a role of significant, executive re
ACTION NEEDED
Reply to this email with a justification for naming {{ domain_request.senior_official.get_formatted_name }} as the senior official. If you have questions or comments, include those in your reply.
-Alternatively, you can log in to the registrar and enter a different senior official for this domain request. Once you submit your updated request, we’ll resume the adjudication process.
+Alternatively, you can log in to the registrar and enter a different senior official for this domain request. <{{ manage_url }}> Once you submit your updated request, we’ll resume the adjudication process.
THANK YOU
diff --git a/src/registrar/templates/emails/domain_invitation.txt b/src/registrar/templates/emails/domain_invitation.txt
index a077bff26..270786a7a 100644
--- a/src/registrar/templates/emails/domain_invitation.txt
+++ b/src/registrar/templates/emails/domain_invitation.txt
@@ -4,7 +4,7 @@ Hi,{% if requested_user and requested_user.first_name %} {{ requested_user.first
{{ requestor_email }} has invited you to manage:
{% for domain in domains %}{{ domain.name }}
{% endfor %}
-To manage domain information, visit the .gov registrar .
+To manage domain information, visit the .gov registrar <{{ manage_url }}>.
----------------------------------------------------------------
{% if not requested_user %}
diff --git a/src/registrar/templates/emails/domain_manager_deleted_notification.txt b/src/registrar/templates/emails/domain_manager_deleted_notification.txt
new file mode 100644
index 000000000..fbb1e47cc
--- /dev/null
+++ b/src/registrar/templates/emails/domain_manager_deleted_notification.txt
@@ -0,0 +1,27 @@
+{% autoescape off %}{# In a text file, we don't want to have HTML entities escaped #}
+Hi,{% if domain_manager and domain_manager.first_name %} {{ domain_manager.first_name }}.{% endif %}
+
+A domain manager was removed from {{ domain.name }}.
+
+REMOVED BY: {{ removed_by.email }}
+REMOVED ON: {{ date }}
+MANAGER REMOVED: {{ manager_removed.email }}
+
+----------------------------------------------------------------
+
+WHY DID YOU RECEIVE THIS EMAIL?
+You’re listed as a domain manager for {{ domain.name }}, so you’ll receive a notification whenever a domain manager is removed from that domain.
+If you have questions or concerns, reach out to the person who removed the domain manager or reply to this email.
+
+THANK YOU
+.Gov helps the public identify official, trusted information. Thank you for using a .gov domain.
+
+----------------------------------------------------------------
+
+The .gov team
+Contact us:
+Learn about .gov
+
+The .gov registry is a part of the Cybersecurity and Infrastructure Security Agency
+(CISA)
+{% endautoescape %}
diff --git a/src/registrar/templates/emails/domain_manager_deleted_notification_subject.txt b/src/registrar/templates/emails/domain_manager_deleted_notification_subject.txt
new file mode 100644
index 000000000..c84a20f18
--- /dev/null
+++ b/src/registrar/templates/emails/domain_manager_deleted_notification_subject.txt
@@ -0,0 +1 @@
+A domain manager was removed from {{ domain.name }}
\ No newline at end of file
diff --git a/src/registrar/templates/emails/domain_manager_notification.txt b/src/registrar/templates/emails/domain_manager_notification.txt
index c253937e4..b5096a9d8 100644
--- a/src/registrar/templates/emails/domain_manager_notification.txt
+++ b/src/registrar/templates/emails/domain_manager_notification.txt
@@ -15,7 +15,7 @@ The person who received the invitation will become a domain manager once they lo
associated with the invited email address.
If you need to cancel this invitation or remove the domain manager, you can do that by going to
-this domain in the .gov registrar .
+this domain in the .gov registrar <{{ manage_url }}>.
WHY DID YOU RECEIVE THIS EMAIL?
diff --git a/src/registrar/templates/emails/domain_request_withdrawn.txt b/src/registrar/templates/emails/domain_request_withdrawn.txt
index fbdf5b4f1..fe026027b 100644
--- a/src/registrar/templates/emails/domain_request_withdrawn.txt
+++ b/src/registrar/templates/emails/domain_request_withdrawn.txt
@@ -11,7 +11,7 @@ STATUS: Withdrawn
----------------------------------------------------------------
YOU CAN EDIT YOUR WITHDRAWN REQUEST
-You can edit and resubmit this request by signing in to the registrar .
+You can edit and resubmit this request by signing in to the registrar <{{ manage_url }}>.
SOMETHING WRONG?
diff --git a/src/registrar/templates/emails/portfolio_admin_addition_notification.txt b/src/registrar/templates/emails/portfolio_admin_addition_notification.txt
index b8953aa67..9e6da3985 100644
--- a/src/registrar/templates/emails/portfolio_admin_addition_notification.txt
+++ b/src/registrar/templates/emails/portfolio_admin_addition_notification.txt
@@ -16,7 +16,7 @@ The person who received the invitation will become an admin once they log in to
associated with the invited email address.
If you need to cancel this invitation or remove the admin, you can do that by going to
-the Members section for your organization .
+the Members section for your organization <{{ manage_url }}>.
WHY DID YOU RECEIVE THIS EMAIL?
diff --git a/src/registrar/templates/emails/portfolio_admin_removal_notification.txt b/src/registrar/templates/emails/portfolio_admin_removal_notification.txt
index 6a536aa49..bf0338c03 100644
--- a/src/registrar/templates/emails/portfolio_admin_removal_notification.txt
+++ b/src/registrar/templates/emails/portfolio_admin_removal_notification.txt
@@ -8,7 +8,7 @@ REMOVED BY: {{ requestor_email }}
REMOVED ON: {{date}}
ADMIN REMOVED: {{ removed_email_address }}
-You can view this update by going to the Members section for your .gov organization .
+You can view this update by going to the Members section for your .gov organization <{{ manage_url }}>.
----------------------------------------------------------------
diff --git a/src/registrar/templates/emails/portfolio_invitation.txt b/src/registrar/templates/emails/portfolio_invitation.txt
index 775b74c7c..893da153d 100644
--- a/src/registrar/templates/emails/portfolio_invitation.txt
+++ b/src/registrar/templates/emails/portfolio_invitation.txt
@@ -3,7 +3,7 @@ Hi.
{{ requestor_email }} has invited you to {{ portfolio.organization_name }}.
-You can view this organization on the .gov registrar .
+You can view this organization on the .gov registrar <{{ manage_url }}>.
----------------------------------------------------------------
diff --git a/src/registrar/templates/emails/portfolio_update.txt b/src/registrar/templates/emails/portfolio_update.txt
new file mode 100644
index 000000000..aa13a9fb9
--- /dev/null
+++ b/src/registrar/templates/emails/portfolio_update.txt
@@ -0,0 +1,35 @@
+{% autoescape off %}{# In a text file, we don't want to have HTML entities escaped #}
+Hi,{% if requested_user and requested_user.first_name %} {{ requested_user.first_name }}.{% endif %}
+
+Your permissions were updated in the .gov registrar.
+
+ORGANIZATION: {{ portfolio.organization_name }}
+UPDATED BY: {{ requestor_email }}
+UPDATED ON: {{ date }}
+YOUR PERMISSIONS: {{ permissions.role_display }}
+ Domains - {{ permissions.domains_display }}
+ Domain requests - {{ permissions.domain_requests_display }}
+ Members - {{ permissions.members_display }}
+
+Your updated permissions are now active in the .gov registrar .
+
+----------------------------------------------------------------
+
+SOMETHING WRONG?
+If you have questions or concerns, reach out to the person who updated your
+permissions, or reply to this email.
+
+
+THANK YOU
+.Gov helps the public identify official, trusted information. Thank you for using a .gov
+domain.
+
+----------------------------------------------------------------
+
+The .gov team
+Contact us:
+Learn about .gov
+
+The .gov registry is a part of the Cybersecurity and Infrastructure Security Agency
+(CISA)
+{% endautoescape %}
diff --git a/src/registrar/templates/emails/portfolio_update_subject.txt b/src/registrar/templates/emails/portfolio_update_subject.txt
new file mode 100644
index 000000000..2cd806a73
--- /dev/null
+++ b/src/registrar/templates/emails/portfolio_update_subject.txt
@@ -0,0 +1 @@
+Your permissions were updated in the .gov registrar
\ No newline at end of file
diff --git a/src/registrar/templates/emails/status_change_approved.txt b/src/registrar/templates/emails/status_change_approved.txt
index 821e89e42..635b36cbd 100644
--- a/src/registrar/templates/emails/status_change_approved.txt
+++ b/src/registrar/templates/emails/status_change_approved.txt
@@ -8,7 +8,7 @@ REQUESTED BY: {{ domain_request.creator.email }}
REQUEST RECEIVED ON: {{ domain_request.last_submitted_date|date }}
STATUS: Approved
-You can manage your approved domain on the .gov registrar .
+You can manage your approved domain on the .gov registrar <{{ manage_url }}>.
----------------------------------------------------------------
diff --git a/src/registrar/templates/emails/submission_confirmation.txt b/src/registrar/templates/emails/submission_confirmation.txt
index d9d01ec3e..afbde48d5 100644
--- a/src/registrar/templates/emails/submission_confirmation.txt
+++ b/src/registrar/templates/emails/submission_confirmation.txt
@@ -20,7 +20,7 @@ During our review, we’ll verify that:
- You work at the organization and/or can make requests on its behalf
- Your requested domain meets our naming requirements
{% endif %}
-We’ll email you if we have questions. We’ll also email you as soon as we complete our review. You can check the status of your request at any time on the registrar. .
+We’ll email you if we have questions. We’ll also email you as soon as we complete our review. You can check the status of your request at any time on the registrar. <{{ manage_url }}>.
NEED TO MAKE CHANGES?
diff --git a/src/registrar/templates/emails/transition_domain_invitation.txt b/src/registrar/templates/emails/transition_domain_invitation.txt
index b6773d9e9..14dd626dd 100644
--- a/src/registrar/templates/emails/transition_domain_invitation.txt
+++ b/src/registrar/templates/emails/transition_domain_invitation.txt
@@ -31,7 +31,7 @@ CHECK YOUR .GOV DOMAIN CONTACTS
This is a good time to check who has access to your .gov domain{% if domains|length > 1 %}s{% endif %}. The admin, technical, and billing contacts listed for your domain{% if domains|length > 1 %}s{% endif %} in our old system also received this email. In our new registrar, these contacts are all considered “domain managers.” We no longer have the admin, technical, and billing roles, and you aren’t limited to three domain managers like in the old system.
- 1. Once you have your Login.gov account, sign in to the new registrar at .
+ 1. Once you have your Login.gov account, sign in to the new registrar at <{{ manage_url }}>.
2. Click the “Manage” link next to your .gov domain, then click on “Domain managers” to see who has access to your domain.
3. If any of these users should not have access to your domain, let us know in a reply to this email.
@@ -57,7 +57,7 @@ THANK YOU
The .gov team
.Gov blog
-Domain management
+Domain management <{{ manage_url }}}>
Get.gov
The .gov registry is a part of the Cybersecurity and Infrastructure Security Agency (CISA)
diff --git a/src/registrar/templates/emails/update_to_approved_domain.txt b/src/registrar/templates/emails/update_to_approved_domain.txt
index 99f86ea54..070096f62 100644
--- a/src/registrar/templates/emails/update_to_approved_domain.txt
+++ b/src/registrar/templates/emails/update_to_approved_domain.txt
@@ -8,7 +8,7 @@ UPDATED BY: {{user}}
UPDATED ON: {{date}}
INFORMATION UPDATED: {{changes}}
-You can view this update in the .gov registrar .
+You can view this update in the .gov registrar <{{ manage_url }}>.
Get help with managing your .gov domain .
diff --git a/src/registrar/templates/includes/domains_table.html b/src/registrar/templates/includes/domains_table.html
index 94cb4ea6d..3cf04a830 100644
--- a/src/registrar/templates/includes/domains_table.html
+++ b/src/registrar/templates/includes/domains_table.html
@@ -9,7 +9,7 @@
{{url}}
-{% if has_domain_renewal_flag and num_expiring_domains > 0 and has_any_domains_portfolio_permission %}
+{% if num_expiring_domains > 0 and has_any_domains_portfolio_permission %}
@@ -75,7 +75,7 @@
- {% if has_domain_renewal_flag and num_expiring_domains > 0 and not portfolio %}
+ {% if num_expiring_domains > 0 and not portfolio %}
@@ -173,7 +173,6 @@
>Deleted
- {% if has_domain_renewal_flag %}
Expiring soon
- {% endif %}
diff --git a/src/registrar/templates/includes/member_domains_edit_table.html b/src/registrar/templates/includes/member_domains_edit_table.html
index 0b8ff005a..fd63e5aa7 100644
--- a/src/registrar/templates/includes/member_domains_edit_table.html
+++ b/src/registrar/templates/includes/member_domains_edit_table.html
@@ -1,5 +1,3 @@
-{% load static %}
-
{% if member %}
-
-
-
-
-
+ {% with label_text="Search all domains" item_name="edit-member-domains" aria_label_text="Member domains search component" %}
+ {% include "includes/search.html" %}
+ {% endwith %}
@@ -85,7 +45,7 @@
member domains
-
Assigned domains
+
Assigned domains
Domains
diff --git a/src/registrar/templates/includes/member_domains_table.html b/src/registrar/templates/includes/member_domains_table.html
index d7839e485..4e63fdbc3 100644
--- a/src/registrar/templates/includes/member_domains_table.html
+++ b/src/registrar/templates/includes/member_domains_table.html
@@ -1,5 +1,3 @@
-{% load static %}
-
{% if member %}
-
+
-
-
-
-
-
+ {% with label_text="Domains assigned to " %}
+ {% if member %}
+ {% with label_text=label_text|add:member.email item_name="member-domains" aria_label_text="Member domains search component" %}
+ {% include "includes/search.html" %}
+ {% endwith %}
+ {% else %}
+ {% with label_text=label_text|add:portfolio_invitation.email item_name="member-domains" aria_label_text="Member domains search component" %}
+ {% include "includes/search.html" %}
+ {% endwith %}
+ {% endif %}
+ {% endwith %}