From f03da87f81b2905c9d6fc5b27d175e07d6d82a43 Mon Sep 17 00:00:00 2001 From: Sergiy Korzh Date: Sun, 31 Mar 2024 20:23:22 +0300 Subject: [PATCH 1/3] [fix] Custom display formats were not supported --- easydata.js/packs/core/src/i18n/i18n.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/easydata.js/packs/core/src/i18n/i18n.ts b/easydata.js/packs/core/src/i18n/i18n.ts index cc76ecae..b8bc4a63 100644 --- a/easydata.js/packs/core/src/i18n/i18n.ts +++ b/easydata.js/packs/core/src/i18n/i18n.ts @@ -430,9 +430,6 @@ export namespace i18n { else if (format == 'u') { format = buildUniversalDateTimeFormat(dataType); } - else { - format = buildUniversalDateTimeFormat(dataType); - } } else { format = buildShortDateTimeFormat(dataType); From 85dc2ce55d9a7eb1e464c8aa5e9c277dd8f91096 Mon Sep 17 00:00:00 2001 From: Sergiy Korzh Date: Sun, 31 Mar 2024 20:24:46 +0300 Subject: [PATCH 2/3] [fix] DisplayFormats section was not loaded from JSON metadata file --- easydata.net/src/EasyData.Core/DisplayFormatStore.cs | 5 +++++ easydata.net/src/EasyData.Core/MetaData.cs | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/easydata.net/src/EasyData.Core/DisplayFormatStore.cs b/easydata.net/src/EasyData.Core/DisplayFormatStore.cs index af05527e..4a500a41 100644 --- a/easydata.net/src/EasyData.Core/DisplayFormatStore.cs +++ b/easydata.net/src/EasyData.Core/DisplayFormatStore.cs @@ -45,6 +45,11 @@ public DisplayFormatDescriptor AddOrUpdate(DataType type, string name, string fo desc = new DisplayFormatDescriptor(name, format); desc.IsDefault = isDefault; if (_dict.TryGetValue(type, out var formats)) { + if (isDefault) { + foreach (var fmt in formats) { + fmt.IsDefault = false; + } + } formats.Add(desc); } else { diff --git a/easydata.net/src/EasyData.Core/MetaData.cs b/easydata.net/src/EasyData.Core/MetaData.cs index 696c92a4..3d7487f0 100644 --- a/easydata.net/src/EasyData.Core/MetaData.cs +++ b/easydata.net/src/EasyData.Core/MetaData.cs @@ -1049,6 +1049,7 @@ protected virtual async Task ReadOneModelPropFromJsonAsync(JsonReader reader, st await Editors.ReadFromJsonAsync(reader, ct).ConfigureAwait(false); break; case "dataFormats": + case "displayFormats": await reader.ReadAsync(ct).ConfigureAwait(false); //reading StartObject token await ReadDisplayFormatsFromJsonAsync(reader, ct).ConfigureAwait(false); break; @@ -1071,7 +1072,7 @@ protected async virtual Task ReadDisplayFormatsFromJsonAsync(JsonReader reader, var formatType = reader.Value.ToString().StrToDataType(); await reader.ReadAsync(ct).ConfigureAwait(false); - if (reader.TokenType != JsonToken.StartArray) { + if (reader.TokenType == JsonToken.StartArray) { while ((await reader.ReadAsync(ct).ConfigureAwait(false)) && reader.TokenType != JsonToken.EndArray) { From 424f820bc3141fdf92e4ef4d96ffdb2e9d6df333 Mon Sep 17 00:00:00 2001 From: Sergiy Korzh Date: Tue, 2 Apr 2024 08:52:15 +0300 Subject: [PATCH 3/3] Version 1.5.5 --- easydata.js/version.json | 6 +++--- easydata.net/version.json | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/easydata.js/version.json b/easydata.js/version.json index 64bdba49..96538026 100644 --- a/easydata.js/version.json +++ b/easydata.js/version.json @@ -1,6 +1,6 @@ { - "version": "1.5.4", - "baseVersion": "1.5.4", - "assetVersion": "01_05_04", + "version": "1.5.5", + "baseVersion": "1.5.5", + "assetVersion": "01_05_05", "tag": "latest" } diff --git a/easydata.net/version.json b/easydata.net/version.json index a7d4a372..506cfef7 100644 --- a/easydata.net/version.json +++ b/easydata.net/version.json @@ -1,5 +1,5 @@ { - "assemblyVersion": "1.5.3.1", - "packageVersion": "1.5.3", - "assetVersion": "01_05_03" + "assemblyVersion": "1.5.5.1", + "packageVersion": "1.5.5", + "assetVersion": "01_05_05" }