From 4a35b53b4366663d2cab58c43aa31bb60c7ff777 Mon Sep 17 00:00:00 2001 From: luisramos0 Date: Thu, 14 Feb 2019 17:02:52 +0000 Subject: [PATCH 01/24] Remove dead overrides --- ...hange_distributor_form_to_checkout_address.rb | 6 ------ .../add_distributor_details_js_to_product.rb | 5 ----- .../add_distributor_details_to_product.rb | 5 ----- .../add_distributor_to_add_to_cart_form.rb | 5 ----- app/overrides/add_source_to_product.rb | 5 ----- app/overrides/replace_checkout_payment_button.rb | 5 ----- ...ping_address_form_with_distributor_details.rb | 5 ----- ...ons_to_delivery_instructions.html.haml.deface | 5 ----- ...ng_method_to_delivery_method.html.haml.deface | 2 -- .../add_new_save_checkout_button.html.erb.deface | 16 ---------------- ...urrent_distribution_variants.html.haml.deface | 16 ---------------- .../_taxons/hide_taxon_crumbs.html.haml.deface | 1 - 12 files changed, 76 deletions(-) delete mode 100644 app/overrides/add_change_distributor_form_to_checkout_address.rb delete mode 100644 app/overrides/add_distributor_details_js_to_product.rb delete mode 100644 app/overrides/add_distributor_details_to_product.rb delete mode 100644 app/overrides/add_distributor_to_add_to_cart_form.rb delete mode 100644 app/overrides/add_source_to_product.rb delete mode 100644 app/overrides/replace_checkout_payment_button.rb delete mode 100644 app/overrides/replace_shipping_address_form_with_distributor_details.rb delete mode 100644 app/overrides/spree/checkout/_delivery/shipping_instructions_to_delivery_instructions.html.haml.deface delete mode 100644 app/overrides/spree/checkout/_delivery/shipping_method_to_delivery_method.html.haml.deface delete mode 100644 app/overrides/spree/checkout/edit/add_new_save_checkout_button.html.erb.deface delete mode 100644 app/overrides/spree/products/_cart_form/only_show_current_distribution_variants.html.haml.deface delete mode 100644 app/overrides/spree/products/_taxons/hide_taxon_crumbs.html.haml.deface diff --git a/app/overrides/add_change_distributor_form_to_checkout_address.rb b/app/overrides/add_change_distributor_form_to_checkout_address.rb deleted file mode 100644 index 19b91d2b1f..0000000000 --- a/app/overrides/add_change_distributor_form_to_checkout_address.rb +++ /dev/null @@ -1,6 +0,0 @@ -# Disabled until this form takes order cycles into account -# Deface::Override.new(:virtual_path => "spree/checkout/edit", -# :insert_after => "[data-hook='checkout_summary_box']", -# :partial => "spree/checkout/other_available_distributors", -# :name => "add_change_distributor_form_to_checkout_address", -# :original => '60b9b1a39079f4efa85ff0425108edf671349d4f') diff --git a/app/overrides/add_distributor_details_js_to_product.rb b/app/overrides/add_distributor_details_js_to_product.rb deleted file mode 100644 index 607735b992..0000000000 --- a/app/overrides/add_distributor_details_js_to_product.rb +++ /dev/null @@ -1,5 +0,0 @@ -Deface::Override.new(:virtual_path => "spree/products/show", - :insert_after => "[data-hook='product_show']", - :text => "<%= javascript_include_tag main_app.distributors_enterprises_path(:format => :js) %>", - :name => "add_distributor_details_js_to_product", - :original => 'b05ac497efeeebd4464f29891fd2c4a0f60c24d9') diff --git a/app/overrides/add_distributor_details_to_product.rb b/app/overrides/add_distributor_details_to_product.rb deleted file mode 100644 index dbe657bf96..0000000000 --- a/app/overrides/add_distributor_details_to_product.rb +++ /dev/null @@ -1,5 +0,0 @@ -Deface::Override.new(:virtual_path => "spree/products/show", - :insert_before => "[data-hook='cart_form']", - :partial => "spree/products/distributor_details", - :name => "add_distributor_details_to_product", - :original => '789e3f5f6f36a8cd4115d7342752a37735659298') diff --git a/app/overrides/add_distributor_to_add_to_cart_form.rb b/app/overrides/add_distributor_to_add_to_cart_form.rb deleted file mode 100644 index ad47700473..0000000000 --- a/app/overrides/add_distributor_to_add_to_cart_form.rb +++ /dev/null @@ -1,5 +0,0 @@ -Deface::Override.new(:virtual_path => "spree/products/_cart_form", - :replace => "[data-hook='product_price'] .add-to-cart", - :partial => "spree/products/add_to_cart", - :name => "add_distributor_to_add_to_cart_form", - :original => '294014222132c795048fc6c7866971a332672c87') diff --git a/app/overrides/add_source_to_product.rb b/app/overrides/add_source_to_product.rb deleted file mode 100644 index ded798e840..0000000000 --- a/app/overrides/add_source_to_product.rb +++ /dev/null @@ -1,5 +0,0 @@ -Deface::Override.new(:virtual_path => "spree/products/show", - :insert_bottom => "[data-hook='product_left_part_wrap']", - :partial => "spree/products/source", - :name => "add_source_to_product", - :original => 'bce3ba4847b3eac8ae061774a664ac4951d3d9db') diff --git a/app/overrides/replace_checkout_payment_button.rb b/app/overrides/replace_checkout_payment_button.rb deleted file mode 100644 index 60a198817c..0000000000 --- a/app/overrides/replace_checkout_payment_button.rb +++ /dev/null @@ -1,5 +0,0 @@ -Deface::Override.new(:virtual_path => "spree/checkout/_payment", - :replace => "code[erb-loud]:contains('submit_tag t(:save_and_continue)')", - :text => "<%= submit_tag I18n.t(:process_my_order), :class => 'continue button primary' %>", - :name => "replace_checkout_payment_button", - :original => 'ce2043a01931b3bc16b045302ebb0e0bb9150b67') diff --git a/app/overrides/replace_shipping_address_form_with_distributor_details.rb b/app/overrides/replace_shipping_address_form_with_distributor_details.rb deleted file mode 100644 index c408dc8ed4..0000000000 --- a/app/overrides/replace_shipping_address_form_with_distributor_details.rb +++ /dev/null @@ -1,5 +0,0 @@ -Deface::Override.new(:virtual_path => "spree/checkout/_address", - :replace => "[data-hook='shipping_fieldset_wrapper']", - :partial => "spree/checkout/distributor", - :name => "replace_shipping_address_form_with_distributor_details", - :original => '53e219f90a2e1ba702a767261d0c2afe100ac751') diff --git a/app/overrides/spree/checkout/_delivery/shipping_instructions_to_delivery_instructions.html.haml.deface b/app/overrides/spree/checkout/_delivery/shipping_instructions_to_delivery_instructions.html.haml.deface deleted file mode 100644 index badf49339c..0000000000 --- a/app/overrides/spree/checkout/_delivery/shipping_instructions_to_delivery_instructions.html.haml.deface +++ /dev/null @@ -1,5 +0,0 @@ -/ replace_contents '#shipping_method p#minstrs' - -= form.label :special_instructions, t(:delivery_instructions) -%br/ -= form.text_area :special_instructions, :cols => 40, :rows => 7 diff --git a/app/overrides/spree/checkout/_delivery/shipping_method_to_delivery_method.html.haml.deface b/app/overrides/spree/checkout/_delivery/shipping_method_to_delivery_method.html.haml.deface deleted file mode 100644 index 817a27b0ca..0000000000 --- a/app/overrides/spree/checkout/_delivery/shipping_method_to_delivery_method.html.haml.deface +++ /dev/null @@ -1,2 +0,0 @@ -/ replace_contents '#shipping_method legend' -= t(:delivery_method) diff --git a/app/overrides/spree/checkout/edit/add_new_save_checkout_button.html.erb.deface b/app/overrides/spree/checkout/edit/add_new_save_checkout_button.html.erb.deface deleted file mode 100644 index f70c064f72..0000000000 --- a/app/overrides/spree/checkout/edit/add_new_save_checkout_button.html.erb.deface +++ /dev/null @@ -1,16 +0,0 @@ - - -<% # Add a new 'Save and Continue/Process My Order' button under Order Summary on the checkout pages %> - -
- <%= submit_tag @order.state == "payment" ? t(:process_my_order) : t(:save_and_continue), - :class => "continue button primary large", - :form=> "checkout_form_#{@order.state}" %> - -
diff --git a/app/overrides/spree/products/_cart_form/only_show_current_distribution_variants.html.haml.deface b/app/overrides/spree/products/_cart_form/only_show_current_distribution_variants.html.haml.deface deleted file mode 100644 index adfe5af84f..0000000000 --- a/app/overrides/spree/products/_cart_form/only_show_current_distribution_variants.html.haml.deface +++ /dev/null @@ -1,16 +0,0 @@ -/ replace_contents '#product-variants' - -%h6.product-section-title= t(:variants) -%ul - - has_checked = false - - @product.variants.active(current_currency).each_with_index do |v,index| - - next if v.option_values.empty? || (!v.in_stock && !Spree::Config[:show_zero_stock_products]) - - next if current_order_cycle.present? && !current_order_cycle.has_variant?(v) # All copied from spree apart from this line - - checked = !has_checked && (v.in_stock || Spree::Config[:allow_backorders]) - - has_checked = true if checked - %li - = radio_button_tag "products[#{@product.id}]", v.id, checked, :disabled => !v.in_stock && !Spree::Config[:allow_backorders], 'data-price' => v.price_in(current_currency).display_price - %label{:for => ['products', @product.id, v.id].join('_')} - %span.variant-description= variant_options v - - if variant_price v - %span.price.diff= variant_price v diff --git a/app/overrides/spree/products/_taxons/hide_taxon_crumbs.html.haml.deface b/app/overrides/spree/products/_taxons/hide_taxon_crumbs.html.haml.deface deleted file mode 100644 index 524433516c..0000000000 --- a/app/overrides/spree/products/_taxons/hide_taxon_crumbs.html.haml.deface +++ /dev/null @@ -1 +0,0 @@ -/ remove '#taxon-crumbs' From a369b48bf49cb80ab321a29ab0d09797a464a76a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Thu, 14 Feb 2019 19:30:48 +0000 Subject: [PATCH 02/24] Bump stripe from 4.5.0 to 4.9.0 Bumps [stripe](https://github.com/stripe/stripe-ruby) from 4.5.0 to 4.9.0. - [Release notes](https://github.com/stripe/stripe-ruby/releases) - [Changelog](https://github.com/stripe/stripe-ruby/blob/master/CHANGELOG.md) - [Commits](https://github.com/stripe/stripe-ruby/compare/v4.5.0...v4.9.0) Signed-off-by: dependabot[bot] --- Gemfile | 2 +- Gemfile.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index 93aa430690..5fa4a1fa6d 100644 --- a/Gemfile +++ b/Gemfile @@ -23,7 +23,7 @@ gem 'spree_auth_devise', github: 'openfoodfoundation/spree_auth_devise', branch: # - Change type of password from string to password to hide it in the form gem 'spree_paypal_express', github: "openfoodfoundation/better_spree_paypal_express", branch: "spree-upgrade-intermediate" #gem 'spree_paypal_express', github: "spree-contrib/better_spree_paypal_express", branch: "1-3-stable" -gem 'stripe', '~> 4.5.0' +gem 'stripe', '~> 4.9.0' # We need at least this version to have Digicert's root certificate # which is needed for Pin Payments (and possibly others). gem 'activemerchant', '~> 1.78' diff --git a/Gemfile.lock b/Gemfile.lock index 2790f7ae51..e9451981a3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -724,7 +724,7 @@ GEM tilt (~> 1.1, != 1.3.0) state_machine (1.2.0) stringex (1.3.3) - stripe (4.5.0) + stripe (4.9.0) faraday (~> 0.13) net-http-persistent (~> 3.0) therubyracer (0.12.0) @@ -863,7 +863,7 @@ DEPENDENCIES spree_paypal_express! spring (= 1.7.2) spring-commands-rspec - stripe (~> 4.5.0) + stripe (~> 4.9.0) therubyracer (= 0.12.0) timecop truncate_html From 75a79717cf0edbeb64145227996273b549431364 Mon Sep 17 00:00:00 2001 From: luisramos0 Date: Fri, 15 Feb 2019 12:41:52 +0000 Subject: [PATCH 03/24] Adapt scope_variant_to_hub to new VO rules where on_demand nil is seen as use_producer_settings --- app/models/variant_override.rb | 2 +- lib/open_food_network/scope_variant_to_hub.rb | 18 ++++++------------ .../scope_variant_to_hub_spec.rb | 5 +++-- 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/app/models/variant_override.rb b/app/models/variant_override.rb index dd3b22a5e0..cea630719b 100644 --- a/app/models/variant_override.rb +++ b/app/models/variant_override.rb @@ -57,7 +57,7 @@ class VariantOverride < ActiveRecord::Base end def stock_overridden? - count_on_hand.present? + on_demand == false && count_on_hand.present? end def decrement_stock!(quantity) diff --git a/lib/open_food_network/scope_variant_to_hub.rb b/lib/open_food_network/scope_variant_to_hub.rb index bc2afa63da..55d8dd92b1 100644 --- a/lib/open_food_network/scope_variant_to_hub.rb +++ b/lib/open_food_network/scope_variant_to_hub.rb @@ -29,21 +29,15 @@ module OpenFoodNetwork end def count_on_hand - @variant_override.andand.count_on_hand || super + return super unless @variant_override.andand.stock_overridden? + + @variant_override.count_on_hand end def on_demand - if @variant_override.andand.on_demand.nil? - if @variant_override.andand.count_on_hand.present? - # If we're overriding the stock level of an on_demand variant, show it as not - # on_demand, so our stock control can take effect. - false - else - super - end - else - @variant_override.andand.on_demand - end + return super if @variant_override.andand.on_demand.nil? + + @variant_override.andand.on_demand end def decrement!(attribute, by = 1) diff --git a/spec/lib/open_food_network/scope_variant_to_hub_spec.rb b/spec/lib/open_food_network/scope_variant_to_hub_spec.rb index aa5ce4b317..03f19c62eb 100644 --- a/spec/lib/open_food_network/scope_variant_to_hub_spec.rb +++ b/spec/lib/open_food_network/scope_variant_to_hub_spec.rb @@ -1,3 +1,4 @@ +require 'spec_helper' require 'open_food_network/scope_variant_to_hub' module OpenFoodNetwork @@ -82,9 +83,9 @@ module OpenFoodNetwork before { vo.update_column(:on_demand, nil) } context "when count_on_hand is set" do - it "returns false" do + it "returns variant's on_demand" do scoper.scope v - expect(v.on_demand).to be false + expect(v.on_demand).to be true end end From ca2c8e6ff2ca4145f0ed59e739fdfb7fc1dd68ac Mon Sep 17 00:00:00 2001 From: Kristina Lim Date: Thu, 14 Feb 2019 22:18:01 +1100 Subject: [PATCH 04/24] Add test showing non-"eligible" entries included --- .../report_service_spec.rb | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/engines/order_management/spec/services/order_management/reports/enterprise_fee_summary/report_service_spec.rb b/engines/order_management/spec/services/order_management/reports/enterprise_fee_summary/report_service_spec.rb index 2161bbb4c6..b4c8162afc 100644 --- a/engines/order_management/spec/services/order_management/reports/enterprise_fee_summary/report_service_spec.rb +++ b/engines/order_management/spec/services/order_management/reports/enterprise_fee_summary/report_service_spec.rb @@ -151,6 +151,36 @@ describe OrderManagement::Reports::EnterpriseFeeSummary::ReportService do end end + describe "data exclusions" do + describe "invalid adjustments (through 'eligible') like failed payments" do + let!(:customer_order) { prepare_order(customer: customer) } + + before do + # Make the payment fail. See Spree::Payment#revoke_adjustment_eligibility. + payment = customer_order.payments.first + payment.state = "failed" + payment.save! + end + + it "is included" do + totals = service.list + + expect(totals.length).to eq(2) + + expected_result = [ + ["Payment Transaction", "Sample Distributor", "Sample Payment Method", "Sample Customer", + nil, nil, nil, "2.00"], + ["Shipment", "Sample Distributor", "Sample Shipping Method", "Sample Customer", + nil, nil, "Platform Rate", "1.00"] + ] + + expected_result.each_with_index do |expected_attributes, row_index| + expect_total_attributes(totals[row_index], expected_attributes) + end + end + end + end + describe "handling of more complex cases" do context "with non-sender fee for incoming exchange and non-receiver fee for outgoing" do let!(:variant) do From 8ce7337c9d4d5c63d5ea192962f2954860eb6e3c Mon Sep 17 00:00:00 2001 From: Kristina Lim Date: Mon, 18 Feb 2019 12:59:19 +1100 Subject: [PATCH 05/24] Add test showing $0 non-mandatory adjustments included --- .../report_service_spec.rb | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/engines/order_management/spec/services/order_management/reports/enterprise_fee_summary/report_service_spec.rb b/engines/order_management/spec/services/order_management/reports/enterprise_fee_summary/report_service_spec.rb index b4c8162afc..751f06187e 100644 --- a/engines/order_management/spec/services/order_management/reports/enterprise_fee_summary/report_service_spec.rb +++ b/engines/order_management/spec/services/order_management/reports/enterprise_fee_summary/report_service_spec.rb @@ -179,6 +179,45 @@ describe OrderManagement::Reports::EnterpriseFeeSummary::ReportService do end end end + + describe "non-mandatory $0 adjustments (through 'eligible')" do + let!(:variant) { prepare_variant(outgoing_exchange_fees: [enterprise_fee]) } + + let!(:enterprise_fee) do + create(:enterprise_fee, :per_item, name: "Sample Enterprise Fee", enterprise: distributor, + fee_type: "admin", amount: 0) + end + + let!(:customer_order) { prepare_order(customer: customer) } + + before do + # Change "eligible" in enterprise fee adjustment to false. $0 adjustments that are not + # mandatory are set to be ineligible, but there are no non-mandatory adjustments supported + # by the report yet. + adjustment = Spree::Adjustment.where(originator_type: "EnterpriseFee").first + adjustment.eligible = false + adjustment.save! + end + + it "is included" do + totals = service.list + + expect(totals.length).to eq(3) + + expected_result = [ + ["Admin", "Sample Distributor", "Sample Enterprise Fee", "Sample Customer", + "Outgoing", "Sample Distributor", nil, "0.00"], + ["Payment Transaction", "Sample Distributor", "Sample Payment Method", "Sample Customer", + nil, nil, nil, "2.00"], + ["Shipment", "Sample Distributor", "Sample Shipping Method", "Sample Customer", + nil, nil, "Platform Rate", "1.00"] + ] + + expected_result.each_with_index do |expected_attributes, row_index| + expect_total_attributes(totals[row_index], expected_attributes) + end + end + end end describe "handling of more complex cases" do From 19f99255fa64d6063734c3a4b0953d8b30ff5d2d Mon Sep 17 00:00:00 2001 From: Kristina Lim Date: Mon, 18 Feb 2019 09:30:03 +0800 Subject: [PATCH 06/24] Exclude non-eligible entries from report --- .../reports/enterprise_fee_summary/scope.rb | 2 +- .../reports/enterprise_fee_summary/report_service_spec.rb | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/scope.rb b/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/scope.rb index 9ebec61417..9760e80933 100644 --- a/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/scope.rb +++ b/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/scope.rb @@ -46,7 +46,7 @@ module OrderManagement def find_adjustments chain_to_scope do - Spree::Adjustment + Spree::Adjustment.eligible end end diff --git a/engines/order_management/spec/services/order_management/reports/enterprise_fee_summary/report_service_spec.rb b/engines/order_management/spec/services/order_management/reports/enterprise_fee_summary/report_service_spec.rb index 751f06187e..2fccd7bce0 100644 --- a/engines/order_management/spec/services/order_management/reports/enterprise_fee_summary/report_service_spec.rb +++ b/engines/order_management/spec/services/order_management/reports/enterprise_fee_summary/report_service_spec.rb @@ -165,11 +165,9 @@ describe OrderManagement::Reports::EnterpriseFeeSummary::ReportService do it "is included" do totals = service.list - expect(totals.length).to eq(2) + expect(totals.length).to eq(1) expected_result = [ - ["Payment Transaction", "Sample Distributor", "Sample Payment Method", "Sample Customer", - nil, nil, nil, "2.00"], ["Shipment", "Sample Distributor", "Sample Shipping Method", "Sample Customer", nil, nil, "Platform Rate", "1.00"] ] @@ -202,11 +200,9 @@ describe OrderManagement::Reports::EnterpriseFeeSummary::ReportService do it "is included" do totals = service.list - expect(totals.length).to eq(3) + expect(totals.length).to eq(2) expected_result = [ - ["Admin", "Sample Distributor", "Sample Enterprise Fee", "Sample Customer", - "Outgoing", "Sample Distributor", nil, "0.00"], ["Payment Transaction", "Sample Distributor", "Sample Payment Method", "Sample Customer", nil, nil, nil, "2.00"], ["Shipment", "Sample Distributor", "Sample Shipping Method", "Sample Customer", From 36fd385f7d4db12e3cbde259fdd6e0d89e967469 Mon Sep 17 00:00:00 2001 From: Kristina Lim Date: Mon, 18 Feb 2019 16:07:10 +0800 Subject: [PATCH 07/24] Add test showing $0 mandatory adjustments included --- .../report_service_spec.rb | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/engines/order_management/spec/services/order_management/reports/enterprise_fee_summary/report_service_spec.rb b/engines/order_management/spec/services/order_management/reports/enterprise_fee_summary/report_service_spec.rb index 2fccd7bce0..e9fbc62f89 100644 --- a/engines/order_management/spec/services/order_management/reports/enterprise_fee_summary/report_service_spec.rb +++ b/engines/order_management/spec/services/order_management/reports/enterprise_fee_summary/report_service_spec.rb @@ -214,6 +214,31 @@ describe OrderManagement::Reports::EnterpriseFeeSummary::ReportService do end end end + + describe "$0 mandatory adjustments" do + let!(:payment_method) do + create(:payment_method, :per_item, amount: 0, name: "Sample Payment Method") + end + + let!(:customer_order) { prepare_order(customer: customer) } + + it "is included" do + totals = service.list + + expect(totals.length).to eq(2) + + expected_result = [ + ["Payment Transaction", "Sample Distributor", "Sample Payment Method", "Sample Customer", + nil, nil, nil, "0.00"], + ["Shipment", "Sample Distributor", "Sample Shipping Method", "Sample Customer", + nil, nil, "Platform Rate", "1.00"] + ] + + expected_result.each_with_index do |expected_attributes, row_index| + expect_total_attributes(totals[row_index], expected_attributes) + end + end + end end describe "handling of more complex cases" do From b0a82b0e214686899aedc3967e59eebb0d9e4c1b Mon Sep 17 00:00:00 2001 From: Kristina Lim Date: Mon, 18 Feb 2019 16:52:40 +0800 Subject: [PATCH 08/24] Exclude $0 adjustments from report --- .../reports/enterprise_fee_summary/scope.rb | 6 +++++- .../reports/enterprise_fee_summary/report_service_spec.rb | 4 +--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/scope.rb b/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/scope.rb index 9760e80933..d6bcb8554a 100644 --- a/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/scope.rb +++ b/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/scope.rb @@ -17,7 +17,7 @@ module OrderManagement end def result - group_data.select_attributes + group_data.exclude_groups_with_zero_total.select_attributes @scope.all end @@ -336,6 +336,10 @@ module OrderManagement if params.payment_method_ids.present? end + def exclude_groups_with_zero_total + filter_scope("spree_adjustments.amount != 0") + end + def group_data chain_to_scope do group("enterprise_fees.id", "enterprises.id", "customers.id", "hubs.id", diff --git a/engines/order_management/spec/services/order_management/reports/enterprise_fee_summary/report_service_spec.rb b/engines/order_management/spec/services/order_management/reports/enterprise_fee_summary/report_service_spec.rb index e9fbc62f89..38a760dc96 100644 --- a/engines/order_management/spec/services/order_management/reports/enterprise_fee_summary/report_service_spec.rb +++ b/engines/order_management/spec/services/order_management/reports/enterprise_fee_summary/report_service_spec.rb @@ -225,11 +225,9 @@ describe OrderManagement::Reports::EnterpriseFeeSummary::ReportService do it "is included" do totals = service.list - expect(totals.length).to eq(2) + expect(totals.length).to eq(1) expected_result = [ - ["Payment Transaction", "Sample Distributor", "Sample Payment Method", "Sample Customer", - nil, nil, nil, "0.00"], ["Shipment", "Sample Distributor", "Sample Shipping Method", "Sample Customer", nil, nil, "Platform Rate", "1.00"] ] From 47e154f2ac837d0e5088e25f59d9f2b64a6b593f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Tue, 19 Feb 2019 19:21:37 +0000 Subject: [PATCH 09/24] Bump oj from 3.7.8 to 3.7.9 Bumps [oj](https://github.com/ohler55/oj) from 3.7.8 to 3.7.9. - [Release notes](https://github.com/ohler55/oj/releases) - [Changelog](https://github.com/ohler55/oj/blob/master/CHANGELOG.md) - [Commits](https://github.com/ohler55/oj/compare/v3.7.8...v3.7.9) Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 87b0c1f49d..f88886708e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -559,7 +559,7 @@ GEM multi_json (~> 1.3) multi_xml (~> 0.5) rack (>= 1.2, < 3) - oj (3.7.8) + oj (3.7.9) orm_adapter (0.5.0) paper_trail (5.2.3) activerecord (>= 3.0, < 6.0) From ef786adcfce6bb37adf6777bf1bb3e4111413105 Mon Sep 17 00:00:00 2001 From: luisramos0 Date: Wed, 20 Feb 2019 13:07:21 +0000 Subject: [PATCH 10/24] Make variant_override.stock_overridden? simpler and add comment to explain relationship between count_on_hand and on_demand in a VO --- app/models/variant_override.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/models/variant_override.rb b/app/models/variant_override.rb index cea630719b..a00caef367 100644 --- a/app/models/variant_override.rb +++ b/app/models/variant_override.rb @@ -57,7 +57,9 @@ class VariantOverride < ActiveRecord::Base end def stock_overridden? - on_demand == false && count_on_hand.present? + # If count_on_hand is present, it means on_demand is false + # See StockSettingsOverrideValidation for details + count_on_hand.present? end def decrement_stock!(quantity) From 45e5fed609b11776f162eba9382ab5f65a4bc411 Mon Sep 17 00:00:00 2001 From: luisramos0 Date: Thu, 21 Feb 2019 11:25:01 +0000 Subject: [PATCH 11/24] Improve scope_variant_to_hub code and spec by testing an invalid data state --- app/models/variant_override.rb | 4 ++++ lib/open_food_network/scope_variant_to_hub.rb | 16 ++++++++++------ .../scope_variant_to_hub_spec.rb | 14 +++++++------- 3 files changed, 21 insertions(+), 13 deletions(-) diff --git a/app/models/variant_override.rb b/app/models/variant_override.rb index a00caef367..6b43822e6c 100644 --- a/app/models/variant_override.rb +++ b/app/models/variant_override.rb @@ -62,6 +62,10 @@ class VariantOverride < ActiveRecord::Base count_on_hand.present? end + def use_producer_settings? + on_demand.nil? + end + def decrement_stock!(quantity) if stock_overridden? decrement! :count_on_hand, quantity diff --git a/lib/open_food_network/scope_variant_to_hub.rb b/lib/open_food_network/scope_variant_to_hub.rb index 55d8dd92b1..d838e253cb 100644 --- a/lib/open_food_network/scope_variant_to_hub.rb +++ b/lib/open_food_network/scope_variant_to_hub.rb @@ -29,15 +29,19 @@ module OpenFoodNetwork end def count_on_hand - return super unless @variant_override.andand.stock_overridden? - - @variant_override.count_on_hand + if @variant_override.present? && @variant_override.stock_overridden? + @variant_override.count_on_hand + else + super + end end def on_demand - return super if @variant_override.andand.on_demand.nil? - - @variant_override.andand.on_demand + if @variant_override.present? && !@variant_override.use_producer_settings? + @variant_override.on_demand + else + super + end end def decrement!(attribute, by = 1) diff --git a/spec/lib/open_food_network/scope_variant_to_hub_spec.rb b/spec/lib/open_food_network/scope_variant_to_hub_spec.rb index 03f19c62eb..4f0ec5f13e 100644 --- a/spec/lib/open_food_network/scope_variant_to_hub_spec.rb +++ b/spec/lib/open_food_network/scope_variant_to_hub_spec.rb @@ -82,13 +82,6 @@ module OpenFoodNetwork context "without an on_demand set" do before { vo.update_column(:on_demand, nil) } - context "when count_on_hand is set" do - it "returns variant's on_demand" do - scoper.scope v - expect(v.on_demand).to be true - end - end - context "when count_on_hand is not set" do before { vo.update_column(:count_on_hand, nil) } @@ -97,6 +90,13 @@ module OpenFoodNetwork expect(v.on_demand).to be true end end + + context "when count_on_hand is set" do + it "should return validation error on save" do + scoper.scope v + expect{ vo.save! }.to raise_error ActiveRecord::RecordInvalid + end + end end end From 0b1ea1beda14016ddca2d97ad07336989044c819 Mon Sep 17 00:00:00 2001 From: luisramos0 Date: Fri, 22 Feb 2019 09:41:25 +0000 Subject: [PATCH 12/24] Rename VariantOverride.use_producer_settings to VariantOverride.use_producer_stock_settings --- app/models/variant_override.rb | 2 +- lib/open_food_network/scope_variant_to_hub.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/variant_override.rb b/app/models/variant_override.rb index 6b43822e6c..355a46d1db 100644 --- a/app/models/variant_override.rb +++ b/app/models/variant_override.rb @@ -62,7 +62,7 @@ class VariantOverride < ActiveRecord::Base count_on_hand.present? end - def use_producer_settings? + def use_producer_stock_settings? on_demand.nil? end diff --git a/lib/open_food_network/scope_variant_to_hub.rb b/lib/open_food_network/scope_variant_to_hub.rb index d838e253cb..a721505f7f 100644 --- a/lib/open_food_network/scope_variant_to_hub.rb +++ b/lib/open_food_network/scope_variant_to_hub.rb @@ -37,7 +37,7 @@ module OpenFoodNetwork end def on_demand - if @variant_override.present? && !@variant_override.use_producer_settings? + if @variant_override.present? && !@variant_override.use_producer_stock_settings? @variant_override.on_demand else super From ee8fe4b6b407356a9647692a0733c263bda2ccaf Mon Sep 17 00:00:00 2001 From: luisramos0 Date: Thu, 14 Jun 2018 16:21:11 +0100 Subject: [PATCH 13/24] Move registration process translations to lazy lookups to better organize the en.yml file --- .../registration_authentication.html.haml | 8 +- app/views/registration/steps/_about.html.haml | 28 +- .../registration/steps/_contact.html.haml | 16 +- .../registration/steps/_details.html.haml | 43 ++- .../registration/steps/_finished.html.haml | 8 +- .../steps/_introduction.html.haml | 28 +- .../steps/_limit_reached.html.haml | 8 +- app/views/registration/steps/_logo.html.haml | 18 +- app/views/registration/steps/_promo.html.haml | 18 +- .../registration/steps/_social.html.haml | 24 +- app/views/registration/steps/_steps.html.haml | 2 +- config/locales/en.yml | 280 ++++++++---------- spec/features/consumer/registration_spec.rb | 2 +- 13 files changed, 219 insertions(+), 264 deletions(-) diff --git a/app/assets/javascripts/templates/registration_authentication.html.haml b/app/assets/javascripts/templates/registration_authentication.html.haml index f277c50abc..b5a525c3f2 100644 --- a/app/assets/javascripts/templates/registration_authentication.html.haml +++ b/app/assets/javascripts/templates/registration_authentication.html.haml @@ -1,7 +1,7 @@ .container .row.modal-centered - %h2 {{'welcome_to_ofn' | t}} - %h5 {{'signup_or_login' | t}}: + %h2 {{'js.registration.welcome_to_ofn' | t}} + %h5 {{'js.registration.signup_or_login' | t}}: %div{"ng-controller" => "AuthenticationCtrl"} %tabset %ng-include{src: "'signup.html'"} @@ -9,9 +9,9 @@ %ng-include{src: "'forgot.html'"} %div{ ng: { show: "active('/signup')"} } %hr - {{'have_an_account' | t}} + {{'js.registration.have_an_account' | t}} %a{ href: "", ng: { click: "select('/login')"}} - {{'action_login' | t}} + {{'js.registration.action_login' | t}} %a.close-reveal-modal{"ng-click" => "$close()"} %i.ofn-i_009-close diff --git a/app/views/registration/steps/_about.html.haml b/app/views/registration/steps/_about.html.haml index 529fdebea3..5ec5dbb2c7 100644 --- a/app/views/registration/steps/_about.html.haml +++ b/app/views/registration/steps/_about.html.haml @@ -4,9 +4,9 @@ .row .small-12.columns %header - %h2 {{'enterprise_about_headline' | t}} + %h2= t(".headline") %h5 - {{'enterprise_about_message' | t}} + = t(".message") %span{ ng: { class: "{brick: !enterprise.is_primary_producer, turquoise: enterprise.is_primary_producer}" } } {{ enterprise.name }} @@ -14,33 +14,33 @@ .row .small-12.columns .alert-box.info{ "ofn-inline-alert" => true, ng: { show: "visible" } } - %h6{ "ng-bind" => "'enterprise_success' | t:{enterprise: enterprise.name}" } - %span {{'enterprise_registration_exit_message' | t}} + %h6{ "ng-bind" => "'registration.steps.about.success' | t:{enterprise: enterprise.name}" } + %span= t(".registration_exit_message") %a.close{ ng: { click: "close()" } } × .small-12.large-8.columns .row .small-12.columns .field - %label{ for: 'enterprise_description' } {{'enterprise_description' | t}}: - %input.chunky{ id: 'enterprise_description', placeholder: "{{'enterprise_description_placeholder' | t}}", ng: { model: 'enterprise.description' } } + %label{ for: 'enterprise_description' }= t(".enterprise_description") + %input.chunky{ id: 'enterprise_description', placeholder: "{{'registration.steps.about.enterprise_description_placeholder' | t}}", ng: { model: 'enterprise.description' } } .row .small-12.columns .field - %label{ for: 'enterprise_long_desc' } {{'enterprise_long_desc' | t}}: - %textarea.chunky{ id: 'enterprise_long_desc', rows: 6, placeholder: "{{'enterprise_long_desc_placeholder' | t}}", ng: { model: 'enterprise.long_description' } } - %small{ "ng-bind" => "'enterprise_long_desc_length' | t:{num: enterprise.long_description.length}" } + %label{ for: 'enterprise_long_desc' }= t(".enterprise_long_desc") + %textarea.chunky{ id: 'enterprise_long_desc', rows: 6, placeholder: "{{'registration.steps.about.enterprise_long_desc_placeholder' | t}}", ng: { model: 'enterprise.long_description' } } + %small{ "ng-bind" => "'registration.steps.about.enterprise_long_desc_length' | t:{num: enterprise.long_description.length}" } .small-12.large-4.columns .row .small-12.columns .field - %label{ for: 'enterprise_abn' } {{'enterprise_abn' | t}}: - %input.chunky{ id: 'enterprise_abn', placeholder: "{{'enterprise_abn_placeholder' | t}}", ng: { model: 'enterprise.abn' } } + %label{ for: 'enterprise_abn' }= t(".enterprise_abn")+":" + %input.chunky{ id: 'enterprise_abn', placeholder: "{{'registration.steps.about.enterprise_abn_placeholder' | t}}", ng: { model: 'enterprise.abn' } } .row .small-12.columns .field - %label{ for: 'enterprise_acn' } {{'enterprise_acn' | t}}: - %input.chunky{ id: 'enterprise_acn', placeholder: "{{'enterprise_acn_placeholder' | t}}", ng: { model: 'enterprise.acn' } } + %label{ for: 'enterprise_acn' }= t(".enterprise_acn")+":" + %input.chunky{ id: 'enterprise_acn', placeholder: "{{'registration.steps.about.enterprise_acn_placeholder' | t}}", ng: { model: 'enterprise.acn' } } .row .small-12.columns .field @@ -50,7 +50,7 @@ %input{ id: 'enterprise_charges_sales_tax_false', type: 'radio', name: 'charges_sales_tax', value: 'false', required: true, ng: { model: 'enterprise.charges_sales_tax' } } %label{ for: 'enterprise_charges_sales_tax_false' } {{'say_no' | t}} %span.error.small-12.columns{ ng: { show: "about.charges_sales_tax.$error.required && submitted" } } - {{'enterprise_tax_required' | t}} + = t(".enterprise_tax_required") .row.buttons.pad-top .small-12.columns diff --git a/app/views/registration/steps/_contact.html.haml b/app/views/registration/steps/_contact.html.haml index 746503282d..eed9c25c73 100644 --- a/app/views/registration/steps/_contact.html.haml +++ b/app/views/registration/steps/_contact.html.haml @@ -4,26 +4,26 @@ .row .small-12.columns %header - %h2 {{'registration_greeting' | t}} - %h5{ "ng-bind" => "'who_is_managing_enterprise' | t:{enterprise: enterprise.name}" } + %h2= t('registration.steps.introduction.registration_greeting') + %h5{ "ng-bind" => "'registration.steps.contact.who_is_managing_enterprise' | t:{enterprise: enterprise.name}" } %form{ name: 'contact', novalidate: true, ng: { controller: "RegistrationFormCtrl", submit: "selectIfValid('type',contact)" } } .row.content .small-12.medium-12.large-7.columns .row .small-12.columns.field - %label{ for: 'enterprise_contact' } {{'enterprise.registration.modal.steps.contact.contact_field' | t}}: - %input.chunky.small-12.columns{ id: 'enterprise_contact', name: 'contact_name', required: true, placeholder: "{{'enterprise.registration.modal.steps.contact.contact_field_placeholder' | t}}", ng: { model: 'enterprise.contact_name' } } + %label{ for: 'enterprise_contact' }= t(".contact_field") + %input.chunky.small-12.columns{ id: 'enterprise_contact', name: 'contact_name', required: true, placeholder: "{{'registration.steps.contact.contact_field_placeholder' | t}}", ng: { model: 'enterprise.contact_name' } } %span.error.small-12.columns{ ng: { show: "contact.contact_name.$error.required && submitted" } } - {{'enterprise.registration.modal.steps.contact.contact_field_required' | t}} + = t(".contact_field_required") .row .small-12.columns.field - %label{ for: 'enterprise_email_address' } {{'admin.enterprises.form.contact.email_address' | t}}: + %label{ for: 'enterprise_email_address' }= t("admin.enterprises.form.contact.email_address")+":" %input.chunky.small-12.columns{ id: 'enterprise_email_address', name: 'email_address', type: 'email', placeholder: t('admin.enterprises.form.contact.email_address_placeholder'), ng: { model: 'enterprise.email_address' } } .row .small-12.columns.field - %label{ for: 'enterprise_phone' } {{'enterprise.registration.modal.steps.contact.phone_field' | t}}: - %input.chunky.small-12.columns{ id: 'enterprise_phone', name: 'phone', placeholder: "{{'enterprise.registration.modal.steps.contact.phone_field_placeholder' | t}}", ng: { model: 'enterprise.phone' } } + %label{ for: 'enterprise_phone' }= t(".phone_field")+":" + %input.chunky.small-12.columns{ id: 'enterprise_phone', name: 'phone', placeholder: "{{'registration.steps.contact.phone_field_placeholder' | t}}", ng: { model: 'enterprise.phone' } } .small-12.medium-12.large-5.hide-for-small-only .row.buttons diff --git a/app/views/registration/steps/_details.html.haml b/app/views/registration/steps/_details.html.haml index 4fce6a4319..6639919830 100644 --- a/app/views/registration/steps/_details.html.haml +++ b/app/views/registration/steps/_details.html.haml @@ -4,60 +4,59 @@ .row .small-12.columns %header - %h2 {{'enterprise.registration.modal.steps.details.headline' | t}} - %h5{ ng: { if: "::enterprise.type != 'own'" } } {{'enterprise.registration.modal.steps.details.enterprise' | t}} - %h5{ ng: { if: "::enterprise.type == 'own'" } } {{'enterprise.registration.modal.steps.details.producer' | t}} + %h2= t('.headline') + %h5{ ng: { if: "::enterprise.type != 'own'" } }= t(".enterprise") + %h5{ ng: { if: "::enterprise.type == 'own'" } }= t(".producer") %form{ name: 'details', novalidate: true, ng: { controller: "RegistrationFormCtrl", submit: "selectIfValid('contact',details)" } } .row .small-12.medium-9.large-12.columns.end .field - %label{ for: 'enterprise_name', ng: { if: "::enterprise.type != 'own'" } } {{'enterprise.registration.modal.steps.details.enterprise_name_field' | t}} - %label{ for: 'enterprise_name', ng: { if: "::enterprise.type == 'own'" } } {{'enterprise.registration.modal.steps.details.producer_name_field' | t}} - %input.chunky{ id: 'enterprise_name', name: 'name', placeholder: "{{'enterprise.registration.modal.steps.details.producer_name_field_placeholder' | t}}", required: true, ng: { model: 'enterprise.name' } } + %label{ for: 'enterprise_name', ng: { if: "::enterprise.type != 'own'" } }= t(".enterprise_name_field") + %label{ for: 'enterprise_name', ng: { if: "::enterprise.type == 'own'" } }= t(".producer_name_field") + %input.chunky{ id: 'enterprise_name', name: 'name', placeholder: "{{'registration.steps.details.producer_name_field_placeholder' | t}}", required: true, ng: { model: 'enterprise.name' } } %span.error{ ng: { show: "details.name.$error.required && submitted" } } - {{'enterprise.registration.modal.steps.details.producer_name_field_error' | t}} + = t(".producer_name_field_error") .row .small-12.medium-9.large-6.columns .field - %label{ for: 'enterprise_address' } {{'enterprise.registration.modal.steps.details.address1_field' | t}} - %input.chunky{ id: 'enterprise_address', name: 'address1', required: true, placeholder: "{{'enterprise.registration.modal.steps.details.address1_field_placeholder' | t}}", required: true, ng: { model: 'enterprise.address.address1' } } + %label{ for: 'enterprise_address' }= t(".address1_field") + %input.chunky{ id: 'enterprise_address', name: 'address1', required: true, placeholder: "{{'registration.steps.details.address1_field_placeholder' | t}}", required: true, ng: { model: 'enterprise.address.address1' } } %span.error{ ng: { show: "details.address1.$error.required && submitted" } } - {{'enterprise.registration.modal.steps.details.address1_field_error' | t}} + = t(".address1_field_error") .field - %label{ for: 'enterprise_address2' } {{'enterprise.registration.modal.steps.details.address2_field' | t}} + %label{ for: 'enterprise_address2' }= t(".address2_field") %input.chunky{ id: 'enterprise_address2', name: 'address2', required: false, placeholder: "", required: false, ng: { model: 'enterprise.address.address2' } } .small-12.medium-9.large-6.columns.end .row .small-12.medium-8.large-8.columns .field - %label{ for: 'enterprise_city' } {{'enterprise.registration.modal.steps.details.suburb_field' | t}} - %input.chunky{ id: 'enterprise_city', name: 'city', required: true, placeholder: "{{'enterprise.registration.modal.steps.details.suburb_field_placeholder' | t}}", ng: { model: 'enterprise.address.city' } } + %label{ for: 'enterprise_city' }= t('.suburb_field') + %input.chunky{ id: 'enterprise_city', name: 'city', required: true, placeholder: "{{'registration.steps.details.suburb_field_placeholder' | t}}", ng: { model: 'enterprise.address.city' } } %span.error{ ng: { show: "details.city.$error.required && submitted" } } - {{'enterprise.registration.modal.steps.details.suburb_field_error' | t}} + = t(".suburb_field_error") .small-12.medium-4.large-4.columns .field - %label{ for: 'enterprise_zipcode' } {{'enterprise.registration.modal.steps.details.postcode_field' | t}} - %input.chunky{ id: 'enterprise_zipcode', name: 'zipcode', required: true, placeholder: "{{'enterprise.registration.modal.steps.details.postcode_field_placeholder' | t}}", ng: { model: 'enterprise.address.zipcode' } } + %label{ for: 'enterprise_zipcode' }= t(".postcode_field") + %input.chunky{ id: 'enterprise_zipcode', name: 'zipcode', required: true, placeholder: "{{'registration.steps.details.postcode_field_placeholder' | t}}", ng: { model: 'enterprise.address.zipcode' } } %span.error{ ng: { show: "details.zipcode.$error.required && submitted" } } - {{'enterprise.registration.modal.steps.details.postcode_field_error' | t}} + = t(".postcode_field_error") .row .small-12.medium-4.large-4.columns .field - %label{ for: 'enterprise_state' } {{'enterprise.registration.modal.steps.details.state_field' | t}} + %label{ for: 'enterprise_state' }= t(".state_field") %select.chunky{ id: 'enterprise_state', name: 'state', ng: { model: 'enterprise.address.state_id', options: 's.id as s.abbr for s in enterprise.country.states', show: 'countryHasStates()', required: 'countryHasStates()' } } %span.error{ ng: { show: "details.state.$error.required && submitted" } } - {{'enterprise.registration.modal.steps.details.state_field_error' | t}} + = t(".state_field_error") .small-12.medium-8.large-8.columns .field - %label{ for: 'enterprise_country' } {{'enterprise.registration.modal.steps.details.country_field' | t}} + %label{ for: 'enterprise_country' }= t(".country_field") %select.chunky{ id: 'enterprise_country', name: 'country', required: true, ng: { init: "setDefaultCountry(#{Spree::Config[:default_country_id]})", model: 'enterprise.country', options: 'c as c.name for c in countries' } } %span.error{ ng: { show: "details.country.$error.required && submitted" } } - {{'enterprise.registration.modal.steps.details.country_field_error' | t}} - + = t(".country_field_error") .row.buttons .small-12.columns diff --git a/app/views/registration/steps/_finished.html.haml b/app/views/registration/steps/_finished.html.haml index 96ed600147..d22384dbdb 100644 --- a/app/views/registration/steps/_finished.html.haml +++ b/app/views/registration/steps/_finished.html.haml @@ -3,10 +3,10 @@ .row .small-12.columns.pad-top %header - %h2 {{'registration_finished_headline' | t}} + %h2= t(".headline") .panel.callout - %p{ "ng-bind" => "'registration_finished_thanks' | t:{enterprise: enterprise.name}" } - %p {{'registration_finished_login' | t}} + %p{ "ng-bind" => "'registration.steps.finished.thanks' | t:{enterprise: enterprise.name}" } + %p= t(".login") .row .small-12.columns.text-center - %a.button.primary{ type: "button", href: "/" } {{'registration_finished_action' | t}} > + %a.button.primary{ type: "button", href: "/" }= "#{t(".action")} >" diff --git a/app/views/registration/steps/_introduction.html.haml b/app/views/registration/steps/_introduction.html.haml index f973ca055a..84bbb9840e 100644 --- a/app/views/registration/steps/_introduction.html.haml +++ b/app/views/registration/steps/_introduction.html.haml @@ -2,35 +2,35 @@ .row .small-12.columns %header - %h2 {{'registration_greeting' | t}} + %h2= t(".registration_greeting") %h4 %small %i.ofn-i_040-hub - {{'registration_intro' | t}} + = t(".registration_intro") .row{ 'data-equalizer' => true } .small-12.medium-12.large-6.columns.pad-top{ 'data-equalizer-watch' => true } - %h5 {{'registration_checklist' | t}}: + %h5= t(".registration_checklist")+":" %ul.check-list %li - {{'registration_time' | t}} + = t(".registration_time") %li - {{'registration_enterprise_address' | t}} + = t(".registration_enterprise_address") %li - {{'registration_contact_details' | t}} + = t(".registration_contact_details") %li - {{'registration_logo' | t}} + = t(".registration_logo") %li - {{'registration_promo_image' | t}} + = t(".registration_promo_image") %li - {{'registration_about_us' | t}} + = t(".registration_about_us") .small-9.medium-8.large-5.columns.pad-top.end{ 'data-equalizer-watch' => true} %h5 - {{'registration_outcome_headline' | t}} - %p{ "ng-bind-html" => "t('registration_outcome1_html')" } - %p {{'registration_outcome2' | t}} - %p {{'registration_outcome3' | t}} + = t(".registration_outcome_headline") + %p= t(".registration_outcome1_html") + %p= t(".registration_outcome2") + %p= t(".registration_outcome3") .row{'ng-init' => "tos_required=#{Spree::Config.enterprises_require_tos}" } %hr @@ -43,4 +43,4 @@ %label{for: "accept_terms"} #{t(:enterprise_tos_agree)} .small-12.medium-6.columns - %input.button.primary.left{ type: "button", value: "{{'registration_action' | t}}", ng: { click: "select('details')", disabled: "tos_required && !tos_accepted", model: "tos_accepted"} } + %input.button.primary.left{ type: "button", value: "{{'registration.steps.introduction.registration_action' | t}}", ng: { click: "select('details')", disabled: "tos_required && !tos_accepted", model: "tos_accepted"} } diff --git a/app/views/registration/steps/_limit_reached.html.haml b/app/views/registration/steps/_limit_reached.html.haml index 44f3b53f22..c8fa25a43c 100644 --- a/app/views/registration/steps/_limit_reached.html.haml +++ b/app/views/registration/steps/_limit_reached.html.haml @@ -2,16 +2,16 @@ .row .small-12.columns %header - %h2 {{'limit_reached_headline' | t}} - %h4 {{'limit_reached_message' | t}} + %h2= t(".headline") + %h4= t(".message") .row .small-12.medium-3.large-2.columns.text-right.hide-for-small-only %img{:src => "/assets/potatoes.png"} .small-12.medium-9.large-10.columns %p - {{'limit_reached_text' | t}} + = t(".text") %strong Open Food Network. .row .small-12.columns %hr - %input.button.primary{ type: "button", value: "{{'limit_reached_action' | t}}", ng: { click: "close()" } } + %input.button.primary{ type: "button", value: "{{'registration.steps.limit_reached.action' | t}}", ng: { click: "close()" } } diff --git a/app/views/registration/steps/_logo.html.haml b/app/views/registration/steps/_logo.html.haml index 3d1effdf93..677653b4bb 100644 --- a/app/views/registration/steps/_logo.html.haml +++ b/app/views/registration/steps/_logo.html.haml @@ -5,42 +5,42 @@ .row .small-12.columns.center %h4 - {{'select_logo' | t}} + = t(".select_logo") .row .small-12.columns.center %span.small - {{'logo_tip' | t}} + = t(".logo_tip") .row.pad-top .small-12.columns .image-select.small-12.columns - %label.small-12.columns.button{ for: 'image-select' } {{'logo_label' | t}} + %label.small-12.columns.button{ for: 'image-select' }= t(".logo_label") %input#image-select{ type: 'file', hidden: true, 'nv-file-select' => true, uploader: "imageUploader", options: '{ alias: imageStep }' } .row.show-for-large-up .large-12.columns %span#or.large-12.columns - {{'action_or' | t}} + = t("action_or") .row.show-for-large-up .large-12.columns #image-over{ 'nv-file-over' => true, uploader: "imageUploader" } - {{'logo_drag' | t}} + = t(".logo_drag") .small-12.medium-12.large-6.columns .row .small-12.columns.center .row .small-12.columns.center %h4 - {{'review_logo' | t}} + = t(".review_logo") .row .small-12.columns.center %span.small - {{'review_logo_tip' | t}} + = t(".review_logo_tip") .row.pad-top .small-12.columns.center #image-placeholder.logo %img{ ng: { show: "imageSrc() && !imageUploader.isUploading", src: '{{ imageSrc() }}' } } .message{ ng: { hide: "imageSrc() || imageUploader.isUploading" } } - {{'logo_placeholder' | t}} + = t(".logo_placeholder") .loading{ ng: { hide: "!imageUploader.isUploading" } } %img.spinner{ src: "/assets/spinning-circles.svg" } %br/ - {{'uploading' | t}} + = t("registration.steps.images.uploading") diff --git a/app/views/registration/steps/_promo.html.haml b/app/views/registration/steps/_promo.html.haml index 0b224e1f64..91a8bc9a78 100644 --- a/app/views/registration/steps/_promo.html.haml +++ b/app/views/registration/steps/_promo.html.haml @@ -3,42 +3,42 @@ .row .small-12.columns.center %h4 - {{'select_promo_image' | t}} + = t(".select_promo_image") .row .small-12.medium-12.large-5.columns.center .row .small-12.columns.center %span.small - {{'promo_image_tip' | t}} + = t(".promo_image_tip") .row.pad-top .small-12.columns .image-select.small-12.columns - %label.small-12.columns.button{ for: 'image-select' } {{'promo_image_label' | t}} + %label.small-12.columns.button{ for: 'image-select' }= t(".promo_image_label") %input#image-select{ type: 'file', hidden: true, 'nv-file-select' => true, uploader: "imageUploader", options: '{ alias: imageStep }' } .large-2.columns %span#or.horizontal.large-12.columns - {{'action_or' | t}} + = t("action_or") .large-5.columns #image-over{ 'nv-file-over' => true, uploader: "imageUploader" } - {{'promo_image_drag' | t}} + = t(".promo_image_drag") .small-12.medium-12.large-12.columns.pad-top .row .small-12.columns.center %h4 - {{'review_promo_image' | t}} + = t(".review_promo_image") .row .small-12.columns.center .row .small-12.columns.center %span.small - {{'review_promo_image_tip' | t}} + = t(".review_promo_image_tip") .row.pad-top .small-12.columns.center #image-placeholder.promo %img{ ng: { show: "imageSrc() && !imageUploader.isUploading", src: '{{ imageSrc() }}' } } .message{ ng: { hide: "imageSrc() || imageUploader.isUploading" } } - {{'promo_image_placeholder' | t}} + = t(".promo_image_placeholder") .loading{ ng: { hide: "!imageUploader.isUploading" } } %img.spinner{ src: "/assets/spinning-circles.svg" } %br/ - {{'uploading' | t}} + = t("registration.steps.images.uploading") diff --git a/app/views/registration/steps/_social.html.haml b/app/views/registration/steps/_social.html.haml index edbdd94dd9..8552b927b7 100644 --- a/app/views/registration/steps/_social.html.haml +++ b/app/views/registration/steps/_social.html.haml @@ -5,8 +5,8 @@ .row .small-12.columns %header - %h2 {{'enterprise_final_step' | t}} - %h5{ "ng-bind" => "'enterprise_social_text' | t:{enterprise: enterprise.name}" } + %h2= t(".enterprise_final_step") + %h5{ "ng-bind" => "'registration.steps.social.enterprise_social_text' | t:{enterprise: enterprise.name}" } %form{ name: 'social', novalidate: true, ng: { controller: "RegistrationFormCtrl", submit: "update('finished',social)" } } .row.content @@ -14,29 +14,29 @@ .row .small-12.columns .field - %label{ for: 'enterprise_website' } {{'website' | t}}: - %input.chunky{ id: 'enterprise_website', placeholder: "{{'website_placeholder' | t}}", ng: { model: 'enterprise.website' } } + %label{ for: 'enterprise_website' }= t(".website")+":" + %input.chunky{ id: 'enterprise_website', placeholder: "{{'registration.steps.social.website_placeholder' | t}}", ng: { model: 'enterprise.website' } } .row .small-12.columns .field - %label{ for: 'enterprise_facebook' } {{'facebook' | t}}: - %input.chunky{ id: 'enterprise_facebook', placeholder: "{{'facebook_placeholder' | t}}", ng: { model: 'enterprise.facebook' } } + %label{ for: 'enterprise_facebook' }= t(".facebook")+":" + %input.chunky{ id: 'enterprise_facebook', placeholder: "{{'registration.steps.social.facebook_placeholder' | t}}", ng: { model: 'enterprise.facebook' } } .row .small-12.columns .field - %label{ for: 'enterprise_linkedin' } {{'linkedin' | t}}: - %input.chunky{ id: 'enterprise_linkedin', placeholder: "{{'linkedin_placeholder' | t}}", ng: { model: 'enterprise.linkedin' } } + %label{ for: 'enterprise_linkedin' }= t(".linkedin")+":" + %input.chunky{ id: 'enterprise_linkedin', placeholder: "{{'registration.steps.social.linkedin_placeholder' | t}}", ng: { model: 'enterprise.linkedin' } } .small-12.large-5.columns .row .small-12.columns .field - %label{ for: 'enterprise_twitter' } {{'twitter' | t}}: - %input.chunky{ id: 'enterprise_twitter', placeholder: "{{'twitter_placeholder' | t}}", ng: { model: 'enterprise.twitter' } } + %label{ for: 'enterprise_twitter' }= t(".twitter")+":" + %input.chunky{ id: 'enterprise_twitter', placeholder: "{{'registration.steps.social.twitter_placeholder' | t}}", ng: { model: 'enterprise.twitter' } } .row .small-12.columns .field - %label{ for: 'enterprise_instagram' } {{'instagram' | t}}: - %input.chunky{ id: 'enterprise_instagram', placeholder: "{{'instagram_placeholder' | t}}", ng: { model: 'enterprise.instagram' } } + %label{ for: 'enterprise_instagram' }= t(".instagram")+":" + %input.chunky{ id: 'enterprise_instagram', placeholder: "{{'registration.steps.social.instagram_placeholder' | t}}", ng: { model: 'enterprise.instagram' } } .row.buttons .small-12.columns diff --git a/app/views/registration/steps/_steps.html.haml b/app/views/registration/steps/_steps.html.haml index 3538d5ff48..081cd97d98 100644 --- a/app/views/registration/steps/_steps.html.haml +++ b/app/views/registration/steps/_steps.html.haml @@ -1,5 +1,5 @@ %script{ type: "text/ng-template", id: "registration/steps.html" } .row#progress-bar .small-12.medium-2.columns.item{ ng: { repeat: 'step in steps', class: "{active: (currentStep() == step),'show-for-medium-up': (currentStep() != step)}" } } - {{ $index+1 + ". " + ('enterprise.registration.modal.steps.' + step + '.title' | t) }} + {{ $index+1 + ". " + ('registration.steps.' + step + '.title' | t) }} diff --git a/config/locales/en.yml b/config/locales/en.yml index fc1595d709..486e5cb6e3 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1867,24 +1867,60 @@ See the %{link} to find out more about %{sitename}'s features and to start using choose_password: "Choose a password" confirm_password: "Confirm password" action_signup: "Sign up now" - welcome_to_ofn: "Welcome to the Open Food Network!" - signup_or_login: "Start By Signing Up (or logging in)" - have_an_account: "Already have an account?" - action_login: "Log in now." forgot_password: "Forgot Password?" password_reset_sent: "An email with instructions on resetting your password has been sent!" reset_password: "Reset password" - registration_greeting: "Greetings!" - who_is_managing_enterprise: "Who is responsible for managing %{enterprise}?" update_and_recalculate_fees: "Update And Recalculate Fees" registration: steps: - images: - continue: "Continue" - back: "Back" - headline: "Thanks!" - description: "Let's upload some pretty pictures so your profile looks great! :)" + introduction: + registration_greeting: "Hi there!" + registration_intro: "You can now create a profile for your Producer or Hub" + registration_checklist: "You'll need" + registration_time: "5-10 minutes" + registration_enterprise_address: "Enterprise address" + registration_contact_details: "Primary contact details" + registration_logo: "Your logo image" + registration_promo_image: "Landscape image for your profile" + registration_about_us: "'About Us' text" + registration_outcome_headline: "What do I get?" + registration_outcome1_html: "Your profile helps people find and contact you on the Open Food Network." + registration_outcome2: "Use this space to tell the story of your enterprise, to help drive connections to your social and online presence." + registration_outcome3: "It's also the first step towards trading on the Open Food Network, or opening an online store." + registration_action: "Let's get started!" + details: + title: "Details" + headline: "Let's Get Started" + enterprise: "Woot! First need to know a little bit about your enterprise:" + producer: "Woot! First we need to know a little bit about your farm:" + enterprise_name_field: "Enterprise Name:" + producer_name_field: "Farm Name:" + producer_name_field_placeholder: "e.g. Charlie's Awesome Farm" + producer_name_field_error: "Please choose a unique name for your enterprise" + address1_field: "Address line 1:" + address1_field_placeholder: "e.g. 123 Cranberry Drive" + address1_field_error: "Please enter an address" + address2_field: "Address line 2:" + suburb_field: "Suburb:" + suburb_field_placeholder: "e.g. Northcote" + suburb_field_error: "Please enter a suburb" + postcode_field: "Postcode:" + postcode_field_placeholder: "e.g. 3070" + postcode_field_error: "Postcode required" + state_field: "State:" + state_field_error: "State required" + country_field: "Country:" + country_field_error: "Please select a country" + contact: + title: "Contact" + who_is_managing_enterprise: "Who is responsible for managing %{enterprise}?" + contact_field: "Primary Contact" + contact_field_placeholder: "Contact Name" + contact_field_required: "You need to enter a primary contact." + phone_field: "Phone number" + phone_field_placeholder: "eg. (03) 1234 5678" type: + title: "Type" headline: "Last step to add %{enterprise}!" question: "Are you a producer?" yes_producer: "Yes, I'm a producer" @@ -1893,161 +1929,75 @@ See the %{link} to find out more about %{sitename}'s features and to start using yes_producer_help: "Producers make yummy things to eat and/or drink. You're a producer if you grow it, raise it, brew it, bake it, ferment it, milk it or mould it." no_producer_help: "If you’re not a producer, you’re probably someone who sells and distributes food. You might be a hub, coop, buying group, retailer, wholesaler or other." create_profile: "Create Profile" - enterprise: - registration: - modal: - steps: - details: - title: 'Details' - headline: "Let's Get Started" - enterprise: "Woot! First we need to know a little bit about your enterprise:" - producer: "Woot! First we need to know a little bit about your farm:" - enterprise_name_field: "Enterprise Name:" - producer_name_field: "Farm Name:" - producer_name_field_placeholder: "e.g. Charlie's Awesome Farm" - producer_name_field_error: "Please choose a unique name for your enterprise" - address1_field: "Address line 1:" - address1_field_placeholder: "e.g. 123 Cranberry Drive" - address1_field_error: "Please enter an address" - address2_field: "Address line 2:" - suburb_field: "Suburb:" - suburb_field_placeholder: "e.g. Northcote" - suburb_field_error: "Please enter a suburb" - postcode_field: "Postcode:" - postcode_field_placeholder: "e.g. 3070" - postcode_field_error: "Postcode required" - state_field: "State:" - state_field_error: "State required" - country_field: "Country:" - country_field_error: "Please select a country" - contact: - title: 'Contact' - contact_field: 'Primary Contact' - contact_field_placeholder: 'Contact Name' - contact_field_required: "You need to enter a primary contact." - email_field: 'Email address' - email_field_placeholder: 'eg. charlie@thefarm.com' - phone_field: 'Phone number' - phone_field_placeholder: 'eg. (03) 1234 5678' - type: - title: 'Type' - about: - title: 'About' - images: - title: 'Images' - social: - title: 'Social' - # TODO: Remove these once the enterprise.registration.modal keys are translated - enterprise_contact: "Primary Contact" - enterprise_contact_placeholder: "Contact Name" - enterprise_contact_required: "You need to enter a primary contact." - enterprise_email_address: "Email address" - enterprise_email_placeholder: "eg. charlie@thefarm.com" - enterprise_phone: "Phone number" - enterprise_phone_placeholder: "eg. (03) 1234 5678" - # END + about: + title: "About" + headline: "Nice one!" + message: "Now let's flesh out the details about" + success: "Success! %{enterprise} added to the Open Food Network" + registration_exit_message: "If you exit this wizard at any stage, you can continue to create your profile by going to the admin interface." + enterprise_description: "Short Description" + enterprise_description_placeholder: "A short sentence describing your enterprise" + enterprise_long_desc: "Long Description" + enterprise_long_desc_placeholder: "This is your opportunity to tell the story of your enterprise - what makes you different and wonderful? We'd suggest keeping your description to under 600 characters or 150 words." + enterprise_long_desc_length: "%{num} characters / up to 600 recommended" + enterprise_abn: "ABN" + enterprise_abn_placeholder: "eg. 99 123 456 789" + enterprise_acn: "ACN" + enterprise_acn_placeholder: "eg. 123 456 789" + enterprise_tax_required: "You need to make a selection." + images: + title: "Images" + headline: "Thanks!" + description: "Let's upload some pretty pictures so your profile looks great! :)" + uploading: "Uploading..." + continue: "Continue" + back: "Back" + logo: + select_logo: "Step 1. Select Logo Image" + logo_tip: "Tip: Square images will work best, preferably at least 300×300px" + logo_label: "Choose a logo image" + logo_drag: "Drag and drop your logo here" + review_logo: "Step 2. Review Your Logo" + review_logo_tip: "Tip: for best results, your logo should fill the available space" + logo_placeholder: "Your logo will appear here for review once uploaded" + promo: + select_promo_image: "Step 3. Select Promo Image" + promo_image_tip: "Tip: Shown as a banner, preferred size is 1200×260px" + promo_image_label: "Choose a promo image" + promo_image_drag: "Drag and drop your promo here" + review_promo_image: "Step 4. Review Your Promo Banner" + review_promo_image_tip: "Tip: for best results, your promo image should fill the available space" + promo_image_placeholder: "Your logo will appear here for review once uploaded" + social: + title: "Social" + enterprise_final_step: "Final step!" + enterprise_social_text: "How can people find %{enterprise} online?" + website: "Website" + website_placeholder: "eg. openfoodnetwork.org.au" + facebook: "Facebook" + facebook_placeholder: "eg. www.facebook.com/PageNameHere" + linkedin: "LinkedIn" + linkedin_placeholder: "eg. www.linkedin.com/YourNameHere" + twitter: "Twitter" + twitter_placeholder: "eg. @twitter_handle" + instagram: "Instagram" + instagram_placeholder: "eg. @instagram_handle" + limit_reached: + headline: "Oh no!" + message: "You have reached the limit!" + text: "You have reached the limit for the number of enterprises you are allowed to own on the" + action: "Return to the homepage" + finished: + headline: "Finished!" + thanks: "Thanks for filling out the details for %{enterprise}." + login: "You can change or update your enterprise at any stage by logging into Open Food Network and going to Admin." + action: "Open Food Network home" + back: "Back" continue: "Continue" - limit_reached_headline: "Oh no!" - limit_reached_message: "You have reached the limit!" - limit_reached_text: "You have reached the limit for the number of enterprises you are allowed to own on the" - limit_reached_action: "Return to the homepage" - select_promo_image: "Step 3. Select Promo Image" - promo_image_tip: "Tip: Shown as a banner, preferred size is 1200×260px" - promo_image_label: "Choose a promo image" action_or: "OR" - promo_image_drag: "Drag and drop your promo here" - review_promo_image: "Step 4. Review Your Promo Banner" - review_promo_image_tip: "Tip: for best results, your promo image should fill the available space" - promo_image_placeholder: "Your logo will appear here for review once uploaded" - uploading: "Uploading..." - select_logo: "Step 1. Select Logo Image" - logo_tip: "Tip: Square images will work best, preferably at least 300×300px" - logo_label: "Choose a logo image" - logo_drag: "Drag and drop your logo here" - review_logo: "Step 2. Review Your Logo" - review_logo_tip: "Tip: for best results, your logo should fill the available space" - logo_placeholder: "Your logo will appear here for review once uploaded" - enterprise_about_headline: "Nice one!" - enterprise_about_message: "Now let's flesh out the details about" - enterprise_success: "Success! %{enterprise} added to the Open Food Network " - enterprise_registration_exit_message: "If you exit this wizard at any stage, you can continue to create your profile by going to the admin interface." - enterprise_description: "Short Description" - enterprise_description_placeholder: "A short sentence describing your enterprise" - enterprise_long_desc: "Long Description" - enterprise_long_desc_placeholder: "This is your opportunity to tell the story of your enterprise - what makes you different and wonderful? We'd suggest keeping your description to under 600 characters or 150 words." - enterprise_long_desc_length: "%{num} characters / up to 600 recommended" - enterprise_abn: "ABN" - enterprise_abn_placeholder: "eg. 99 123 456 789" - enterprise_acn: "ACN" - enterprise_acn_placeholder: "eg. 123 456 789" - enterprise_tax_required: "You need to make a selection." - enterprise_final_step: "Final step!" - enterprise_social_text: "How can people find %{enterprise} online?" - website: "Website" - website_placeholder: "eg. openfoodnetwork.org.au" - facebook: "Facebook" - facebook_placeholder: "eg. www.facebook.com/PageNameHere" - linkedin: "LinkedIn" - linkedin_placeholder: "eg. www.linkedin.com/YourNameHere" - twitter: "Twitter" - twitter_placeholder: "eg. @twitter_handle" - instagram: "Instagram" - instagram_placeholder: "eg. @instagram_handle" - registration_greeting: "Hi there!" - registration_intro: "You can now create a profile for your Producer or Hub" - registration_action: "Let's get started!" - registration_checklist: "You'll need" - registration_time: "5-10 minutes" - registration_enterprise_address: "Enterprise address" - registration_contact_details: "Primary contact details" - registration_logo: "Your logo image" - registration_promo_image: "Landscape image for your profile" - registration_about_us: "'About Us' text" - registration_outcome_headline: "What do I get?" - registration_outcome1_html: "Your profile helps people find and contact you on the Open Food Network." - registration_outcome2: "Use this space to tell the story of your enterprise, to help drive connections to your social and online presence. " - registration_outcome3: "It's also the first step towards trading on the Open Food Network, or opening an online store." - registration_finished_headline: "Finished!" - registration_finished_thanks: "Thanks for filling out the details for %{enterprise}." - registration_finished_login: "You can change or update your enterprise at any stage by logging into Open Food Network and going to Admin." - registration_finished_action: "Open Food Network home" - registration_contact_name: 'Contact Name' + enterprise_limit: Enterprise Limit - # TODO: Remove these once the enterprise.registration.modal keys are translated - registration_type_headline: "Last step to add %{enterprise}!" - registration_type_question: "Are you a producer?" - registration_type_producer: "Yes, I'm a producer" - registration_type_no_producer: "No, I'm not a producer" - registration_type_error: "Please choose one. Are you are producer?" - registration_type_producer_help: "Producers make yummy things to eat and/or drink. You're a producer if you grow it, raise it, brew it, bake it, ferment it, milk it or mould it." - registration_type_no_producer_help: "If you’re not a producer, you’re probably someone who sells and distributes food. You might be a hub, coop, buying group, retailer, wholesaler or other." - # END - - - # TODO: Remove these once the enterprise.registration.modal keys are translated - registration_detail_headline: "Let's Get Started" - registration_detail_enterprise: "Woot! First we need to know a little bit about your enterprise:" - registration_detail_producer: "Woot! First we need to know a little bit about your farm:" - registration_detail_name_enterprise: "Enterprise Name:" - registration_detail_name_producer: "Farm Name:" - registration_detail_name_placeholder: "e.g. Charlie's Awesome Farm" - registration_detail_name_error: "Please choose a unique name for your enterprise" - registration_detail_address1: "Address line 1:" - registration_detail_address1_placeholder: "e.g. 123 Cranberry Drive" - registration_detail_address1_error: "Please enter an address" - registration_detail_address2: "Address line 2:" - registration_detail_suburb: "Suburb:" - registration_detail_suburb_placeholder: "e.g. Northcote" - registration_detail_suburb_error: "Please enter a suburb" - registration_detail_postcode: "Postcode:" - registration_detail_postcode_placeholder: "e.g. 3070" - registration_detail_postcode_error: "Postcode required" - registration_detail_state: "State:" - registration_detail_state_error: "State required" - registration_detail_country: "Country:" - registration_detail_country_error: "Please select a country" - # END shipping_method_destroy_error: "That shipping method cannot be deleted as it is referenced by an order: %{number}." accounts_and_billing_task_already_running_error: "A task is already running, please wait until it has finished" accounts_and_billing_start_task_notice: "Task Queued" @@ -2687,6 +2637,12 @@ See the %{link} to find out more about %{sitename}'s features and to start using closes: closes closed: closed close_date_not_set: Close date not set + registration: + welcome_to_ofn: "Welcome to the Open Food Network!" + signup_or_login: "Start By Signing Up (or logging in)" + have_an_account: "Already have an account?" + action_login: "Log in now." + producers: signup: start_free_profile: "Start with a free profile, and expand when you're ready!" diff --git a/spec/features/consumer/registration_spec.rb b/spec/features/consumer/registration_spec.rb index 0a7756d104..efbb9deca0 100644 --- a/spec/features/consumer/registration_spec.rb +++ b/spec/features/consumer/registration_spec.rb @@ -139,7 +139,7 @@ feature "Registration", js: true do fill_in "Email", with: user.email fill_in "Password", with: user.password click_button 'Login' - expect(page).to have_content I18n.t('limit_reached_headline') + expect(page).to have_content I18n.t('registration.steps.limit_reached.headline') end end end From c4b646c5839bef241477bc153b154d06b18064c7 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Fri, 22 Feb 2019 23:01:01 +0000 Subject: [PATCH 14/24] Wait for angular to load in BOM spec --- spec/features/admin/bulk_order_management_spec.rb | 2 ++ spec/support/request/web_helper.rb | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/spec/features/admin/bulk_order_management_spec.rb b/spec/features/admin/bulk_order_management_spec.rb index 26dbc2aab0..7e11b329c2 100644 --- a/spec/features/admin/bulk_order_management_spec.rb +++ b/spec/features/admin/bulk_order_management_spec.rb @@ -45,6 +45,7 @@ feature %q{ before :each do visit '/admin/orders/bulk_management' + wait_for_angular_requests end it "displays a column for user's full name" do @@ -456,6 +457,7 @@ feature %q{ before :each do visit '/admin/orders/bulk_management' + wait_for_angular_requests end it "displays date fields for filtering orders, with default values set" do diff --git a/spec/support/request/web_helper.rb b/spec/support/request/web_helper.rb index 912c19e445..19f503d837 100644 --- a/spec/support/request/web_helper.rb +++ b/spec/support/request/web_helper.rb @@ -152,8 +152,16 @@ module WebHelper page.driver.browser.switch_to.alert.accept end + def wait_for_angular_requests + wait_until { angular_requests_finished } + end + private + def angular_requests_finished + page.evaluate_script('angular.element(".ng-scope").injector().get("$http").pendingRequests.length === 0') + end + def wait_for_ajax wait_until { page.evaluate_script("$.active") == 0 } end From ea8be0ab950e46bef0b3877313ae54dedf0cb12d Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Sat, 23 Feb 2019 16:13:23 +0000 Subject: [PATCH 15/24] Fine-tune angular helper --- spec/features/admin/bulk_order_management_spec.rb | 13 +++++++++++-- spec/support/request/web_helper.rb | 14 ++++++++------ 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/spec/features/admin/bulk_order_management_spec.rb b/spec/features/admin/bulk_order_management_spec.rb index 7e11b329c2..aaa2429d5a 100644 --- a/spec/features/admin/bulk_order_management_spec.rb +++ b/spec/features/admin/bulk_order_management_spec.rb @@ -45,7 +45,7 @@ feature %q{ before :each do visit '/admin/orders/bulk_management' - wait_for_angular_requests + wait_until { request_monitor_finished 'LineItemsCtrl' } end it "displays a column for user's full name" do @@ -93,6 +93,7 @@ feature %q{ before do visit spree.admin_bulk_order_management_path + wait_until { request_monitor_finished 'LineItemsCtrl' } end it "sorts by customer name when the customer name header is clicked" do @@ -261,6 +262,7 @@ feature %q{ before :each do visit '/admin/orders/bulk_management' + wait_until { request_monitor_finished 'LineItemsCtrl' } end it "displays a select box for producers, which filters line items by the selected supplier" do @@ -299,6 +301,7 @@ feature %q{ before :each do visit '/admin/orders/bulk_management' + wait_until { request_monitor_finished 'LineItemsCtrl' } end it "displays a select box for distributors, which filters line items by the selected distributor" do @@ -338,6 +341,7 @@ feature %q{ before do visit '/admin/orders/bulk_management' + wait_until { request_monitor_finished 'LineItemsCtrl' } end it "displays a select box for order cycles, which filters line items by the selected order cycle" do @@ -378,6 +382,7 @@ feature %q{ before :each do visit '/admin/orders/bulk_management' + wait_until { request_monitor_finished 'LineItemsCtrl' } end it "allows filters to be used in combination" do @@ -428,6 +433,7 @@ feature %q{ before :each do visit '/admin/orders/bulk_management' + wait_until { request_monitor_finished 'LineItemsCtrl' } end it "displays a quick search input" do @@ -457,7 +463,7 @@ feature %q{ before :each do visit '/admin/orders/bulk_management' - wait_for_angular_requests + wait_until { request_monitor_finished 'LineItemsCtrl' } end it "displays date fields for filtering orders, with default values set" do @@ -530,6 +536,7 @@ feature %q{ before :each do visit '/admin/orders/bulk_management' + wait_until { request_monitor_finished 'LineItemsCtrl' } end it "displays a checkbox for each line item in the list" do @@ -572,6 +579,7 @@ feature %q{ expect(page).to have_no_selector "tr#li_#{li2.id}" check "toggle_bulk" fill_in "quick_search", with: '' + wait_until { request_monitor_finished 'LineItemsCtrl' } expect(find("tr#li_#{li1.id} input[type='checkbox'][name='bulk']").checked?).to be true expect(find("tr#li_#{li2.id} input[type='checkbox'][name='bulk']").checked?).to be false expect(find("input[type='checkbox'][name='toggle_bulk']").checked?).to be false @@ -585,6 +593,7 @@ feature %q{ find("div#bulk-actions-dropdown div.menu_item", :text => "Delete Selected" ).click expect(page).to have_no_selector "tr#li_#{li1.id}" fill_in "quick_search", with: '' + wait_until { request_monitor_finished 'LineItemsCtrl' } expect(page).to have_selector "tr#li_#{li2.id}" expect(page).to have_no_selector "tr#li_#{li1.id}" end diff --git a/spec/support/request/web_helper.rb b/spec/support/request/web_helper.rb index 19f503d837..4cf788ae8e 100644 --- a/spec/support/request/web_helper.rb +++ b/spec/support/request/web_helper.rb @@ -152,16 +152,18 @@ module WebHelper page.driver.browser.switch_to.alert.accept end - def wait_for_angular_requests - wait_until { angular_requests_finished } + def angular_http_requests_finished(angular_controller=nil) + scope_element = angular_controller ? "[ng-controller=#{angular_controller}]" : '.ng-scope' + page.evaluate_script("angular.element(document.querySelector('#{scope_element}')).injector().get('$http').pendingRequests.length == 0") + end + + def request_monitor_finished(angular_controller=nil) + scope_element = angular_controller ? "[ng-controller=#{angular_controller}]" : '.ng-scope' + page.evaluate_script("angular.element(document.querySelector('#{scope_element}')).scope().RequestMonitor.loading == false") end private - def angular_requests_finished - page.evaluate_script('angular.element(".ng-scope").injector().get("$http").pendingRequests.length === 0') - end - def wait_for_ajax wait_until { page.evaluate_script("$.active") == 0 } end From 021220514ecf33d7452b42f32de440450f14e2e7 Mon Sep 17 00:00:00 2001 From: Transifex-Openfoodnetwork Date: Mon, 25 Feb 2019 21:11:12 +1100 Subject: [PATCH 16/24] Updating translations for config/locales/ca.yml --- config/locales/ca.yml | 99 +++++++++++++++++++++++++++++++++++++------ 1 file changed, 85 insertions(+), 14 deletions(-) diff --git a/config/locales/ca.yml b/config/locales/ca.yml index f340592af3..b47a8890bb 100644 --- a/config/locales/ca.yml +++ b/config/locales/ca.yml @@ -31,6 +31,16 @@ ca: on_demand_but_count_on_hand_set: "ha d'estar en blanc si és sota demanda" limited_stock_but_no_count_on_hand: "cal especificar-se perquè força existències limitades" activemodel: + attributes: + order_management/reports/enterprise_fee_summary/parameters: + start_at: "Començar" + end_at: "Acabar" + distributor_ids: "Grups" + producer_ids: "Productors" + order_cycle_ids: "Cicles de comanda" + enterprise_fee_ids: "Noms de les comissions" + shipping_method_ids: "Mètodes d'enviament" + payment_method_ids: "Mètodes de Pagament" errors: models: subscription_validator: @@ -74,6 +84,13 @@ ca: models: order_cycle: cloned_order_cycle_name: "CÒPIA DE %{order_cycle}" + validators: + date_time_string_validator: + not_string_error: "ha de ser una seqüència" + invalid_format_error: "ha de ser vàlid" + integer_array_validator: + not_array_error: "ha de ser una matriu" + invalid_element_error: "ha de contenir només nombres enters vàlids" enterprise_mailer: confirmation_instructions: subject: "Sisplau, confirma l'adreça electrònica d'%{enterprise}" @@ -318,7 +335,7 @@ ca: business_model_configuration: edit: business_model_configuration: "Model de sostenibilitat" - business_model_configuration_tip: "Configureu la tarifa què es cobrarà a les botigues cada mes per utilitzar la Xarxa Open Food." + business_model_configuration_tip: "Configureu la tarifa què es cobrarà a les botigues cada mes per utilitzar Open Food Network." bill_calculation_settings: "Configuració del càlcul de ticket" bill_calculation_settings_tip: "Ajusteu la quantitat que es facturarà a les organitzacions cada mes per utilitzar l'OFN." shop_trial_length: "Durada de la prova de la botiga (dies)" @@ -418,9 +435,9 @@ ca: user_guide: Guia de l'usuari enterprise_fees: index: - title: Tarifes de l'organització + title: Comissions de l'organització enterprise: Organització - fee_type: Tipus de tarifa + fee_type: Tipus de comissió name: Nom tax_category: Categoria d'impostos calculator: Calculadora @@ -634,8 +651,8 @@ ca: website_placeholder: 'p. ex.: www.hortajosepribes.com' enterprise_fees: name: Nom - fee_type: Tipus de tarifa - manage_fees: Gestioneu les tarifes de l'organització + fee_type: Tipus de comissió + manage_fees: Gestioneu les comissions de l'organització no_fees_yet: Encara no tens cap tipus de comissió de l'organització create_button: Crea'n una ara images: @@ -737,7 +754,7 @@ ca: title: Connectar amb Stripe part1: Stripe és un servei de processament de pagaments que permet que les botigues de l'OFN acceptin els pagaments amb targeta de crèdit de les consumidores. part2: Per utilitzar aquesta funció heu de connectar el vostre compte Stripe a l'OFN. Si feu clic a "Accepto", us redirigirem al lloc web de Stripe on podeu connectar un compte Stripe existent o bé crear-ne un si encara no en teniu cap. - part3: Això permetrà que Open Food Network accepti pagaments amb targeta de crèdit de consumidores en nom vostre. Tingueu en compte que haureu de mantenir el vostre propi compte de Stripe, pagar-ne les tarifes i mantenir el servei a les consumidores pel teu compte. + part3: Això permetrà que Open Food Network accepti pagaments amb targeta de crèdit de consumidores en nom vostre. Tingueu en compte que haureu de mantenir el vostre propi compte de Stripe, pagar-ne les comissions i mantenir el servei a les consumidores pel teu compte. i_agree: Accepto cancel: Cancel·lar tag_rules: @@ -775,7 +792,7 @@ ca: payment_methods_tip: Aquesta organització no té mètodes de pagament shipping_methods: Mètodes d'enviament shipping_methods_tip: 'Aquesta organització té mètodes d''enviament ' - enterprise_fees: Honoraris de l'organització + enterprise_fees: Comissions de l'organització enterprise_fees_tip: Aquesta organització no té comissions admin_index: name: Nom @@ -873,7 +890,7 @@ ca: incoming: Entrant supplier: Proveïdora receival_details: Detalls de recepció - fees: Tarifes + fees: Comissions outgoing: Sortint distributor: Distribuïdora products: Productes @@ -911,7 +928,7 @@ ca: customer_instructions: Instruccions de la consumidora customer_instructions_placeholder: Notes de recollida o de lliurament products: Productes - fees: Tarifes + fees: Comissions destroy_errors: orders_present: Una consumidora ha seleccionat aquest Cicle de Comanda i no es pot esborrar. Per evitar que les consumidores hi accedeixin, tanqueu-lo. schedule_present: Aquest cicle de comanda està vinculat a una programació i no es pot esborrar. Desenllaça o suprimeix primer la programació. @@ -996,6 +1013,9 @@ ca: description: Factures per a la importació a Xero packing: name: Informes d'embalatge + enterprise_fee_summary: + name: "Resum de les comissions de l'organització" + description: "Resum de les comissions de l'organització recollides" subscriptions: subscriptions: Subscripcions new: Nova subscripció @@ -1883,7 +1903,7 @@ ca: shipping_method_destroy_error: "Aquest mètode d'enviament no es pot esborrar perquè s'hi fa referència en una comanda: %{number}." accounts_and_billing_task_already_running_error: "Ja s'està executant una tasca, espera fins que hagi acabat" accounts_and_billing_start_task_notice: "Tasca en cua" - fees: "Tarifes" + fees: "Comissions" item_cost: "Cost de l'article" bulk: "A granel" shop_variant_quantity_min: "min" @@ -1955,7 +1975,7 @@ ca: process_my_order: "Processa la meva comanda" delivery_instructions: Instruccions de lliurament delivery_method: Mètode de lliurament - fee_type: "Tipus de tarifa" + fee_type: "Tipus de comissió" tax_category: "Categoria d'impostos" calculator: "Calculadora" calculator_values: "Valors de la calculadora" @@ -2000,7 +2020,6 @@ ca: spree_admin_enterprises_none_text: "Encara no tens cap organització" spree_admin_enterprises_tabs_hubs: "GRUPS" spree_admin_enterprises_producers_manage_products: "GESTIONA ELS PRODUCTES" - spree_admin_enterprises_any_active_products_text: "No tens cap producte actiu." spree_admin_enterprises_create_new_product: "CREA UN NOU PRODUCTE" spree_admin_single_enterprise_alert_mail_confirmation: "Si us plau confirma l'adreça de correu electrònic de" spree_admin_single_enterprise_alert_mail_sent: "Hem enviat un correu electrònic a" @@ -2127,7 +2146,7 @@ ca: report_header_sales_tax: "Impost sobre vendes (%{currency_symbol})" report_header_delivery_charge: "Càrrec de lliurament (%{currency_symbol})" report_header_tax_on_delivery: "Impost sobre el lliurament (%{currency_symbol})" - report_header_tax_on_fees: "Impost sobre les tarifes (%{currency_symbol})" + report_header_tax_on_fees: "Impost sobre les comissions (%{currency_symbol})" report_header_total_tax: "Impost total (%{currency_symbol})" report_header_enterprise: Organització report_header_customer: Consumidora @@ -2248,7 +2267,7 @@ ca: shipping: "Enviament" shipping_methods: "Mètodes d'enviament" payment_methods: "Mètodes de Pagament" - payment_method_fee: "Tarifa de transacció" + payment_method_fee: "Comissió de transacció" inventory_settings: "Configuració de l'inventari" tag_rules: "Regles d'etiqueta" shop_preferences: "Preferències de la botiga" @@ -2526,6 +2545,45 @@ ca: producers: signup: start_free_profile: "Comença amb un perfil gratuït i amplia'l quan estiguis preparada." + order_management: + reports: + enterprise_fee_summary: + date_end_before_start_error: "ha de ser després de l'inici" + parameter_not_allowed_error: "No esteu autoritzats a utilitzar un o més filtres seleccionats per a aquest informe." + fee_calculated_on_transfer_through_all: "Tots" + fee_calculated_on_transfer_through_entire_orders: "Comandes completades a través de" + tax_category_various: "Varis" + fee_type: + payment_method: "Transacció de pagament" + shipping_method: "Enviament" + fee_placements: + supplier: "Entrant" + distributor: "Sortint" + coordinator: "Coordinador" + tax_category_name: + shipping_instance_rate: "Tarifa de la plataforma" + formats: + csv: + header: + fee_type: "Tipus de comissió" + enterprise_name: "Propietària de l'organització" + fee_name: "Nom de la comissió" + customer_name: "Consumidora" + fee_placement: "Col·locació de comissions" + fee_calculated_on_transfer_through_name: "Càlcul de comissions a través de transferència" + tax_category_name: "Categoria d'impostos" + total_amount: "€€ SUM" + html: + header: + fee_type: "Tipus de comissió" + enterprise_name: "Propietària de l'organització" + fee_name: "Nom de la comissió" + customer_name: "Consumidora" + fee_placement: "Col·locació de comissions" + fee_calculated_on_transfer_through_name: "Càlcul de comissions a través de transferència" + tax_category_name: "Categoria d'impostos" + total_amount: "€€ SUM" + invalid_filter_parameters: "Els filtres que heu seleccionat per a aquest informe no són vàlids." spree: email: Correu electrònic account_updated: "Compte actualitzat!" @@ -2569,6 +2627,11 @@ ca: distributor: "Distribuïdora:" order_cycle: "Cicle de comanda:" overview: + products: + active_products: + zero: "No tens cap producte actiu." + one: "Teniu un producte actiu" + other: "Teniu %{count} productes actius" order_cycles: order_cycles: "Cicles de comanda" order_cycles_tip: "Els cicles de comanda determinen quan i on els teus productes estan disponibles per a les consumidores." @@ -2642,6 +2705,14 @@ ca: bulk_coop_allocation: 'Compra grupal - Assignació' bulk_coop_packing_sheets: 'Compra grupal - Fulls de preparació de cistelles' bulk_coop_customer_payments: 'Compra grupal - Pagaments de les consumidores' + enterprise_fee_summaries: + filters: + date_range: "Interval de dates" + report_format_csv: "Descarrega com a CSV" + generate_report: "Generar informe" + report: + none: "No productora" + select_and_search: "Seleccioneu els filtres i feu clic a GENERAR INFORME per accedir a les dades." users: index: listing_users: "Llistat d'usuàries" From bbfe71fd2763343e16a23790d7a92b8c78502111 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Mon, 25 Feb 2019 10:25:23 +0000 Subject: [PATCH 17/24] Improve readability and add code comment --- spec/support/request/web_helper.rb | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/spec/support/request/web_helper.rb b/spec/support/request/web_helper.rb index 4cf788ae8e..52ffc306ac 100644 --- a/spec/support/request/web_helper.rb +++ b/spec/support/request/web_helper.rb @@ -152,18 +152,23 @@ module WebHelper page.driver.browser.switch_to.alert.accept end - def angular_http_requests_finished(angular_controller=nil) - scope_element = angular_controller ? "[ng-controller=#{angular_controller}]" : '.ng-scope' - page.evaluate_script("angular.element(document.querySelector('#{scope_element}')).injector().get('$http').pendingRequests.length == 0") + def angular_http_requests_finished(controller=nil) + page.evaluate_script("#{angular_scope(controller)}.injector().get('$http').pendingRequests.length == 0") end - def request_monitor_finished(angular_controller=nil) - scope_element = angular_controller ? "[ng-controller=#{angular_controller}]" : '.ng-scope' - page.evaluate_script("angular.element(document.querySelector('#{scope_element}')).scope().RequestMonitor.loading == false") + def request_monitor_finished(controller=nil) + page.evaluate_script("#{angular_scope(controller)}.scope().RequestMonitor.loading == false") end private + # Takes an optional angular controller name eg: "LineItemsCtrl", + # otherwise finds the first object in the DOM with an angular scope + def angular_scope(controller=nil) + element = controller ? "[ng-controller=#{controller}]" : '.ng-scope' + "angular.element(document.querySelector('#{element}'))" + end + def wait_for_ajax wait_until { page.evaluate_script("$.active") == 0 } end From 6e77afbf35644dc24519d18be6ae7e66287d36e7 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Sat, 23 Feb 2019 20:33:05 +0000 Subject: [PATCH 18/24] Adjust expectations in flaky spec --- spec/features/admin/shipping_methods_spec.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/spec/features/admin/shipping_methods_spec.rb b/spec/features/admin/shipping_methods_spec.rb index bb65e70255..03f1bcec8c 100644 --- a/spec/features/admin/shipping_methods_spec.rb +++ b/spec/features/admin/shipping_methods_spec.rb @@ -103,9 +103,8 @@ feature 'shipping methods' do click_button I18n.t("actions.create") - expect(page).to have_no_button I18n.t("actions.create") - message = "Shipping method \"Teleport\" has been successfully created!" - expect(page).to have_flash_message message + expect(page).to have_content I18n.t('editing_shipping_method') + expect(flash_message).to eq I18n.t('successfully_created', resource: 'Shipping method "Teleport"') expect(first('tags-input .tag-list ti-tag-item')).to have_content "local" From a1647053cbf1f4a0d87509c0f44fbb58b8311fe7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" Date: Mon, 25 Feb 2019 19:26:41 +0000 Subject: [PATCH 19/24] Bump combine_pdf from 1.0.15 to 1.0.16 Bumps [combine_pdf](https://github.com/boazsegev/combine_pdf) from 1.0.15 to 1.0.16. - [Release notes](https://github.com/boazsegev/combine_pdf/releases) - [Changelog](https://github.com/boazsegev/combine_pdf/blob/master/CHANGELOG.md) - [Commits](https://github.com/boazsegev/combine_pdf/compare/v1.0.15...v1.0.16) Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index f88886708e..d586e1f7f4 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -239,7 +239,7 @@ GEM execjs coffee-script-source (1.10.0) colorize (0.8.1) - combine_pdf (1.0.15) + combine_pdf (1.0.16) ruby-rc4 (>= 0.1.5) compass (1.0.3) chunky_png (~> 1.2) From 595fb75d827a76cb0840d4718ab00f2f75007fae Mon Sep 17 00:00:00 2001 From: Transifex-Openfoodnetwork Date: Tue, 26 Feb 2019 20:46:12 +1100 Subject: [PATCH 20/24] Updating translations for config/locales/es.yml --- config/locales/es.yml | 135 ++++++++++++++++++++++++++++++++---------- 1 file changed, 103 insertions(+), 32 deletions(-) diff --git a/config/locales/es.yml b/config/locales/es.yml index 73bddfe067..fcd2d21ff7 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -31,6 +31,16 @@ es: on_demand_but_count_on_hand_set: "debe estar en blanco si está bajo demanda" limited_stock_but_no_count_on_hand: "se debe especificar porque se ha definido estoc limitado" activemodel: + attributes: + order_management/reports/enterprise_fee_summary/parameters: + start_at: "Inicio" + end_at: "Final" + distributor_ids: "Hubs" + producer_ids: "Productoras" + order_cycle_ids: "Ciclos de Pedido" + enterprise_fee_ids: "Nombres de las comisiones" + shipping_method_ids: "Métodos de envío" + payment_method_ids: "Métodos de Pago" errors: models: subscription_validator: @@ -74,6 +84,13 @@ es: models: order_cycle: cloned_order_cycle_name: "COPIA DE %{order_cycle}" + validators: + date_time_string_validator: + not_string_error: "debe ser una cadena" + invalid_format_error: "debe ser válido" + integer_array_validator: + not_array_error: "debe ser una matriz" + invalid_element_error: "debe contener solo enteros válidos" enterprise_mailer: confirmation_instructions: subject: "Confirma la dirección de correo electrónico de %{enterprise}" @@ -851,7 +868,7 @@ es: pickup_instructions_tip: Estas instrucciones se muestran a las consumidoras después de completar un pedido. pickup_time_placeholder: "Listo para ( Fecha / Hora)" receival_instructions_placeholder: "Instrucciones de recepción" - add_fee: 'Añadir tarifa' + add_fee: 'Añadir comisión' selected: 'seleccionado' add_exchange_form: add_supplier: 'Añadir proveedora' @@ -868,7 +885,7 @@ es: search_by_order_cycle_name: "Buscar por nombre del Ciclo de Pedido..." involving: "Involucrando" any_enterprise: "Cualquier organización" - any_schedule: "Cualquier horario" + any_schedule: "Cualquier programación" form: incoming: Entrante supplier: Proveedora @@ -882,19 +899,19 @@ es: delivery_details: Detalles de Recogida / Entrega debug_info: Información de Debug index: - schedule: Horario - schedules: Horarios - adding_a_new_schedule: Agregar un nuevo horario - updating_a_schedule: Actualización de un horario - new_schedule: Nuevo horario - create_schedule: Crear horario - update_schedule: Actualizar horario - delete_schedule: Eliminar horario - created_schedule: Horario creado - updated_schedule: Horario actualizado - deleted_schedule: Horario eliminado - schedule_name_placeholder: Nombre del horario - name_required_error: Por favor ingrese un nombre para este horario + schedule: Programación + schedules: Programación + adding_a_new_schedule: Agregar una nueva programación + updating_a_schedule: Actualización de una programación + new_schedule: Nueva programación + create_schedule: Crear programación + update_schedule: Actualizar programación + delete_schedule: Eliminar programación + created_schedule: Programación creada + updated_schedule: Programación actualizada + deleted_schedule: Programación eliminada + schedule_name_placeholder: Nombre de la programación + name_required_error: Por favor ingrese un nombre para esta programación no_order_cycles_error: Seleccione al menos un ciclo de pedido (arrastrar y soltar) name_and_timing_form: name: Nombre @@ -914,7 +931,7 @@ es: fees: Comisiones destroy_errors: orders_present: Ese ciclo de pedido ha sido seleccionado por un cliente y no puede ser eliminado. Para evitar que los clientes accedan a él, ciérrelo. - schedule_present: Ese ciclo de pedido está vinculado a un horario y no puede ser eliminado. Desvincula o elimina el calendario primero. + schedule_present: Ese ciclo de pedido está vinculado a una programación y no puede ser eliminado. Desvincula o elimina la programación primero. bulk_update: no_data: Hm, algo salió mal. No se encontraron datos de ciclo de pedido. date_warning: @@ -996,6 +1013,9 @@ es: description: Facturas para la importación en Xero packing: name: Informes de empaquetado + enterprise_fee_summary: + name: "Resumen de las comisiones de la organización" + description: "Resumen de las comisiones de la organización recolectadas" subscriptions: subscriptions: Suscripciones new: Nueva suscripción @@ -1014,10 +1034,10 @@ es: set_up_shipping_and_payment_methods_html: Configurar los métodos %{shipping_link} y %{payment_link} set_up_shipping_and_payment_methods_note_html: Tenga en cuenta que solo se pueden usar
métodos de pago en efectivo y Stripe con las suscripciones ensure_at_least_one_customer_html: Asegúrese de que exista al menos un %{customer_link} - create_at_least_one_schedule: Crear al menos un horario + create_at_least_one_schedule: Crear al menos una programación create_at_least_one_schedule_step_1_html: 1. Vaya a la página %{order_cycles_link} create_at_least_one_schedule_step_2: 2. Crea un ciclo de pedido si aún no lo has hecho - create_at_least_one_schedule_step_3: 3. Haga clic en '+ Nuevo horario' y complete el formulario + create_at_least_one_schedule_step_3: 3. Haga clic en '+ Nueva programación' y complete el formulario once_you_are_done_you_can_html: Una vez que haya terminado, puede %{reload_this_page_link} reload_this_page: recarga esta página steps: @@ -1028,7 +1048,7 @@ es: subscription_line_items: this_is_an_estimate: | Los precios mostrados son solo una estimación y se calculan en el momento en que se cambia la suscripción. - Si cambias precios o tarifas, los pedidos se actualizarán pero la suscripción seguirá mostrando los valores anteriores. + Si cambias precios o comisiones, los pedidos se actualizarán pero la suscripción seguirá mostrando los valores anteriores. not_in_open_and_upcoming_order_cycles_warning: "No hay ciclos de pedidos abiertos o próximos para este producto." details: details: Detalles @@ -1616,7 +1636,7 @@ es: shops_signup_help_text: Usted necesita un mejor retorno. Usted necesita nuevos compradores y socios de logística. Usted necesita que su historia sea contada a través de ventas al por mayor, al detalle y en la mesa de la cocina. shops_signup_detail: Aquí está el detalle. orders: Pedidos - orders_fees: Tarifas... + orders_fees: Comisiones... orders_edit_title: Carrito de compras orders_edit_headline: Su carrito de compras orders_edit_time: Pedido listo para @@ -1688,7 +1708,7 @@ es: error_not_found_in_database: "%{name} no se encuentra en la base de datos" error_not_primary_producer: "%{name} no está habilitado como productora" error_no_permission_for_enterprise: "\"%{name}\": no tiene permiso para administrar productos para esta organización" - item_handling_fees: "Tarifa de manejo de artículo (incluída en el total de artículos)" + item_handling_fees: "Comisiones de manejo de artículos (incluída en el total de artículos)" january: "Enero" february: "Febrero" march: "Marzo" @@ -1717,7 +1737,7 @@ es: password_reset_sent: "¡Le enviamos un correo electrónico con instrucciones para restaurar la contraseña!" reset_password: "Restaurar contraseña" who_is_managing_enterprise: "¿Quién es responsable de administrar %{enterprise}?" - update_and_recalculate_fees: "Actualizar y recalcular tarifas" + update_and_recalculate_fees: "Actualizar y recalcular comisiones" registration: steps: images: @@ -1883,7 +1903,7 @@ es: shipping_method_destroy_error: "Ese método de envío no puede ser eliminado ya que se hace referencia en un pedido: %{number}." accounts_and_billing_task_already_running_error: "Se está ejecutando una tarea, espere hasta que haya finalizado" accounts_and_billing_start_task_notice: "Tarea en cola" - fees: "Tarifas" + fees: "Comisiones" item_cost: "Costo del artículo" bulk: "Agrupar" shop_variant_quantity_min: "mínimo" @@ -1893,11 +1913,11 @@ es: change_shop: "Cambiar de tienda:" shop_at: "Comprar en:" price_breakdown: "Desglose de precios completo" - admin_fee: "Tarifa de administración" - sales_fee: "Tarifa de ventas" - packing_fee: "Tarifa de empaquetado" - transport_fee: "Tarifa de transporte" - fundraising_fee: "Tarifa para recaudación de fondos" + admin_fee: "Comisión de administración" + sales_fee: "Comisión de ventas" + packing_fee: "Comisión de empaquetado" + transport_fee: "Comisión de transporte" + fundraising_fee: "Comisión para recaptación de fondos" price_graph: "Gráfico de precios" included_tax: "Impuesto incluido" balance: "Saldo" @@ -2000,7 +2020,6 @@ es: spree_admin_enterprises_none_text: "No tienes ninguna organización" spree_admin_enterprises_tabs_hubs: "HUBS" spree_admin_enterprises_producers_manage_products: "GESTIONAR PRODUCTOS" - spree_admin_enterprises_any_active_products_text: "No tienes ningún producto activo" spree_admin_enterprises_create_new_product: "CREAR UN NUEVO PRODUCTO" spree_admin_single_enterprise_alert_mail_confirmation: "Confirma la dirección de email para" spree_admin_single_enterprise_alert_mail_sent: "Te hemos enviado un mail a" @@ -2127,7 +2146,7 @@ es: report_header_sales_tax: "Impuesto sobre las Ventas (%{currency_symbol})" report_header_delivery_charge: "Gastos de Envío (%{currency_symbol})" report_header_tax_on_delivery: "Impuestos sobre la entrega (%{currency_symbol})" - report_header_tax_on_fees: "Impuesto sobre las tasas (%{currency_symbol})" + report_header_tax_on_fees: "Impuesto sobre las comisiones (%{currency_symbol})" report_header_total_tax: "Total Impuestos (%{currency_symbol})" report_header_enterprise: Organización report_header_customer: Consumidora @@ -2209,7 +2228,7 @@ es: report_header_gst_free_income: Ingresos sin IVA report_header_total_untaxable_produce: Total productos sin impuestos report_header_total_taxable_produce: Total productos con impuestos - report_header_total_untaxable_fees: Total comisiones sin impuestos + report_header_total_untaxable_fees: Total comisiones no imponibles (sin impuestos) report_header_total_taxable_fees: Total de impuestos imponibles (impuestos incluidos) report_header_delivery_shipping_cost: Gastos de envío (impuestos incluidos) report_header_transaction_fee: Comisión por transacción (sin impuestos) @@ -2248,7 +2267,7 @@ es: shipping: "Envío" shipping_methods: "Métodos de envío" payment_methods: "Métodos de Pago" - payment_method_fee: "Tarifa de Transacción" + payment_method_fee: "Comisión de Transacción" inventory_settings: "Configuración del Inventario" tag_rules: "Reglas de las Etiquetas" shop_preferences: "Configuración de la tienda" @@ -2527,6 +2546,45 @@ es: producers: signup: start_free_profile: "Empieze con un perfil gratuito, y amplíelo cuando esté preparado!" + order_management: + reports: + enterprise_fee_summary: + date_end_before_start_error: "debe ser después del comienzo" + parameter_not_allowed_error: "No está autorizado a usar uno o más filtros seleccionados para este informe." + fee_calculated_on_transfer_through_all: "Todos" + fee_calculated_on_transfer_through_entire_orders: "Pedidos completos a través de %{distributor}" + tax_category_various: "Varios" + fee_type: + payment_method: "Transaccion de pago" + shipping_method: "Envío" + fee_placements: + supplier: "Entrante" + distributor: "Saliente" + coordinator: "Coordinadora" + tax_category_name: + shipping_instance_rate: "Tarifa de plataforma" + formats: + csv: + header: + fee_type: "Tipo de Comisión" + enterprise_name: "Propietario de la organización" + fee_name: "Nombre de la comisión" + customer_name: "Consumidora" + fee_placement: "Asignación de comisiones" + fee_calculated_on_transfer_through_name: "Cálculo de comisiones a través de transferencias" + tax_category_name: "Categoría de impuestos" + total_amount: "€€ SUM" + html: + header: + fee_type: "Tipo de Comisión" + enterprise_name: "Propietario de la organización" + fee_name: "Nombre de la comisión" + customer_name: "Consumidora" + fee_placement: "Asignación de comisiones" + fee_calculated_on_transfer_through_name: "Cálculo de comisiones a través de transferencias" + tax_category_name: "Categoría de impuestos" + total_amount: "€€ SUM" + invalid_filter_parameters: "Los filtros que seleccionó para este informe no son válidos." spree: email: Email account_updated: "Cuenta actualizada!" @@ -2570,6 +2628,11 @@ es: distributor: "Distribuidora:" order_cycle: "Ciclo de pedido:" overview: + products: + active_products: + zero: "No tienes ningún producto activo" + one: "Tiene un producto activo." + other: "Tiene %{count} productos activos" order_cycles: order_cycles: "Ciclos de Pedido" order_cycles_tip: "Los ciclos de pedido determinan cuándo y dónde los productos están disponibles para las consumidoras." @@ -2643,6 +2706,14 @@ es: bulk_coop_allocation: 'Bulk Co-op - Asignación' bulk_coop_packing_sheets: 'Bulk Co-op - Hojas de Empaquetado' bulk_coop_customer_payments: 'Bulk Co-op - Pagos de las Consumidoras' + enterprise_fee_summaries: + filters: + date_range: "Rango de fechas" + report_format_csv: "Descargar como CSV" + generate_report: "Generar informe" + report: + none: "Ninguno" + select_and_search: "Seleccione los filtros y haga clic en GENERAR INFORME para acceder a sus datos." users: index: listing_users: "Listado de Usuarias" From 4d47276810ebc82c9923c5491a70d5ab920521cb Mon Sep 17 00:00:00 2001 From: Pau Perez Date: Tue, 26 Feb 2019 17:48:55 +0100 Subject: [PATCH 22/24] Bring Bugsnag initializer from ofn-install This copies ofn-install's `roles/app/templates/bugsnag.rb.j2` to `config/initializers/bugsnag.rb`. All tasks and templates regarding Bugsnag can then be :fire: from ofn-install. As a result, it'll fix the issue that both Katuma and OFF are facing where the `config/initializer/bugsnag.rb` symlink to `shared/config/bugsnag.rb` does not exist thus, nothing gets notified to Bugsnag since December 3rd (according to customer support). --- config/initializers/bugsnag.rb | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 config/initializers/bugsnag.rb diff --git a/config/initializers/bugsnag.rb b/config/initializers/bugsnag.rb new file mode 100644 index 0000000000..89da91d9e0 --- /dev/null +++ b/config/initializers/bugsnag.rb @@ -0,0 +1,5 @@ +Bugsnag.configure do |config| + config.api_key = ENV['BUGSNAG_API_KEY'] + config.notify_release_stages = %w(production staging) + config.use_ssl = true +end From 5b880f7bfe0cd0bda1df00ee5d39e4c17fdd7036 Mon Sep 17 00:00:00 2001 From: Danni M Date: Wed, 27 Feb 2019 10:41:39 +1100 Subject: [PATCH 23/24] Update issue templates Fixed headings on the story template --- .github/ISSUE_TEMPLATE/story-template.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/story-template.md b/.github/ISSUE_TEMPLATE/story-template.md index 48a1c33493..f3bfa62f54 100644 --- a/.github/ISSUE_TEMPLATE/story-template.md +++ b/.github/ISSUE_TEMPLATE/story-template.md @@ -7,12 +7,12 @@ assignees: '' --- -**## Description** +## Description -**## Acceptance Criteria** +## Acceptance Criteria From 958e98debdfcc99156c1a2b3db33dc53add5f3c7 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Fri, 22 Feb 2019 14:01:22 +1100 Subject: [PATCH 24/24] Document stock validation of variant overrides --- .../stock_settings_override_validation.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/app/models/concerns/stock_settings_override_validation.rb b/app/models/concerns/stock_settings_override_validation.rb index b9e3624aec..b548a8b64b 100644 --- a/app/models/concerns/stock_settings_override_validation.rb +++ b/app/models/concerns/stock_settings_override_validation.rb @@ -1,3 +1,21 @@ +# Validates the combination of on_demand and count_on_hand values. +# +# `on_demand` can have three values: true, false or nil +# `count_on_hand` can either be: nil or a number +# +# This means that a variant override can be in six different stock states +# but only three of them are valid. +# +# | on_demand | count_on_hand | stock_overridden? | use_producer_stock_settings? | valid? | +# |-----------|---------------|-------------------|------------------------------|--------| +# | 1 | nil | false | false | true | +# | 0 | x | true | false | true | +# | nil | nil | false | true | true | +# | 1 | x | ? | ? | false | +# | 0 | nil | ? | ? | false | +# | nil | x | ? | ? | false | +# +# This module has one method for each invalid case. module StockSettingsOverrideValidation extend ActiveSupport::Concern