From 940df826f7ac7e88271eb941e4f3a3b68bd3654e Mon Sep 17 00:00:00 2001 From: OlgunR Date: Tue, 3 Feb 2026 13:43:23 +0100 Subject: [PATCH] Normalize dashboard date dimensions, update grid UI Added normalization for date dimensions in SqlDashboardStorage to ensure consistent grouping for "AddedWhen" and "ChangedWhen" fields. Refactored CatalogsGrid.razor to use custom sort icons and default DxGrid filter row UI, simplifying markup and improving visual consistency. Updated related CSS for sortable headers and filter inputs. --- DbFirst.API/Dashboards/SqlDashboardStorage.cs | 28 +++++++- .../Components/CatalogsGrid.razor | 18 +++-- .../Components/CatalogsGrid.razor | 71 ++----------------- 3 files changed, 46 insertions(+), 71 deletions(-) diff --git a/DbFirst.API/Dashboards/SqlDashboardStorage.cs b/DbFirst.API/Dashboards/SqlDashboardStorage.cs index fced0b2..fd44eda 100644 --- a/DbFirst.API/Dashboards/SqlDashboardStorage.cs +++ b/DbFirst.API/Dashboards/SqlDashboardStorage.cs @@ -52,7 +52,33 @@ public sealed class SqlDashboardStorage : IEditableDashboardStorage } var xml = Encoding.UTF8.GetString(data); - return XDocument.Parse(xml); + var doc = XDocument.Parse(xml); + NormalizeCatalogDateDimensions(doc); + return doc; + } + + private static void NormalizeCatalogDateDimensions(XDocument doc) + { + var dateMembers = new HashSet(StringComparer.OrdinalIgnoreCase) + { + "AddedWhen", + "ChangedWhen" + }; + + foreach (var dimension in doc.Descendants("Dimension")) + { + var member = dimension.Attribute("DataMember")?.Value; + if (member == null || !dateMembers.Contains(member)) + { + continue; + } + + var interval = dimension.Attribute("DateTimeGroupInterval")?.Value; + if (string.IsNullOrWhiteSpace(interval) || string.Equals(interval, "Year", StringComparison.OrdinalIgnoreCase)) + { + dimension.SetAttributeValue("DateTimeGroupInterval", "DayMonthYear"); + } + } } public string AddDashboard(XDocument dashboard, string dashboardName) diff --git a/DbFirst.BlazorWasm/Components/CatalogsGrid.razor b/DbFirst.BlazorWasm/Components/CatalogsGrid.razor index b3f4c21..2453a44 100644 --- a/DbFirst.BlazorWasm/Components/CatalogsGrid.razor +++ b/DbFirst.BlazorWasm/Components/CatalogsGrid.razor @@ -3,12 +3,16 @@ @if (!string.IsNullOrWhiteSpace(errorMessage)) @@ -93,42 +62,12 @@ else
- - - - - - - - - - - - - - - - - - - - + + + + - - - - - +