Overview

Ran into this (again) at #3523496: Block component instance form values not processed by validation/submit handlers. #3499703: Make all XB HTTP API routes consistently prefixed, ensure they all have OpenAPI specs, and tests to keep it so made the DX a lot clearer, but this was a bit that was out of scope there (it was focused on routes, nothing else).

Quoting XB's routing definitions:

# Forms: component instance and content entity.
# @see \Drupal\experience_builder\Theme\XBThemeNegotiator::applies()
experience_builder.api.form.component_inputs:
  path: '/xb/api/v0/form/component-instance/{entity_type}/{entity}'
  defaults:
    _form: 'Drupal\experience_builder\Form\ComponentInputsForm'
  …

This is inconsistent. And all docs refer to "component instance"s. So let's make all that consistent :)

Proposed resolution

Let's make it consistent:

# Forms: component instance and content entity.
# @see \Drupal\experience_builder\Theme\XBThemeNegotiator::applies()
experience_builder.api.form.component_instance:
  path: '/xb/api/v0/form/component-instance/{entity_type}/{entity}'
  defaults:
    _form: 'Drupal\experience_builder\Form\ComponentInstanceForm'
  …

User interface changes

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

wim leers created an issue. See original summary.

wim leers’s picture

neerajsingh made their first commit to this issue’s fork.

neerajsingh’s picture

Status: Active » Needs review

Renamed the form 'ComponentInputsForm' to 'ComponentInstanceForm'. Marking this issue as NR.

penyaskito’s picture

Status: Needs review » Needs work

NW per MR review. Tests failures are legit + eslint.

wim leers’s picture

@neerajsingh — do you think you could address this feedback? 😇🙏 I'd love to merge this MR!

wim leers’s picture

neerajsingh’s picture

Status: Needs work » Needs review

Thank you @penyaskito, @wim-leers for your validation and guidance. I have addressed the feedbacks.

wim leers’s picture

Assigned: Unassigned » wim leers
wim leers’s picture

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

Thanks! 🙏 You did all the hard work — I only had to do some touch-ups 😊

Much appreciated!

wim leers’s picture

Some of the seemingly unrelated Playwright failures here are also happening on other MRs: https://git.drupalcode.org/project/experience_builder/-/pipelines/578215 — but there seem to be more here. That is brand new test coverage since last night, so asking those who worked on it to check: #3539554-13: Add Playwright tests for XB AI module 🤞

wim leers’s picture

Title: Rename `ComponentInputsForm` to `ComponentInstanceForm`, to match the route name » Rename `ComponentInputsForm` to `ComponentInstanceForm`, to improve DX
wim leers’s picture

Title: Rename `ComponentInputsForm` to `ComponentInstanceForm`, to improve DX » DX: Rename `ComponentInputsForm` to `ComponentInstanceForm`

wim leers’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for helping making XB more consistent :)

Status: Fixed » Closed (fixed)

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