mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-21 05:09:15 +00:00
Translate variant override on_demand yes and no
This commit is contained in:
@@ -14,8 +14,8 @@ angular.module("admin.variantOverrides").controller "AdminVariantOverridesCtrl",
|
||||
$scope.selectView = Views.selectView
|
||||
$scope.currentView = -> Views.currentView
|
||||
$scope.onDemandOptions = [
|
||||
{ description: t('js.yes'), value: true },
|
||||
{ description: t('js.no'), value: false }
|
||||
{ description: t('js.variant_overrides.on_demand.yes'), value: true },
|
||||
{ description: t('js.variant_overrides.on_demand.no'), value: false }
|
||||
]
|
||||
|
||||
$scope.views = Views.setViews
|
||||
|
||||
@@ -2596,6 +2596,9 @@ See the %{link} to find out more about %{sitename}'s features and to start using
|
||||
now_out_of_stock: is now out of stock.
|
||||
only_n_remainging: "now only has %{num} remaining."
|
||||
variant_overrides:
|
||||
on_demand:
|
||||
"yes": "Yes"
|
||||
"no": "No"
|
||||
inventory_products: "Inventory Products"
|
||||
hidden_products: "Hidden Products"
|
||||
new_products: "New Products"
|
||||
|
||||
@@ -141,7 +141,7 @@ feature %q{
|
||||
fill_in "variant-overrides-#{variant.id}-sku", with: 'NEWSKU'
|
||||
fill_in "variant-overrides-#{variant.id}-price", with: '777.77'
|
||||
fill_in "variant-overrides-#{variant.id}-count_on_hand", with: '123'
|
||||
select I18n.t("js.yes"), from: "variant-overrides-#{variant.id}-on_demand"
|
||||
select I18n.t("js.variant_overrides.on_demand.yes"), from: "variant-overrides-#{variant.id}-on_demand"
|
||||
page.should have_content "Changes to one override remain unsaved."
|
||||
|
||||
expect do
|
||||
@@ -236,7 +236,7 @@ feature %q{
|
||||
it "product values are affected by overrides" do
|
||||
page.should have_input "variant-overrides-#{variant.id}-price", with: '77.77', placeholder: '1.23'
|
||||
page.should have_input "variant-overrides-#{variant.id}-count_on_hand", with: '11111', placeholder: '12'
|
||||
expect(page).to have_select "variant-overrides-#{variant.id}-on_demand", selected: I18n.t("js.yes")
|
||||
expect(page).to have_select "variant-overrides-#{variant.id}-on_demand", selected: I18n.t("js.variant_overrides.on_demand.yes")
|
||||
end
|
||||
|
||||
it "updates existing overrides" do
|
||||
@@ -257,14 +257,14 @@ feature %q{
|
||||
end
|
||||
|
||||
it "updates on_demand settings" do
|
||||
select I18n.t("js.no"), from: "variant-overrides-#{variant.id}-on_demand"
|
||||
select I18n.t("js.variant_overrides.on_demand.no"), from: "variant-overrides-#{variant.id}-on_demand"
|
||||
click_button I18n.t("save_changes")
|
||||
expect(page).to have_content I18n.t("js.changes_saved")
|
||||
|
||||
vo.reload
|
||||
expect(vo.on_demand).to eq(false)
|
||||
|
||||
select I18n.t("js.yes"), from: "variant-overrides-#{variant.id}-on_demand"
|
||||
select I18n.t("js.variant_overrides.on_demand.yes"), from: "variant-overrides-#{variant.id}-on_demand"
|
||||
click_button I18n.t("save_changes")
|
||||
expect(page).to have_content I18n.t("js.changes_saved")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user