Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix expectations about solidus_auth_devise order in the Gemfile #4465

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix Gemfile order dependency solidus_frontend <> solidus_auth_devise
solidus_frontend tries to load a partial from solidus_auth_devise [1] [2].
However, it provided a fallback [3] when the latter was missing.

Unfortunately, it worked with the assumption that solidus_auth_devise
went below solidus_frontend in the Gemfile. Otherwise, the fallback
template took precedence.

We're now removing the fallback template and rendering the template only
when it's present. This way, it makes no critical which gem goes
first.

[1] - https://github.com/solidusio/solidus_frontend/blob/dae732ed7442a755cc0426cd2afa6ac662de7105/app/views/spree/shared/_nav_bar.html.erb#L4
[2] - https://github.com/solidusio/solidus_auth_devise/blob/bfbf616ef625aa51c6b74040d96998082f736e13/lib/views/frontend/spree/shared/_login_bar_items.html.erb
[3] - https://github.com/solidusio/solidus_frontend/blob/dae732ed7442a755cc0426cd2afa6ac662de7105/app/views/spree/shared/_login_bar_items.html.erb
  • Loading branch information
waiting-for-dev committed Jul 25, 2022
commit cb54eaebdc958a7460654f2583117fcb42da7558
1 change: 0 additions & 1 deletion frontend/app/views/spree/shared/_login_bar_items.html.erb

This file was deleted.

3 changes: 2 additions & 1 deletion frontend/app/views/spree/shared/_nav_bar.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<nav id="top-nav-bar" class="columns ten">
<ul id="nav-bar" class="inline" data-hook>
<%= render 'spree/shared/locale_selector' %>
<%= render 'spree/shared/login_bar_items' %>
<%# solidus_auth_devise or a custom auth system can replace this partial %>
<%= render 'spree/shared/login_bar_items' if lookup_context.exists?('spree/shared/_login_bar_items') %>
<li id="search-bar" data-hook>
<%= render partial: 'spree/shared/search' %>
</li>
Expand Down