From 72d264fab9301435ac4ed9b3efa0d09fd96451f0 Mon Sep 17 00:00:00 2001 From: Pierre de Lacroix Date: Thu, 7 Sep 2017 18:03:37 +0200 Subject: [PATCH] Make "on demand" columns visible by default on admin "bulk product edit" and "inventory" (variant overrides) tables --- lib/open_food_network/column_preference_defaults.rb | 4 ++-- spec/features/admin/variant_overrides_spec.rb | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/open_food_network/column_preference_defaults.rb b/lib/open_food_network/column_preference_defaults.rb index 41eef63c09..6972fa3785 100644 --- a/lib/open_food_network/column_preference_defaults.rb +++ b/lib/open_food_network/column_preference_defaults.rb @@ -16,7 +16,7 @@ module OpenFoodNetwork sku: { name: I18n.t("admin.sku"), visible: false }, price: { name: I18n.t("admin.price"), visible: true }, on_hand: { name: I18n.t("admin.on_hand"), visible: true }, - on_demand: { name: I18n.t("admin.on_demand?"), visible: false }, + on_demand: { name: I18n.t("admin.on_demand?"), visible: true }, reset: { name: I18n.t("#{node}.enable_reset?"), visible: false }, inheritance: { name: I18n.t("#{node}.inherit?"), visible: false }, tags: { name: I18n.t("admin.tags"), visible: false }, @@ -64,7 +64,7 @@ module OpenFoodNetwork unit: { name: I18n.t("#{node}.unit"), visible: true }, price: { name: I18n.t("admin.price"), visible: true }, on_hand: { name: I18n.t("admin.on_hand"), visible: true }, - on_demand: { name: I18n.t("admin.on_demand"), visible: false }, + on_demand: { name: I18n.t("admin.on_demand"), visible: true }, category: { name: I18n.t("#{node}.category"), visible: false }, tax_category: { name: I18n.t("#{node}.tax_category"), visible: false }, inherits_properties: { name: I18n.t("#{node}.inherits_properties?"), visible: false }, diff --git a/spec/features/admin/variant_overrides_spec.rb b/spec/features/admin/variant_overrides_spec.rb index c78ae11ad9..9064913868 100644 --- a/spec/features/admin/variant_overrides_spec.rb +++ b/spec/features/admin/variant_overrides_spec.rb @@ -66,12 +66,12 @@ feature %q{ context "with no overrides" do it "displays the list of products with variants" do - page.should have_table_row ['PRODUCER', 'PRODUCT', 'PRICE', 'ON HAND'] - page.should have_table_row [producer.name, product.name, '', ''] + page.should have_table_row ['PRODUCER', 'PRODUCT', 'PRICE', 'ON HAND', 'ON DEMAND?'] + page.should have_table_row [producer.name, product.name, '', '', ''] page.should have_input "variant-overrides-#{variant.id}-price", placeholder: '1.23' page.should have_input "variant-overrides-#{variant.id}-count_on_hand", placeholder: '12' - page.should have_table_row [producer_related.name, product_related.name, '', ''] + page.should have_table_row [producer_related.name, product_related.name, '', '', ''] page.should have_input "variant-overrides-#{variant_related.id}-price", placeholder: '2.34' page.should have_input "variant-overrides-#{variant_related.id}-count_on_hand", placeholder: '23' @@ -133,7 +133,6 @@ feature %q{ it "creates new overrides" do first("div#columns-dropdown", :text => "COLUMNS").click first("div#columns-dropdown div.menu div.menu_item", text: "SKU").click - first("div#columns-dropdown div.menu div.menu_item", text: "On Demand").click first("div#columns-dropdown", :text => "COLUMNS").click fill_in "variant-overrides-#{variant.id}-sku", with: 'NEWSKU'