Support for syncing all properties (including context) to Probatem's Virtual Status Board.
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
# Package
|
# Package
|
||||||
|
|
||||||
version = "4.29.1"
|
version = "4.29.2"
|
||||||
author = "Jonathan Bernard"
|
author = "Jonathan Bernard"
|
||||||
description = "Personal issue tracker."
|
description = "Personal issue tracker."
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
const PIT_VERSION* = "4.29.1"
|
const PIT_VERSION* = "4.29.2"
|
||||||
|
|
||||||
const USAGE* = """Usage:
|
const USAGE* = """Usage:
|
||||||
pit ( new | add) <summary> [<state>] [options]
|
pit ( new | add) <summary> [<state>] [options]
|
||||||
|
@@ -19,9 +19,11 @@ type
|
|||||||
lastUpdatedAt*: DateTime
|
lastUpdatedAt*: DateTime
|
||||||
archivedAt*: Option[DateTime]
|
archivedAt*: Option[DateTime]
|
||||||
tags*: seq[string]
|
tags*: seq[string]
|
||||||
|
context*: Option[string]
|
||||||
parent*: Option[string]
|
parent*: Option[string]
|
||||||
priority*: Option[string]
|
priority*: Option[string]
|
||||||
project*: Option[string]
|
project*: Option[string]
|
||||||
|
properties*: JsonNode
|
||||||
milestone*: Option[string]
|
milestone*: Option[string]
|
||||||
hideUntil*: Option[DateTime]
|
hideUntil*: Option[DateTime]
|
||||||
|
|
||||||
@@ -33,7 +35,7 @@ proc fromJsonHook(dt: var DateTime, n: JsonNode): void =
|
|||||||
|
|
||||||
|
|
||||||
#func `%`*(p: Project): JsonNode = toJson(p)
|
#func `%`*(p: Project): JsonNode = toJson(p)
|
||||||
func `%`*(t: ServerTask): JsonNode = toJson(t)
|
proc `%`*(t: ServerTask): JsonNode = toJson(t)
|
||||||
|
|
||||||
|
|
||||||
proc toServerTask(i: Issue): ServerTask =
|
proc toServerTask(i: Issue): ServerTask =
|
||||||
@@ -43,6 +45,12 @@ proc toServerTask(i: Issue): ServerTask =
|
|||||||
details: i.details,
|
details: i.details,
|
||||||
state: $i.state,
|
state: $i.state,
|
||||||
tags: i.tags,
|
tags: i.tags,
|
||||||
|
properties: %i.properties,
|
||||||
|
|
||||||
|
context:
|
||||||
|
if i.hasProp("context"): some(i["context"])
|
||||||
|
else: none[string](),
|
||||||
|
|
||||||
lastUpdatedAt:
|
lastUpdatedAt:
|
||||||
if i.hasProp("last-updated"): parseIso8601(i["last-updated"])
|
if i.hasProp("last-updated"): parseIso8601(i["last-updated"])
|
||||||
else: now(),
|
else: now(),
|
||||||
@@ -80,7 +88,7 @@ proc initSyncContext*(pit: PitConfig, syncConfig: JsonNode): PbmVsbSyncContext =
|
|||||||
|
|
||||||
proc fetchServerTasks*(ctx: PbmVsbSyncContext): seq[ServerTask] =
|
proc fetchServerTasks*(ctx: PbmVsbSyncContext): seq[ServerTask] =
|
||||||
result = newSeq[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
|
debug "Fetching tasks from server:\n\t" & url
|
||||||
let resp = ctx.http.get(url)
|
let resp = ctx.http.get(url)
|
||||||
|
Reference in New Issue
Block a user