How to override components from gems in app #6042
Replies: 1 comment
-
Finally I found the answer, there was a hidden feature flag |
Beta Was this translation helpful? Give feedback.
-
Finally I found the answer, there was a hidden feature flag |
Beta Was this translation helpful? Give feedback.
-
The guides are outdated: https://guides.solidus.io/customization/customizing-the-backend as it is still mentioning using Deface and Overrides. I have opened an issue for this: solidusio/edgeguides#140
I have then found some things to read:
#4594
#5099
ViewComponent/view_component#411
and then have finally found the "relevant" docs:
https://github.com/solidusio/solidus/blob/main/admin/docs/components.md and
https://github.com/solidusio/solidus/blob/main/admin/docs/customizing_components.md
I have tried every possible solution as written there but still I have not found a way to override components either implicitly, nor explicitly.
I have tried the following implicit path schemes:
I could neither get a new component registered, named exactly as in the guides.
Furthermore the component registry seems to be almost empty on a new installation:
Adding it explicitly did not work either. I have tried the following:
I am just learning solidus right now so I am not sure yet if this is expected.
Also, the component generator as mentioned here: https://github.com/solidusio/solidus/blob/main/admin/docs/components.md throws namespace errors even when the --skip-namespace option is used:
I am sure I am overlooking something simple. How are you guys able to override the admin? :)
UPDATE: I have found out there are two different admins running in parallel. Oh this is super confusing... I don't understand why the SolidusAdmin routes are shown to be mounted on the root mixed together with Frontend routes when I do a
rails routes
, but it is mounted on /admin properly in routes.rb and it seems to be working well on admin/orders when the "Show Legacy UI" is switched off, but the SolidusAdmin routes are not getting picked up, it keeps matching the route to the controller in Spree::Admin. So there is no wonder why I could not get the components to be overridden, it wasn't even using SolidusAdmin :) Digging deeper...Beta Was this translation helpful? Give feedback.
All reactions