Support for syncing all properties (including context) to Probatem's Virtual Status Board.

This commit is contained in:
2025-08-02 22:44:04 -05:00
parent 85d561c8a5
commit 3ee5bdf8fd
3 changed files with 13 additions and 5 deletions

View File

@@ -1,6 +1,6 @@
# Package
version = "4.29.1"
version = "4.29.2"
author = "Jonathan Bernard"
description = "Personal issue tracker."
license = "MIT"

View File

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

View File

@@ -19,9 +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]
@@ -33,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 =
@@ -43,6 +45,12 @@ 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(),
@@ -80,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)