Skip to content
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

Attachments v2 #1813

Open
wants to merge 180 commits into
base: main
Choose a base branch
from
Open

Attachments v2 #1813

wants to merge 180 commits into from

Conversation

rafalp
Copy link
Owner

@rafalp rafalp commented Sep 10, 2024

This PR implements new attachments feature as misago.attachments app, making misago.threads smaller. Also brings attachments feature closer to the industry standard.

Fixes #1805, #1813, and #1812

Also does part of the #1801

TODO

  • Create misago.attachments app
  • Move attachments data from misago.threads
  • Make attachment types hardcoded in misago.attachments
  • Write tests for the Attachment model
  • Move attachments admin to misago.admin
  • Validate that image type attachment is supported by Pillow
  • Store uploaded file as attachment
  • Store image dimensions on model
  • Plugin hook for initial attachment plugin_data
  • Let admins configure thumbnail dimensions
  • Add setting to disable attachments uploads globally
  • Add setting to disable attachments uploads in private threads
  • Add permission for uploading attachments in private threads
  • Pass attachments permissions to the PostForm
  • Pass attachments permissions to the PostForm in private threads
  • Test PostForm attachments handling logic
  • Test posting formsets
  • Update start thread posting state
  • Update post reply posting state
  • Update edit posting state
  • Show is_deleted flag in admin
  • Management command that deletes flagged attachments
  • Management command that deletes old temp attachments
  • Utility for deleting attachments
  • Utility for deleting user's attachments
  • Utility for deleting thread's attachments
  • Utility for deleting post's attachments
  • Utility for deleting category's attachments
  • Test decorator for deleting attachment files at the end of test
  • Update delete category actions to use new deletion utils
  • Update delete user actions to use new deletion utils
  • Include attachments in the GDPR data dump
  • Resize textareas to accomodate new attachment UI
  • Gateway attachment files behind permission check
  • Option to use NGINX X-Accel-Redirect to secure downloads
  • Create "category with all relations" fixture with asserts for tests
  • Open attachments on a dedicated page
  • Limit space for all unused attachments
  • Limit space for user's attachments
  • Limit space for user's unused attachments
  • Delete attachments from their detail page
  • Display list of allowed attachment types in admin (as a reference)
  • Display attachments storage usage on admin dashboard
  • Add setting for naming disallowed file types uploads
  • View your attachments space usage in account settings
  • Browse your attachments in account settings
  • Delete your attachments from account settings
  • Display and find broken attachments in admin attachments list
  • Add upload API to attachments app
  • Add <attachment=filename.jpg:123> syntax to messages parser
  • Insert attachments in editor's textarea
  • Embed attachments in post body
  • Display not embedded attachments under post's body
  • Embed attachments in post preview
  • Use lightbox for viewing attachments, investigate PhotoSwipe
  • Upload attachments with PostForm (without JavaScript)
  • Delete attachments from new post (without JavaScript)
  • Delete attachments from edited post (without JavaScript)
  • Upload attachments with PostForm (with JavaScript)
  • Upload attachments with PostForm (JavaScript + paste file)
  • Upload attachments with PostForm (JavaScript + drag and drop)
  • Delete attachments from new post (with JavaScript)
  • Delete attachments from edited post (with JavaScript)
  • Replace attachments links in existing posts with new syntax
  • Reparse existing posts with new parser (see Reparse existing posts using new parser #1723)

Posting forms

Manually verify and write tests for file uploads and deletion on those forms:

Scenarios to test

  • User with permission sees upload UI
  • User without permission doesn't see upload UI
  • User sees insert attachments UI
  • User can upload new attachment without JS
  • User can upload new attachment with JS
  • User can delete attachment he has permission to

Views to test:

  • Start thread
  • Start private thread
  • Reply thread
  • Reply private thread
  • Quick reply thread
  • Quick reply private thread
  • Edit thread
  • Edit private thread
  • Edit thread post
  • Edit private thread post
  • Inline edit thread
  • Inline edit private thread
  • Inline edit thread post
  • Inline edit private thread post

@rafalp rafalp added the area: backend This issue involves Python, Django or dependency (eg. database) label Sep 10, 2024
@rafalp rafalp added this to the Next feature release milestone Sep 10, 2024
@rafalp rafalp self-assigned this Sep 10, 2024
@rafalp rafalp added the feature: admin Affects admin control panel label Sep 10, 2024
@rafalp rafalp force-pushed the fix-1805-move-attachemts-to-app branch from 0cc2750 to 96fb0a4 Compare September 15, 2024 09:25
@rafalp rafalp added the feature: posting Start/reply/edit flows label Oct 29, 2024
@rafalp rafalp force-pushed the fix-1805-move-attachemts-to-app branch from 96fb0a4 to ef1b351 Compare January 5, 2025 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: backend This issue involves Python, Django or dependency (eg. database) feature: admin Affects admin control panel feature: posting Start/reply/edit flows
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move attachments from misago.threads to misago.attachments.
2 participants