|
|
|
@@ -1,5 +1,5 @@
|
|
|
|
import std/[algorithm, json, jsonutils, options, os, sets, strutils, tables, terminal,
|
|
|
|
import std/[algorithm, json, jsonutils, options, os, sets, strutils, tables,
|
|
|
|
times, unicode, wordwrap]
|
|
|
|
terminal, times, unicode, wordwrap]
|
|
|
|
from std/sequtils import repeat, toSeq
|
|
|
|
from std/sequtils import repeat, toSeq
|
|
|
|
import cliutils, uuids, zero_functional
|
|
|
|
import cliutils, uuids, zero_functional
|
|
|
|
import ./[formatting, libpit]
|
|
|
|
import ./[formatting, libpit]
|
|
|
|
@@ -256,8 +256,7 @@ proc formatMilestone*(
|
|
|
|
result.add(withColor("─".repeat(availWidth), fgWhite))
|
|
|
|
result.add(withColor("─".repeat(availWidth), fgWhite))
|
|
|
|
|
|
|
|
|
|
|
|
var parentsToChildren = issues -->
|
|
|
|
var parentsToChildren = issues -->
|
|
|
|
filter(it.hasProp("parent")) -->
|
|
|
|
filter(it.hasProp("parent")).group(it["parent"])
|
|
|
|
group(it["parent"])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var issuesToFormat = sorted(issues, cmp) -->
|
|
|
|
var issuesToFormat = sorted(issues, cmp) -->
|
|
|
|
filter(not it.hasProp("parent"))
|
|
|
|
filter(not it.hasProp("parent"))
|
|
|
|
@@ -282,7 +281,7 @@ proc findShortestColumn(columns: seq[seq[string]]): int =
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
proc joinColumns(columns: seq[seq[string]], columnWidth: int): seq[string] =
|
|
|
|
proc joinColumns(columns: seq[seq[string]], columnWidth: int): seq[string] =
|
|
|
|
let maxLines = columns --> map(it.len) --> max()
|
|
|
|
let maxLines = columns --> map(it.len).max()
|
|
|
|
|
|
|
|
|
|
|
|
for lineNo in 0 ..< maxLines:
|
|
|
|
for lineNo in 0 ..< maxLines:
|
|
|
|
var newLine = ""
|
|
|
|
var newLine = ""
|
|
|
|
@@ -316,7 +315,7 @@ proc showProject*(ctx: CliContext, project: Project) =
|
|
|
|
fgBlue, bold=true))
|
|
|
|
fgBlue, bold=true))
|
|
|
|
|
|
|
|
|
|
|
|
let milestoneTexts: seq[seq[string]] = project.milestoneOrder -->
|
|
|
|
let milestoneTexts: seq[seq[string]] = project.milestoneOrder -->
|
|
|
|
filter(project.milestones.hasKey(it) and project.milestones[it].len > 0) -->
|
|
|
|
filter(project.milestones.hasKey(it) and project.milestones[it].len > 0).
|
|
|
|
map(ctx.formatMilestone(it, project.milestones[it], columnWidth))
|
|
|
|
map(ctx.formatMilestone(it, project.milestones[it], columnWidth))
|
|
|
|
|
|
|
|
|
|
|
|
var columns: seq[seq[string]] = repeat(newSeq[string](), numColumns)
|
|
|
|
var columns: seq[seq[string]] = repeat(newSeq[string](), numColumns)
|
|
|
|
@@ -347,8 +346,16 @@ proc showProjectBoard*(ctx: CliContext, filter = none[IssueFilter]()) =
|
|
|
|
let projectsCfg = ctx.loadProjectsConfiguration()
|
|
|
|
let projectsCfg = ctx.loadProjectsConfiguration()
|
|
|
|
let projectsDb = ctx.buildDb(projectsCfg)
|
|
|
|
let projectsDb = ctx.buildDb(projectsCfg)
|
|
|
|
|
|
|
|
|
|
|
|
for (context, projects) in pairs(projectsDb):
|
|
|
|
var contextsAndProjects: seq[(string, seq[Project])] = @[]
|
|
|
|
if projectsDb.len > 1:
|
|
|
|
|
|
|
|
|
|
|
|
for (context, pjs) in pairs(projectsDb):
|
|
|
|
|
|
|
|
let projects = pjs
|
|
|
|
|
|
|
|
let issues: seq[Issue] = projects --> map(toSeq(values(it.milestones))).flatten().flatten()
|
|
|
|
|
|
|
|
if issues.len > 0:
|
|
|
|
|
|
|
|
contextsAndProjects.add((context, projects))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (context, projects) in contextsAndProjects:
|
|
|
|
|
|
|
|
if contextsAndProjects.len > 1:
|
|
|
|
stdout.writeLine("")
|
|
|
|
stdout.writeLine("")
|
|
|
|
stdout.writeLine(withColor(
|
|
|
|
stdout.writeLine(withColor(
|
|
|
|
ctx.getIssueContextDisplayName(context) & ":",
|
|
|
|
ctx.getIssueContextDisplayName(context) & ":",
|
|
|
|
|