From 4f77fa661f9ca24b5c41aecf09ec56e35a0ff1bb Mon Sep 17 00:00:00 2001
From: Kim Allen
Date: Fri, 6 Jun 2025 11:28:45 -0700
Subject: [PATCH] #3741: Show a list of org admins on the org details page
[KMA] (#3845)
* Add admin list on org info page with rough styling
* Use an unstyled unordered list for admin list
* Remove admin title
* Update indenting and change h4 to h3 to not jump heading levels
* Readd accidentally deleted line; add another heading to give it semantic sense
* Update with new design for headings and field data
* Update tests to reflect html changes
* Fix formating issue
* Update styling; update field used for org name
* Update org name value to show fed agency if org name doesn't exist
* Utilize address template
* Update styling to be determined by top-level wrapper
* Linter updates
* Update test to check address
* Use federal_agency as intended
---
.../templates/includes/senior_official.html | 6 +-
.../portfolio_organization_info.html | 98 ++++++++++---------
src/registrar/tests/test_views_portfolio.py | 38 +++++--
src/registrar/views/portfolios.py | 1 +
4 files changed, 84 insertions(+), 59 deletions(-)
diff --git a/src/registrar/templates/includes/senior_official.html b/src/registrar/templates/includes/senior_official.html
index 52b4ab6eb..04ee1afec 100644
--- a/src/registrar/templates/includes/senior_official.html
+++ b/src/registrar/templates/includes/senior_official.html
@@ -39,15 +39,15 @@
{% if form.full_name.value is not None %}
- {% include "includes/input_read_only.html" with field=form.full_name %}
+
{{ form.full_name.value }}
{% endif %}
{% if form.title.value is not None %}
- {% include "includes/input_read_only.html" with field=form.title %}
+
{{ form.title.value }}
{% endif %}
{% if form.email.value is not None %}
- {% include "includes/input_read_only.html" with field=form.email %}
+
+ Your organization name can’t be updated here.
+ To suggest an update, email help@get.gov.
+
+ {% endif %}
+
Organization admins
+
+ {% for admin in portfolio_admins %}
+
+
{{admin.first_name}} {{admin.last_name}}
+
{{admin.email}}
+
+ {% endfor %}
+
+
+
Organization name and address
+
+ {% if has_edit_portfolio_permission %}
+ {% include "includes/required_fields.html" with remove_margin_top=True %}
+
+ {% else %}
+
+ {% include "includes/organization_address.html" with organization=portfolio %}
+
{% endif %}
diff --git a/src/registrar/tests/test_views_portfolio.py b/src/registrar/tests/test_views_portfolio.py
index 83a3e9516..08e14bdfd 100644
--- a/src/registrar/tests/test_views_portfolio.py
+++ b/src/registrar/tests/test_views_portfolio.py
@@ -309,7 +309,7 @@ class TestPortfolio(WebTest):
@less_console_noise_decorator
def test_portfolio_organization_info_page_edit_access(self):
- """Test that user with a portfolio can access the portfolio organization page, read only"""
+ """Test that user with a portfolio can access the portfolio organization page, edit access"""
self.app.set_user(self.user.username)
portfolio_permission, _ = UserPortfolioPermission.objects.get_or_create(
user=self.user,
@@ -327,13 +327,36 @@ class TestPortfolio(WebTest):
response = self.app.get(reverse("organization-info"))
# Assert the response is a 200
self.assertEqual(response.status_code, 200)
- # The label for Federal agency will always be a h4
- self.assertContains(response, '
Organization name
')
- # The read only label for city will be a h4
- self.assertNotContains(response, '
City
')
- self.assertNotContains(response, '
Los Angeles
')
+ self.assertContains(response, "
Organization admins
")
+ self.assertContains(response, "
Organization name and address
")
+ self.assertContains(
+ response, '
Organization name
'
+ )
+ self.assertNotContains(response, "")
self.assertContains(response, 'for="id_city"')
+ @less_console_noise_decorator
+ def test_portfolio_organization_detail_pages_shows_read_only(self):
+ """Test that breadcrumb menus display on portfolio detail pages"""
+ self.app.set_user(self.user.username)
+ portfolio_permission, _ = UserPortfolioPermission.objects.get_or_create(
+ user=self.user,
+ portfolio=self.portfolio,
+ additional_permissions=[
+ UserPortfolioPermissionChoices.VIEW_PORTFOLIO,
+ ],
+ )
+ self.portfolio.organization_name = "Hotel California"
+ self.portfolio.save()
+
+ with override_flag("organization_feature", active=True):
+ org_info_response = self.app.get(reverse("organization-info"))
+ # We don't use the label "Organization name" in the view-only view
+ self.assertNotContains(
+ org_info_response, '