From 196644482f58e91b413d50bc7bc8065cc001db75 Mon Sep 17 00:00:00 2001 From: Arthur Zamarin Date: Thu, 30 May 2024 21:10:34 +0300 Subject: [PATCH] package/QA report: fix shown values and order Signed-off-by: Arthur Zamarin --- pkg/app/handler/packages/show.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkg/app/handler/packages/show.go b/pkg/app/handler/packages/show.go index 718a2a6..feaa14f 100644 --- a/pkg/app/handler/packages/show.go +++ b/pkg/app/handler/packages/show.go @@ -72,8 +72,12 @@ func Show(w http.ResponseWriter, r *http.Request) { case "qa-report": currentSubTab = "QA report" query = query. - Relation("PkgCheckResults"). - Relation("Versions.PkgCheckResults") + Relation("PkgCheckResults", func(q *pg.Query) (*pg.Query, error) { + return q.Where("version IS NULL").Order("class", "message"), nil + }). + Relation("Versions.PkgCheckResults", func(q *pg.Query) (*pg.Query, error) { + return q.Order("version", "class", "message"), nil + }) case "pull-requests": atom = strings.ReplaceAll(atom, "/pull-requests", "") currentSubTab = "Pull requests"