From dcb5bd0c823167f0007f544b133f0463345c854e Mon Sep 17 00:00:00 2001 From: jamesread Date: Mon, 9 Mar 2026 09:18:24 +0000 Subject: [PATCH] chore: Allow entity key ordering for actionless components --- service/internal/api/dashboards.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/service/internal/api/dashboards.go b/service/internal/api/dashboards.go index 44e2244..bf7e9cb 100644 --- a/service/internal/api/dashboards.go +++ b/service/internal/api/dashboards.go @@ -182,6 +182,11 @@ func entityKeyLess(a, b string) bool { func sortDashboardComponents(components []*apiv1.DashboardComponent) []*apiv1.DashboardComponent { sort.Slice(components, func(i, j int) bool { if components[i].Action == nil || components[j].Action == nil { + if components[i].EntityKey != "" && components[j].EntityKey != "" && + components[i].EntityKey != components[j].EntityKey { + return entityKeyLess(components[i].EntityKey, components[j].EntityKey) + } + return components[i].Title < components[j].Title }