From c79f19260cf4be63010876f93f4a123483d7a85d Mon Sep 17 00:00:00 2001 From: Don Walizer <12420708+dwalizer@users.noreply.github.com> Date: Fri, 8 Dec 2023 12:50:04 -0500 Subject: [PATCH] #2494 Update Spring Boot to 3.1.6, fix querying to handle null errors --- pom.xml | 4 ++-- service/pom.xml | 1 + .../UserActionsHistoryService.groovy | 12 ++++++++--- .../repos/UserActionsHistoryRepo.groovy | 20 +++++++++---------- 4 files changed, 22 insertions(+), 15 deletions(-) diff --git a/pom.xml b/pom.xml index 9ed8a1a2a4..54fd7b7d22 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ 29.0-jre - 3.1.4 + 3.1.6 2.0.0 2.27.2 @@ -52,7 +52,7 @@ org.springframework.boot spring-boot-starter-parent - 3.1.4 + 3.1.6 diff --git a/service/pom.xml b/service/pom.xml index 36c914a28f..6794abdb11 100644 --- a/service/pom.xml +++ b/service/pom.xml @@ -556,6 +556,7 @@ The Apache Software License, Version 2.0|Apache License, Version 2.0 The Apache Software License, Version 2.0|Apache Public License 2.0 The Apache Software License, Version 2.0|Apache 2.0 + The Apache Software License, Version 2.0|Apache-2.0 The Apache Software License, Version 2.0|Apache 2 The Apache Software License, Version 2.0|The Apache License, Version 2.0 The Apache Software License, Version 2.0|Apache License, version 2.0 diff --git a/service/src/main/java/skills/services/userActions/UserActionsHistoryService.groovy b/service/src/main/java/skills/services/userActions/UserActionsHistoryService.groovy index 6d42b8c706..96956c838f 100644 --- a/service/src/main/java/skills/services/userActions/UserActionsHistoryService.groovy +++ b/service/src/main/java/skills/services/userActions/UserActionsHistoryService.groovy @@ -93,8 +93,12 @@ class UserActionsHistoryService { String quizFilter, String itemIdFilter, DashboardAction actionFilter) { + String projectIdFilterQuery = projectIdFilter ? '%' + projectIdFilter.toLowerCase() + '%' : null + String userFilterQuery = userFilter ? '%' + userFilter.toLowerCase() + '%' : null + String quizFilterQuery = quizFilter ? '%' + quizFilter.toLowerCase() + '%' : null + String itemIdFilterQuery = itemIdFilter ? '%' + itemIdFilter.toLowerCase() + '%' : null Page userActionsPreviewFromDB = userActionsHistoryRepo.getActions( - projectIdFilter, itemFilter, userFilter, quizFilter, itemIdFilter, actionFilter, pageRequest) + projectIdFilterQuery, itemFilter, userFilterQuery, quizFilterQuery, itemIdFilterQuery, actionFilter, pageRequest) Long totalRows = userActionsPreviewFromDB.getTotalElements() List actionResList = userActionsPreviewFromDB.getContent().collect { new DashboardUserActionRes( @@ -146,8 +150,10 @@ class UserActionsHistoryService { } DashboardUserActionsFilterOptions getUserActionsFilterOptions(String projectId = null, String quizId = null) { - List dashboardActions = userActionsHistoryRepo.findDistinctDashboardActions(projectId, quizId) - List dashboardItems = userActionsHistoryRepo.findDistinctDashboardItems(projectId, quizId) + String projectIdFilter = projectId ? projectId.toLowerCase() : null + String quizIdFilter = quizId ? quizId.toLowerCase() : null + List dashboardActions = userActionsHistoryRepo.findDistinctDashboardActions(projectIdFilter, quizIdFilter) + List dashboardItems = userActionsHistoryRepo.findDistinctDashboardItems(projectIdFilter, quizIdFilter) return new DashboardUserActionsFilterOptions( actionFilterOptions: dashboardActions.collect { it.toString() }, diff --git a/service/src/main/java/skills/storage/repos/UserActionsHistoryRepo.groovy b/service/src/main/java/skills/storage/repos/UserActionsHistoryRepo.groovy index 1d5b017f47..3f2f7d1af3 100644 --- a/service/src/main/java/skills/storage/repos/UserActionsHistoryRepo.groovy +++ b/service/src/main/java/skills/storage/repos/UserActionsHistoryRepo.groovy @@ -58,15 +58,15 @@ interface UserActionsHistoryRepo extends CrudRepository getActions(@Nullable @Param("projectIdFilter") String projectIdFilter, @@ -80,8 +80,8 @@ interface UserActionsHistoryRepo extends CrudRepository findDistinctDashboardActions(@Nullable @Param("projectId") String projectId, @Nullable @Param("quizId") String quizId) @@ -89,8 +89,8 @@ interface UserActionsHistoryRepo extends CrudRepository findDistinctDashboardItems(@Nullable @Param("projectId") String projectId, @Nullable @Param("quizId") String quizId)