11200: add explanations

This commit is contained in:
Ahmed Ejaz
2024-09-11 11:41:01 +05:00
parent f8d3467d46
commit 76fdf3725a
2 changed files with 4 additions and 0 deletions

View File

@@ -41,6 +41,8 @@ module Admin
"#{admin_products_path}#{url_filters.empty? ? '' : "#?#{url_filters.to_query}"}"
end
# if user hasn't saved any preferences on products page and there's only one producer;
# we need to hide producer column
def hide_producer_column?(producer_options)
spree_current_user.column_preferences.products.empty? && producer_options.one?
end

View File

@@ -7,6 +7,8 @@ RSpec.describe 'As an enterprise user, I can manage my products' do
include WebHelper
let!(:supplier) { create(:supplier_enterprise) }
# Creating another producer such that producer column is visible
# otherwise on one producer, it's hidden by default
let!(:supplier2) { create(:supplier_enterprise) }
let!(:taxon) { create(:taxon) }