From 47f3aa2699b9c59b20ef1dcfb186bb42921e6038 Mon Sep 17 00:00:00 2001 From: Damian Legawiec Date: Wed, 22 May 2024 17:53:56 +0200 Subject: [PATCH 1/2] Don't call spreecloud in test env in admin --- app/helpers/spree/admin/base_helper.rb | 4 ++++ app/views/spree/admin/shared/_version.html.erb | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/helpers/spree/admin/base_helper.rb b/app/helpers/spree/admin/base_helper.rb index ad054c383f..19c2276857 100644 --- a/app/helpers/spree/admin/base_helper.rb +++ b/app/helpers/spree/admin/base_helper.rb @@ -287,6 +287,10 @@ 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] && !Rails.env.test? + end + def spree_update_available? @spree_update_available ||= Spree::Admin::Updater.update_available? end diff --git a/app/views/spree/admin/shared/_version.html.erb b/app/views/spree/admin/shared/_version.html.erb index 7c5795940d..ce6eb71b1e 100644 --- a/app/views/spree/admin/shared/_version.html.erb +++ b/app/views/spree/admin/shared/_version.html.erb @@ -1,10 +1,10 @@ -<% if can?(:admin, current_store) && Spree::Backend::RuntimeConfig[:admin_show_version] %> +<% if spree_admin_show_version? %>
- <%= 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' %> <% if spree_update_available? %> From aebd90be9278fe902afdacbcba73413d98ae90fe Mon Sep 17 00:00:00 2001 From: Damian Legawiec Date: Wed, 22 May 2024 20:38:17 +0200 Subject: [PATCH 2/2] Update base_helper.rb --- app/helpers/spree/admin/base_helper.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/helpers/spree/admin/base_helper.rb b/app/helpers/spree/admin/base_helper.rb index 19c2276857..85c0f7b791 100644 --- a/app/helpers/spree/admin/base_helper.rb +++ b/app/helpers/spree/admin/base_helper.rb @@ -288,11 +288,11 @@ def taxon_wysiwyg_editor_enabled? end def spree_admin_show_version? - can?(:admin, current_store) && Spree::Backend::RuntimeConfig[:admin_show_version] && !Rails.env.test? + 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