-
Notifications
You must be signed in to change notification settings - Fork 92
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: Enable transcripts for video library [FC-0076] #1596
base: master
Are you sure you want to change the base?
feat: Enable transcripts for video library [FC-0076] #1596
Conversation
Thanks for the pull request, @ChrisChV! This repository is currently maintained by Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review. 🔘 Get product approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. Where can I find more information?If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources: When can I expect my changes to be merged?Our goal is to get community contributions seen and reviewed as efficiently as possible. However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1596 +/- ##
==========================================
+ Coverage 93.24% 93.26% +0.02%
==========================================
Files 1100 1100
Lines 21803 21848 +45
Branches 4725 4639 -86
==========================================
+ Hits 20330 20377 +47
- Misses 1401 1406 +5
+ Partials 72 65 -7 ☔ View full report in Codecov by Sentry. |
51ac20d
to
a82e796
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.
@ChrisChV Your code is working fine :) But I left some nits and questions, so would like to re-review once they're addressed.
Also: I found some bugs with the subtitles in the Course asset list. When I've copied a Library Video into a Course (creating a new LibraryBlock), it (correctly) notifies me that the subtitle files have been added to the course. But when I try to view their URLs, I get errors:
Subtitle.asset.bugs.mp4
{!isLibrary && ( // Since content libraries v2 don't support static assets yet, we can't include transcripts. | ||
<TranscriptWidget /> | ||
)} | ||
<TranscriptWidget /> |
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.
(out of scope for this issue) The Transcripts part of this VideoPreviewWidget
is hard to use 😞
- Can't type in the language I want in the dropdown; I have to scroll all the way down to the language to select it.
- No spinners shown while transcript uploads / downloads from Youtube are happening -- it just sits there looking like it's doing nothing.
It also doesn't prevent me from clicking "Save", and so if an upload / replace / delete for a transcript fails, I don't know about it until I re-open the modal. - When I import transcripts from YouTube, only one of the imported transcripts (English) shows up in the preview widget.
I have to save, and the re-edit to see all languages for the imported transcripts. - The "select a language then launch file upload control" behavior is non-intuitive, and may not be accessible either? I think these two components should split in two, so I can select my language / upload a file in whatever order I want to.
- The "Download" transcript menu item tries to send me to a new page. It should open in a new window (which closes after the download completes).
Do we have budget for a follow-up task to fix this?
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 @pomegranited for listing this issues. It will be very helpful!
Do we have budget for a follow-up task to fix this?
I think so, I have to evaluate it.
}), | ||
...rest, | ||
})); | ||
const isLibrary = selectors.app.isLibrary(getState()); |
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.
nit: Do we need to call getState()
twice in each of these 4 functions below?
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.
Updated here 9f74c07
@@ -80,6 +80,14 @@ export const downloadVideoTranscriptURL = (({ studioEndpointUrl, blockId, langua | |||
`${videoTranscripts({ studioEndpointUrl, blockId })}?language_code=${language}` | |||
)) satisfies UrlFunction; | |||
|
|||
export const trascriptXblockV2 = (({ transcriptHandlerUrl }) => ( |
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.
nit: typo
export const trascriptXblockV2 = (({ transcriptHandlerUrl }) => ( | |
export const transcriptXblockV2 = (({ transcriptHandlerUrl }) => ( |
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.
Updated here 4961e73
@@ -242,6 +242,8 @@ exports[`TranscriptWidget component snapshots snapshot: renders ErrorAlert with | |||
</CollapsibleFormWidget> | |||
`; | |||
|
|||
exports[`TranscriptWidget component snapshots snapshot: renders when isLibrary is true 1`] = `undefined`; |
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.
I don't understand this test? Isn't the TranscriptWidget rendered when isLibrary
is true?
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.
Updated here 91b4a9d
I think it's an issue with all files in general. Using that screen, I added a new file, and it has the same problem. For now, it is out of the scope of this task. |
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.
👍 Thank you for making those changes @ChrisChV ! Works great.
- I tested this using the PR testing instructions.
- I read through the code
- I checked for accessibility issues by using my keyboard to navigate
- Includes documentation -- good code comments
-
User-facing strings are extracted for translationN/A
@pomegranited @ChrisChV We are fixing the issue with linking static files into a course in openedx/edx-platform#36173 |
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.
👍 LGTM sorry for taking so long!
- I tested this
- I read through the code
- I checked for accessibility issues
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.
nice work!
@@ -207,6 +213,7 @@ export const mapStateToProps = (state) => ({ | |||
allowTranscriptImport: selectors.video.allowTranscriptImport(state), | |||
isUploadError: selectors.requests.isFailed(state, { requestKey: RequestKeys.uploadTranscript }), | |||
isDeleteError: selectors.requests.isFailed(state, { requestKey: RequestKeys.deleteTranscript }), | |||
isLibrary: selectors.app.isLibrary(state), |
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.
If you need to access the redux store, please use a hook instead of a prop:
const isLibrary = useSelector(selectors.app.isLibrary);
Description
updateTranscriptHandlerUrl()
and call it when is ready.LanguageNamesWidget
in a library.Supporting information
Testing instructions
Import transcript
button in theport transcript from YouTube?
box. Save.Other information