From 2134a3469c2c33637032c1a21edd4660b5beb040 Mon Sep 17 00:00:00 2001 From: Marty Pradere Date: Tue, 13 May 2025 15:35:45 -0700 Subject: [PATCH] User dropdowns should only show active users (#949) * Add user active status to PrincipalsWithoutAdmin * Update UsersAndGroupsCombo filter --- ehr/resources/queries/core/PrincipalsWithoutAdmin.sql | 6 ++++-- ehr/resources/web/ehr/form/field/UsersAndGroupsCombo.js | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ehr/resources/queries/core/PrincipalsWithoutAdmin.sql b/ehr/resources/queries/core/PrincipalsWithoutAdmin.sql index b74fc264f..cf47bf87e 100644 --- a/ehr/resources/queries/core/PrincipalsWithoutAdmin.sql +++ b/ehr/resources/queries/core/PrincipalsWithoutAdmin.sql @@ -19,7 +19,8 @@ SELECT u.DisplayName, 'u' as Type, u.FirstName, - u.LastName + u.LastName, + u.active FROM core.Users u WHERE u.userid > 0 @@ -31,6 +32,7 @@ SELECT g.Name as DisplayName, 'g' as Type, null as FirstName, - null as LastName + null as LastName, + true AS active FROM core.groups g WHERE g.userid > 0 diff --git a/ehr/resources/web/ehr/form/field/UsersAndGroupsCombo.js b/ehr/resources/web/ehr/form/field/UsersAndGroupsCombo.js index 695a528cd..e8f3448bc 100644 --- a/ehr/resources/web/ehr/form/field/UsersAndGroupsCombo.js +++ b/ehr/resources/web/ehr/form/field/UsersAndGroupsCombo.js @@ -20,6 +20,7 @@ Ext4.define('EHR.form.field.UsersAndGroupsCombo', { queryName: 'PrincipalsWithoutAdmin', columns: 'UserId,DisplayName,FirstName,LastName', sort: 'Type,DisplayName', + filterArray: [LABKEY.Filter.create('active', true, LABKEY.Filter.Types.EQUAL)], autoLoad: true }, anyMatch: true,