diff --git a/Changelog.md b/Changelog.md index 5456158993f6f99814d241f94fa2912945767aae..510d670d80c31f45edd31b528356f296af8533d1 100644 --- a/Changelog.md +++ b/Changelog.md @@ -3,6 +3,9 @@ All notable changes to this project will be documented in this file. +## [0.95] - 2025-03-21 +- COMP-461: Also match nren name when searching in user management + ## [0.94] - 2025-03-19 - Fix Excel export for data that includes null values diff --git a/compendium-frontend/src/survey/management/UserManagementComponent.tsx b/compendium-frontend/src/survey/management/UserManagementComponent.tsx index 690704040cf7b23a87f467c6d5be6dfd5b6a7771..b95a1413a5c5a2b1936720ba4341c5d99cd91d97 100644 --- a/compendium-frontend/src/survey/management/UserManagementComponent.tsx +++ b/compendium-frontend/src/survey/management/UserManagementComponent.tsx @@ -238,7 +238,13 @@ function UserManagementComponent() { const sortFunction = sortFunctions[sortColumn.column] ?? defaultSortFunction - const filteredUsers = filter ? users.filter((u) => u.email.includes(filter) || u.name.includes(filter)) : users + const lowercaseFilter = filter ? filter.toLowerCase() : filter + + const filteredUsers = filter ? users.filter((u) => + u.email.toLowerCase().includes(lowercaseFilter) + || u.name.toLowerCase().includes(lowercaseFilter) + || u.nrens.some((nren) => nren.toLowerCase().includes(lowercaseFilter) + )) : users const userList = filteredUsers.filter((u) => u.id !== loggedInUser.id).sort(sortFunction) if (!sortColumn.asc) { userList.reverse() diff --git a/compendium_v2/publishers/survey_publisher.py b/compendium_v2/publishers/survey_publisher.py index 7b7686aa2b627d6fa8c39ef1d25b2e4019451f5c..9f333290961cff0965cf014337fbb1ea69b43fde 100644 --- a/compendium_v2/publishers/survey_publisher.py +++ b/compendium_v2/publishers/survey_publisher.py @@ -298,6 +298,8 @@ def publish(year, dry_run=False): select(SurveyResponse).where( SurveyResponse.survey_year == year, SurveyResponse.status == ResponseStatus.completed, SurveyResponse.valid == True).where(~SurveyResponse.nren_id.in_( # noqa: E712 + # If any NRENs are in this table, new surveys will not be generated for them. + # This is a catch to ensure that existing survey data doesn't make it through publishing. select(NRENExclusion.nren_id).where(NRENExclusion.year == year) ) )