From dc971709562f43b265feb6200700d8e62a5a3acf Mon Sep 17 00:00:00 2001 From: Anastasia Gradova Date: Mon, 22 Apr 2024 14:00:29 -0600 Subject: [PATCH 1/3] Removed canceled users from displaying in dashboard --- app/templates/views/manage-users.html | 119 +++++++++++++------------- 1 file changed, 61 insertions(+), 58 deletions(-) diff --git a/app/templates/views/manage-users.html b/app/templates/views/manage-users.html index 4b938e0d4..de71d0184 100644 --- a/app/templates/views/manage-users.html +++ b/app/templates/views/manage-users.html @@ -31,67 +31,70 @@
{% for user in users %} -
-

- {%- if user.name -%} - {{ user.name }} - {%- endif -%} - {%- if user.status == 'pending' -%} - {{ user.email_address }}(invited) - {%- elif user.status == 'cancelled' -%} - {{ user.email_address }}(cancelled invite) - {%- elif user.status == 'expired' -%} - {{ user.email_address }}(expired invite) - {%- elif user.id == current_user.id -%} - (you) - {% else %} - {{ user.email_address }} - {% endif %} -

-

Permissions

-
    - {% for permission, label in permissions %} - {{ tick_cross( - user.has_permission_for_service(current_service.id, permission), - label - ) }} - {% endfor %} -
- {# only show if the service has folders #} - {% if current_service.all_template_folders %} -

- {% 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 %} + {% if user.status != 'cancelled' %} +

+

+ {%- if user.name -%} + {{ user.name }} + {%- endif -%} + {%- if user.status == 'pending' -%} + {{ user.email_address }}(invited) + {%- elif user.status == 'cancelled' -%} + {{ user.email_address }}(cancelled invite) + {%- elif user.status == 'expired' -%} + {{ user.email_address }}(expired invite) + {%- elif user.id == current_user.id -%} + (you) {% else %} - Can see all folders - {% endif%} -

- {% endif %} - {% if current_service.has_permission('email_auth') %} -

- Signs in with - {{ user.auth_type | format_auth_type(with_indefinite_article=True) }} -

- {% endif %} - {% if current_service.has_permission('email_auth') %} -

- Signs in with - {{ user.auth_type | format_auth_type(with_indefinite_article=True) }} -

- {% endif %} - {% if current_user.has_permissions('manage_service') %} - {% if user.status == 'pending' %} - Cancel invitation for {{ user.email_address }} - {% elif user.status == 'expired' %} - Resend invite for {{ user.email_address }} - {% elif user.is_editable_by(current_user) %} - Change details for {{ user.name }} {{ user.email_address }} + {{ user.email_address }} {% endif %} +

+

Permissions

+
    + {% for permission, label in permissions %} + {{ tick_cross( + user.has_permission_for_service(current_service.id, permission), + label + ) }} + {% endfor %} +
+ {# only show if the service has folders #} + {% if current_service.all_template_folders %} +

+ {% 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 %} -
+ {% if current_service.has_permission('email_auth') %} +

+ Signs in with + {{ user.auth_type | format_auth_type(with_indefinite_article=True) }} +

+ {% endif %} + {% if current_service.has_permission('email_auth') %} +

+ Signs in with + {{ user.auth_type | format_auth_type(with_indefinite_article=True) }} +

+ {% endif %} + {% if current_user.has_permissions('manage_service') %} + {% if user.status == 'pending' or user.status == 'expired' %} + Cancel invitation for {{ user.email_address }} + {% endif %} + {% if user.status == 'expired' %} + Resend invite for {{ user.email_address }} + {% elif user.is_editable_by(current_user) %} + Change details for {{ user.name }} {{ user.email_address }} + {% endif %} + {% endif %} +
+ {% endif %} {% endfor %}
From 682a798dcd3efb3ffe14cbbb0fcd34f574e2994f Mon Sep 17 00:00:00 2001 From: Anastasia Gradova Date: Mon, 22 Apr 2024 16:09:25 -0600 Subject: [PATCH 2/3] Updated test cases for canceled users --- tests/app/main/views/test_manage_users.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/tests/app/main/views/test_manage_users.py b/tests/app/main/views/test_manage_users.py index c3d128155..46b389c4e 100644 --- a/tests/app/main/views/test_manage_users.py +++ b/tests/app/main/views/test_manage_users.py @@ -1249,14 +1249,15 @@ def test_cancel_invited_user_doesnt_work_if_user_not_invited_to_this_service( "Cancel invitation for invited_user@test.gsa.gov" ), ), - ( - "cancelled", - ( - "invited_user@test.gsa.gov(cancelled invite) " - "Permissions" - # all permissions are greyed out - ), - ), + # Test case removed due to the removal of canceled users from the dashboard + # ( + # "cancelled", + # ( + # "invited_user@test.gsa.gov(cancelled invite) " + # "Permissions" + # # all permissions are greyed out + # ), + # ), ], ) def test_manage_users_shows_invited_user( From f5f5d0359c851aa7768766d81572fc9bd182292d Mon Sep 17 00:00:00 2001 From: Carlo Costino Date: Tue, 23 Apr 2024 19:43:56 -0400 Subject: [PATCH 3/3] Remove E2E environment variables from the manifest This changeset removes the E2E environment variables from the admin manifest file. While these might be needed on the API side to ensure that they are exposed and able to be used in the staging environment, we do not need them to be enabled for the admin app; they should only be present in the GitHub Actions that are run in a PR, and the .github/workflows/checks.yml file takes care of that and injects them directly into the container environment that the end-to-end tests run in. Signed-off-by: Carlo Costino --- manifest.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/manifest.yml b/manifest.yml index 17e6989f9..f3dcced9e 100644 --- a/manifest.yml +++ b/manifest.yml @@ -37,11 +37,6 @@ applications: # Credentials variables - NOTIFY_E2E_AUTH_STATE_PATH: (( NOTIFY_E2E_AUTH_STATE_PATH )) - NOTIFY_E2E_TEST_EMAIL: (( NOTIFY_E2E_TEST_EMAIL )) - NOTIFY_E2E_TEST_PASSWORD: (( NOTIFY_E2E_TEST_PASSWORD )) - NOTIFY_E2E_TEST_URI: (( NOTIFY_E2E_TEST_URI )) - ADMIN_CLIENT_SECRET: ((ADMIN_CLIENT_SECRET)) ADMIN_CLIENT_USERNAME: ((ADMIN_CLIENT_USERNAME)) DANGEROUS_SALT: ((DANGEROUS_SALT))