fix(migration): make sure trello checklists are properly imported
This commit is contained in:
parent
ca6d1946da
commit
168287923f
@ -133,6 +133,24 @@ func getTrelloData(token string) (trelloData []*trello.Board, err error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(card.IDCheckLists) > 0 {
|
||||||
|
for _, checkListID := range card.IDCheckLists {
|
||||||
|
checklist, err := client.GetChecklist(checkListID, allArg)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
checklist.CheckItems = []trello.CheckItem{}
|
||||||
|
err = client.Get("checklists/"+checkListID+"/checkItems", allArg, &checklist.CheckItems)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
card.Checklists = append(card.Checklists, checklist)
|
||||||
|
log.Debugf("Retrieved checklist %s for card %s", checkListID, card.ID)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
list.Cards = append(list.Cards, card)
|
list.Cards = append(list.Cards, card)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -214,7 +232,7 @@ func convertTrelloDataToVikunja(trelloData []*trello.Board, token string) (fullV
|
|||||||
|
|
||||||
for _, item := range checklist.CheckItems {
|
for _, item := range checklist.CheckItems {
|
||||||
task.Description += "\n* "
|
task.Description += "\n* "
|
||||||
if item.State == "completed" {
|
if item.State == "complete" {
|
||||||
task.Description += "[x]"
|
task.Description += "[x]"
|
||||||
} else {
|
} else {
|
||||||
task.Description += "[ ]"
|
task.Description += "[ ]"
|
||||||
|
@ -86,7 +86,7 @@ func TestConvertTrelloToVikunja(t *testing.T) {
|
|||||||
Name: "Pending Task",
|
Name: "Pending Task",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
State: "completed",
|
State: "complete",
|
||||||
Name: "Completed Task",
|
Name: "Completed Task",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user