Skip to content

Commit

Permalink
Don't call spreecloud in test env in admin (#317)
Browse files Browse the repository at this point in the history
* Don't call spreecloud in test env in admin

* Update base_helper.rb
  • Loading branch information
damianlegawiec authored May 22, 2024
1 parent 2cf8a1d commit 4187373
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
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

0 comments on commit 4187373

Please sign in to comment.