Overview

Parent issue #3499919: [Meta] Plan for in-browser code components
Related / Blocked by

Code components are not available under "Components" in the library by default. They're listed under "Code" (done in #3499947: Managing code components in library). This means they can't be used for editing content of the page — until they're added to components.

Add a button on the component editing UI (done in #3499988: Editing code components) that allows users to add a code component to components.

As a result of this issue, the component should be ready to use just as any other SDC or block.

Proposed resolution

Consult how this change needs to be represented in the code component's config entity (done in #3499927: Config entity for storing code components). After this change the code component should be picked up by the component source plugin done in #3498889: ComponentSource plugin for code components, and as a result, be listed under "Components". It should no longer be visible under "Code".

Out of scope:
Choosing a component group — more questions need to be addressed in #3499964: Component groups for primary components (theme-provided SDCs + code components).

User interface changes

Adding code component to components

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

balintbrews created an issue. See original summary.

balintbrews’s picture

Issue summary: View changes
balintbrews’s picture

In case #3506108: Editing code components as overrides, step 1 lands sooner, we need to make sure that code components that are overrides can't be added to the components.

wim leers’s picture

Consult how this change needs to be represented in the code component's config entity

The way this was implemented in #3499927: Config entity for storing code components + #3498889: ComponentSource plugin for code components:

  • The "code component" (JavaScriptComponent config entity) has its status set to true.
  • This causes \Drupal\experience_builder\EntityHandlers\JavascriptComponentStorage::doPostSave() to create the corresponding Component config entity.

This is already implemented and tested on the back end.

So the UI shown in the issue summary should only need to PATCH the config entity (using the /xb/api/config/js_component/…) and set status to true.

nagwani’s picture

Issue tags: +sprint
balintbrews’s picture

Assigned: Unassigned » balintbrews

balintbrews’s picture

Assigned: balintbrews » hooroomoo
Status: Active » Needs review

  • balintbrews committed a039993a on 0.x
    Issue #3500071 by balintbrews, wim leers: Adding code components to...
balintbrews’s picture

Assigned: hooroomoo » Unassigned
Status: Needs review » Fixed
StatusFileSize
new217.23 KB

New UI elements for adding to code components

wim leers’s picture

wim leers’s picture

Component: Page builder » Theme builder
nagwani’s picture

Issue tags: -sprint

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.