فهرست منبع

fix: (#703) Fixed entity fieldsets being drawn in a random order

jamesread 7 ماه پیش
والد
کامیت
83fe489949
1فایلهای تغییر یافته به همراه3 افزوده شده و 6 حذف شده
  1. 3 6
      service/internal/api/dashboards.go

+ 3 - 6
service/internal/api/dashboards.go

@@ -89,13 +89,10 @@ func buildDefaultDashboard(rr *DashboardRenderRequest) *apiv1.Dashboard {
 }
 }
 
 
 func sortActions(components []*apiv1.DashboardComponent) []*apiv1.DashboardComponent {
 func sortActions(components []*apiv1.DashboardComponent) []*apiv1.DashboardComponent {
+	log.Infof("sortActions: %+v", components)
 	sort.Slice(components, func(i, j int) bool {
 	sort.Slice(components, func(i, j int) bool {
-		if components[i].Action == nil {
-			return false
-		}
-
-		if components[j].Action == nil {
-			return true
+		if components[i].Action == nil || components[j].Action == nil {
+			return components[i].Title < components[j].Title
 		}
 		}
 
 
 		if components[i].Action.Order == components[j].Action.Order {
 		if components[i].Action.Order == components[j].Action.Order {