-
-
Notifications
You must be signed in to change notification settings - Fork 264
feat: Activity log for uploading attachments (closes #354) #366
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: Activity log for uploading attachments (closes #354) #366
Conversation
| await cardActivityRepo.create(ctx.db, { | ||
| type: "card.updated.attachment.added", | ||
| cardId: card.id, | ||
| toTitle: input.originalFilename, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of hijacking the toTitle column we should extend the card_activity schema to reference attachmentId and join onto card_attachment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can then reference filename directly - also it will give us more flexibility to include other info on the upload attachment in future
| if (type === "card.updated.attachment.added" && toTitle) { | ||
| return ( | ||
| <Trans> | ||
| added attachment <TextHighlight>{truncate(toTitle)}</TextHighlight> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't forget to include a fallback if filename doesn't exist (for activities created before these changes)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added an attachment is probably fine
hjball
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work @program-the-brain-not-the-heartbeat, I've left a few comments but otherwise lgtm
|
Sounds good @hjball, I will take a look at this again tomorrow. For the I think for most use cases, 1mb form data + attachment size will work and not affect nginx or returning 413 too large http status code. |
|
Is this still in draft? @program-the-brain-not-the-heartbeat |
|
Yes, @hjball -- I want to do some more testing before publishing. |
This PR adds the UI functionality for activity logs for adding and removing attachments to a card.
The backend already created database rows for the attachment, it just wasn't rendered on the frontend.
This closes #354
Things to note:
const MAX_SIZE_BYTES = 50 * 1024 * 1024; // 50MBhardcoded and does not respectNEXT_API_BODY_SIZE_LIMIT, made aFIXMEcomment.NEXT_API_BODY_SIZE_LIMITdoes not look like it is utilized anywhere in the code.