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..9d16afe3db 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 @@ -68,12 +68,9 @@ protected static void ValidateInputCounts(StringValues keys, StringValues labels protected static void ValidateValuesFormat(StringValues values, KeyValueType type) { - foreach (var key in values) + if (values.Any(k => !IsValidInput(k ?? string.Empty))) { - if (!IsValidInput(key ?? string.Empty)) - { - throw new UserFriendlyException($"The following characters are allowed for {type}: " + validInputPattern); - } + throw new UserFriendlyException($"The following characters are allowed for {type}: " + validInputPattern); } } diff --git a/applications/Unity.GrantManager/modules/Unity.Payments/src/Unity.Payments.Application/Integrations/Cas/SupplierService.cs b/applications/Unity.GrantManager/modules/Unity.Payments/src/Unity.Payments.Application/Integrations/Cas/SupplierService.cs index 761ee71632..23147665c9 100644 --- a/applications/Unity.GrantManager/modules/Unity.Payments/src/Unity.Payments.Application/Integrations/Cas/SupplierService.cs +++ b/applications/Unity.GrantManager/modules/Unity.Payments/src/Unity.Payments.Application/Integrations/Cas/SupplierService.cs @@ -188,7 +188,7 @@ public static SiteEto GetSiteEto(JsonElement site) SupplierSiteCode = GetJsonProperty("suppliersitecode", site), AddressLine1 = GetJsonProperty("addressline1", site), AddressLine2 = GetJsonProperty("addressline2", site), - AddressLine3 = GetJsonProperty("addressline2", site), + AddressLine3 = GetJsonProperty("addressline3", site), City = GetJsonProperty("city", site), Province = GetJsonProperty("province", site), Country = GetJsonProperty("country", site), 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..6c36736706 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 @@ -317,16 +317,13 @@ 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) + foreach (var field in fieldsMap.Fields.Where(f => !userProvidedMappings.ContainsKey(f.Path))) { - 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 columnNameSource = GetDefaultColumnNameSource(field, upsertReportColmnsMapDto.CorrelationProvider); + var sanitizedName = SanitizeColumnName(columnNameSource); + var uniqueName = EnsureUniqueness(sanitizedName, usedColumnNames); + autoGeneratedColumnNames[field.Path] = uniqueName; + usedColumnNames.Add(uniqueName); } // Create mapping rows 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..a0178963b9 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 @@ -32,8 +32,6 @@ bool isAuthorizedForTenantSwitch = false; 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..396be48bce 100644 --- a/applications/Unity.GrantManager/src/Unity.GrantManager.Application/Applicants/IApplicantAppService.cs +++ b/applications/Unity.GrantManager/src/Unity.GrantManager.Application/Applicants/IApplicantAppService.cs @@ -1,8 +1,7 @@ -using System; -using System.Collections.Generic; +using Unity.GrantManager.Applications; +using System; 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..6012a3f7e8 100644 --- a/applications/Unity.GrantManager/src/Unity.GrantManager.Application/Assessments/AssessmentAppService.cs +++ b/applications/Unity.GrantManager/src/Unity.GrantManager.Application/Assessments/AssessmentAppService.cs @@ -1,4 +1,5 @@ -using Microsoft.AspNetCore.Authorization; +using Unity.GrantManager.Applications; +using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization.Infrastructure; using System; using System.Collections.Generic; @@ -11,7 +12,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; @@ -23,7 +23,6 @@ using Volo.Abp.EventBus.Local; using Volo.Abp.Features; using Volo.Abp.Identity.Integration; -using Volo.Abp.Settings; using Volo.Abp.Users; using Volo.Abp.Validation; diff --git a/applications/Unity.GrantManager/src/Unity.GrantManager.Application/Reporting/Configuration/FormMetadataService.cs b/applications/Unity.GrantManager/src/Unity.GrantManager.Application/Reporting/Configuration/FormMetadataService.cs index 8621683fe6..5f2600d744 100644 --- a/applications/Unity.GrantManager/src/Unity.GrantManager.Application/Reporting/Configuration/FormMetadataService.cs +++ b/applications/Unity.GrantManager/src/Unity.GrantManager.Application/Reporting/Configuration/FormMetadataService.cs @@ -174,18 +174,15 @@ private static void UniqueifyPaths(List components hasDuplicates = false; // Second pass: prefix duplicate paths with (DKx) - foreach (var component in componentsList) + foreach (var component in componentsList.Where(c => !string.IsNullOrEmpty(c.Path) && pathCounts.GetValueOrDefault(c.Path, 0) > 1)) { - if (!string.IsNullOrEmpty(component.Path) && pathCounts.GetValueOrDefault(component.Path, 0) > 1) - { - // Get the current counter for this path - pathCounters[component.Path] = pathCounters.GetValueOrDefault(component.Path, 0) + 1; - int duplicateNumber = pathCounters[component.Path]; + // Get the current counter for this path + pathCounters[component.Path] = pathCounters.GetValueOrDefault(component.Path, 0) + 1; + int duplicateNumber = pathCounters[component.Path]; - // Prefix with (DKx) where x is the duplicate number - component.Path = $"(DK{duplicateNumber}){component.Path}"; - hasDuplicates = true; - } + // Prefix with (DKx) where x is the duplicate number + component.Path = $"(DK{duplicateNumber}){component.Path}"; + hasDuplicates = true; } } diff --git a/applications/Unity.GrantManager/src/Unity.GrantManager.Application/Reporting/DataGenerators/ReportingDataGenerator.cs b/applications/Unity.GrantManager/src/Unity.GrantManager.Application/Reporting/DataGenerators/ReportingDataGenerator.cs index 587507635c..c468f4b42c 100644 --- a/applications/Unity.GrantManager/src/Unity.GrantManager.Application/Reporting/DataGenerators/ReportingDataGenerator.cs +++ b/applications/Unity.GrantManager/src/Unity.GrantManager.Application/Reporting/DataGenerators/ReportingDataGenerator.cs @@ -33,12 +33,9 @@ public class ReportingDataGenerator : ApplicationService, IReportingDataGenerato ScanNode(dataNode, keysToTrack, reportResult); // Ensure all keys are present in the result, even if no matches were found - foreach (var key in keysToTrack) + foreach (var key in keysToTrack.Where(k => !reportResult.ContainsKey(k))) { - if (!reportResult.ContainsKey(key)) - { - reportResult[key] = []; - } + reportResult[key] = []; } // Clean up the JSON strings diff --git a/applications/Unity.GrantManager/src/Unity.GrantManager.Web/Views/Shared/Components/ApplicantContacts/ApplicantContactsController.cs b/applications/Unity.GrantManager/src/Unity.GrantManager.Web/Views/Shared/Components/ApplicantContacts/ApplicantContactsController.cs index 04ec4cd11d..1e030c1977 100644 --- a/applications/Unity.GrantManager/src/Unity.GrantManager.Web/Views/Shared/Components/ApplicantContacts/ApplicantContactsController.cs +++ b/applications/Unity.GrantManager/src/Unity.GrantManager.Web/Views/Shared/Components/ApplicantContacts/ApplicantContactsController.cs @@ -12,6 +12,8 @@ public class ApplicantContactsController : AbpController [Route("Refresh")] public async Task Refresh(Guid applicantId) { + if (!ModelState.IsValid) return BadRequest(); + await Task.CompletedTask; return ViewComponent("ApplicantContacts", new { applicantId });