From 75a7745736e92fe451653abdec9601368410e97f Mon Sep 17 00:00:00 2001 From: Syed Usama Amer Date: Wed, 1 May 2019 10:43:35 -0500 Subject: [PATCH 1/3] Closes translation bug for enterprise fee settings --- .../controllers/enterprise_fees_controller.js.coffee | 2 +- app/views/admin/enterprise_fees/index.html.haml | 2 +- config/locales/en.yml | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/admin/enterprise_fees/controllers/enterprise_fees_controller.js.coffee b/app/assets/javascripts/admin/enterprise_fees/controllers/enterprise_fees_controller.js.coffee index e3cf5ee4cd..37d6436dac 100644 --- a/app/assets/javascripts/admin/enterprise_fees/controllers/enterprise_fees_controller.js.coffee +++ b/app/assets/javascripts/admin/enterprise_fees/controllers/enterprise_fees_controller.js.coffee @@ -1,6 +1,6 @@ angular.module('admin.enterpriseFees').controller 'enterpriseFeesCtrl', ($scope, $http, $window, enterprises, tax_categories, calculators) -> $scope.enterprises = enterprises - $scope.tax_categories = [{id: -1, name: "Inherit From Product"}].concat tax_categories + $scope.tax_categories = [{id: -1, name: t('js.admin.enterprise_fees.inherit_from_product') }].concat tax_categories $scope.calculators = calculators $scope.enterpriseFeesUrl = -> diff --git a/app/views/admin/enterprise_fees/index.html.haml b/app/views/admin/enterprise_fees/index.html.haml index 3a2dae96b1..65888bceab 100644 --- a/app/views/admin/enterprise_fees/index.html.haml +++ b/app/views/admin/enterprise_fees/index.html.haml @@ -6,7 +6,7 @@ = render "admin/enterprise_fees/data" = render :partial => 'spree/shared/error_messages', :locals => { :target => @enterprise_fee_set } - %input.search{'ng-model' => 'query', 'placeholder' => 'Search'} + %input.search{'ng-model' => 'query', 'placeholder' => t('.search')} %table.index#listing_enterprise_fees %thead diff --git a/config/locales/en.yml b/config/locales/en.yml index eed0881ba6..36fa7c09b6 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -501,6 +501,7 @@ en: tax_category: Tax Category calculator: Calculator calculator_values: Calculator Values + search: "Search" enterprise_groups: index: @@ -2572,6 +2573,8 @@ See the %{link} to find out more about %{sitename}'s features and to start using resolve: Resolve new_tag_rule_dialog: select_rule_type: "Select a rule type:" + enterprise_fees: + inherit_from_product: "Inherit From Product" orders: index: per_page: "%{results} per page" From bcc21cdade72bc98736b4ee75c1f733d41cef957 Mon Sep 17 00:00:00 2001 From: luisramos0 Date: Mon, 6 May 2019 20:56:19 +0100 Subject: [PATCH 2/3] Make stock locations backorderable_default false. This is required because when the default stock location is created, the backorderable_default column doesnt exist and when this column is created, the initial default is true. This is why we need to force it to false here. This column is the default value for on_demand which must be false. --- ...506194625_update_stock_locations_backorderable_default.rb | 5 +++++ db/schema.rb | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20190506194625_update_stock_locations_backorderable_default.rb diff --git a/db/migrate/20190506194625_update_stock_locations_backorderable_default.rb b/db/migrate/20190506194625_update_stock_locations_backorderable_default.rb new file mode 100644 index 0000000000..a95aae6eea --- /dev/null +++ b/db/migrate/20190506194625_update_stock_locations_backorderable_default.rb @@ -0,0 +1,5 @@ +class UpdateStockLocationsBackorderableDefault < ActiveRecord::Migration + def change + Spree::StockLocation.update_all(backorderable_default: false) + end +end diff --git a/db/schema.rb b/db/schema.rb index fb7ffe9a96..d3c8b9e01b 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20190501143327) do +ActiveRecord::Schema.define(:version => 20190506194625) do create_table "adjustment_metadata", :force => true do |t| t.integer "adjustment_id" From bb12592a746d62a2ea4651b339eee2f512f5993e Mon Sep 17 00:00:00 2001 From: Pau Perez Date: Fri, 10 May 2019 00:06:01 +0200 Subject: [PATCH 3/3] Report cache diff to Bugsnag in a new tab This will allow us to see the difference between the cache entry and the actual shopfront. Otherwise, there is no way to see what wasn't refreshed in the cache. --- app/jobs/products_cache_integrity_checker_job.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/jobs/products_cache_integrity_checker_job.rb b/app/jobs/products_cache_integrity_checker_job.rb index 78feb3a1b0..8861b5a5a9 100644 --- a/app/jobs/products_cache_integrity_checker_job.rb +++ b/app/jobs/products_cache_integrity_checker_job.rb @@ -3,7 +3,14 @@ require 'open_food_network/products_cache_integrity_checker' ProductsCacheIntegrityCheckerJob = Struct.new(:distributor_id, :order_cycle_id) do def perform unless checker.ok? - Bugsnag.notify RuntimeError.new("Products JSON differs from cached version for distributor: #{distributor_id}, order cycle: #{order_cycle_id}"), diff: checker.diff.to_s(:text) + exception = RuntimeError.new( + "Products JSON differs from cached version for distributor: #{distributor_id}, " \ + "order cycle: #{order_cycle_id}" + ) + + Bugsnag.notify(exception) do |report| + report.add_tab(:products_cache, diff: checker.diff.to_s(:text)) + end end end