1
0

feat(migration): include non upload attachments from Trello (#2261)

This makes the Trello migrator include attachments that are not file uploads. To include them in Vikunja without missing data, their text (usually links) will be appended to the Vikunja description.

Co-authored-by: Elscrux <nickposer2102@gmail.com>
Reviewed-on: https://kolaente.dev/vikunja/vikunja/pulls/2261
Reviewed-by: konrad <k@knt.li>
Co-authored-by: Elscrux <elscrux@gmail.com>
Co-committed-by: Elscrux <elscrux@gmail.com>
This commit is contained in:
Elscrux
2024-04-10 22:12:06 +00:00
committed by konrad
parent 423558f58a
commit 61ee0bd5e2
2 changed files with 43 additions and 33 deletions

View File

@ -78,6 +78,13 @@ func getTestBoard(t *testing.T) ([]*trello.Board, time.Time) {
MimeType: "image/jpg",
URL: "https://vikunja.io/testimage.jpg",
},
{
ID: "7cc71b16f0c7a57bed3c94e9",
Name: "Website",
IsUpload: false,
MimeType: "",
URL: "https://vikunja.io",
},
},
},
{
@ -265,10 +272,11 @@ func TestConvertTrelloToVikunja(t *testing.T) {
Tasks: []*models.TaskWithComments{
{
Task: models.Task{
Title: "Test Card 1",
Description: "<p>Card Description <strong>bold</strong></p>\n",
BucketID: 1,
DueDate: time1,
Title: "Test Card 1",
Description: "<p>Card Description <strong>bold</strong></p>\n" +
"<p><a href=\"https://vikunja.io\">Website</a></p>\n",
BucketID: 1,
DueDate: time1,
Labels: []*models.Label{
{
Title: "Label 1",
@ -481,6 +489,6 @@ func TestCreateOrganizationMap(t *testing.T) {
},
}
if diff, equal := messagediff.PrettyDiff(organizationMap, expectedMap); !equal {
t.Errorf("converted trello data = %v,\nwant %v,\ndiff: %v", organizationMap, expectedMap, diff)
t.Errorf("converted organization map = %v,\nwant %v,\ndiff: %v", organizationMap, expectedMap, diff)
}
}