Skip to content
Snippets Groups Projects

#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

Edited by Jesse Baker

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • utkarsh_33 added 1 commit

    added 1 commit

    Compare with previous version

  • Kyle Einecker added 1 commit

    added 1 commit

    • 8f1cfb3a - Update modifier logic for copy/paste shortcuts.

    Compare with previous version

  • utkarsh_33 added 12 commits

    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

    Compare with previous version

  • utkarsh_33 added 1 commit

    added 1 commit

    Compare with previous version

  • utkarsh_33 added 3 commits

    added 3 commits

    • 51eb9158 - 1 commit from branch project:0.x
    • 20f6fe6b - Attempt to fix UI eslint
    • 3aeae935 - Merge branch '0.x' into 3462633-allow-copy-pasting

    Compare with previous version

  • utkarsh_33 added 1 commit

    added 1 commit

    • d1ad99b9 - Removed unwanted console log

    Compare with previous version

  • utkarsh_33 added 8 commits

    added 8 commits

    Compare with previous version

  • utkarsh_33 marked this merge request as ready

    marked this merge request as ready

  • utkarsh_33 added 4 commits

    added 4 commits

    Compare with previous version

  • utkarsh_33 added 1 commit

    added 1 commit

    Compare with previous version

  • Jesse Baker
  • 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.

  • Jesse Baker requested changes

    requested changes

  • utkarsh_33 added 1 commit

    added 1 commit

    Compare with previous version

  • Ben Mullins added 1 commit

    added 1 commit

    • 69dbbb5e - this works manually but I can't currently get the Meta-C and Meta-V to register in Cypress

    Compare with previous version

  • Ben Mullins added 7 commits

    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

    Compare with previous version

  • Ben Mullins marked this merge request as draft

    marked this merge request as draft

  • Ben Mullins added 2 commits

    added 2 commits

    Compare with previous version

  • Ben Mullins added 1 commit

    added 1 commit

    Compare with previous version

  • Ben Mullins added 1 commit

    added 1 commit

    • 99edabad - of course we need to load URL and wait for xb loaded

    Compare with previous version

  • Harumi Jang
  • Harumi Jang requested changes

    requested changes

  • Harumi Jang marked this merge request as ready

    marked this merge request as ready

  • Harumi Jang added 21 commits

    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

    Compare with previous version

  • Jesse Baker added 2 commits

    added 2 commits

    • 91e33ae7 - 1 commit from branch project:0.x
    • b1da3575 - Merge branch '0.x' into 3462633-allow-copy-pasting

    Compare with previous version

  • Jesse Baker added 1 commit

    added 1 commit

    • 8bb1c534 - removed redundant refs now there is no iframe events to worry about

    Compare with previous version

  • Jesse Baker added 1 commit

    added 1 commit

    • 356d47a4 - Refactor inserting nodes and sections.

    Compare with previous version

  • Jesse Baker added 1 commit

    added 1 commit

    • 9b0e2d12 - Refactoring copy/paste into its own hook

    Compare with previous version

  • Jesse Baker added 4 commits

    added 4 commits

    Compare with previous version

  • Jesse Baker added 2 commits

    added 2 commits

    • 25c800da - After paste, the component that was pasted now gets selected immediately. Updated tests
    • 90ad8ca6 - rearranged tests

    Compare with previous version

  • Jesse Baker
  • Jesse Baker added 3 commits

    added 3 commits

    Compare with previous version

  • Jesse Baker changed the description

    changed the description

  • Jesse Baker added 1 commit

    added 1 commit

    • 63453acc - Fix flashing UI/border immediately after pasting where the selectedComponent...

    Compare with previous version

  • Jesse Baker added 1 commit

    added 1 commit

    • be0ed7e4 - Replace meta with mod in the hotkey definition - meta is the Windows key which...

    Compare with previous version

  • Harumi Jang
  • Harumi Jang
  • Harumi Jang
  • Harumi Jang
  • Harumi Jang
  • Jesse Baker added 1 commit

    added 1 commit

    • 49fc20f7 - Address review feedback, changed intialised/visibility logic from using -99999...

    Compare with previous version

  • Harumi Jang added 1 commit

    added 1 commit

    Compare with previous version

  • Harumi Jang added 1 commit

    added 1 commit

    Compare with previous version

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading