Overview

Module and theme components are displayed in separate lists in the design. For this reason, the client side needs to be able to be able to distinguish:

  1. module-provided Components
  2. theme-provided Components
  3. JavaScript Components
  4. Blocks
  5. Elements

Proposed resolution

This could be done either by:

  1. providing different endpoints for the different component sources
  2. it could be a single endpoint where the components are categorized (that's a confusing word choice, because of #3459088: Every XB `Component` config entity should have a `category` property, which is independent of this!) based on their source provider's type.

User interface changes

None.

CommentFileSizeAuthor
#10 XB Categories.png71.48 KBlauriii
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

lauriii created an issue. See original summary.

lauriii’s picture

Assigned: Unassigned » wim leers
wim leers’s picture

Title: Provide the frontend a way to distinguish module and theme components from one another » [PP-1] Provide the frontend a way to distinguish module and theme components from one another
Issue summary: View changes
Issue tags: +Needs issue summary update
Related issues: +#3482529: Refactor XB internals to not assume /xb-components HTTP API returns only SDC-powered XB Components

#3482529: Refactor XB internals to not assume /xb-components HTTP API returns only SDC-powered XB Components introduces some additional structure that will make this much clearer to land.

wim leers’s picture

Title: [PP-1] Provide the frontend a way to distinguish module and theme components from one another » [PP-1] HTTP API: update /xb-components to specify each `Component`'s `extensionType`
Issue summary: View changes
Issue tags: -Needs issue summary update
Related issues: +#3455975: HTTP API: update /xb-component/{component_id} to list possible prop sources for current entity context

wim leers’s picture

Title: [PP-1] HTTP API: update /xb-components to specify each `Component`'s `extensionType` » [PP-1] HTTP API: update /xb-components to specify each `Component`'s `extension_type`
Assigned: wim leers » Unassigned
Status: Active » Needs review

Ready! 😊

wim leers’s picture

Issue tags: +openapi

Trivial update for /openapi.yml, tagging.

wim leers’s picture

Title: [PP-1] HTTP API: update /xb-components to specify each `Component`'s `extension_type` » HTTP API: update /xb-components to specify each `Component`'s `extension_type`
wim leers’s picture

Assigned: Unassigned » longwave
lauriii’s picture

Issue summary: View changes
Status: Needs review » Needs work
StatusFileSize
new71.48 KB

Discussed this with @longwave and @jessebaker. We believe the extension_type key is too narrow and doesn't account for other needs we have for these. Essentially what we need is information on what is the source of the "component". Potential sources are: Blocks, Theme Components, Module Components, Elements, and JavaScript components. Each of these sources then have categories within itself. Here's a visualization of that:

longwave’s picture

Title: HTTP API: update /xb-components to specify each `Component`'s `extension_type` » HTTP API: update /xb-components to specify each `Component`'s `source`
Issue summary: View changes

As per the diagram repurposing this issue to add source.

category will be added in #3459088: Every XB `Component` config entity should have a `category` property which is postponed on the core issue #3474533: ComponentPluginManager must implement CategorizingPluginManagerInterface

longwave’s picture

Status: Needs work » Needs review

source implementation in MR!419.

wim leers’s picture

Status: Needs review » Needs work
Issue tags: +Needs documentation updates

RTBC as far as I'm concerned, with one exception: docs/components.md should be updated to capture #10, and … why not embed exactly that diagram in that document while we're at it? 😇

longwave’s picture

Assigned: longwave » wim leers
Status: Needs work » Needs review
Issue tags: -Needs documentation updates

Added the categories requirement and Mermaid version of #10 to components.md.

wim leers’s picture

Assigned: wim leers » Unassigned
Status: Needs review » Reviewed & tested by the community
wim leers’s picture

Assigned: Unassigned » traviscarden

Needs approval from @traviscarden.

traviscarden’s picture

Assigned: traviscarden » wim leers

Looks good!

traviscarden’s picture

Assigned: wim leers » Unassigned
Status: Reviewed & tested by the community » Fixed

Oops. You asked me to go ahead and merge. Done. 🙂

Status: Fixed » Closed (fixed)

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