Compare commits

...

3 Commits

4 changed files with 17 additions and 6 deletions

View File

@@ -1,2 +1,2 @@
[tools]
nim = "2.2.0"
nim = "2.2.4"

View File

@@ -1,6 +1,6 @@
# Package
version = "4.29.0"
version = "4.29.2"
author = "Jonathan Bernard"
description = "Personal issue tracker."
license = "MIT"
@@ -13,7 +13,6 @@ bin = @["pit"]
requires @[
"nim >= 1.4.0",
"docopt >= 0.7.1",
"jester >= 0.6.0",
"uuids >= 0.1.10",
"zero_functional"
]

View File

@@ -1,4 +1,4 @@
const PIT_VERSION* = "4.29.0"
const PIT_VERSION* = "4.29.2"
const USAGE* = """Usage:
pit ( new | add) <summary> [<state>] [options]

View File

@@ -19,8 +19,11 @@ type
lastUpdatedAt*: DateTime
archivedAt*: Option[DateTime]
tags*: seq[string]
context*: Option[string]
parent*: Option[string]
priority*: Option[string]
project*: Option[string]
properties*: JsonNode
milestone*: Option[string]
hideUntil*: Option[DateTime]
@@ -32,7 +35,7 @@ proc fromJsonHook(dt: var DateTime, n: JsonNode): void =
#func `%`*(p: Project): JsonNode = toJson(p)
func `%`*(t: ServerTask): JsonNode = toJson(t)
proc `%`*(t: ServerTask): JsonNode = toJson(t)
proc toServerTask(i: Issue): ServerTask =
@@ -42,9 +45,18 @@ proc toServerTask(i: Issue): ServerTask =
details: i.details,
state: $i.state,
tags: i.tags,
properties: %i.properties,
context:
if i.hasProp("context"): some(i["context"])
else: none[string](),
lastUpdatedAt:
if i.hasProp("last-updated"): parseIso8601(i["last-updated"])
else: now(),
parent:
if i.hasProp("parent"): some(i["parent"])
else: none[string](),
priority:
if i.hasProp("priority"): some(i["priority"])
else: none[string](),
@@ -76,7 +88,7 @@ proc initSyncContext*(pit: PitConfig, syncConfig: JsonNode): PbmVsbSyncContext =
proc fetchServerTasks*(ctx: PbmVsbSyncContext): seq[ServerTask] =
result = newSeq[ServerTask]()
let url = ctx.apiBaseUrl & "/tasks"
let url = ctx.apiBaseUrl & "/tasks?context=" & ctx.issueContext
debug "Fetching tasks from server:\n\t" & url
let resp = ctx.http.get(url)