Allow copy pasting components with CTRL+C and CTRL+V

Created on 19 July 2024, about 2 months ago
Updated 29 August 2024, 10 days ago

Overview

As a content creator, I want to be able to copy and paste components so that I can conveniently use existing content as a basis of new content. This could work simply so that when user tries to copy a component, we place the underlying JSON structure in the clipboard. This may lead into error scenarios, like for example if the component had property expressions in its properties. In this scenario we should display the property expression as "missing". The user can either fill in it manually, or map it to another property.

User interface changes

Feature request
Status

Active

Component

Page builder

Created by

🇫🇮Finland lauriii Finland

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @lauriii
  • 🇧🇪Belgium Wim Leers Ghent 🇧🇪🇪🇺

    This may lead into error scenarios, like for example if the component had property expressions in its properties. In this scenario we should display the property expression as "missing". The user can either fill in it manually, or map it to another property.

    If the entire JSON structure is copied, I don't see how this could fail? 🤔

  • 🇫🇮Finland lauriii Finland

    This might be something we should give further consideration but I would imagine users would not expect that copying a component also copies the property expressions source data. This means that copying a component to a new host entity could lead into situation where property expression could be pointing to a target which doesn't exist in the new host entity.

  • 🇧🇪Belgium Wim Leers Ghent 🇧🇪🇪🇺

    This means that copying a component to a new host entity

    Ah, yes.

    StaticPropSources would copy over just fine, but not DynamicPropSources — for these, users should indeed be prompted.

    That's also what the DynamicPropSoruce::$expression is for: \Drupal\experience_builder\PropExpressions\StructuredData\StructuredDataPropExpressionInterface::isSupported() literally is designed to allow detecting this 👍

    IOW: the back end already has the necessary infrastructure.

  • 🇫🇮Finland lauriii Finland

    Adding this to the board as a potential delighter to add.

Production build 0.71.5 2024