Skip to content

Commit

Permalink
feat: [AXIMST-375] Course unit - Added functionality for copying and …
Browse files Browse the repository at this point in the history
…pasting xblocks and units (#147)

* feat: [AXIMST-350] added functionality for copying and pasting xblocks and units

* refactor: refactoring after review

* refactor: refactoring after second review
  • Loading branch information
PKulkoRaccoonGang committed Mar 10, 2024
1 parent 2b7538c commit 149ce38
Show file tree
Hide file tree
Showing 50 changed files with 1,481 additions and 54 deletions.
16 changes: 16 additions & 0 deletions src/course-unit/CourseUnit.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,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 @@ -35,9 +36,13 @@ const CourseUnit = ({ courseId }) => {
savingStatus,
isTitleEditFormOpen,
isErrorAlert,
staticFileNotices,
currentlyVisibleToStudents,
isInternetConnectionAlertFailed,
unitXBlockActions,
sharedClipboardData,
showPasteXBlock,
showPasteUnit,
handleTitleEditSubmit,
headerNavigationsActions,
handleTitleEdit,
Expand Down Expand Up @@ -88,6 +93,7 @@ const CourseUnit = ({ courseId }) => {
sequenceId={sequenceId}
unitId={blockId}
handleCreateNewCourseXBlock={handleCreateNewCourseXBlock}
showPasteUnit={showPasteUnit}
/>
<Layout
lg={[{ span: 8 }, { span: 4 }]}
Expand All @@ -104,6 +110,10 @@ const CourseUnit = ({ courseId }) => {
icon={WarningIcon}
/>
)}
<PasteNotificationAlert
staticFileNotices={staticFileNotices}
courseId={courseId}
/>
<Stack gap={4} className="mb-4">
{courseVerticalChildren.children.map(({ name, blockId: id, shouldScroll }) => (
<CourseXBlock
Expand All @@ -120,6 +130,12 @@ const CourseUnit = ({ courseId }) => {
blockId={blockId}
handleCreateNewCourseXBlock={handleCreateNewCourseXBlock}
/>
{showPasteXBlock && (
<PasteComponent
clipboardData={sharedClipboardData}
handleCreateNewCourseXBlock={handleCreateNewCourseXBlock}
/>
)}
</Layout.Element>
<Layout.Element>
<Stack gap={3}>
Expand Down
2 changes: 2 additions & 0 deletions src/course-unit/CourseUnit.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
@import "./add-component/AddComponent";
@import "./course-xblock/CourseXBlock";
@import "./sidebar/Sidebar";
@import "./course-xblock/CourseXblock";
@import "./clipboard/paste-component/PasteComponent";
Loading

0 comments on commit 149ce38

Please sign in to comment.