Skip to content
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: [AXIMST-375] Course unit - Added functionality for copying and pasting xblocks and units #147

Merged
merged 3 commits into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export const NOTIFICATION_MESSAGES = {
duplicating: 'Duplicating',
deleting: 'Deleting',
copying: 'Copying',
pasting: 'Pasting',
discardChanges: 'Discarding changes',
publishing: 'Publishing',
hidingFromStudents: 'Hiding from students',
Expand Down
16 changes: 16 additions & 0 deletions src/course-unit/CourseUnit.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import Sequence from './course-sequence';
import Sidebar from './sidebar';
import { useCourseUnit } from './hooks';
import messages from './messages';
import { PasteNotificationAlert, PasteComponent } from './clipboard';

const CourseUnit = ({ courseId }) => {
const { blockId } = useParams();
Expand All @@ -37,9 +38,13 @@ const CourseUnit = ({ courseId }) => {
savingStatus,
isEditTitleFormOpen,
isErrorAlert,
staticFileNotices,
currentlyVisibleToStudents,
isInternetConnectionAlertFailed,
unitXBlockActions,
sharedClipboardData,
showPasteXBlock,
showPasteUnit,
handleTitleEditSubmit,
headerNavigationsActions,
handleTitleEdit,
Expand Down Expand Up @@ -100,6 +105,7 @@ const CourseUnit = ({ courseId }) => {
sequenceId={sequenceId}
unitId={blockId}
handleCreateNewCourseXBlock={handleCreateNewCourseXBlock}
showPasteUnit={showPasteUnit}
/>
<Layout
lg={[{ span: 8 }, { span: 4 }]}
Expand All @@ -116,6 +122,10 @@ const CourseUnit = ({ courseId }) => {
icon={WarningIcon}
/>
)}
<PasteNotificationAlert
staticFileNotices={staticFileNotices}
courseId={courseId}
/>
<Stack gap={4} className="mb-4">
{courseVerticalChildren.children.map(({
name, blockId: id, shouldScroll, userPartitionInfo,
Expand All @@ -137,6 +147,12 @@ const CourseUnit = ({ courseId }) => {
blockId={blockId}
handleCreateNewCourseXBlock={handleCreateNewCourseXBlock}
/>
{showPasteXBlock && (
<PasteComponent
clipboardData={sharedClipboardData}
handleCreateNewCourseXBlock={handleCreateNewCourseXBlock}
/>
)}
</Layout.Element>
<Layout.Element>
<Stack gap={3}>
Expand Down
1 change: 1 addition & 0 deletions src/course-unit/CourseUnit.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
@import "./add-component/AddComponent";
@import "./sidebar/Sidebar";
@import "./course-xblock/CourseXblock";
@import "./clipboard/paste-component/PasteComponent";
Loading
Loading