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 <[email protected]>

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 13, 2024
1 parent 6baec5b commit 14eba02
Show file tree
Hide file tree
Showing 66 changed files with 1,964 additions and 75 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,5 +114,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 @@ -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,15 +38,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 @@ -98,6 +104,7 @@ const CourseUnit = ({ courseId }) => {
sequenceId={sequenceId}
unitId={blockId}
handleCreateNewCourseXBlock={handleCreateNewCourseXBlock}
showPasteUnit={showPasteUnit}
/>
<Layout
lg={[{ span: 8 }, { span: 4 }]}
Expand All @@ -114,6 +121,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 @@ -130,6 +143,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 14eba02

Please sign in to comment.