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

[stable27] Refactor attachment loading #5087

Merged
merged 26 commits into from
Dec 6, 2023
Merged

Conversation

mejo-
Copy link
Member

@mejo- mejo- commented Dec 5, 2023

Manual backport of #5042

@mejo- mejo- added this to the Nextcloud 27.1.5 milestone Dec 5, 2023
@mejo- mejo- added the bug Something isn't working label Dec 5, 2023
@mejo- mejo- changed the base branch from main to stable27 December 5, 2023 15:27
@mejo- mejo- force-pushed the backport/5042/stable27 branch 2 times, most recently from 6c04c15 to a37baa0 Compare December 5, 2023 16:11
@mejo-
Copy link
Member Author

mejo- commented Dec 5, 2023

/compile

@mejo-
Copy link
Member Author

mejo- commented Dec 5, 2023

/compile

This format was only used from 03.01.2022 to 23.05.2022.

Signed-off-by: Jonas <[email protected]>
`AttachmentResolver` only returns one candidate now.

Signed-off-by: Jonas <[email protected]>
* 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 <[email protected]>
* `getMetadata()` from AttachmentResolver class.
* `isSupportedImage` logic from ImageView node. Was never used.
* `hasPreview=true` logic from AttachmentResolver class.

Signed-off-by: Jonas <[email protected]>
Required for AttachmentResolver to fetch list of attachments for
the document.

Signed-off-by: Jonas <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
Also don't set any davPath at all in public share. We probably don't
have DAV access there anyway.

Signed-off-by: Jonas <[email protected]>
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 <[email protected]>
Required for the file attachment download test to succeed.

Signed-off-by: Jonas <[email protected]>
@mejo-
Copy link
Member Author

mejo- commented Dec 5, 2023

/compile

Signed-off-by: nextcloud-command <[email protected]>
@mejo- mejo- merged commit 00698a7 into stable27 Dec 6, 2023
35 checks passed
@mejo- mejo- deleted the backport/5042/stable27 branch December 6, 2023 09:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2. developing bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants