Skip to content
Merged

Dev #2376

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, string>();
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
<abp-dropdown id="user-dropdown">
<abp-dropdown-button class="btn-dropdown" text="@CurrentTenant.Name" />
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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;
Expand All @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,18 +174,15 @@ private static void UniqueifyPaths(List<FormComponentMetaDataItemDto> 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;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ public class ApplicantContactsController : AbpController
[Route("Refresh")]
public async Task<IActionResult> Refresh(Guid applicantId)
{
if (!ModelState.IsValid) return BadRequest();

await Task.CompletedTask;

return ViewComponent("ApplicantContacts", new { applicantId });
Expand Down
Loading