From 86983f50d4338cbffa3622585331b32cf35e0287 Mon Sep 17 00:00:00 2001 From: Christoph Ritzer Date: Sat, 9 Mar 2024 09:01:02 +0000 Subject: [PATCH] fix(migration): Trello checklists (#2140) Trello checklists are now properly converted to html checklists and put into the description. Co-authored-by: kolaente Reviewed-on: https://kolaente.dev/vikunja/vikunja/pulls/2140 Reviewed-by: konrad Co-authored-by: Christoph Ritzer Co-committed-by: Christoph Ritzer --- pkg/modules/migration/trello/trello.go | 10 +++++----- pkg/modules/migration/trello/trello_test.go | 14 ++++++++------ 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/pkg/modules/migration/trello/trello.go b/pkg/modules/migration/trello/trello.go index 0ae4edd8a..676201b90 100644 --- a/pkg/modules/migration/trello/trello.go +++ b/pkg/modules/migration/trello/trello.go @@ -248,17 +248,17 @@ func convertTrelloDataToVikunja(trelloData []*trello.Board, token string) (fullV // Checklists (as markdown in description) for _, checklist := range card.Checklists { - task.Description += "\n\n## " + checklist.Name + "\n" + task.Description += "\n\n

" + checklist.Name + "

\n\n" + `
    ` for _, item := range checklist.CheckItems { - task.Description += "\n* " + task.Description += "\n" if item.State == "complete" { - task.Description += "[x]" + task.Description += `
  • ` + item.Name + `

  • ` } else { - task.Description += "[ ]" + task.Description += `
  • ` + item.Name + `

  • ` } - task.Description += " " + item.Name } + task.Description += "
" } if len(card.Checklists) > 0 { log.Debugf("[Trello Migration] Converted %d checklists from card %s", len(card.Checklists), card.ID) diff --git a/pkg/modules/migration/trello/trello_test.go b/pkg/modules/migration/trello/trello_test.go index 020ab5399..2b4c6af1e 100644 --- a/pkg/modules/migration/trello/trello_test.go +++ b/pkg/modules/migration/trello/trello_test.go @@ -249,15 +249,17 @@ func TestConvertTrelloToVikunja(t *testing.T) { Title: "Test Card 2", Description: ` -## Checkproject 1 +

Checkproject 1

-* [ ] Pending Task -* [x] Completed Task +
    +
  • Pending Task

  • +
  • Completed Task

-## Checkproject 2 +

Checkproject 2

-* [ ] Pending Task -* [ ] Another Pending Task`, +
    +
  • Pending Task

  • +
  • Another Pending Task

`, BucketID: 1, KanbanPosition: 124, },