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
Comments
Comment #2
wim leersComment #5
neerajsinghRenamed the form 'ComponentInputsForm' to 'ComponentInstanceForm'. Marking this issue as NR.
Comment #6
penyaskitoNW per MR review. Tests failures are legit + eslint.
Comment #7
wim leers@neerajsingh — do you think you could address this feedback? 😇🙏 I'd love to merge this MR!
Comment #8
wim leersThis not being done yet is continuing to cause communication confusion — see #3541034-3: Render component instance form for `ContentTemplate` and support updating static props.
Comment #9
neerajsinghThank you @penyaskito, @wim-leers for your validation and guidance. I have addressed the feedbacks.
Comment #10
wim leersComment #11
wim leersThanks! 🙏 You did all the hard work — I only had to do some touch-ups 😊
Much appreciated!
Comment #12
wim leersSome 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 🤞
Comment #13
wim leersComment #14
wim leersComment #16
wim leersThanks for helping making XB more consistent :)