From a6c2f19feccd15e77c5b9a304185b9a2ff6573e4 Mon Sep 17 00:00:00 2001 From: Todd Davis Date: Wed, 6 Apr 2022 10:24:28 -0500 Subject: [PATCH] feat: Use strikethrough if task is complete --- main.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 439c604..19a538a 100644 --- a/main.go +++ b/main.go @@ -18,6 +18,7 @@ type KanbnColumns [][]struct { Metadata struct { Assigned string `json:"assigned"` Created string `json:"created"` + Completed string `json:"completed"` Progress int `json:"progress"` Started *string `json:"started,omitempty"` Tags []interface{} `json:"tags"` @@ -89,7 +90,11 @@ func renderBoard(r io.Reader, w io.Writer) error { // convert columns of rows into rows of columns for curCol, column := range lane.Columns { for colRow, task := range column { - rows[colRow][curCol] = task.Name + complete := "" + if task.Progress == 1 || task.Metadata.Completed != "" { + complete="~~" + } + rows[colRow][curCol] = fmt.Sprintf("%s%s%s", complete, task.Name, complete) } } // print the rows