-
Notifications
You must be signed in to change notification settings - Fork 43
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
Add upload subtitle button #1229
Conversation
Adds an "Upload" button next to the "Download" button in the subtitle edit view. The button opens a file dialog where you can select a vtt file. The contents of the selected file will then replace the current subtitle cues. Tags (optional metadata from Opencast that specifiy e.g. the language of the subtitle) remain unaffected by uploading.
This pull request is deployed at test.editor.opencast.org/1229/2023-12-12_09-06-22/ . |
This pull request has conflicts ☹ |
This pull request is deployed at test.editor.opencast.org/1229/2024-01-18_15-23-06/ . |
Testing this, I found a few issues: Opening the upload dialog doesn't seem to work reliably(Tested in Firefox)
Uploaded files do not always replace subtitlesCreate a new, empty WebVTT file:
Uploading this file will not produce an error, but also not replace the existing subtitles. |
An empty file is not valid WebVTT, but our parser will not recognize this as an error. So we just check for the empty string ourselves.
This pull request is deployed at test.editor.opencast.org/1229/2024-04-08_08-56-27/ . |
So this is annoying. It seems that using
I assume the best way to solve this would be to build our own modal (we currently don't have a modal class in the editor) instead of using |
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.
Just requesting changes to accurately represent this state in the PR overview.
Tested this again, and it seems like even with the new patch, I still got neither an error nor will the content be overwritten if I upload an empty subtitle file. |
Empty string was getting filtered out due to being falsy. Fixes that.
Should now result in an error. |
This pull request is deployed at test.editor.opencast.org/1229/2024-05-16_12-50-49/ . |
I can confirm this. I now get an error when I try to upload an empty subtitle file. Personally, I would prefer a different placement of the error message. The upload button moves to the left when an error occurs, I would prefer the button position to remain fixed. Perhaps the error messages can be displayed below the buttons (other ideas are welcome)? |
Fixes an issue with the upload subtitle button, where the automatic browser dialog used by the button would "time out", failing to open up the subsequent file dialog. This replaces it with a confirmation modal from appkit. WARNING: Requires opencast/appkit#5 to be merged and released!
Instead of trying to awkwardly fit an error box into our layout, instead inform the user via a modal if anything failed during the subtitle upload.
Demo of how this will look like with the new modal from appkit: This fixes the issue with dialog timing out, and also handles displaying the error differently? @snoesberger What do you think? |
Looks good to me and is also much better for the error messages. Is there any way to add some sort of "danger" sign (like |
Thanks for the research, let's use the modal without the warning-sign for now and add it to the "nice to have" list for later. |
This has the modals we need for the subtitle upload
This pull request has conflicts ☹ |
This pull request is deployed at test.editor.opencast.org/1229/2024-06-06_06-27-23/ . |
This pull request is deployed at test.editor.opencast.org/1229/2024-06-06_06-33-11/ . |
Thanks for including the modal, looks much better now. I tested it and it works as expected. |
Again, late to the game, but allow me a question: Why does the button come so late in the regular workflow? If I do it correctly, I first have to
and then I can finally update a file which has no relation to the clicks I just made. Wouldn't it be easier to make this an "earlier" option? |
Three reasons:
That being said, I'm not necessarily against adding a button like your image suggests. Although I would keep the current Upload button too. |
Thanks, Arne.
|
It even has to be customised. This way we make sure that the admin who sets up the editor makes sure that subtitles from the editor work well with their Opencast. It also saves us as a project from having to make assumptions on which languages users might want.
Good call, will do.
Correct. |
For users wondering where they can upload their subtitle files, this hopefully guides them to creating one if a subtitle for their language does not yet exist.
This pull request is deployed at test.editor.opencast.org/1229/2024-06-10_06-53-05/ . |
Seems like people are okay with this and the changes look fine to me. Merging… |
Resolves #999.
Adds an "Upload" button next to the "Download" button in the subtitle edit view. The button opens a file dialog where you can select a vtt file. The contents of the selected file will then replace the current subtitle cues. Tags (optional metadata from Opencast that specifiy e.g. the language of the subtitle) remain unaffected by uploading.
Courtesy of the Opencast 2023 Crowdfunding.