-
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?
Changes from 5 commits
b7fbac9
627b4af
a82e796
9c4a930
73c4bda
729780e
9f74c07
4961e73
91b4a9d
e23367e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import React from 'react'; | ||
import { connect } from 'react-redux'; | ||
import { connect, useDispatch } from 'react-redux'; | ||
import PropTypes from 'prop-types'; | ||
import { | ||
FormattedMessage, | ||
|
@@ -17,7 +17,7 @@ import { | |
} from '@openedx/paragon'; | ||
import { Add, InfoOutline } from '@openedx/paragon/icons'; | ||
|
||
import { actions, selectors } from '../../../../../../data/redux'; | ||
import { thunkActions, actions, selectors } from '../../../../../../data/redux'; | ||
import messages from './messages'; | ||
|
||
import { RequestKeys } from '../../../../../../data/constants/requests'; | ||
|
@@ -90,13 +90,18 @@ const TranscriptWidget = ({ | |
updateField, | ||
isUploadError, | ||
isDeleteError, | ||
isLibrary, | ||
// injected | ||
intl, | ||
}) => { | ||
const [error] = React.useContext(ErrorContext).transcripts; | ||
const [showImportCard, setShowImportCard] = React.useState(true); | ||
const fullTextLanguages = module.hooks.transcriptLanguages(transcripts, intl); | ||
const hasTranscripts = module.hooks.hasTranscripts(transcripts); | ||
const dispatch = useDispatch(); | ||
if (isLibrary) { | ||
dispatch(thunkActions.video.updateTranscriptHandlerUrl()); | ||
} | ||
|
||
return ( | ||
<CollapsibleFormWidget | ||
|
@@ -197,6 +202,7 @@ TranscriptWidget.propTypes = { | |
updateField: PropTypes.func.isRequired, | ||
isUploadError: PropTypes.bool.isRequired, | ||
isDeleteError: PropTypes.bool.isRequired, | ||
isLibrary: PropTypes.bool.isRequired, | ||
intl: PropTypes.shape(intlShape).isRequired, | ||
}; | ||
export const mapStateToProps = (state) => ({ | ||
|
@@ -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 commentThe 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); |
||
}); | ||
|
||
export const mapDispatchToProps = (dispatch) => ({ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,9 +49,7 @@ const VideoSettingsModal: React.FC<Props> = ({ | |
<SocialShareWidget /> | ||
)} | ||
<ThumbnailWidget /> | ||
{!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 commentThe reason will be displayed to describe this comment to others. Learn more. (out of scope for this issue) The Transcripts part of this
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 commentThe reason will be displayed to describe this comment to others. Learn more. Thanks @pomegranited for listing this issues. It will be very helpful!
I think so, I have to evaluate it. |
||
<DurationWidget /> | ||
<HandoutWidget /> | ||
<LicenseWidget /> | ||
|
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