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

Don't call spreecloud in test env in admin #317

Merged
merged 2 commits into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 5 additions & 1 deletion app/helpers/spree/admin/base_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,12 @@ def taxon_wysiwyg_editor_enabled?
Spree::Backend::Config[:taxon_wysiwyg_editor_enabled]
end

def spree_admin_show_version?
can?(:admin, current_store) && Spree::Backend::RuntimeConfig[:admin_show_version]
end

def spree_update_available?
@spree_update_available ||= Spree::Admin::Updater.update_available?
@spree_update_available ||= !Rails.env.test? && Spree::Admin::Updater.update_available?
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions app/views/spree/admin/shared/_version.html.erb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<% if can?(:admin, current_store) && Spree::Backend::RuntimeConfig[:admin_show_version] %>
<% if spree_admin_show_version? %>
<div
class="spree-version px-3 py-2"
aria-label="Spree Commerce version">
<div class="d-flex align-items-center justify-content-between">
<span class="text-muted small">
<%= link_to Spree.version, "https://github.com/spree/spree/releases/tag/v#{Spree.version.gsub(/\.beta|\.rc\d+/, '')}", target: '_blank' %>
<%= link_to Spree.version, "https://github.com/spree/spree/releases/tag/v#{Spree.version}", target: '_blank' %>
</span>
<% if spree_update_available? %>
<span class="small text-info">
Expand Down
Loading