Copied URL results in "missing or malformed jwt" #3224
Labels
No Label
area/internal-code
changes requested
confirmed
dependencies
duplicate
good first issue
help wanted
hosting
invalid
kind/bug
kind/feature
question
wontfix
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: vikunja/frontend#3224
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
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?
Description
I want to add a link to an attachment to the task description.
next I click the copy URL link below the attachment and add a link to the description like this:
When I click that link in the description afterwards, I get a new window with a JSON message:
Vikunja Frontend Version
0.20.3
Vikunja API Version
v0.20.2
Browser and version
Firefox 110.0.1 (64-Bit) / Windows 11
Can you reproduce the bug on the Vikunja demo site?
Yes
Screenshots
My instance:
Try.vikunja.io
That's a limitation of the api. I think we could solve this by intercepting links to attachments and downloading them as we do when clicking on the download button. We already do something like that for images embedded in the description or comments.
You mean what you do here: https://kolaente.dev/vikunja/frontend/src/branch/main/src/helpers/markdownRenderer.ts#L17-L19
must be also done here: https://kolaente.dev/vikunja/frontend/src/branch/main/src/helpers/markdownRenderer.ts#L33-L35
Right?
Pretty much, but then also need to add an event handler to the link object so that it will download the attachment when clicking on it.
I just gave it a try but I don't see how I could achieve this in a .ts file (markdownRenderer.ts).
Looking at components/tasks/partials/attachments.vue I see that there's a
@click="viewOrDownload(a)"
but thats a .vue file.So I think I can't send a PR 🤷♂️
But if you fix it I'll look closely at your solution and hopefully learn something new 😅
The part for adding an event listener to the links is similar to this one here: https://kolaente.dev/vikunja/frontend/src/branch/main/src/components/input/editor.vue#L268-L275 (adding a change handler to the checkboxes to make checklists work).
Basically, this has a few steps:
The first could be done here as well - just
querySelect
all link elements in the editor scope and then check if they are linking to an attachment, then add the event handler to it.Copied URL resluts in "missing or malformed jwt"to Copied URL results in "missing or malformed jwt"😉
@dpschen 😆 Nasty typo
If the URL doesn't work as a limit of the API, would it be best to just not include the URL as a comment? Perhaps don't include a comment by default when including an attachment, or just say something like "attached 'image.png'" by default?
Just ran into this today and it's slightly awkward as a user...
Seems to be fixed in 0.21.0