-
Notifications
You must be signed in to change notification settings - Fork 95
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
feat: show images in a document with the viewer #2924
feat: show images in a document with the viewer #2924
Conversation
@luka-nextcloud Please fix the eslint issues. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- The directory path for the first PROPFIND is wrong. It seems it looks for
STORAGE_ROOT/ATTACHMENT_DIR_NAME
so it only works for documents in user's storage root. - This will not work when accessing the document via a shared access. We could use the endpoints provided by the attachment controller. These are public endpoints using the Text edition session to authenticate. I can help in this department if needed.
You could use #getImageAttachmentUrl()
in src/services/AttachmentResolver.js
which ends up getting the image from AttachmentController::getImageFile()
.
Problem is that this method only returns a preview for now. We could add a parameter to choose between raw content or preview.
There is still the special case of images which can't be displayed but for which there is a preview provider. So in this case, the preview would be a fallback even if asking the raw image.
#2974 might help here. You could get the image URL with |
@luka-nextcloud #2974 is merged now 😁 |
550139d
to
19407b3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nicely done!
- A few remaining eslint warnings and errors (
npm run lint
) - The image could use all the available space and avoid overflow. See inline basic style suggestion.
- The dav helper is not used anymore and could be removed IMO
- Pressing escape closes the modal and the document (the viewer). @max-nextcloud @vinicius73 Do you know if there is any way to avoid that?
- some other inline comments
19407b3
to
14ca32b
Compare
Test summaryRun details
View run in Cypress Dashboard ➡️ This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@luka-nextcloud 👍 We're close. There's still an overflow issue when the image height is too big. It would be nice to get something like in the previous screencast: that the image is entirely visible, takes the most space possible and keeps its aspect ratio.
Signed-off-by: Luka Trovic <luka@nextcloud.com>
83e8eda
to
5984413
Compare
@julien-nc Can you please check again? |
/compile |
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
@luka-nextcloud Would be great to have a cypress test for this :) |
Signed-off-by: Luka Trovic luka@nextcloud.com
Summary