+
{asset.displayName}
+ { asset.transcripts && (
+
+
+
+ )}
+
);
-GalleryCard.defaultProps = {
- showId: false,
-};
-
GalleryCard.propTypes = {
asset: PropTypes.shape({
contentType: PropTypes.string,
@@ -62,8 +75,9 @@ GalleryCard.propTypes = {
url: PropTypes.string,
duration: PropTypes.number,
status: PropTypes.string,
+ statusBadgeVariant: PropTypes.string,
+ transcripts: PropTypes.array,
}).isRequired,
- showId: PropTypes.bool,
};
export default GalleryCard;
diff --git a/src/editors/sharedComponents/SelectionModal/SearchSort.jsx b/src/editors/sharedComponents/SelectionModal/SearchSort.jsx
index 3a54af3ce..11a5f9145 100644
--- a/src/editors/sharedComponents/SelectionModal/SearchSort.jsx
+++ b/src/editors/sharedComponents/SelectionModal/SearchSort.jsx
@@ -8,7 +8,6 @@ import { Close, Search } from '@edx/paragon/icons';
import {
FormattedMessage,
injectIntl,
- MessageDescriptor,
intlShape,
} from '@edx/frontend-platform/i18n';
@@ -109,7 +108,6 @@ SearchSort.defaultProps = {
filterKeys: null,
filterMessages: null,
showSwitch: false,
- switchMessage: null,
onSwitchClick: null,
};
@@ -126,7 +124,7 @@ SearchSort.propTypes = {
filterKeys: PropTypes.shape({}),
filterMessages: PropTypes.shape({}),
showSwitch: PropTypes.bool,
- switchMessage: MessageDescriptor,
+ switchMessage: PropTypes.shape({}).isRequired,
onSwitchClick: PropTypes.func,
// injected
intl: intlShape.isRequired,
diff --git a/src/editors/sharedComponents/SelectionModal/__snapshots__/Gallery.test.jsx.snap b/src/editors/sharedComponents/SelectionModal/__snapshots__/Gallery.test.jsx.snap
index 92be690c8..380b58307 100644
--- a/src/editors/sharedComponents/SelectionModal/__snapshots__/Gallery.test.jsx.snap
+++ b/src/editors/sharedComponents/SelectionModal/__snapshots__/Gallery.test.jsx.snap
@@ -6,6 +6,7 @@ exports[`TextEditor Image Gallery component component snapshot: loaded but no im
style={
Object {
"height": "375px",
+ "margin": "0 -1.5rem",
}
}
>
@@ -19,6 +20,7 @@ exports[`TextEditor Image Gallery component component snapshot: loaded but searc
style={
Object {
"height": "375px",
+ "margin": "0 -1.5rem",
}
}
>
@@ -36,6 +38,7 @@ exports[`TextEditor Image Gallery component component snapshot: loaded, show gal
style={
Object {
"height": "375px",
+ "margin": "0 -1.5rem",
}
}
>
diff --git a/src/editors/sharedComponents/SelectionModal/__snapshots__/GalleryCard.test.jsx.snap b/src/editors/sharedComponents/SelectionModal/__snapshots__/GalleryCard.test.jsx.snap
index 41f5ac1df..684f7189c 100644
--- a/src/editors/sharedComponents/SelectionModal/__snapshots__/GalleryCard.test.jsx.snap
+++ b/src/editors/sharedComponents/SelectionModal/__snapshots__/GalleryCard.test.jsx.snap
@@ -4,27 +4,49 @@ exports[`GalleryCard component snapshot: dateAdded=12345 1`] = `
-
+ >
+
+
props.img.displayName
-
+
)}
title={intl.formatMessage(titleMsg)}
+ bodyStyle={{ background: '#EBEBEB' }}
+ headerComponent={(
+
+
+
+ )}
>
{/* Error Alerts */}
@@ -85,8 +90,7 @@ export const SelectionModal = ({
>
-
-
+
@@ -108,13 +112,13 @@ SelectionModal.propTypes = {
dismiss: PropTypes.func.isRequired,
show: PropTypes.bool.isRequired,
set: PropTypes.func.isRequired,
- message: MessageDescriptor,
+ message: PropTypes.shape({}).isRequired,
}).isRequired,
inputError: PropTypes.shape({
dismiss: PropTypes.func.isRequired,
show: PropTypes.bool.isRequired,
set: PropTypes.func.isRequired,
- message: MessageDescriptor,
+ message: PropTypes.shape({}).isRequired,
}).isRequired,
fileInput: PropTypes.shape({
click: PropTypes.func.isRequired,
@@ -125,11 +129,11 @@ SelectionModal.propTypes = {
selectBtnProps: PropTypes.shape({}).isRequired,
acceptedFiles: PropTypes.shape({}).isRequired,
modalMessages: PropTypes.shape({
- confirmMsg: MessageDescriptor,
- uploadButtonMsg: MessageDescriptor,
- titleMsg: MessageDescriptor,
- fetchError: MessageDescriptor,
- uploadError: MessageDescriptor,
+ confirmMsg: PropTypes.shape({}).isRequired,
+ uploadButtonMsg: PropTypes.shape({}).isRequired,
+ titleMsg: PropTypes.shape({}).isRequired,
+ fetchError: PropTypes.shape({}).isRequired,
+ uploadError: PropTypes.shape({}).isRequired,
}).isRequired,
isLoaded: PropTypes.bool.isRequired,
isFetchError: PropTypes.bool.isRequired,
diff --git a/src/editors/sharedComponents/SourceCodeModal/__snapshots__/index.test.jsx.snap b/src/editors/sharedComponents/SourceCodeModal/__snapshots__/index.test.jsx.snap
index 33662d621..2676d51a9 100644
--- a/src/editors/sharedComponents/SourceCodeModal/__snapshots__/index.test.jsx.snap
+++ b/src/editors/sharedComponents/SourceCodeModal/__snapshots__/index.test.jsx.snap
@@ -2,6 +2,7 @@
exports[`SourceCodeModal renders as expected with default behavior 1`] = `
}
footerAction={null}
+ headerComponent={null}
isFullscreenScroll={true}
isOpen={false}
size="xl"
diff --git a/src/editors/utils/formatDuration.js b/src/editors/utils/formatDuration.js
new file mode 100644
index 000000000..83008b7d7
--- /dev/null
+++ b/src/editors/utils/formatDuration.js
@@ -0,0 +1,18 @@
+import * as moment from 'moment-shortformat';
+
+const formatDuration = (duration) => {
+ const d = moment.duration(duration, 'seconds');
+ if (d.hours > 0) {
+ return (
+ `${d.hours().toString().padStart(2, '0')}:`
+ + `${d.minutes().toString().padStart(2, '0')}:`
+ + `${d.seconds().toString().padStart(2, '0')}`
+ );
+ }
+ return (
+ `${d.minutes().toString().padStart(2, '0')}:`
+ + `${d.seconds().toString().padStart(2, '0')}`
+ );
+};
+
+export default formatDuration;
diff --git a/src/editors/utils/index.js b/src/editors/utils/index.js
index b765c1382..14ecc749c 100644
--- a/src/editors/utils/index.js
+++ b/src/editors/utils/index.js
@@ -3,3 +3,4 @@ export { default as StrictDict } from './StrictDict';
export { default as keyStore } from './keyStore';
export { default as camelizeKeys } from './camelizeKeys';
export { default as removeItemOnce } from './removeOnce';
+export { default as formatDuration } from './formatDuration';
diff --git a/src/index.jsx b/src/index.jsx
index c4b875116..847deec60 100644
--- a/src/index.jsx
+++ b/src/index.jsx
@@ -1,7 +1,7 @@
import Placeholder from './Placeholder';
import messages from './i18n/index';
import EditorPage from './editors/EditorPage';
-import SelectorPage from './editors/SelectorPage';
+import VideoSelectorPage from './editors/VideoSelectorPage';
-export { messages, EditorPage, SelectorPage };
+export { messages, EditorPage, VideoSelectorPage };
export default Placeholder;