From 7f8f99d4eb949d7d97f7e86997cb930a30ad0906 Mon Sep 17 00:00:00 2001 From: masoodafar-web Date: Fri, 19 Jun 2026 01:56:54 +0330 Subject: [PATCH] feat: enhance organization chart data mapping for improved clarity 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. --- .../Components/OrganizationChart.razor.cs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/FrontOffice.Main/Pages/Profile/Components/OrganizationChart.razor.cs b/src/FrontOffice.Main/Pages/Profile/Components/OrganizationChart.razor.cs index a7ab481..2603f3f 100644 --- a/src/FrontOffice.Main/Pages/Profile/Components/OrganizationChart.razor.cs +++ b/src/FrontOffice.Main/Pages/Profile/Components/OrganizationChart.razor.cs @@ -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); }