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

Open image, video, audio and PDF attachments with viewer #7066

Merged
merged 1 commit into from
Sep 2, 2022

Conversation

ChristophWurst
Copy link
Member

@ChristophWurst ChristophWurst commented Aug 22, 2022

Fixes #6983

Tested media

  • PDFs
  • JPEG
  • GIF
  • OGG
  • MP4

How to test

  1. Create an account
  2. Send an email to yourself with various attachments
  3. Open the email
  4. Click the attachment - it will open if its supported

@ChristophWurst ChristophWurst self-assigned this Aug 22, 2022
@ChristophWurst ChristophWurst changed the title Open attachments with viewer Open image and PDF attachments with viewer Aug 25, 2022
@ChristophWurst ChristophWurst changed the title Open image and PDF attachments with viewer Open image, video, audio and PDF attachments with viewer Aug 25, 2022
@ChristophWurst ChristophWurst added this to the v1.14.0 milestone Aug 31, 2022
@ChristophWurst ChristophWurst requested review from GretaD, kesselb and JuliaKirschenheuter and removed request for GretaD August 31, 2022 12:46
@ChristophWurst ChristophWurst marked this pull request as ready for review August 31, 2022 12:47
@GretaD
Copy link
Contributor

GretaD commented Sep 1, 2022

i am having this error when i click the attachment(all of the formats)

`vue.runtime.esm.js:4573 [Vue warn]: Error in v-on handler: "TypeError: Cannot read properties of undefined (reading 'startsWith')"

found in

---> <MessageAttachment> at src/components/MessageAttachment.vue
       <MessageAttachments> at src/components/MessageAttachments.vue
         <Message> at src/components/Message.vue
           <ThreadEnvelope> at src/components/ThreadEnvelope.vue
             <NcAppContentDetails>
               <Thread> at src/components/Thread.vue
                 <Pane>
                   <Splitpanes>
                     <NcAppContent>
                       <MailboxThread> at src/components/MailboxThread.vue
                         <Content>
                           <Home> at src/views/Home.vue
                             <App> at src/App.vue
                               <Root>`

@GretaD
Copy link
Contributor

GretaD commented Sep 1, 2022

Screenshot from 2022-09-01 15-42-23

@ChristophWurst
Copy link
Member Author

Inspect the MessagesAttachemnts component. It has a fileInfos computed prop. Do all objects in the array have a mime property?

Copy link
Contributor

@JuliaKirschenheuter JuliaKirschenheuter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

works well!

@JuliaKirschenheuter
Copy link
Contributor

i am having this error when i click the attachment(all of the formats)

i've checked it too but can't reproduce it

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
@ChristophWurst ChristophWurst merged commit fd37f6b into main Sep 2, 2022
@ChristophWurst ChristophWurst deleted the enhancement/viewer-attachments branch September 2, 2022 17:09
@sazanof
Copy link
Collaborator

sazanof commented Sep 5, 2022

#7066 (comment)
Maybe because

image

open({ path, list = [], loadMore = () => ([]), canLoop = true, onPrev = () => {}, onNext = () => {}, onClose = () => {} } = {}) {

that an object is passed instead of string (path variable === fileInfo)?

Inspect the MessagesAttachemnts component. It has a fileInfos computed prop. Do all objects in the array have a mime property?

Yep.
image

@ChristophWurst
Copy link
Member Author

Requires nextcloud/viewer#1338

Pull the latest master of https://github.com/nextcloud/viewer/. It now allows passing a fileinfo object, not just paths.

@sazanof
Copy link
Collaborator

sazanof commented Sep 5, 2022

Requires nextcloud/viewer#1338

Pull the latest master of https://github.com/nextcloud/viewer/. It now allows passing a fileinfo object, not just paths.

Yes, thank you. Now images are open in modal correct. But only images, not PDF or audio files.

canPreview is false, because application/pdf not found in OCA.Viewer.mimetypes

UPD. because

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Render PDF attachments
4 participants