When I go to delete a facility, I get a confirmation modal explaining what will happen with users and patients that only have access to that facility (potentially orphaned users/patients). The modal is providing the wrong value for number of users only added to the facility.
Steps to reproduce
In dev4, org Bray and Morse Trading has 2 facilities and 3 users: 1 user has all facilities access as an admin and 2 are standard users with access to both facilities. When I use the support admin dashboard Manage facility tool to delete one of the facilities, the confirmation modal says "There are 2 users and 0 patients added only to this facility." This is incorrect. I would expect the modal to say that there are no users added only to this facility.
Expected behavior
The modal should provide the value for users only added to a specific facility and that value should reflect the number of users that have access to the facility to be deleted and no other facility.
Additional context
Looks like getUsersInSingleFacility is written to get count of users total in that facility group when the logic is actually a little more complex.
If developing a query for this ticket is too involved/not performant, work with Jayna to come up with copy and we'll just use the existing query to give the value of all users in the facility.
Description
When I go to delete a facility, I get a confirmation modal explaining what will happen with users and patients that only have access to that facility (potentially orphaned users/patients). The modal is providing the wrong value for number of users only added to the facility.
Steps to reproduce
In
dev4
, org Bray and Morse Trading has 2 facilities and 3 users: 1 user has all facilities access as an admin and 2 are standard users with access to both facilities. When I use the support admin dashboard Manage facility tool to delete one of the facilities, the confirmation modal says "There are 2 users and 0 patients added only to this facility." This is incorrect. I would expect the modal to say that there are no users added only to this facility.Expected behavior
The modal should provide the value for users only added to a specific facility and that value should reflect the number of users that have access to the facility to be deleted and no other facility.
Additional context
Looks like
getUsersInSingleFacility
is written to get count of users total in that facility group when the logic is actually a little more complex.If developing a query for this ticket is too involved/not performant, work with Jayna to come up with copy and we'll just use the existing query to give the value of all users in the facility.