Files
notifications-admin/app/templates/views/manage-users.html
Alex Janousek 6f5750f095 Removed all govuk css (#2814)
* Removed all govuk css

* Updated reference files

* Removing govuk js

* Fixed casing for modules, removed unused page

* Got more reference images

* Updated template page

* Removed govuk padding util

* Updated hint to uswds hint

* More govuk cleanup

* Commiting backstopjs ref files

* Fixed all unit tests that broke due to brittleness around govuk styling

* Added new ref images

* Final removal of govuk

* Officially removed all govuk references

* Updated reference file

* Updated link to button

* UI modernization

* Cleanup

* removed govuk escaping tests since they are no longer needed

* Fix CodeQL security issue in escapeElementName function

- Escape backslashes first before other special characters
- Prevents potential double-escaping vulnerability
- Addresses CodeQL alert about improper string escaping

* Found more govuk removal. Fixed unit tests

* Add missing pipeline check to pre-commit

* updated test

* Updated e2e test

* More update to e2e test

* Fixed another e2e test

* Simple PR comments addressed

* More updates

* Updated backstop ref files

* Refactored folder selection for non-admins

* Updated redundant line

* Updated tests to include correct mocks

* Added more ref files

* Addressing carlos comments

* Addressing Carlo comments, cleanup of window initing

* More cleanup and addressing carlo comments

* Fixing a11 scan

* Fixed a few issues with javascript

* Fixed for pr

* Fixing e2e tests

* Tweaking e2e test

* Added more ref files and cleaned up urls.js

* Fixed bug with creating new template

* Removed brittle test - addressed code ql comment

* e2e race condition fix

* More e2e test fixes

* Updated e2e tests to not wait for text sent

* Updated test to not wait for button click response

* Made tear down more resilent if staging is down

* reverted e2e test to what was working before main merge

* Updated backstopRef images

* Updated gulp to include job-polling differently
2025-10-06 09:38:54 -04:00

139 lines
5.6 KiB
HTML

{% extends "withnav_template.html" %}
{% from "components/tick-cross.html" import tick_cross %}
{% from "components/live-search.html" import live_search %}
{% from "components/components/button/macro.njk" import usaButton %}
{% block service_page_title %}
Team members
{% endblock %}
{% block serviceNavigation %}{% endblock %}
{% block sideNavigation %}
{% include "components/settings_nav.html" %}
{% endblock %}
{% block maincolumn_content %}
<div class="button-flex-header">
<h1 class="font-body-2xl margin-0">
Team members
</h1>
{% if current_user.has_permissions(ServicePermission.MANAGE_SERVICE) %}
{{ usaButton({
"element": "a",
"text": "Invite a team member",
"href": url_for('.invite_user', service_id=current_service.id),
"classes": "usa-button--outline"
}) }}
{% endif %}
</div>
{% if show_search_box %}
<div>
{{ live_search(target_selector='.user-list-item', show=True, form=form) }}
</div>
<div class="js-live-search-no-results" style="display: none;">
<p class="usa-body margin-0">No results found</p>
</div>
{% endif %}
<div class="user-list">
{% for user in users %}
{% if user.status != 'cancelled' %}
<div class="user-list-item width-full">
<h2 class="user-list-item-heading font-body-lg margin-y-0" title="{{ user.email_address }}">
{%- if user.name -%}
<span class="font-heading-md live-search-relevant">{{ user.name }}</span>
{%- else -%}
<span class="font-heading-md live-search-relevant">{{ user.email_address }}</span>
{%- endif -%}
</h2>
<p class="margin-top-0">
{%- if user.status == 'pending' -%}
<span class="live-search-relevant">{{ user.email_address }}</span>
<span class="usa-hint">(invited)</span>
{%- elif user.status == 'expired' -%}
<span class="live-search-relevant">{{ user.email_address }}</span>
<span class="usa-hint">(expired invite)</span>
{%- elif user.id == current_user.id -%}
<span class="live-search-relevant">{{ user.email_address }}</span>
<span class="usa-hint">(you)</span>
{%- else -%}
<span class="live-search-relevant">{{ user.email_address }}</span>
{% endif %}
</p>
<div class="usa-accordion usa-accordion--bordered margin-bottom-2">
<h3 class="margin-bottom-0 usa-accordion__heading">
<button
type="button"
class="usa-accordion__button"
aria-expanded="false"
aria-controls="permissions_{{user.id}}"
>
Permissions
</button>
</h3>
<div id="permissions_{{user.id}}" class="usa-accordion__content usa-prose" hidden>
<ul class="tick-cross-list-permissions">
{% for permission, label in permissions %}
{{ tick_cross(
user.has_permission_for_service(current_service.id, permission),
label
) }}
{% endfor %}
</ul>
{% if current_service.all_template_folders %}
<p class="usa-body tick-cross-list-hint">
{% if user.platform_admin %}
Platform admin can see all folders
{% else %}
{% set folder_count = user.template_folders_for_service(current_service) | length %}
{% if folder_count == 0 %}
Cannot see any folders
{% elif folder_count != current_service.all_template_folders | length %}
Can see {{ folder_count }} folder{% if folder_count > 1 %}s{% endif %}
{% else %}
Can see all folders
{% endif %}
{% endif %}
</p>
{% endif %}
{% if current_service.has_permission('email_auth') %}
<p class="usa-body tick-cross-list-hint">
Signs in with
{{ user.auth_type | format_auth_type(with_indefinite_article=True) }}
</p>
{% endif %}
</div>
</div>
{% if current_user.has_permissions(ServicePermission.MANAGE_SERVICE) %}
{% if user.status == 'pending' or user.status == 'expired' %}
<a class="user-list-edit-link usa-link padding-x-2" href="{{ url_for('.cancel_invited_user', service_id=current_service.id, invited_user_id=user.id) }}">
Cancel invitation<span class="usa-sr-only"> for {{ user.email_address }}</span>
</a>
{% endif %}
{% if user.status == 'expired' %}
<a class="user-list-edit-link usa-link" href="{{ url_for('.resend_invite', service_id=current_service.id, invited_user_id=user.id) }}">
Resend invite<span class="usa-sr-only"> for {{ user.email_address }}</span>
</a>
{% elif user.is_editable_by(current_user) %}
<a class="user-list-edit-link usa-link padding-x-2" href="{{ url_for('.edit_user_permissions', service_id=current_service.id, user_id=user.id) }}">
Change details<span class="usa-sr-only"> for {{ user.name }} {{ user.email_address }}</span>
</a>
{% endif %}
{% endif %}
</div>
{% endif %}
{% endfor %}
</div>
{% endblock %}