feat: enhance organization chart data mapping for improved clarity
Build and Deploy to Kubernetes / build-and-deploy (push) Failing after 17m19s
Build and Deploy to Kubernetes / build-and-deploy (push) Failing after 17m19s
Updated the organization chart component to explicitly map network node properties to a flat array with camelCase keys. This change aligns the data structure with the BackOffice admin chart, enhancing consistency and clarity in the displayed information.
This commit is contained in:
@@ -95,7 +95,23 @@ public partial class OrganizationChart : IAsyncDisposable
|
||||
try
|
||||
{
|
||||
_dotNetHelper = DotNetObjectReference.Create(this);
|
||||
var flatData = _networkTree.ToFlatArray();
|
||||
// Explicit camelCase mapping (same pattern as BackOffice admin chart)
|
||||
var flatData = _networkTree.ToFlatArray().Select(n => new
|
||||
{
|
||||
id = n.Id,
|
||||
parentId = n.ParentId,
|
||||
fullName = n.FullName,
|
||||
mobile = n.Mobile,
|
||||
avatar = n.Avatar,
|
||||
position = n.Position,
|
||||
level = n.Level,
|
||||
isActive = n.IsActive,
|
||||
isClubActive = n.IsClubActive,
|
||||
activationWeekNumber = n.ActivationWeekNumber,
|
||||
joinedAt = n.JoinedAt,
|
||||
referralCode = n.ReferralCode,
|
||||
packageName = n.PackageName ?? string.Empty
|
||||
}).ToArray();
|
||||
|
||||
await JSRuntime.InvokeVoidAsync("OrgChart.init", "org-chart-container", flatData, _dotNetHelper);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user