auto-create users on mention and resolve user refs in relationships

This commit is contained in:
2026-03-27 18:11:13 +01:00
parent 74cc7c104a
commit 9b250c20f9
3 changed files with 69 additions and 6 deletions

View File

@@ -107,7 +107,7 @@ func PrintNodes(w io.Writer, nodes []*models.Node, jsonOut bool) error {
render(prioRM, n.GetProperty("prio"), true),
render(statusRM, n.GetProperty("status"), true),
render(typeRM, n.GetProperty("type"), true),
cTitle.Sprint(truncate(n.Title, 35)),
cTitle.Sprint(truncate(n.Title, 80)),
cDim.Sprint("["+n.GetProperty("namespace")+"]"),
)
if len(tags) > 0 {
@@ -147,14 +147,14 @@ func PrintNode(w io.Writer, n *models.Node, jsonOut bool) error {
}
if tags := getDisplayTags(n); len(tags) > 0 {
fmt.Fprintf(w, "\n tags: %s\n\n", cPrimary.Sprint(strings.Join(tags, " • ")))
fmt.Fprintf(w, "\n tags: %s\n", cPrimary.Sprint(strings.Join(tags, " • ")))
}
if db, err := db.GetDB(); err == nil {
if len(n.Relations) > 0 {
for relType, ids := range n.Relations {
fmt.Fprintf(w, " %s\n", string(relType))
if relIcon, ok := relIcons[string(relType)]; ok && relType != "created" {
if relIcon, ok := relIcons[string(relType)]; ok {
fmt.Fprintf(w, "\n %s\n", string(relType))
for _, id := range ids {
node, err := db.NodeByID(id)
if err == nil {
@@ -167,7 +167,7 @@ func PrintNode(w io.Writer, n *models.Node, jsonOut bool) error {
} else {
fmt.Fprintf(w, "failed to attach to db: %v", err)
}
fmt.Fprintln(w)
return nil
}