Trello: Include non upload attachments #2261
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "Elscrux/vikunja:feature/trello-non-upload-attachements"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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 prepended to the Vikunja description.
This code was already tested in a migration and the unit tests were also extended.
Hi Elscrux!
Thank you for creating a PR!
I've deployed the frontend changes of this PR on a preview environment under this URL: https://2261-feature-trello-non-upload-attach--vikunja-frontend-preview.netlify.app
You can use this url to view the changes live and test them out.
You will need to manually connect this to an api running somewhere. The easiest to use is https://try.vikunja.io/.
This preview does not contain any changes made to the api, only the frontend.
Have a nice day!
@ -342,0 +364,4 @@
task.Attachments = append(task.Attachments, vikunjaAttachment)
log.Debugf("[Trello Migration] Downloaded card attachment %s", attachment.ID)
} else {
Nitpick: please use a
continue
here and get rid of theelse
. Makes it more idiomatic.@ -342,0 +366,4 @@
log.Debugf("[Trello Migration] Downloaded card attachment %s", attachment.ID)
} else {
// Other links are not attachments in Vikunja, but we can add them to the description
task.Description = "<p><a href=\"" + attachment.URL + "\">" + attachment.URL + "</a></p>\n" + task.Description
Please change this so that the attachments are appended to the description, not added in front of the rest.
Please also refactor the string concatenation to something like
@ -368,2 +370,2 @@
log.Debugf("[Trello Migration] Downloaded card attachment %s", attachment.ID)
// Other links are not attachments in Vikunja, but we can add them to the description
task.Description += `<p><a href="` + attachment.URL + `">` + attachment.URL + "</a></p>\n"
Please use
attachment.Name
as the link text here.Or maybe use the url as fallback, but if the attachment has a name that should be preferred.
Thanks!
Please fix the test.