Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow integrators to duplicate, copy and paste page blocks [PlanID:2023.3/34/3] #447

Closed
6 tasks done
darh opened this issue Nov 3, 2022 · 13 comments · Fixed by #582
Closed
6 tasks done

Allow integrators to duplicate, copy and paste page blocks [PlanID:2023.3/34/3] #447

darh opened this issue Nov 3, 2022 · 13 comments · Fixed by #582
Assignees
Labels
frontend Frontend code changes (Javascript, Typescript, Vue.js)

Comments

@darh
Copy link
Contributor

darh commented Nov 3, 2022

When using page-builder, an integrator can see two new icons between edit and delete - clone and copy.

Image

  • Add the two new icons (use proper icons for duplicate and copy)
  • Support block cloning
  • Support block copy-to-clipboard; write JSON representation of the block to the clipboard for cross-app and
  • Show temporary success toast when block is copied
  • Show info toast that there is a page-block waiting
  • Support paste from clipboard

New blocks added with paste or clone should be placed at the end of the grid.

Keep in mind that it is highly probable that this functionality will be added to other resource types and elements on frontend.

@EmmyMay
Copy link
Contributor

EmmyMay commented Nov 8, 2022

image

@EmmyMay
Copy link
Contributor

EmmyMay commented Nov 10, 2022

image
web-platform-tests/interop#143

Reading from the clipboard is still inconsistent across browsers. Reading the clipboard to let the user know if there is a page-block awaiting looks undoable for now. I want to move forward by just displaying the two toasts to them for now.

@EmmyMay
Copy link
Contributor

EmmyMay commented Nov 11, 2022

@darh darh added this to the 2023.3.0-dev.1 milestone Nov 11, 2022
@darh darh added the frontend Frontend code changes (Javascript, Typescript, Vue.js) label Nov 11, 2022
@EmmyMay
Copy link
Contributor

EmmyMay commented Nov 11, 2022

Corteza-locale updated

@EmmyMay
Copy link
Contributor

EmmyMay commented Nov 29, 2022

#514 for issue #447

@EmmyMay
Copy link
Contributor

EmmyMay commented Nov 29, 2022

Changelog Documentation

What was added?

The ability to copy, clone, and paste page blocks in page builders.

Why was it added?

To make it possible to duplicate page blocks easily.

What changed?

The toolbox for page blocks now has more icons.

Why did it change?

These icons make it so that these new features are easily accessible.

How did it change?

You'll find that there are more icons now than the usual two of edit and delete.

@Bojan-Svirkov
Copy link
Contributor

I went through this and the feature is working nicely I just have one note in regards to the ability for resizing the block. So @EmmyMay please look into this since when the block is resized into it's smaller form after that you cannot resize it since the button for resizing is covered by the other modal which is above it. Please look into the video:

image

c9816f3c-4b29-4bf4-a996-fd4b1def1a9c.webm

@EmmyMay
Copy link
Contributor

EmmyMay commented Nov 30, 2022

Nice catch @Bojan-Svirkov. I'll look into it

@EmmyMay
Copy link
Contributor

EmmyMay commented Nov 30, 2022

Per the issue raised by @Bojan-Svirkov, there is no less hacky way as far as I investigated to fix that except to tweak the toolbox for the general view.

@Fajfa

@darh
Copy link
Contributor Author

darh commented Nov 30, 2022

Maybe a few pixels less on padding/margin will help - in general, not only on the narrow version?

@EmmyMay
Copy link
Contributor

EmmyMay commented Nov 30, 2022

Maybe a few pixels less on padding/margin will help - in general, not only on the narrow version?

Joze suggested something different that I think is even better. Will push once I get it working.

@EmmyMay
Copy link
Contributor

EmmyMay commented Dec 2, 2022

@Bojan-Svirkov The issue has been fixed. Toolbox still overlays the block but it should not get in the way now.

@Bojan-Svirkov
Copy link
Contributor

@EmmyMay I just tested this and yes now I can resize the blocks and I guess we can be happy with this solution. I also added the CL entry so I am moving the card to Done. Once you merge everything feel free to close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
frontend Frontend code changes (Javascript, Typescript, Vue.js)
Projects
None yet
3 participants