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

Refactor attachment loading #5042

Merged
merged 23 commits into from
Nov 29, 2023
Merged

Refactor attachment loading #5042

merged 23 commits into from
Nov 29, 2023

Commits on Nov 29, 2023

  1. refactor(AttachmentService): Some code style cleanup

    Signed-off-by: Jonas <jonas@freesources.org>
    mejo- committed Nov 29, 2023
    Configuration menu
    Copy the full SHA
    271a59a View commit details
    Browse the repository at this point in the history
  2. chore(attachments): Remove support for obsolete text:// format

    This format was only used from 03.01.2022 to 23.05.2022.
    
    Signed-off-by: Jonas <jonas@freesources.org>
    mejo- committed Nov 29, 2023
    Configuration menu
    Copy the full SHA
    df3e4df View commit details
    Browse the repository at this point in the history
  3. feat(attachments): API endpoint to get list of attachments for a docu…

    …ment
    
    Signed-off-by: Jonas <jonas@freesources.org>
    mejo- committed Nov 29, 2023
    Configuration menu
    Copy the full SHA
    8c1c6e8 View commit details
    Browse the repository at this point in the history
  4. chore(attachments): Remove obsolete metadata API endpoint

    Signed-off-by: Jonas <jonas@freesources.org>
    mejo- committed Nov 29, 2023
    Configuration menu
    Copy the full SHA
    73cb49b View commit details
    Browse the repository at this point in the history
  5. feat(attachments): Use getAttachmentList API endpoint in resolver

    Signed-off-by: Jonas <jonas@freesources.org>
    mejo- committed Nov 29, 2023
    Configuration menu
    Copy the full SHA
    153a85f View commit details
    Browse the repository at this point in the history
  6. fix(attachment): Remove candidate logic from ImageView node

    `AttachmentResolver` only returns one candidate now.
    
    Signed-off-by: Jonas <jonas@freesources.org>
    mejo- committed Nov 29, 2023
    Configuration menu
    Copy the full SHA
    680ca1d View commit details
    Browse the repository at this point in the history
  7. fix(attachments): Fix some issues with the showimage modal

    * Only open images from native attachments list
    * Only open images, non-image attachments are not supported anyway
    * Fix watcher for `startIndex`
    * Don't set computed property `currentImage`
    * Show error if image cannot be found in attachments
    
    Signed-off-by: Jonas <jonas@freesources.org>
    mejo- committed Nov 29, 2023
    Configuration menu
    Copy the full SHA
    86e2b97 View commit details
    Browse the repository at this point in the history
  8. chore(attachments): Remove obsolete code

    * `getMetadata()` from AttachmentResolver class.
    * `isSupportedImage` logic from ImageView node. Was never used.
    * `hasPreview=true` logic from AttachmentResolver class.
    
    Signed-off-by: Jonas <jonas@freesources.org>
    mejo- committed Nov 29, 2023
    Configuration menu
    Copy the full SHA
    b274e37 View commit details
    Browse the repository at this point in the history
  9. feat(editor): Allow to pass fileId to MarkdownContentEditor

    Required for AttachmentResolver to fetch list of attachments for
    the document.
    
    Signed-off-by: Jonas <jonas@freesources.org>
    mejo- committed Nov 29, 2023
    Configuration menu
    Copy the full SHA
    a2813ae View commit details
    Browse the repository at this point in the history
  10. feat(attachments): Allow to get attachments without document session

    For all read-only attachments API endpoints, add support to authorize
    with user session or share token when no document session is available.
    
    Allows to get the attachments list and attachment files from
    MarkdownContentEditor.vue without a document session.
    
    Signed-off-by: Jonas <jonas@freesources.org>
    mejo- committed Nov 29, 2023
    Configuration menu
    Copy the full SHA
    bd54a68 View commit details
    Browse the repository at this point in the history
  11. chore(attachments): Remove special-handling for preview URLs

    We don't remember a legitimate reason why they would end up in a text
    document. Probably something that predate the attachments directory
    era.
    
    Signed-off-by: Jonas <jonas@freesources.org>
    mejo- committed Nov 29, 2023
    Configuration menu
    Copy the full SHA
    d15781c View commit details
    Browse the repository at this point in the history
  12. fix(attachments): Open non-image attachments in viewer or download

    When viewer is available, not in use and supports the mimetype, and
    we're not in a public share, open the attachment in viewer. Otherwise,
    download the attachment.
    
    Fixes: #3849
    Fixes: #4723
    Fixes: #5030
    
    Signed-off-by: Jonas <jonas@freesources.org>
    mejo- committed Nov 29, 2023
    Configuration menu
    Copy the full SHA
    e4108d4 View commit details
    Browse the repository at this point in the history
  13. fix(AttachmentController): Set fileName of returned attachments

    Signed-off-by: Jonas <jonas@freesources.org>
    mejo- committed Nov 29, 2023
    Configuration menu
    Copy the full SHA
    98ba0de View commit details
    Browse the repository at this point in the history
  14. chore(composer): Update autoloader maps

    Signed-off-by: Jonas <jonas@freesources.org>
    mejo- committed Nov 29, 2023
    Configuration menu
    Copy the full SHA
    dade37e View commit details
    Browse the repository at this point in the history
  15. fix(attachments): Fix encoding of attachment URI component

    Signed-off-by: Jonas <jonas@freesources.org>
    mejo- committed Nov 29, 2023
    Configuration menu
    Copy the full SHA
    7743591 View commit details
    Browse the repository at this point in the history
  16. test(cy): Test to open image in modal and download attachment

    Signed-off-by: Jonas <jonas@freesources.org>
    mejo- committed Nov 29, 2023
    Configuration menu
    Copy the full SHA
    ec91074 View commit details
    Browse the repository at this point in the history
  17. chore(middleware): Rename to RequireDocumentSessionOrUserOrShareToken

    Signed-off-by: Jonas <jonas@freesources.org>
    mejo- committed Nov 29, 2023
    Configuration menu
    Copy the full SHA
    b01c547 View commit details
    Browse the repository at this point in the history
  18. fix(attachments): use getRelativePath from userFolder for davPath

    Also don't set any davPath at all in public share. We probably don't
    have DAV access there anyway.
    
    Signed-off-by: Jonas <jonas@freesources.org>
    mejo- committed Nov 29, 2023
    Configuration menu
    Copy the full SHA
    a1f8308 View commit details
    Browse the repository at this point in the history
  19. test(AttachmentResolver): Refactor jest tests after parent class refa…

    …ctoring
    
    Signed-off-by: Jonas <jonas@freesources.org>
    mejo- committed Nov 29, 2023
    Configuration menu
    Copy the full SHA
    3ce2e44 View commit details
    Browse the repository at this point in the history
  20. fix(attachments): Show all loaded images in ShowImageModal

    Instead of just opening native image attachments, query the HTML
    document to get all loaded attachments (regardless whether native, via
    direct URL or via DAV) and list them.
    
    Signed-off-by: Jonas <jonas@freesources.org>
    mejo- committed Nov 29, 2023
    Configuration menu
    Copy the full SHA
    6796170 View commit details
    Browse the repository at this point in the history
  21. fix(SessionMiddleware): Check if user/share have access to document

    Signed-off-by: Jonas <jonas@freesources.org>
    mejo- committed Nov 29, 2023
    Configuration menu
    Copy the full SHA
    c7e0cf0 View commit details
    Browse the repository at this point in the history
  22. fix(AttachmentResolver): Require either fileId or session

    Signed-off-by: Jonas <jonas@freesources.org>
    mejo- committed Nov 29, 2023
    Configuration menu
    Copy the full SHA
    978cbc6 View commit details
    Browse the repository at this point in the history
  23. reactor(ImageView): Simplify attachmentType/isMediaAttachment logic

    Signed-off-by: Jonas <jonas@freesources.org>
    mejo- committed Nov 29, 2023
    Configuration menu
    Copy the full SHA
    77a0d4a View commit details
    Browse the repository at this point in the history