From 0a751aa7223bb7d1e800ad81827afb653de89fdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96zg=C3=BCr=20Kesim?= Date: Sun, 14 Jan 2024 19:58:19 +0100 Subject: [PATCH] show children of specification features --- data.go | 5 +++++ issues.go | 17 ++++++++++------- table.tmpl | 7 ++++++- 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/data.go b/data.go index 4b782eb..336069d 100644 --- a/data.go +++ b/data.go @@ -188,6 +188,11 @@ func (d *Data) getIssues() { var features = Issues{} var open = 0 for _, issue := range iss.Issues { + for _, ch := range issue.Relationships { + if ch.Typ.Name == "parent-of" { + issue.Children = append(issue.Children, ch.Issue) + } + } if issue.Resolution.Name == "open" && strings.Compare(d.minimumVersion, issue.TargetVersion.Name) < 0 { open++ diff --git a/issues.go b/issues.go index 88a8ccc..9d650fc 100644 --- a/issues.go +++ b/issues.go @@ -49,10 +49,19 @@ type Issue struct { UpdatedAt time.Time `json:"updated_at"` Notes []Note Relationships []Relationship + Children []Child `json:"-"` Tags []KeyVal History []Change } +type Child struct { + Id uint32 + Summary string + Status KeyVal + Resolution KeyVal + Handler KeyVal +} + type KeyVal struct { Id uint32 Name string @@ -79,13 +88,7 @@ type Attachment struct { type Relationship struct { Id uint32 Typ KeyVal `json:"type"` - Issue struct { - Id uint32 - Summary string - Status KeyVal - Resolution KeyVal - Handler KeyVal - } + Issue Child } type Change struct { diff --git a/table.tmpl b/table.tmpl index 9b29099..cffda85 100644 --- a/table.tmpl +++ b/table.tmpl @@ -124,7 +124,12 @@ details[open].issue { {{- range $sorter.Sort . }} {{ if .IsHandled }}🥷{{else}}{{end}} {{.Id}} - {{.Summary}}
+ {{.Summary}} + {{ with .Children }}(children: + {{ range $child := . }} + {{$child.Id}} + {{ end }}) + {{ end }}
{{- end}} {{- end }}