Skip to content

Commit d1a51a4

Browse files
committed
feat: Add slots for video and file upload components and alerts
This change add plugin slots for the file and video upload components, and the alerts components on those pages.
1 parent bfe3905 commit d1a51a4

File tree

8 files changed

+28
-20
lines changed

8 files changed

+28
-20
lines changed

src/course-outline/page-alerts/PageAlerts.jsx

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { PluginSlot } from '@openedx/frontend-plugin-framework';
21
import CourseOutlinePageAlertsSlot from 'CourseAuthoring/plugin-slots/CourseOutlinePageAlertsSlot';
32
import React, { useState } from 'react';
43
import PropTypes from 'prop-types';

src/files-and-videos/files-page/FilesPage.jsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import { RequestStatus } from '../../data/constants';
99
import Placeholder from '../../editors/Placeholder';
1010
import { useModel } from '../../generic/model-store';
1111
import getPageHeadTitle from '../../generic/utils';
12-
import { EditFileErrors, } from '../generic';
13-
import { fetchAssets, resetErrors, } from './data/thunks';
12+
import { EditFileErrors } from '../generic';
13+
import { fetchAssets, resetErrors } from './data/thunks';
1414
import FilesPageProvider from './FilesPageProvider';
1515
import messages from './messages';
1616

src/files-and-videos/generic/EditFileErrors.jsx

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { PluginSlot } from '@openedx/frontend-plugin-framework';
21
import EditFileErrorAlertsSlot from 'CourseAuthoring/plugin-slots/EditFileErrorAlertsSlot';
32
import React from 'react';
43
import PropTypes from 'prop-types';

src/files-and-videos/videos-page/VideosPage.jsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useIntl, } from '@edx/frontend-platform/i18n';
1+
import { useIntl } from '@edx/frontend-platform/i18n';
22
import { Container } from '@openedx/paragon';
33
import CourseVideosSlot from 'CourseAuthoring/plugin-slots/CourseVideosSlot';
44
import PropTypes from 'prop-types';
@@ -10,7 +10,7 @@ import { RequestStatus } from '../../data/constants';
1010
import Placeholder from '../../editors/Placeholder';
1111
import { useModel } from '../../generic/model-store';
1212
import getPageHeadTitle from '../../generic/utils';
13-
import { EditFileErrors, } from '../generic';
13+
import { EditFileErrors } from '../generic';
1414
import { resetErrors } from './data/thunks';
1515
import messages from './messages';
1616
import VideosPageProvider from './VideosPageProvider';

src/plugin-slots/CourseFilesSlot/index.jsx

+10-2
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,18 @@ import {
99
resetErrors,
1010
updateAssetLock,
1111
updateAssetOrder,
12-
validateAssetFiles
12+
validateAssetFiles,
1313
} from 'CourseAuthoring/files-and-videos/files-page/data/thunks';
1414
import FileInfoModalSidebar from 'CourseAuthoring/files-and-videos/files-page/FileInfoModalSidebar';
1515
import FileThumbnail from 'CourseAuthoring/files-and-videos/files-page/FileThumbnail';
1616
import FileValidationModal from 'CourseAuthoring/files-and-videos/files-page/FileValidationModal';
1717
import messages from 'CourseAuthoring/files-and-videos/files-page/messages';
18-
import { AccessColumn, ActiveColumn, FileTable, ThumbnailColumn } from 'CourseAuthoring/files-and-videos/generic';
18+
import {
19+
AccessColumn, ActiveColumn, FileTable, ThumbnailColumn,
20+
} from 'CourseAuthoring/files-and-videos/generic';
1921
import { useModels } from 'CourseAuthoring/generic/model-store';
2022
import { getFileSizeToClosestByte } from 'CourseAuthoring/utils';
23+
import PropTypes from 'prop-types';
2124
import React from 'react';
2225
import { useDispatch, useSelector } from 'react-redux';
2326

@@ -166,4 +169,9 @@ const CourseFilesSlot = ({ courseId }) => {
166169
</PluginSlot>
167170
);
168171
};
172+
173+
CourseFilesSlot.propTypes = {
174+
courseId: PropTypes.string.isRequired,
175+
};
176+
169177
export default CourseFilesSlot;
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { PluginSlot } from '@openedx/frontend-plugin-framework';
22
import React from 'react';
33

4-
const CourseOutlinePageAlertsSlot = () => <PluginSlot id="course_outline_page_alerts_slots" />
5-
export default CourseOutlinePageAlertsSlot
4+
const CourseOutlinePageAlertsSlot = () => <PluginSlot id="course_outline_page_alerts_slots" />;
5+
export default CourseOutlinePageAlertsSlot;

src/plugin-slots/CourseVideosSlot/index.jsx

+11-6
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
import { useIntl } from '@edx/frontend-platform/i18n';
22
import { PluginSlot } from '@openedx/frontend-plugin-framework';
3-
import { ActionRow, Button, CheckboxFilter, useToggle } from '@openedx/paragon';
3+
import {
4+
ActionRow, Button, CheckboxFilter, useToggle,
5+
} from '@openedx/paragon';
46
import { RequestStatus } from 'CourseAuthoring/data/constants';
57
import {
68
ActiveColumn,
79
FileTable,
810
StatusColumn,
911
ThumbnailColumn,
10-
TranscriptColumn
12+
TranscriptColumn,
1113
} from 'CourseAuthoring/files-and-videos/generic';
1214
import FILES_AND_UPLOAD_TYPE_FILTERS from 'CourseAuthoring/files-and-videos/generic/constants';
1315
import {
@@ -16,15 +18,16 @@ import {
1618
deleteVideoFile,
1719
fetchVideoDownload, fetchVideos,
1820
getUsagePaths, markVideoUploadsInProgressAsFailed, resetErrors,
19-
updateVideoOrder
21+
updateVideoOrder,
2022
} from 'CourseAuthoring/files-and-videos/videos-page/data/thunks';
2123
import { getFormattedDuration, resampleFile } from 'CourseAuthoring/files-and-videos/videos-page/data/utils';
2224
import VideoInfoModalSidebar from 'CourseAuthoring/files-and-videos/videos-page/info-sidebar';
2325
import messages from 'CourseAuthoring/files-and-videos/videos-page/messages';
2426
import TranscriptSettings from 'CourseAuthoring/files-and-videos/videos-page/transcript-settings';
2527
import UploadModal from 'CourseAuthoring/files-and-videos/videos-page/upload-modal';
2628
import VideoThumbnail from 'CourseAuthoring/files-and-videos/videos-page/VideoThumbnail';
27-
import { useModel, useModels } from 'CourseAuthoring/generic/model-store';
29+
import { useModels } from 'CourseAuthoring/generic/model-store';
30+
import PropTypes from 'prop-types';
2831
import React, { useEffect, useRef } from 'react';
2932
import { useDispatch, useSelector } from 'react-redux';
3033

@@ -113,8 +116,6 @@ const CourseVideosSlot = ({ courseId }) => {
113116
}
114117
}, [addVideoStatus]);
115118

116-
117-
118119
const data = {
119120
supportedFileFormats,
120121
encodingsDownloadUrl,
@@ -268,4 +269,8 @@ const CourseVideosSlot = ({ courseId }) => {
268269
);
269270
};
270271

272+
CourseVideosSlot.propTypes = {
273+
courseId: PropTypes.string.isRequired,
274+
};
275+
271276
export default CourseVideosSlot;
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
import { PluginSlot } from '@openedx/frontend-plugin-framework';
22

3-
4-
const EditFileErrorAlertsSlot = () =>
5-
<PluginSlot id="edit_file_error_alerts_slot" />
6-
3+
const EditFileErrorAlertsSlot = () => <PluginSlot id="edit_file_error_alerts_slot" />;
74

85
export default EditFileErrorAlertsSlot;

0 commit comments

Comments
 (0)