- Issue created by @attilatilman
- 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
I would swear this was fixed weeks ago 😬
Which commit or tag of XB was this tested on?
- 🇺🇸United States hooroomoo
It was changed back here: https://www.drupal.org/project/experience_builder/issues/3521819#comment... 🐛 Hovered preview for JS components in library not working Active in order to resolve that bug's issue.
But the change itself is a band-aid solution that solved the above issue, but causes the 422 error here. We will want to update the band-aid solution but it will require work. @tedbowman actually started on a proof of concept solution to address this: 🐛 Component list for UI Library should return auto-saved code components if any Active
I think in order to address this there's 2 options:
1. Continue on 🐛 Component list for UI Library should return auto-saved code components if any Active if that approach looks good
2. Remove the "Add to components" from the contextual menu from now, and make users click it from the top right in the code editor (which is working). And then return to #1 later, if we want to prioritize what's currently in the remaining sprints before GAMy opinion is doing #2 because it seems like most people have been adding components using the top right button in the code editor anyway.
- Merge request !1100Remove add to components from contextual menu and add todos → (Merged) created by hooroomoo
- 🇺🇸United States hooroomoo
Opened an MR to remove the "Add to components" menu item from the contextual menu for now. Added a todo that points to 🐛 Component list for UI Library should return auto-saved code components if any Active which will replace the band-aid solution with a proper one.
The reason behind this bug is because in the "add to components" PATCH request, we are currently sending "...selectedComponent" along with
status: true
. Ideally the frontend should only have to send the necessary changes, in this casestatus: true
. See 🐛 PATCH request for config entities reset values that are not sent Active .The band-aid is that we send "...selectedComponent" in the PATCH. Without sending that as of now, I think the hovered preview, and props and slots breaks. I think this is because the component entities displayed in the component UI list don't have the most auto-saved version of a JS component.
Clicking from the contextual menu sends the JS component config entity (...selectedComponent) since thats what we use to render the list of code components. The JS component config entity doesn't include
imported_js_components
(by backend design) and so the server complains because it requiresimported_js_components
to be sent when its also sentcompiled_js
The bug doesn't happen from clicking the top right "Add to components" button because
...selectedComponent
in this case is taken from our redux store of the code editor which stores theimported_js_components
property that the error is about. - 🇳🇱Netherlands balintbrews Amsterdam, NL
I also think removing it for now is the good call. Approved the MR, assigning back to @hooroomoo to resolve the conflicts, then this can be merged.
-
hooroomoo →
committed e79b245e on 0.x
Issue #3528151 by hooroomoo: Temporarily remove "Add to components" from...
-
hooroomoo →
committed e79b245e on 0.x
- 🇺🇸United States hooroomoo
It will be addressed properly in 🐛 Component list for UI Library should return auto-saved code components if any Active