- Issue created by @wim leers
- π¦πΊAustralia larowlan π¦πΊπ.au GMT+10
The FE of this is handled in π Make store API paths/uris configurable via environment variables (and eventually drupalSettings) Needs work it shows (in comments) the extension points. I knew we'd need this at some point so took the time to document it there.
- Assigned to wim leers
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
I need to update this issue β many things have changed since this was created.
- Issue was unassigned.
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
All originally identified blockers are in. But π Support complex SDC prop shapes: introduce (Storable)PropShape to compute field type storage settings Fixed changes things.
Issue summary fully updated π
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
- Status changed to Active
4 months ago 2:17pm 1 August 2024 - Assigned to bnjmnm
- Merge request !167#3455975: HTTP API: update /xb-component/{component_id} to list possible prop sources for current entity context β (Merged) created by bnjmnm
- Issue was unassigned.
- Status changed to Needs review
3 months ago 8:27pm 13 August 2024 - π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
Thank you, @bnjmnm, for getting this going! π€©π
This looks stellar. Zero remarks on the code. Looks like the details I write >2 months ago were sufficient? π€
The exact shape of the response is irrelevant at this time β because the very purpose of this issue is to just leap ahead of the UI and at least allow some experimentation to happen on the front end when the necessary designs for this eventually arrive.
But I am surprised the new test does not fail because π Create an Open API spec for the current mock HTTP responses Fixed introduced an OpenAPI spec that covers this route too. In that OpenAPI spec,
/xb-components
has this schema:type: object minProperties: 1 # @see \Drupal\Core\Plugin\Component::$machineName patternProperties: '^\\[a-zA-Z0-9_-]:[a-zA-Z0-9_-]$': $ref: '#/components/schemas/Component'
and that
$ref
does listadditionalProperties: false
, which this test should be triggering? π€Now, I know that I literally just wrote:
The exact shape of the response is irrelevant at this time [β¦]
β¦ but I'd expect we'd need to update
openapi.yml
somewhat like this as a very MVP way to capture this in the OpenAPI spec:diff --git a/openapi.yml b/openapi.yml index a29efe50..4160b691 100644 --- a/openapi.yml +++ b/openapi.yml @@ -180,6 +180,10 @@ components: type: [string, integer, number, boolean, object] default_markup: type: string + # @todo Refine when designs for choosing a PropSource arrive. + # @see https://www.drupal.org/project/experience_builder/issues/3455975 + prop_source_choices: + type: object additionalProperties: false Layout: title: layout
- Status changed to Needs work
3 months ago 4:29pm 19 August 2024 - π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
Still missing here: an update to
openapi.yml
. The fact that this is currently passing tests is indicative of theopenapi.yml
file not being validated correctly byApiResponseValidator
, becauseadditionalProperties: false
in$ref: '#/components/schemas/Component'
should result in a validation error π¬ - π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
Ugh, looks like
thephpleague/openapi-psr7-validator
does not really supportpatternProperties
, because the only mention of it is in a comment, and the same goes fordevizzent/cebe-php-openapi
which it relies upon?! π±π€―- https://github.com/search?q=repo%3Athephpleague%2Fopenapi-psr7-validator...
- https://github.com/search?q=repo%3ADEVizzent%2Fcebe-php-openapi%20patter...
π
Time to call it a day.
- First commit to issue fork.
- Assigned to wim leers
- Status changed to Needs review
3 months ago 12:25am 24 August 2024 - πΊπΈUnited States tedbow Ithaca, NY, USA
@Wim Leers see my MR comments. let me know what you think the `x-xb-validation` using the OpenAPI extension naming to check this. If you are good with approach assign it back to me and I will finish it up
- Assigned to tedbow
- Status changed to Needs work
3 months ago 9:03am 26 August 2024 - π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
+1 for this direction. Details on the MR. Glad you've found a way forward! π
- Assigned to wim leers
- Status changed to Needs review
3 months ago 2:15pm 26 August 2024 - Assigned to tedbow
- Status changed to Needs work
3 months ago 2:19pm 26 August 2024 - πΊπΈUnited States tedbow Ithaca, NY, USA
Actually I still need to look at test failures
- Issue was unassigned.
- πΊπΈUnited States tedbow Ithaca, NY, USA
Unassigning myself. I am not sure the Cypress test is failing. I have the tests running locally but I can't figure it out. Thought maybe it was `ApiResponseValidator` but I commented that out and the test is still failing
- π³π±Netherlands balintbrews Amsterdam, NL
β¨ Implement simplified zoom interface Fixed significantly rewrites those end-to-end tests and introduces hardening for the tests to avoid trying to access elements in the iframe before their events are initialized. It's close to being merged, so I recommend that we wait until it lands, and see how the failing tests behave with those changes.
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
Turns out it's not β¨ Implement simplified zoom interface Fixed that will fix that, but π Unnecessary wait() use in e2e tests causing failures Active .
- Status changed to Postponed
3 months ago 3:08pm 27 August 2024 - Status changed to Needs work
3 months ago 7:48pm 28 August 2024 - πΊπΈUnited States bnjmnm Ann Arbor, MI
There's a remaining test failing because it is failing to find an iframe where
data-test-xb-content-initialized
isTRUE
and I discovered why by addingconsole.log()
calls next to wheredata-test-xb-content-initialized
is switched to false and true.The two final logs - both which change the attribute to FALSE (without the expected switch to TRUE) - only happen in this MR.
I can see how this might happen since the switch to FALSE will occur any time the useEffect is triggered by a change to
dispatch, height, handleDragAdd, handleDragEnd, handleDragStart, layout, model, components,
but the switch to TRUE only happens when theonload
callback is invoked. It seems like there are plenty of opportunities for one of the 8 useEffect dependencies to change and changedata-test-xb-content-initialized
to FALSE withoutonload
firing to change it to TRUE.If those extra renders of the iframe are unnecessary, perhaps they should be addressed in this issue. If it is expected and acceptable, then we need a different way to mark something as initialized.
WITH THIS MR OPEN YOU CAN CONFIRM THIS BY... going to the XB UI and look at the iframe html - you'll see the
data-test-xb-content-initialized
within moments of the UI loading. - πΊπΈUnited States bnjmnm Ann Arbor, MI
Further debugging shows that this MR is not creating any new changes that trigger the iFrame attribute update changes. Instead, it is changing the order that they change, and components is changing after layout and model.
A change to
component
triggers the useEffect that setsdata-test-xb-content-initialized
to false, but unlike layout/model it does not result in the iframe loading anything new, so theonload
that would setdata-test-xb-content-initialized
to TRUE is not invoked. - Status changed to Needs review
3 months ago 1:20pm 29 August 2024 - πΊπΈUnited States bnjmnm Ann Arbor, MI
Based on the extensive debugging it looks like this can be addressed by changing a few lines so
components
(a list of the available components) is no longer a dependency of the iframe-impacting useEffect or theupdateData
useCallback. Neither of these should need to update if the components list changes.While it's true that
updateData
requirescomponents
to have initialized for it to properly add a component to the layout, this doesn't need to be enforced as a callback dependency because the UI doesn't offer that option until it is ready anyways.I think this solution is sound but it would be good to get another FE person to look it over to ensure this isn't going to break something elsewhere.
- π³π±Netherlands balintbrews Amsterdam, NL
Truly great investigation, and I agree with the solution! I love how this ended up being an actual problem β unnecessary rerenders β our test uncovered.
- Status changed to RTBC
3 months ago 2:42pm 29 August 2024 - π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
π @bnjmnm! Agreed with @balintbrews π
-
Wim Leers β
committed 0a04bd43 on 0.x authored by
bnjmnm β
Issue #3455975 by tedbow, bnjmnm, Wim Leers: HTTP API: update /xb-...
-
Wim Leers β
committed 0a04bd43 on 0.x authored by
bnjmnm β
- Status changed to Fixed
3 months ago 3:04pm 29 August 2024 - πΊπΈUnited States tedbow Ithaca, NY, USA
Somehow the removal of
patternProperties
got remove from this MR will open up a follow-up Automatically closed - issue fixed for 2 weeks with no activity.