diff --git a/applications/Unity.GrantManager/modules/Unity.Flex/src/Unity.Flex.Web/Views/Shared/Components/Common/KeyValueComponentDefinition.cs b/applications/Unity.GrantManager/modules/Unity.Flex/src/Unity.Flex.Web/Views/Shared/Components/Common/KeyValueComponentDefinition.cs index 8d27f7a3cc..1f0c7cf0a2 100644 --- a/applications/Unity.GrantManager/modules/Unity.Flex/src/Unity.Flex.Web/Views/Shared/Components/Common/KeyValueComponentDefinition.cs +++ b/applications/Unity.GrantManager/modules/Unity.Flex/src/Unity.Flex.Web/Views/Shared/Components/Common/KeyValueComponentDefinition.cs @@ -30,17 +30,14 @@ protected enum KeyValueType protected static void ValidateKeysFormat(StringValues keys) { - foreach (var key in keys) + foreach (var key in keys.Where(k => string.IsNullOrWhiteSpace(k))) { - if (string.IsNullOrWhiteSpace(key)) - { - throw new UserFriendlyException("There are empty Keys captured which are required"); - } + throw new UserFriendlyException("There are empty Keys captured which are required"); + } - if (!IsValidInput(key)) - { - throw new UserFriendlyException("The following characters are allowed for Keys: " + validInputPattern); - } + foreach (var key in keys.Where(k => !string.IsNullOrWhiteSpace(k) && !IsValidInput(k))) + { + throw new UserFriendlyException("The following characters are allowed for Keys: " + validInputPattern); } } diff --git a/applications/Unity.GrantManager/modules/Unity.Reporting/src/Unity.Reporting.Application/Configuration/ReportMappingUtils.cs b/applications/Unity.GrantManager/modules/Unity.Reporting/src/Unity.Reporting.Application/Configuration/ReportMappingUtils.cs index 169350689f..878dd022dd 100644 --- a/applications/Unity.GrantManager/modules/Unity.Reporting/src/Unity.Reporting.Application/Configuration/ReportMappingUtils.cs +++ b/applications/Unity.GrantManager/modules/Unity.Reporting/src/Unity.Reporting.Application/Configuration/ReportMappingUtils.cs @@ -316,18 +316,18 @@ internal static ReportColumnsMap CreateNewMap(UpsertReportColumnsMapDto upsertRe // Generate column names for fields without user-provided mappings // For formversion provider, use Key (CHEFS Property Name) as the source; for others, use Label - var autoGeneratedColumnNames = new Dictionary(); - foreach (var field in fieldsMap.Fields) - { - if (!userProvidedMappings.ContainsKey(field.Path)) - { - var columnNameSource = GetDefaultColumnNameSource(field, upsertReportColmnsMapDto.CorrelationProvider); - var sanitizedName = SanitizeColumnName(columnNameSource); - var uniqueName = EnsureUniqueness(sanitizedName, usedColumnNames); - autoGeneratedColumnNames[field.Path] = uniqueName; - usedColumnNames.Add(uniqueName); - } - } + var autoGeneratedColumnNames = fieldsMap.Fields + .Where(field => !userProvidedMappings.ContainsKey(field.Path)) + .ToDictionary( + field => field.Path, + field => { + var columnNameSource = GetDefaultColumnNameSource(field, upsertReportColmnsMapDto.CorrelationProvider); + var sanitizedName = SanitizeColumnName(columnNameSource); + var uniqueName = EnsureUniqueness(sanitizedName, usedColumnNames); + usedColumnNames.Add(uniqueName); + return uniqueName; + } + ); // Create mapping rows var mapRows = fieldsMap.Fields.Select(field => diff --git a/applications/Unity.GrantManager/modules/Unity.Theme.UX2/src/Unity.Theme.UX2/Themes/UX2/Components/Topbar/Default.cshtml b/applications/Unity.GrantManager/modules/Unity.Theme.UX2/src/Unity.Theme.UX2/Themes/UX2/Components/Topbar/Default.cshtml index 29f143e884..e9cc126ee8 100644 --- a/applications/Unity.GrantManager/modules/Unity.Theme.UX2/src/Unity.Theme.UX2/Themes/UX2/Components/Topbar/Default.cshtml +++ b/applications/Unity.GrantManager/modules/Unity.Theme.UX2/src/Unity.Theme.UX2/Themes/UX2/Components/Topbar/Default.cshtml @@ -33,7 +33,6 @@ if (CurrentUser.IsAuthenticated && CurrentUser.FindClaimValue("has_multiple_tenants") == "true") isAuthorizedForTenantSwitch = true; - bool isAuthorizedForPaymentConfiguration = await PermissionChecker.IsGrantedAsync("SettingManagement.ConfigurePayments"); } diff --git a/applications/Unity.GrantManager/src/Unity.GrantManager.Application/Applicants/IApplicantAppService.cs b/applications/Unity.GrantManager/src/Unity.GrantManager.Application/Applicants/IApplicantAppService.cs index 700c775081..5bd565e22d 100644 --- a/applications/Unity.GrantManager/src/Unity.GrantManager.Application/Applicants/IApplicantAppService.cs +++ b/applications/Unity.GrantManager/src/Unity.GrantManager.Application/Applicants/IApplicantAppService.cs @@ -2,7 +2,6 @@ using System.Collections.Generic; using System.Text.Json; using System.Threading.Tasks; -using Unity.GrantManager.Applications; using Unity.GrantManager.GrantApplications; using Unity.GrantManager.Intakes; using Unity.Modules.Shared; diff --git a/applications/Unity.GrantManager/src/Unity.GrantManager.Application/Assessments/AssessmentAppService.cs b/applications/Unity.GrantManager/src/Unity.GrantManager.Application/Assessments/AssessmentAppService.cs index 09d14f365a..3d5f32fffc 100644 --- a/applications/Unity.GrantManager/src/Unity.GrantManager.Application/Assessments/AssessmentAppService.cs +++ b/applications/Unity.GrantManager/src/Unity.GrantManager.Application/Assessments/AssessmentAppService.cs @@ -11,7 +11,6 @@ using Unity.Flex.Scoresheets.Enums; using Unity.Flex.Scoresheets.Events; using Unity.Flex.Worksheets.Definitions; -using Unity.GrantManager.Applications; using Unity.GrantManager.Comments; using Unity.GrantManager.Exceptions; using Unity.GrantManager.Workflow;