Make "on demand" columns visible by default

on admin "bulk product edit" and "inventory" (variant overrides) tables
This commit is contained in:
Pierre de Lacroix
2017-09-07 18:03:37 +02:00
committed by Maikel Linke
parent f50e745826
commit 72d264fab9
2 changed files with 5 additions and 6 deletions

View File

@@ -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 },

View File

@@ -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'