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

PoC: Emit events on files_versions frontend actions to allow apps to hook into them #26023

Closed
wants to merge 1 commit into from

Conversation

juliushaertl
Copy link
Member

Apps might offer the possibility to view certain versions of a file in their viewer and revert to older versions during editing. In order to achieve this in a more sane way than just attaching to click events this PR adds generic events for the actions that the files_versions sidebar triggers.

  • files_versions:restore:started
  • files_versions:restore:finished
  • files_versions:restore:failed
  • files_versions:download:triggered

In addition to the version info and file info that is passed with the events the preventDefault property can be used by the apps to stop before the files_versions app executes the actual logic, e.g. for Collabora we need to wait for the Collabora server to be ready before we execute the actual MOVE action to restore a file.

…into them

Signed-off-by: Julius Härtl <jus@bitgrid.net>
@icewind1991
Copy link
Member

Collabora we need to wait for the Collabora server to be ready before we execute the actual MOVE action to restore a file.

What about instead of canceling the restore operation, allow the event handlers to return a Promise for files_versions to wait on before continuing.

@skjnldsv
Copy link
Member

What about instead of canceling the restore operation, allow the event handlers to return a Promise for files_versions to wait on before continuing.

Not possible, events are async and should not block the main process. This is prone to failure. I think this approach is the cleaner and safer :)

This was referenced May 20, 2021
@blizzz blizzz mentioned this pull request Jun 2, 2021
57 tasks
@blizzz
Copy link
Member

blizzz commented Jun 2, 2021

CI is unhappy, js needs a rebuild. 22 or move to 23?

@MorrisJobke MorrisJobke mentioned this pull request Jun 10, 2021
59 tasks
@blizzz blizzz mentioned this pull request Jun 16, 2021
45 tasks
@blizzz
Copy link
Member

blizzz commented Jun 16, 2021

ping @juliushaertl

@juliushaertl juliushaertl added 2. developing Work in progress and removed 3. to review Waiting for reviews labels Jun 16, 2021
@skjnldsv skjnldsv mentioned this pull request Oct 13, 2021
@skjnldsv skjnldsv modified the milestones: Nextcloud 23, Nextcloud 24 Oct 21, 2021
@skjnldsv skjnldsv mentioned this pull request Mar 24, 2022
@blizzz blizzz mentioned this pull request Mar 31, 2022
This was referenced Apr 7, 2022
@blizzz blizzz modified the milestones: Nextcloud 24, Nextcloud 25 Apr 21, 2022
@juliushaertl
Copy link
Member Author

Closing for now

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.

5 participants