Trello: Include non upload attachments #2261

Merged
konrad merged 6 commits from Elscrux/vikunja:feature/trello-non-upload-attachements into main 2024-04-10 22:12:09 +00:00
Contributor

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.

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.
Elscrux added 1 commit 2024-04-09 16:52:10 +00:00
Trello: Include non upload attachments
All checks were successful
continuous-integration/drone/pr Build is passing
a84f7a5a7f
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.
Member

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!

Beep boop, I'm a bot.

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! > Beep boop, I'm a bot.
konrad requested changes 2024-04-09 20:50:27 +00:00
Dismissed
@ -342,0 +364,4 @@
task.Attachments = append(task.Attachments, vikunjaAttachment)
log.Debugf("[Trello Migration] Downloaded card attachment %s", attachment.ID)
} else {
Owner

Nitpick: please use a continue here and get rid of the else. Makes it more idiomatic.

Nitpick: please use a `continue` here and get rid of the `else`. Makes it more idiomatic.
konrad marked this conversation as resolved
@ -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
Owner

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

`<p><a href="` + attachment.URL + `">` + attachment.Name + `</a></p>`+"\n"
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 ``` `<p><a href="` + attachment.URL + `">` + attachment.Name + `</a></p>`+"\n" ```
konrad marked this conversation as resolved
Elscrux added 2 commits 2024-04-10 12:03:15 +00:00
Append attachments instead of prepending
Some checks failed
continuous-integration/drone/pr Build is failing
5cb8179fa3
Elscrux added 1 commit 2024-04-10 12:04:28 +00:00
Fix test
All checks were successful
continuous-integration/drone/pr Build is passing
0e93ec1529
konrad reviewed 2024-04-10 21:35:24 +00:00
@ -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"
Owner

Please use attachment.Name as the link text here.

Please use `attachment.Name` as the link text here.
Owner

Or maybe use the url as fallback, but if the attachment has a name that should be preferred.

Or maybe use the url as fallback, but if the attachment has a name that should be preferred.
konrad marked this conversation as resolved
Elscrux added 1 commit 2024-04-10 21:43:09 +00:00
Use name for display
Some checks failed
continuous-integration/drone/pr Build is failing
8b5f20da4a
konrad approved these changes 2024-04-10 21:55:32 +00:00
konrad left a comment
Owner

Thanks!

Thanks!
konrad scheduled this pull request to auto merge when all checks succeed 2024-04-10 21:56:03 +00:00
Owner

Please fix the test.

Please fix the test.
Elscrux added 1 commit 2024-04-10 21:59:15 +00:00
Fix test
All checks were successful
continuous-integration/drone/pr Build is passing
036a188a23
konrad merged commit 61ee0bd5e2 into main 2024-04-10 22:12:09 +00:00
Sign in to join this conversation.
No description provided.