diff --git a/api/src/Sozsoft.Platform.EntityFrameworkCore/Seeds/TenantData.json b/api/src/Sozsoft.Platform.EntityFrameworkCore/Seeds/TenantData.json index d7986de..f178777 100644 --- a/api/src/Sozsoft.Platform.EntityFrameworkCore/Seeds/TenantData.json +++ b/api/src/Sozsoft.Platform.EntityFrameworkCore/Seeds/TenantData.json @@ -1436,11 +1436,6 @@ "Name": "Finans", "ParentName": "Yönetim" }, - { - "Id": "63dc7ed1-81f2-4c5a-9d8b-0a1b2c3d4e5f", - "Name": "Muhasebe", - "ParentName": "Finans" - }, { "Id": "3cd38ab3-7e6f-4b8d-9c0a-5f4e3d2c1b0a", "Name": "Bilgi İşlem", @@ -1453,30 +1448,12 @@ "DepartmentName": "Yönetim", "Name": "Genel Müdür" }, - { - "Id": "b7c8d9e0-f1a2-4b3c-8d9e-0f1a2b3c4d5e", - "DepartmentName": "Muhasebe", - "Name": "Muhasebe Müdürü", - "ParentName": "Genel Müdür" - }, - { - "Id": "c3d4e5f6-a7b8-4c9d-8e0f-1a2b3c4d5e6f", - "DepartmentName": "Muhasebe", - "Name": "Muhasebe Şefi", - "ParentName": "Muhasebe Müdürü" - }, { "Id": "b7c8d9e0-f1a2-4b3c-8d9e-0f1a2b3c4d2e", "DepartmentName": "Bilgi İşlem", "Name": "Bilgi İşlem Müdürü", "ParentName": "Genel Müdür" }, - { - "Id": "b7c8d9e0-f1a2-4b3c-1d9e-0f1a2b3c4d2e", - "DepartmentName": "Finans", - "Name": "Finans Müdürü", - "ParentName": "Genel Müdür" - }, { "Id": "b7c8d9e0-f1b2-4b3c-1d9e-0f1a2b3c4d2e", "DepartmentName": "Satış", @@ -1494,6 +1471,24 @@ "DepartmentName": "Üretim", "Name": "Üretim Müdürü", "ParentName": "Genel Müdür" + }, + { + "Id": "b7c8d9e0-f1a2-4b3c-1d9e-0f1a2b3c4d2e", + "DepartmentName": "Finans", + "Name": "Finans Müdürü", + "ParentName": "Genel Müdür" + }, + { + "Id": "b7c8d9e0-f1a2-4b3c-8d9e-0f1a2b3c4d5e", + "DepartmentName": "Finans", + "Name": "Muhasebe Müdürü", + "ParentName": "Finans Müdürü" + }, + { + "Id": "c3d4e5f6-a7b8-4c9d-8e0f-1a2b3c4d5e6f", + "DepartmentName": "Finans", + "Name": "Muhasebe Şefi", + "ParentName": "Muhasebe Müdürü" } ], "Announcements": [ diff --git a/api/src/Sozsoft.Platform.HttpApi.Host/PredefinedReports/DynamicFormReport.cs b/api/src/Sozsoft.Platform.HttpApi.Host/PredefinedReports/DynamicFormReport.cs index a32d473..be691ee 100644 --- a/api/src/Sozsoft.Platform.HttpApi.Host/PredefinedReports/DynamicFormReport.cs +++ b/api/src/Sozsoft.Platform.HttpApi.Host/PredefinedReports/DynamicFormReport.cs @@ -720,7 +720,7 @@ public class DynamicFormReport : XtraReport private static string CreateFilter(string fieldName, string op, object value) { - return JsonSerializer.Serialize(new object[] { fieldName, op, value }); + return DynamicReportImageHelper.SerializeJson(new object[] { fieldName, op, value }); } private static IDictionary GetFirstRow(IEnumerable rows) diff --git a/api/src/Sozsoft.Platform.HttpApi.Host/PredefinedReports/DynamicReportImageHelper.cs b/api/src/Sozsoft.Platform.HttpApi.Host/PredefinedReports/DynamicReportImageHelper.cs index abd82be..a8b7416 100644 --- a/api/src/Sozsoft.Platform.HttpApi.Host/PredefinedReports/DynamicReportImageHelper.cs +++ b/api/src/Sozsoft.Platform.HttpApi.Host/PredefinedReports/DynamicReportImageHelper.cs @@ -5,6 +5,7 @@ using System.Data; using System.Globalization; using System.Linq; using System.Net.Http; +using System.Text.Encodings.Web; using System.Text.Json; using System.Text.RegularExpressions; using System.Threading.Tasks; @@ -37,6 +38,10 @@ internal static class DynamicReportImageHelper private static readonly Regex ReportPagingRegex = new( @"\s+OFFSET\s+\d+\s+ROWS(?:\s+FETCH\s+NEXT\s+\d+\s+ROWS\s+ONLY)?\s*$", RegexOptions.IgnoreCase | RegexOptions.CultureInvariant | RegexOptions.Compiled); + private static readonly JsonSerializerOptions ReportJsonSerializerOptions = new() + { + Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping + }; private static readonly HttpClient HttpClient = new(new HttpClientHandler { ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator @@ -402,6 +407,11 @@ internal static class DynamicReportImageHelper string.Equals(value, "1", StringComparison.OrdinalIgnoreCase); } + public static string SerializeJson(T value) + { + return JsonSerializer.Serialize(value, ReportJsonSerializerOptions); + } + public static string GetImageBaseUrl(IConfiguration configuration) { return configuration["App:CdnUrl"] ?? configuration["App:SelfUrl"]; diff --git a/api/src/Sozsoft.Platform.HttpApi.Host/PredefinedReports/DynamicTreeReport.cs b/api/src/Sozsoft.Platform.HttpApi.Host/PredefinedReports/DynamicTreeReport.cs index f030fc5..5c1738a 100644 --- a/api/src/Sozsoft.Platform.HttpApi.Host/PredefinedReports/DynamicTreeReport.cs +++ b/api/src/Sozsoft.Platform.HttpApi.Host/PredefinedReports/DynamicTreeReport.cs @@ -313,7 +313,7 @@ public class DynamicTreeReport : XtraReport var dataSource = new JsonDataSource { Name = TreeDataSourceName, - JsonSource = new CustomJsonSource(JsonSerializer.Serialize(normalizedRows)) + JsonSource = new CustomJsonSource(DynamicReportImageHelper.SerializeJson(normalizedRows)) }; dataSource.Fill(); ComponentStorage.Add(dataSource);