Skip to content

Commit

Permalink
feat: Copy/paste functionality
Browse files Browse the repository at this point in the history
* feat: [AXIMST-344] Copy/paste functionality base

* feat: [AXIMST-344] Copy/paste functionality visible part

* feat: tests

* fix: PR comment review

* refactor: refactoring after review

* refactor: refactoring after rebase

---------

Co-authored-by: monteri <lansevermore>
Co-authored-by: PKulkoRaccoonGang <peter.kulko@raccoongang.com>

feat: [AXIMST-375] Course unit - Added functionality for copying and 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

fix: [AXIMST-480] fixed paste notification behavior after switching a unit (#160)

fix: [AXIMST-478] fixed copy-paste tooltip (#161)

feat: [AXIMST-338] Course unit - Added canEdit and canPasteComponent variables (#170)

* feat: [AXIMST-338] added canEdit and canPasteComponent variables

* refactor: added condition for Can copy Unit btn

feat: [AXIMST-525] separated the copy unit button (#190)

refactor: [AXIMST-507] Course unit - Changed Paste unit UI (#186)

* refactor: [AXIMST-507] changed Paste unit UI

* refactor: code refactoring

fix: fixed react-intl error (#197)

fix: [AXIMST-516] fixed paste alerts view (#189)

refactor: code refactoring

refactor: code refactoring
  • Loading branch information
monteri authored and PKulkoRaccoonGang committed Mar 10, 2024
1 parent cdd3118 commit 5435ce0
Show file tree
Hide file tree
Showing 65 changed files with 1,962 additions and 74 deletions.
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,5 +113,8 @@
},
"peerDependencies": {
"decode-uri-component": ">=0.2.2"
},
"overrides": {
"react-intl": "^6.4.0"
}
}
19 changes: 19 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,15 +36,20 @@ const CourseUnit = ({ courseId }) => {
savingStatus,
isTitleEditFormOpen,
isErrorAlert,
staticFileNotices,
currentlyVisibleToStudents,
isInternetConnectionAlertFailed,
unitXBlockActions,
sharedClipboardData,
showPasteXBlock,
showPasteUnit,
handleTitleEditSubmit,
headerNavigationsActions,
handleTitleEdit,
handleInternetConnectionFailed,
handleCreateNewCourseXBlock,
courseVerticalChildren,
canPasteComponent,
} = useCourseUnit({ courseId, blockId });

document.title = getPageHeadTitle('', unitTitle);
Expand Down Expand Up @@ -88,6 +94,7 @@ const CourseUnit = ({ courseId }) => {
sequenceId={sequenceId}
unitId={blockId}
handleCreateNewCourseXBlock={handleCreateNewCourseXBlock}
showPasteUnit={showPasteUnit}
/>
<Layout
lg={[{ span: 8 }, { span: 4 }]}
Expand All @@ -104,6 +111,12 @@ const CourseUnit = ({ courseId }) => {
icon={WarningIcon}
/>
)}
{staticFileNotices && (
<PasteNotificationAlert
staticFileNotices={staticFileNotices}
courseId={courseId}
/>
)}
<Stack gap={4} className="mb-4">
{courseVerticalChildren.children.map(({ name, blockId: id, shouldScroll }) => (
<CourseXBlock
Expand All @@ -120,6 +133,12 @@ const CourseUnit = ({ courseId }) => {
blockId={blockId}
handleCreateNewCourseXBlock={handleCreateNewCourseXBlock}
/>
{showPasteXBlock && canPasteComponent && (
<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 "./course-xblock/CourseXBlock";
@import "./sidebar/Sidebar";
@import "./clipboard/paste-component/PasteComponent";
Loading

0 comments on commit 5435ce0

Please sign in to comment.