From 93598aaf172064a18d51969ff61f56e7ef2befba Mon Sep 17 00:00:00 2001 From: Amy Chen Date: Thu, 26 Sep 2024 16:37:07 -0700 Subject: [PATCH] TN-3318 remove patient-list-export button for researchers (#4407) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Address https://movember.atlassian.net/browse/TN-3318 remove patient list export button on the patient list page for users with Researcher role (note: the button will still be present for users that have Admin role and have Researcher role as well) Screenshot for a non-admin user with Researcher role: ![Screenshot 2024-09-25 at 9 13 58 AM](https://github.com/user-attachments/assets/e8d7736c-0f51-4d25-ad8e-91286300581b) Screenshot for a user without Researcher role: ![Screenshot 2024-09-25 at 9 15 06 AM](https://github.com/user-attachments/assets/ef5c601b-857f-4402-9b8c-53620393acac) The patient list export button, ![Screenshot 2024-09-25 at 9 27 39 AM](https://github.com/user-attachments/assets/e6fb5752-5c49-409f-bfc8-44a75748d272) is removed for non-admin users with Researcher role Co-authored-by: Amy Chen --- portal/templates/admin/patients_by_org.html | 4 +++- portal/templates/admin/patients_substudy.html | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/portal/templates/admin/patients_by_org.html b/portal/templates/admin/patients_by_org.html index 376c83318a..01a518658f 100644 --- a/portal/templates/admin/patients_by_org.html +++ b/portal/templates/admin/patients_by_org.html @@ -32,6 +32,8 @@

{{_("Patient List")}}

{{deletedUsersFilter()}} {% endif %} + {# variable for checking if user is a researcher #} + {% set isResearcher = user.has_role(ROLE.RESEARCHER.value) and not(user.has_role(ROLE.ADMIN.value)) %} {{_("Patient List")}} data-unique-id="id" data-id-field="id" data-filter-control="true" - data-show-export="true" + {%- if not isResearcher -%} data-show-export="true" {%- endif -%} data-export-data-type="all" > {{testUsersCheckbox(postUrl=url_for('patients.patients_root'))}} diff --git a/portal/templates/admin/patients_substudy.html b/portal/templates/admin/patients_substudy.html index c4cfe7e8c6..dd43f32444 100644 --- a/portal/templates/admin/patients_substudy.html +++ b/portal/templates/admin/patients_substudy.html @@ -33,6 +33,8 @@

{{list_title}}

+ {# variable for checking if user is a researcher #} + {% set isResearcher = user.has_role(ROLE.RESEARCHER.value) and not(user.has_role(ROLE.ADMIN.value)) %}
{{list_title}} data-unique-id="id" data-id-field="id" data-filter-control="true" - data-show-export="true" + {%- if not isResearcher -%} data-show-export="true" {%- endif -%} data-export-data-type="all" > {{testUsersCheckbox(postUrl=url_for('patients.patients_substudy'))}}