-
Notifications
You must be signed in to change notification settings - Fork 60
feat: Save current state of a file before downloading it #3001
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
Conversation
|
Hey @silverkszlo is this a bug? feat? Please add labels + milestone accordingly :) |
Hey @skjnldsv , yes, sorry, this PR is still a draft, all the necessary information are incoming 🙏 |
80c3e53 to
740cf53
Compare
mejo-
left a comment
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.
Tested and works well 😊
skjnldsv
left a comment
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.
Thanks for taking the time, Unfortunately I'm not super keen on approving this. Viewer should stay app-agnostic and be clean of external APIs as much as possible.
Have you considered adding a service on your side that intercept the click ?
You could probably do it with event delegation like document.addEventListener('click', (event) => { and catch any link that have the current document dav url in them ?
Thank you for the suggestion! I’ve discussed it with @mejo- , and we think that intercepting the click might be a fragile solution, since it would depend on timing and require the Text app to be aware of Viewer’s internal implementation details. @mejo- had another idea: adding a It could look like the following in Viewer: and: What do you think? |
|
I mean, there is also the fact that Viewer is getting re-written for this release cycle, and we'l use the official Files actions. So maybe it's worth ensuring the downloadAction is implementing your solution straight away, and not viewer ? |
Ah good to know! Okay, then yes it probably makes more sense to adjust the action. What do you think @juliusknorr ? |
As this will have to be backported anyway, being a customer request and kind of urgent, I'd suggest to go with the handler approach now and refactor/change/delete it after the rewrite is complete? |
I'd say the current approach is then good for stable32, but I agree that for master we still need to adjust then to make this work with the file action after the rewrite bits. |
juliusknorr
left a comment
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.
Looks good and works well in combination with the companion branch in text
73a8e1c to
4f4e2a6
Compare
|
Cypress seems unrelated, rebased to rerun CI again |
Signed-off-by: silver <[email protected]>
Signed-off-by: silver <[email protected]>
Signed-off-by: silver <[email protected]>
Signed-off-by: silver <[email protected]>
4f4e2a6 to
8c33319
Compare
|
/backport to stable32 please |
|
/backport to stable31 please |
|
/backport to stable30 please |
Resolves https://github.com/issues/assigned?issue=nextcloud-gmbh%7Ccustomer-feature-requests%7C1059
The related PR in Text is here.
Before:
When editing a markdown document online in files and download it from the editor/viewer without saving it manually, the last saved version is downloaded. The last saved version may not include what was just added/edited after the previous
saveoperation. So the downloaded file may differ from the file one sees online.Now:
Clicking on
Downloadnow triggers an automaticsaveoperation of the document. If the saving for some reason fails, the last saved version is still being downloaded.