#3462633 : Allow copy pasting components with CTRL+C and CTRL+V.
insertNode
and insertMultipleNodes
have been consolidated into one action: insertNodes
. Now, even when only inserting a single item to the layout, it's expected that we pass a full layoutModel
. This addresses issue #3472089**.**
Introduced a new hook useCopyPasteComponents
that returns the copy and paste functions used by the meta+c and meta+v useHotkeys
in Canvas.tsx
.
Implemented copy and paste Cypress e2e tests and also grabbed the Cypress unit test from over in #3472089.
Cmd/ctrl+C and cmd/ctrl+v now perform a "copy and paste" like action that uses the browser's local storage but not the system clipboard. This allows us to enforce that copy and pasting only occurs between the same site on the same domain and prevents issues like people trying to copy an instance of an SDC from a layout one site to another even though none of the SDC files would move with it!
Copy and pasting a parent component that has slots/children will also copy all of the children.
After pasting a component the selected component state is updated to be the component you just pasted (the parent in the case where it has children).
Closes #3462633
Merge request reports
Activity
added 5 commits
- e60fa682 - Passing selected component to paste reducer
- 91455f10 - Added component to copy and component next to which it should be pasted to respective clipboards
- 7c13286b - Partially functioning copy paste using keyboard
- 6071b1e6 - Clear the clipboard after successfully pasting the component
- 1d02f5a3 - Removed unused reducer and eslint
Toggle commit list- Resolved by Harumi Jang
added 1 commit
- 8f1cfb3a - Update modifier logic for copy/paste shortcuts.
added 12 commits
-
8f1cfb3a...a79008e3 - 4 commits from branch
project:0.x
- 1bcdd039 - Added tests
- 6fdb3071 - Issue #3471028 by deepakkm, tedbow, akhil babu: Expand test coverage in FieldUninstallValidatorTest
- b09bce7b - Issue #3476891: FieldTypeUninstallValidator lists the same content revision 2x...
- b14197e0 - Issue #3470647 by shyam_bhatt, omkar-pd, jessebaker: Zoom Behaviour Issue:...
- a7ee7018 - Issue #3476204 by cosmicdreams, jessebaker, bnjmnm, deepakkm, wim leers,...
- c161c88f - Added logic to take care of refreshs
- eb0e5d26 - Added a seperate paste reducer
- 84095794 - Merge branch '0.x' into 3462633-allow-copy-pasting
Toggle commit list-
8f1cfb3a...a79008e3 - 4 commits from branch
added 8 commits
-
d1ad99b9...ba13164c - 5 commits from branch
project:0.x
- a5e22015 - Fixed tests
- 9b7cf6bf - Merge branch '0.x' into 3462633-allow-copy-pasting
- 7182a3c6 - Fixed UI eslint errors
Toggle commit list-
d1ad99b9...ba13164c - 5 commits from branch
added 4 commits
-
7182a3c6...bcf659ba - 2 commits from branch
project:0.x
- 59b66363 - wip
- 968cd230 - Merge branch '0.x' into 3462633-allow-copy-pasting
-
7182a3c6...bcf659ba - 2 commits from branch
- Resolved by Jesse Baker
- Resolved by Jesse Baker
I have tested and given a look at the code. Testing it manually, it doesn't work at all and looking at the code I can see that the issue is that you are only storing a uuid on the clipboard but need to store the actual model data as JSON.
The Cypress test is flawed and asserts something that is true even if you remove the commands to press cmd+c and cmd+v so it's giving a false positive which is why it's still passing the Cypress tests.
added 1 commit
- 69dbbb5e - this works manually but I can't currently get the Meta-C and Meta-V to register in Cypress
added 7 commits
-
69dbbb5e...5ad74b95 - 5 commits from branch
project:0.x
- 4a8655db - Merge remote-tracking branch 'origin/0.x' into 3462633-allow-copy-pasting
- fb8dfffa - its a huge mess but it does what it supposed to do
-
69dbbb5e...5ad74b95 - 5 commits from branch
added 1 commit
- 99edabad - of course we need to load URL and wait for xb loaded
- Resolved by Harumi Jang
added 21 commits
-
99edabad...adadbecd - 11 commits from branch
project:0.x
- a219fefc - Issue #3479895 by soaratul: Client-side warning due to insufficient use of @radix-ui/react-slot
- 18346f8c - Issue #3471108 by balintbrews, jessebaker: Unable to scroll component props form
- e8ab475f - Issue #3480193 by longwave, wim leers: Replace plus with dot in Component config entity IDs
- 4c147382 - Issue #3480763 by longwave, wim leers: CI: Pin to GitLab CI Template version...
- f7ac81db - Issue #3480217 by longwave, wim leers: Add Kernel test coverage of ApiLayoutController
- 1b89d3ee - Issue #3478537 by wim leers, longwave, lauriii, catch, effulgentsia: Introduce...
- 614b35cb - Issue #3481195 by soaratul, traviscarden: Can't get rid of zoom cursor after Ctrl+Click
- 1e1b817e - Issue #3481183 by omkar-pd, traviscarden: Missing hover state on "Delete" context menu option
- ab6eb73d - Issue #3478299 by tedbow, longwave, wim leers: Implement basic auto-save
- aa925772 - Merge branch '0.x' into 3462633-allow-copy-pasting
Toggle commit list-
99edabad...adadbecd - 11 commits from branch
added 1 commit
- 8bb1c534 - removed redundant refs now there is no iframe events to worry about
added 4 commits
-
9b0e2d12...cb45b758 - 3 commits from branch
project:0.x
- 8ba24702 - Merge branch '0.x' into 3462633-allow-copy-pasting
-
9b0e2d12...cb45b758 - 3 commits from branch
- Resolved by Harumi Jang
added 1 commit
- 63453acc - Fix flashing UI/border immediately after pasting where the selectedComponent...
added 1 commit
- be0ed7e4 - Replace meta with mod in the hotkey definition - meta is the Windows key which...
- Resolved by Jesse Baker
- Resolved by Jesse Baker
- Resolved by Jesse Baker
- Resolved by Jesse Baker
- Resolved by Jesse Baker
added 1 commit
- 49fc20f7 - Address review feedback, changed intialised/visibility logic from using -99999...