Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.
Ruby b2b-commercee-commerceecommerceecommerce-apiecommerce-frameworkecommerce-platformheadlessheadless-commerceheadless-ecommercemarketplacemulti-tenantmulti-vendormulti-vendor-ecommerceopen-sourcespree-commerce
Remove allow currency change preference, rename show currency selector to allow currency change, fix tests
KacperMekarski6e9564902c26
diff --git a/backend/app/controllers/spree/admin/general_settings_controller.rb b/backend/app/controllers/spree/admin/general_settings_controller.rbindex f1b6cf2e80..1e5ad4783c 100644--- a/backend/app/controllers/spree/admin/general_settings_controller.rb+++ b/backend/app/controllers/spree/admin/general_settings_controller.rb@@ -27,7 +27,7 @@ module Spreeenddef render(*args)- @preferences_currency |= [:allow_currency_change, :show_currency_selector]+ @preferences_currency |= [:allow_currency_change]superenddiff --git a/backend/app/views/spree/admin/general_settings/_form.html.erb b/backend/app/views/spree/admin/general_settings/_form.html.erbindex 2d02e06f33..3a82e8bb5f 100644--- a/backend/app/views/spree/admin/general_settings/_form.html.erb+++ b/backend/app/views/spree/admin/general_settings/_form.html.erb@@ -13,15 +13,5 @@<p class="help-block"><%= Spree.t('allow_currency_change.long') %></p></div></div>-- <div class="form-group">- <div class="checkbox">- <label>- <%= check_box('', :show_currency_selector, { checked: Spree::Config.show_currency_selector}) %>- <%= Spree.t('show_currency_selector.short') %>- </label>- <p class="help-block"><%= Spree.t('show_currency_selector.long_html') %></p>- </div>- </div></div></div>diff --git a/backend/spec/features/admin/general_settings/prices_settings_presence_spec.rb b/backend/spec/features/admin/general_settings/prices_settings_presence_spec.rbindex 24b0580b8f..afc548ac38 100644--- a/backend/spec/features/admin/general_settings/prices_settings_presence_spec.rb+++ b/backend/spec/features/admin/general_settings/prices_settings_presence_spec.rb@@ -8,7 +8,6 @@ describe 'Currencies settings presence', type: :feature, js: true dovisit spree.edit_admin_general_settings_pathexpect(page).to have_content 'Allow Currency Change'- expect(page).to have_content 'Show Currency Selector'endendenddiff --git a/backend/spec/features/admin/general_settings/prices_settings_updating_spec.rb b/backend/spec/features/admin/general_settings/prices_settings_updating_spec.rbindex da30eaef2f..64e9ca6b9e 100644--- a/backend/spec/features/admin/general_settings/prices_settings_updating_spec.rb+++ b/backend/spec/features/admin/general_settings/prices_settings_updating_spec.rb@@ -8,7 +8,6 @@ describe 'Updating currencies settings', type: :feature, js: true dobefore doreset_spree_preferences do |config|config.allow_currency_change = false- config.show_currency_selector = falseendend@@ -17,17 +16,14 @@ describe 'Updating currencies settings', type: :feature, js: true do# Test initial stateexpect(page).to have_unchecked_field('allow_currency_change')- expect(page).to have_unchecked_field('show_currency_selector')# Interact with the formcheck('allow_currency_change')- check('show_currency_selector')click_button 'Update'# Test final stateexpect(page).to have_content 'General Settings has been successfully updated!'expect(page).to have_checked_field('allow_currency_change')- expect(page).to have_checked_field('show_currency_selector')endend@@ -35,7 +31,6 @@ describe 'Updating currencies settings', type: :feature, js: true dobefore doreset_spree_preferences do |config|config.allow_currency_change = true- config.show_currency_selector = trueendend@@ -43,15 +38,12 @@ describe 'Updating currencies settings', type: :feature, js: true dovisit spree.edit_admin_general_settings_pathexpect(page).to have_checked_field('allow_currency_change')- expect(page).to have_checked_field('show_currency_selector')uncheck('allow_currency_change')- uncheck('show_currency_selector')click_button 'Update'expect(page).to have_content 'General Settings has been successfully updated!'expect(page).to have_unchecked_field('allow_currency_change')- expect(page).to have_unchecked_field('show_currency_selector')endendenddiff --git a/core/app/models/spree/app_configuration.rb b/core/app/models/spree/app_configuration.rbindex 48ef7a43b2..f116af911d 100644--- a/core/app/models/spree/app_configuration.rb+++ b/core/app/models/spree/app_configuration.rb@@ -70,7 +70,6 @@ module Spree# Multi currency configurationspreference :allow_currency_change, :boolean, default: false- preference :show_currency_selector, :boolean, default: false# searcher_class allows spree extension writers to provide their own Search classdef searcher_classdiff --git a/core/config/locales/en.yml b/core/config/locales/en.ymlindex 6a5d3645af..c91aec85b9 100644--- a/core/config/locales/en.yml+++ b/core/config/locales/en.yml@@ -576,7 +576,7 @@ en:all: Allallow_currency_change:short: Allow Currency Change- long: Allow users to change their currency via the currency picker.+ long: Display the currency picker in the main nav bar and allow users to change their currency via it. In addition, multiple stores must be supported.all_adjustments_closed: All adjustments successfully closed!all_adjustments_opened: All adjustments successfully opened!all_departments: All departments@@ -1570,9 +1570,6 @@ en:shopping_cart: Shopping Cartshow: Showshow_active: Show Active- show_currency_selector:- short: Show Currency Selector- long_html: Display the currency picker in the main nav bar. This will only display if there are multiple supported currencies, and <strong>Allow currency change</strong> option is enabled.show_deleted: Show Deletedshow_discontinued: Show Discontinuedshow_only_complete_orders: Only show complete orders