Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
e903edf
refactor(AttachmentService): Some code style cleanup
mejo- Oct 25, 2023
8682d60
chore(attachments): Remove support for obsolete `text://` format
mejo- Oct 31, 2023
75ec895
feat(attachments): API endpoint to get list of attachments for a docu…
mejo- Oct 25, 2023
264aa76
chore(attachments): Remove obsolete metadata API endpoint
mejo- Nov 15, 2023
2f78829
feat(attachments): Use getAttachmentList API endpoint in resolver
mejo- Oct 31, 2023
b288c85
fix(attachment): Remove candidate logic from ImageView node
mejo- Nov 15, 2023
13cea83
fix(attachments): Fix some issues with the showimage modal
mejo- Nov 21, 2023
d8842a6
chore(attachments): Remove obsolete code
mejo- Nov 21, 2023
0bc3556
feat(editor): Allow to pass fileId to MarkdownContentEditor
mejo- Nov 21, 2023
0f2b874
feat(attachments): Allow to get attachments without document session
mejo- Nov 22, 2023
9b9e876
chore(attachments): Remove special-handling for preview URLs
mejo- Nov 22, 2023
d95d6b2
fix(attachments): Open non-image attachments in viewer or download
mejo- Nov 22, 2023
337724d
fix(AttachmentController): Set fileName of returned attachments
mejo- Nov 27, 2023
7a32d8e
chore(composer): Update autoloader maps
mejo- Nov 27, 2023
597b8d5
fix(attachments): Fix encoding of attachment URI component
mejo- Nov 27, 2023
98a47c3
test(cy): Test to open image in modal and download attachment
mejo- Nov 28, 2023
adf5fe8
chore(middleware): Rename to RequireDocumentSessionOrUserOrShareToken
mejo- Nov 28, 2023
88c8810
fix(attachments): use `getRelativePath` from userFolder for `davPath`
mejo- Nov 28, 2023
6864890
test(AttachmentResolver): Refactor jest tests after parent class refa…
mejo- Nov 28, 2023
6a46001
fix(attachments): Show all loaded images in ShowImageModal
mejo- Nov 28, 2023
e632d72
fix(SessionMiddleware): Check if user/share have access to document
mejo- Nov 29, 2023
b3be90a
fix(AttachmentResolver): Require either fileId or session
mejo- Nov 29, 2023
e391298
reactor(ImageView): Simplify attachmentType/isMediaAttachment logic
mejo- Nov 29, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(AttachmentResolver): Require either fileId or session
Signed-off-by: Jonas <[email protected]>
  • Loading branch information
mejo- authored and backportbot-nextcloud[bot] committed Nov 29, 2023
commit b3be90aba7d1b4fe27a2f2d40fe0fd5ce95d5ee8
2 changes: 1 addition & 1 deletion src/services/AttachmentResolver.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export default class AttachmentResolver {
this.#user = user
this.#shareToken = shareToken
this.#currentDirectory = currentDirectory
this.#documentId = fileId ?? session?.documentId
this.#documentId = fileId ?? session.documentId
this.#initAttachmentListPromise = this.#updateAttachmentList()
}

Expand Down
6 changes: 3 additions & 3 deletions src/tests/services/AttachmentResolver.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ describe('Image resolver', () => {
const shareToken = 'myShareToken'

it('is a class with one constructor argument', () => {
const resolver = new AttachmentResolver({})
const resolver = new AttachmentResolver({ fileId })
expect(resolver).toBeInstanceOf(AttachmentResolver)
})

Expand All @@ -65,7 +65,7 @@ describe('Image resolver', () => {
'https://nextcloud.com/pic.jpg',
'data:4173456789ASDF',
]
const resolver = initAttachmentResolver({ })
const resolver = initAttachmentResolver({ fileId })
for (const src of sources) {
const attachment = await resolver.resolve(src)
expect(attachment.isImage).toBe(true)
Expand All @@ -84,7 +84,7 @@ describe('Image resolver', () => {

it('handles non-native urls wia webdav', async () => {
const src = `/path/to/some image.png`
const resolver = new AttachmentResolver({ user, currentDirectory })
const resolver = new AttachmentResolver({ fileId, user, currentDirectory })
const attachment = await resolver.resolve(src)
expect(attachment.isImage).toBe(true)
expect(attachment.previewUrl).toBe('http://localhost/nc-webroot/remote.php/dav/files/user-uid/parentDir/path/to/some%20image.png')
Expand Down