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

Get mimeIconUrl for media attachments without a session #3909

Merged
merged 4 commits into from
Mar 16, 2023

Conversation

mejo-
Copy link
Member

@mejo- mejo- commented Mar 7, 2023

📝 Summary

In order to have non-image attachments rendered in editors without a session, AttachmentResolver.resolve() should return a candidate with the mimeType icon as url as last resort - because all endpoints from Text AttachmentController require a session. This fixes rendering of non-image attachments in RichTextReader.

Fixes: #2919

🏁 Checklist

  • Code is properly formatted (npm run lint / npm run stylelint / composer run cs:check)
  • Sign-off message is added to all commits
  • Tests (unit, integration and/or end-to-end) passing and the changes are covered with tests
  • Documentation (README or documentation) has been updated or is not required

@mejo- mejo- force-pushed the fix/media_preview_no_session branch from 60f12a5 to 0f6805c Compare March 7, 2023 16:20
src/services/AttachmentResolver.js Outdated Show resolved Hide resolved
src/services/AttachmentResolver.js Show resolved Hide resolved
@cypress
Copy link

cypress bot commented Mar 7, 2023

1 flaky tests on run #9078 ↗︎

0 136 1 0 Flakiness 1

Details:

Get mimeIconUrl for media attachments without a session
Project: Text Commit: 3fd23f207b
Status: Passed Duration: 04:48 💡
Started: Mar 16, 2023 7:05 PM Ended: Mar 16, 2023 7:10 PM
Flakiness  cypress/e2e/share.spec.js • 1 flaky test

View Output Video

Test Artifacts
Open test.md in viewer > Share a file with download disabled shows an error Output Screenshots

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings.

@mejo- mejo- force-pushed the fix/media_preview_no_session branch 2 times, most recently from d124e5b to bee70d2 Compare March 15, 2023 14:15
mejo- added 3 commits March 16, 2023 12:22
* Prop `dark` for NcModal has to be a boolean
* Custom validator for prop `images` should succeed if all images have
  basename and source set, not the other way round.

Signed-off-by: Jonas <jonas@freesources.org>
Signed-off-by: Jonas <jonas@freesources.org>
In order to have non-image attachments rendered in editors without
a session, `AttachmentResolver.resolve()` should return a candidate with
the mimeType icon as url as last resort - because all endpoints from
Text `AttachmentController` require a session.

This fixes rendering of non-image attachments in RichTextReader.

Fixes: #2919

Signed-off-by: Jonas <jonas@freesources.org>
@mejo- mejo- force-pushed the fix/media_preview_no_session branch from bee70d2 to 0b0d268 Compare March 16, 2023 11:22
@mejo-
Copy link
Member Author

mejo- commented Mar 16, 2023

/compile

Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
@mejo- mejo- merged commit 6dcb1e3 into main Mar 16, 2023
@delete-merged-branch delete-merged-branch bot deleted the fix/media_preview_no_session branch March 16, 2023 20:52
@mejo-
Copy link
Member Author

mejo- commented Mar 16, 2023

/backport to stable26

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.

Add new features to RichTextReader
4 participants