You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/Users/dd/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/railties-7.2.2.1/lib/rails/generators/base.rb:321:in`namespace_dirs': undefined method `name' for nil (NoMethodError) @namespace_dirs ||= namespace.name.split("::").map(&:underscore) ^^^^^ from /Users/dd/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/railties-7.2.2.1/lib/rails/generators/base.rb:325:in `namespaced_path'from/Users/dd/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/solidus_admin-0.3.2/lib/generators/solidus_admin/component/templates/component.rb.tt:3:in `template'
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...
Finally I found the answer, there was a hidden feature flag SolidusAdmin::Config.enable_alpha_features? that prevents the new SolidusAdmin to be used for products#show and products#edit and all orders routes except #index. Today was aMAZEing :)
So apparently defining a custom component works, but still could not get it registered implicitly, I had to force it by using a separate namespace or separate name for the component then register it explicitly with SolidusAdmin::Config.components['products/show'] = "MyAdmin::Products::Show::Component" which is OK I guess.
Based on my onboarding experience it would be great to mention the consequences of the dual-admin routing magic and the caveats with the feature flags somewhere in the documentation and guides to make it clearer when to follow which documentation or guide. The edge guides referring to the defacing method made everything even more confusing... I hope others will have a more seamless experience :)
Anyway, looking at the new products#edit view I do not wonder why they are hidden behind alpha feature flags as they are not ready yet, so my best bet on updating the products edit/show page is to directly override the old Spree::Admin views from the solidus_backend repo, since they won't be updated anyway as they are being phased out, so making a huge mess with deface for "updatability" doesn't make sense anymore, at all.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
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...All reactions