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 ihor-romaniuk committed Apr 15, 2024
1 parent 2fda48f commit 4fca279
Show file tree
Hide file tree
Showing 50 changed files with 1,529 additions and 46 deletions.
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,5 +121,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 @@ -27,6 +27,7 @@ import messages from './messages';
import PublishControls from './sidebar/PublishControls';
import LocationInfo from './sidebar/LocationInfo';
import TagsSidebarControls from '../content-tags-drawer/tags-sidebar-controls';
import { PasteNotificationAlert, PasteComponent } from './clipboard';

const CourseUnit = ({ courseId }) => {
const { blockId } = useParams();
Expand All @@ -40,15 +41,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 @@ -101,6 +107,7 @@ const CourseUnit = ({ courseId }) => {
sequenceId={sequenceId}
unitId={blockId}
handleCreateNewCourseXBlock={handleCreateNewCourseXBlock}
showPasteUnit={showPasteUnit}
/>
<Layout
lg={[{ span: 8 }, { span: 4 }]}
Expand All @@ -117,6 +124,12 @@ const CourseUnit = ({ courseId }) => {
icon={WarningIcon}
/>
)}
{staticFileNotices && (
<PasteNotificationAlert
staticFileNotices={staticFileNotices}
courseId={courseId}
/>
)}
<Stack gap={4} className="mb-4">
{courseVerticalChildren.children.map(({
name, blockId: id, blockType: type, shouldScroll,
Expand All @@ -136,6 +149,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 4fca279

Please sign in to comment.