From 144369e55fd45dab38ffffa7830c8cbd0389eebf Mon Sep 17 00:00:00 2001 From: luisramos0 Date: Tue, 17 Sep 2019 15:53:16 +0100 Subject: [PATCH 01/11] Add tax related controllers from spree_backend related to config --- .../spree/admin/tax_categories_controller.rb | 19 ++++++++++++++ .../spree/admin/tax_rates_controller.rb | 26 +++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 app/controllers/spree/admin/tax_categories_controller.rb create mode 100644 app/controllers/spree/admin/tax_rates_controller.rb diff --git a/app/controllers/spree/admin/tax_categories_controller.rb b/app/controllers/spree/admin/tax_categories_controller.rb new file mode 100644 index 00000000000..74e5e83c0b9 --- /dev/null +++ b/app/controllers/spree/admin/tax_categories_controller.rb @@ -0,0 +1,19 @@ +module Spree + module Admin + class TaxCategoriesController < ResourceController + def destroy + if @object.destroy + flash[:success] = flash_message_for(@object, :successfully_removed) + respond_with(@object) do |format| + format.html { redirect_to collection_url } + format.js { render :partial => "spree/admin/shared/destroy" } + end + else + respond_with(@object) do |format| + format.html { redirect_to collection_url } + end + end + end + end + end +end diff --git a/app/controllers/spree/admin/tax_rates_controller.rb b/app/controllers/spree/admin/tax_rates_controller.rb new file mode 100644 index 00000000000..89d90988498 --- /dev/null +++ b/app/controllers/spree/admin/tax_rates_controller.rb @@ -0,0 +1,26 @@ +module Spree + module Admin + class TaxRatesController < ResourceController + before_filter :load_data + + update.after :update_after + create.after :create_after + + private + + def load_data + @available_zones = Zone.order(:name) + @available_categories = TaxCategory.order(:name) + @calculators = TaxRate.calculators.sort_by(&:name) + end + + def update_after + Rails.cache.delete('vat_rates') + end + + def create_after + Rails.cache.delete('vat_rates') + end + end + end +end From 89029f46f9cc5e4ae5a4934d8efc8c31837a2a48 Mon Sep 17 00:00:00 2001 From: luisramos0 Date: Tue, 17 Sep 2019 15:56:53 +0100 Subject: [PATCH 02/11] Fix basic rubocop issues in newly added controller --- app/controllers/spree/admin/tax_categories_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/spree/admin/tax_categories_controller.rb b/app/controllers/spree/admin/tax_categories_controller.rb index 74e5e83c0b9..26cff4479f8 100644 --- a/app/controllers/spree/admin/tax_categories_controller.rb +++ b/app/controllers/spree/admin/tax_categories_controller.rb @@ -6,7 +6,7 @@ def destroy flash[:success] = flash_message_for(@object, :successfully_removed) respond_with(@object) do |format| format.html { redirect_to collection_url } - format.js { render :partial => "spree/admin/shared/destroy" } + format.js { render partial: "spree/admin/shared/destroy" } end else respond_with(@object) do |format| From bc6f7934e08d49e39834a17bbf8af52c793e1ac7 Mon Sep 17 00:00:00 2001 From: luisramos0 Date: Tue, 17 Sep 2019 16:23:39 +0100 Subject: [PATCH 03/11] Add spree_backend views related to admin/configuration menu that are missing in ofn --- .../spree/admin/tax_categories/_form.html.erb | 24 ++++++++ .../spree/admin/tax_categories/edit.html.erb | 18 ++++++ .../spree/admin/tax_categories/index.html.erb | 48 +++++++++++++++ .../spree/admin/tax_categories/new.html.erb | 19 ++++++ .../spree/admin/tax_categories/show.html.erb | 1 + .../spree/admin/tax_rates/_form.html.erb | 42 +++++++++++++ app/views/spree/admin/tax_rates/edit.html.erb | 21 +++++++ .../spree/admin/tax_rates/index.html.erb | 59 +++++++++++++++++++ app/views/spree/admin/tax_rates/new.html.erb | 25 ++++++++ 9 files changed, 257 insertions(+) create mode 100644 app/views/spree/admin/tax_categories/_form.html.erb create mode 100644 app/views/spree/admin/tax_categories/edit.html.erb create mode 100644 app/views/spree/admin/tax_categories/index.html.erb create mode 100644 app/views/spree/admin/tax_categories/new.html.erb create mode 100644 app/views/spree/admin/tax_categories/show.html.erb create mode 100644 app/views/spree/admin/tax_rates/_form.html.erb create mode 100644 app/views/spree/admin/tax_rates/edit.html.erb create mode 100644 app/views/spree/admin/tax_rates/index.html.erb create mode 100644 app/views/spree/admin/tax_rates/new.html.erb diff --git a/app/views/spree/admin/tax_categories/_form.html.erb b/app/views/spree/admin/tax_categories/_form.html.erb new file mode 100644 index 00000000000..f112f866750 --- /dev/null +++ b/app/views/spree/admin/tax_categories/_form.html.erb @@ -0,0 +1,24 @@ +
+
+ <%= f.field_container :name do %> + <%= f.label :name, Spree.t(:name) %> + <%= f.text_field :name, :class => 'fullwidth' %> + <% end %> +
+ +
+ <%= f.field_container :description do %> + <%= f.label :description, Spree.t(:description) %>
+ <%= f.text_field :description, :class => 'fullwidth' %> + <% end %> +
+ +
+ <%= f.field_container :is_default, :class => ['checkbox'] do %> + + <% end %> +
+
\ No newline at end of file diff --git a/app/views/spree/admin/tax_categories/edit.html.erb b/app/views/spree/admin/tax_categories/edit.html.erb new file mode 100644 index 00000000000..8cb0a957c02 --- /dev/null +++ b/app/views/spree/admin/tax_categories/edit.html.erb @@ -0,0 +1,18 @@ +<%= render :partial => 'spree/admin/shared/configuration_menu' %> + +<% content_for :page_title do %> + <%= Spree.t(:editing_tax_category) %> +<% end %> + +<% content_for :page_actions do %> +
  • <%= link_to_with_icon 'icon-arrow-left', Spree.t(:back_to_tax_categories_list), admin_tax_categories_path, :class => 'button' %>
  • +<% end %> + +<%= render :partial => 'spree/shared/error_messages', :locals => { :target => @tax_category } %> + +<%= form_for [:admin, @tax_category] do |f| %> +
    + <%= render :partial => 'form', :locals => { :f => f } %> + <%= render :partial => 'spree/admin/shared/edit_resource_links' %> +
    +<% end %> diff --git a/app/views/spree/admin/tax_categories/index.html.erb b/app/views/spree/admin/tax_categories/index.html.erb new file mode 100644 index 00000000000..135bd56cee0 --- /dev/null +++ b/app/views/spree/admin/tax_categories/index.html.erb @@ -0,0 +1,48 @@ +<%= render :partial => 'spree/admin/shared/configuration_menu' %> + +<% content_for :page_title do %> + <%= Spree.t(:listing_tax_categories) %> +<% end %> + +<% content_for :page_actions do %> +
      +
    • + <%= button_link_to Spree.t(:new_tax_category), new_object_url, :icon => 'icon-plus', :id => 'admin_new_tax_categories_link' %> +
    • +
    +<% end %> + + + + + + + + + + + + + + + + + + <% @tax_categories.each do |tax_category| + @edit_url = edit_admin_tax_category_path(tax_category) + @delete_url = admin_tax_category_path(tax_category) + %> + + + + + + <% end %> + <% if @tax_categories.empty? %> + + <% end %> + +
    <%= Spree.t(:name) %><%= Spree.t(:description) %><%= Spree.t(:default) %>
    <%= tax_category.name %><%= tax_category.description %><%= tax_category.is_default.to_s.titleize %> + <%= link_to_edit tax_category, :no_text => true %> + <%= link_to_delete tax_category, :no_text => true %> +
    <%= Spree.t(:none) %>
    \ No newline at end of file diff --git a/app/views/spree/admin/tax_categories/new.html.erb b/app/views/spree/admin/tax_categories/new.html.erb new file mode 100644 index 00000000000..7a0be6efac3 --- /dev/null +++ b/app/views/spree/admin/tax_categories/new.html.erb @@ -0,0 +1,19 @@ +<%= render :partial => 'spree/admin/shared/configuration_menu' %> + +<% content_for :page_title do %> + <%= Spree.t(:new_tax_category) %> +<% end %> + +<% content_for :page_actions do %> +
  • <%= link_to_with_icon 'icon-arrow-left', Spree.t(:back_to_tax_categories_list), admin_tax_categories_path, :class => 'button' %>
  • +<% end %> + + +<%= render :partial => 'spree/shared/error_messages', :locals => { :target => @tax_category } %> + +<%= form_for [:admin, @tax_category] do |f| %> +
    + <%= render :partial => 'form', :locals => { :f => f } %> + <%= render :partial => 'spree/admin/shared/new_resource_links' %> +
    +<% end %> diff --git a/app/views/spree/admin/tax_categories/show.html.erb b/app/views/spree/admin/tax_categories/show.html.erb new file mode 100644 index 00000000000..74bb46d5277 --- /dev/null +++ b/app/views/spree/admin/tax_categories/show.html.erb @@ -0,0 +1 @@ +<%= render :partial => 'spree/admin/shared/configuration_menu' %> diff --git a/app/views/spree/admin/tax_rates/_form.html.erb b/app/views/spree/admin/tax_rates/_form.html.erb new file mode 100644 index 00000000000..dec5a210c76 --- /dev/null +++ b/app/views/spree/admin/tax_rates/_form.html.erb @@ -0,0 +1,42 @@ +
    +
    +
    + <%= Spree.t(:general_settings) %> + +
    +
    + <%= f.label :name, Spree.t(:name) %> + <%= f.text_field :name, :class => 'fullwidth' %> +
    +
    + <%= f.label :amount, Spree.t(:rate) %> + <%= f.text_field :amount, :class => 'fullwidth' %> +

    <%= Spree.t(:tax_rate_amount_explanation) %>

    +
    +
    + <%= f.check_box :included_in_price %> + <%= f.label :included_in_price, Spree.t(:included_in_price) %> +
    +
    + +
    +
    + <%= f.label :zone, Spree.t(:zone) %> + <%= f.collection_select(:zone_id, @available_zones, :id, :name, {}, {:class => 'select2 fullwidth'}) %> +
    +
    + <%= f.label :tax_category_id, Spree.t(:tax_category) %> + <%= f.collection_select(:tax_category_id, @available_categories,:id, :name, {}, {:class => 'select2 fullwidth'}) %> +
    +
    + <%= f.check_box :show_rate_in_label %> + <%= f.label :show_rate_in_label, Spree.t(:show_rate_in_label) %> +
    +
    +
    +
    + +
    + + <%= render :partial => 'spree/admin/shared/calculator_fields', :locals => { :f => f } %> +
    diff --git a/app/views/spree/admin/tax_rates/edit.html.erb b/app/views/spree/admin/tax_rates/edit.html.erb new file mode 100644 index 00000000000..8308a1c802e --- /dev/null +++ b/app/views/spree/admin/tax_rates/edit.html.erb @@ -0,0 +1,21 @@ +<%= render :partial => 'spree/admin/shared/configuration_menu' %> + +<% content_for :page_title do %> + <%= Spree.t(:editing_tax_rate) %> +<% end %> + +<% content_for :page_actions do %> +
  • + <%= button_link_to Spree.t(:back_to_tax_rates_list), spree.admin_tax_rates_path, :icon => 'icon-arrow-left' %> +
  • +<% end %> + +<%= render :partial => 'spree/shared/error_messages', :locals => { :target => @tax_rate } %> + +<%= form_for [:admin, @tax_rate] do |f| %> +
    + <%= render :partial => 'form', :locals => { :f => f } %> +
    + <%= render :partial => 'spree/admin/shared/edit_resource_links' %> +
    +<% end %> diff --git a/app/views/spree/admin/tax_rates/index.html.erb b/app/views/spree/admin/tax_rates/index.html.erb new file mode 100644 index 00000000000..90e404788c8 --- /dev/null +++ b/app/views/spree/admin/tax_rates/index.html.erb @@ -0,0 +1,59 @@ +<%= render :partial => 'spree/admin/shared/configuration_menu' %> + +<% content_for :page_title do %> + <%= Spree.t(:tax_rates) %> +<% end %> + +<% content_for :page_actions do %> +
  • + <%= button_link_to Spree.t(:new_tax_rate), new_object_url, :icon => 'icon-plus' %> +
  • +<% end %> + +<% unless @tax_rates.any? %> +
    + <%= Spree.t(:no_results) %> +
    +<% else %> + + + + + + + + + + + + + + + + + + + + + + + + + <% @tax_rates.each do |tax_rate|%> + + + + + + + + + + + <% end %> + +
    <%= Spree.t(:zone) %><%= Spree.t(:name) %><%= Spree.t(:category) %><%= Spree.t(:amount) %><%= Spree.t(:included_in_price) %><%= Spree.t(:show_rate_in_label) %><%= Spree.t(:calculator) %>
    <%=tax_rate.zone.try(:name) || Spree.t(:not_available) %><%=tax_rate.name %><%=tax_rate.tax_category.try(:name) || Spree.t(:not_available) %><%=tax_rate.amount %><%=tax_rate.included_in_price %><%=tax_rate.show_rate_in_label %><%=tax_rate.calculator.to_s %> + <%= link_to_edit tax_rate, :no_text => true %> + <%= link_to_delete tax_rate, :no_text => true %> +
    +<% end %> diff --git a/app/views/spree/admin/tax_rates/new.html.erb b/app/views/spree/admin/tax_rates/new.html.erb new file mode 100644 index 00000000000..c3720fcb59a --- /dev/null +++ b/app/views/spree/admin/tax_rates/new.html.erb @@ -0,0 +1,25 @@ +<%= render :partial => 'spree/admin/shared/configuration_menu' %> + +<% content_for :page_title do %> + <%= Spree.t(:new_tax_rate) %> +<% end %> + +<% content_for :page_actions do %> +
  • + <%= button_link_to Spree.t(:back_to_tax_rates_list), spree.admin_tax_rates_path, :icon => 'icon-arrow-left' %> +
  • +<% end %> + +<%= render :partial => 'spree/shared/error_messages', :locals => { :target => @tax_rate } %> + +<%= form_for [:admin, @tax_rate] do |f| %> +
    + + <%= render :partial => 'form', :locals => { :f => f } %> + +
    + + <%= render :partial => 'spree/admin/shared/new_resource_links' %> + +
    +<% end %> From e79c6722639ed7b8aa6f70776403eac63468d9f5 Mon Sep 17 00:00:00 2001 From: luisramos0 Date: Tue, 17 Sep 2019 17:02:56 +0100 Subject: [PATCH 04/11] Convert spree/admin/tax_categories from erb to haml --- .../spree/admin/tax_categories/_form.html.erb | 24 ---------- .../admin/tax_categories/_form.html.haml | 15 ++++++ .../spree/admin/tax_categories/edit.html.erb | 18 ------- .../spree/admin/tax_categories/edit.html.haml | 14 ++++++ .../spree/admin/tax_categories/index.html.erb | 48 ------------------- .../admin/tax_categories/index.html.haml | 38 +++++++++++++++ .../spree/admin/tax_categories/new.html.erb | 19 -------- .../spree/admin/tax_categories/new.html.haml | 14 ++++++ .../spree/admin/tax_categories/show.html.erb | 1 - .../spree/admin/tax_categories/show.html.haml | 1 + 10 files changed, 82 insertions(+), 110 deletions(-) delete mode 100644 app/views/spree/admin/tax_categories/_form.html.erb create mode 100644 app/views/spree/admin/tax_categories/_form.html.haml delete mode 100644 app/views/spree/admin/tax_categories/edit.html.erb create mode 100644 app/views/spree/admin/tax_categories/edit.html.haml delete mode 100644 app/views/spree/admin/tax_categories/index.html.erb create mode 100644 app/views/spree/admin/tax_categories/index.html.haml delete mode 100644 app/views/spree/admin/tax_categories/new.html.erb create mode 100644 app/views/spree/admin/tax_categories/new.html.haml delete mode 100644 app/views/spree/admin/tax_categories/show.html.erb create mode 100644 app/views/spree/admin/tax_categories/show.html.haml diff --git a/app/views/spree/admin/tax_categories/_form.html.erb b/app/views/spree/admin/tax_categories/_form.html.erb deleted file mode 100644 index f112f866750..00000000000 --- a/app/views/spree/admin/tax_categories/_form.html.erb +++ /dev/null @@ -1,24 +0,0 @@ -
    -
    - <%= f.field_container :name do %> - <%= f.label :name, Spree.t(:name) %> - <%= f.text_field :name, :class => 'fullwidth' %> - <% end %> -
    - -
    - <%= f.field_container :description do %> - <%= f.label :description, Spree.t(:description) %>
    - <%= f.text_field :description, :class => 'fullwidth' %> - <% end %> -
    - -
    - <%= f.field_container :is_default, :class => ['checkbox'] do %> - - <% end %> -
    -
    \ No newline at end of file diff --git a/app/views/spree/admin/tax_categories/_form.html.haml b/app/views/spree/admin/tax_categories/_form.html.haml new file mode 100644 index 00000000000..b5070b35a10 --- /dev/null +++ b/app/views/spree/admin/tax_categories/_form.html.haml @@ -0,0 +1,15 @@ +.row + .alpha.four.columns + = f.field_container :name do + = f.label :name, t("spree.name") + = f.text_field :name, class: 'fullwidth' + .five.columns + = f.field_container :description do + = f.label :description, t("spree.description") + %br/ + = f.text_field :description, class: 'fullwidth' + .three.columns.omega + = f.field_container :is_default, class: ['checkbox'] do + %label + = f.check_box :is_default + = t("spree.default") diff --git a/app/views/spree/admin/tax_categories/edit.html.erb b/app/views/spree/admin/tax_categories/edit.html.erb deleted file mode 100644 index 8cb0a957c02..00000000000 --- a/app/views/spree/admin/tax_categories/edit.html.erb +++ /dev/null @@ -1,18 +0,0 @@ -<%= render :partial => 'spree/admin/shared/configuration_menu' %> - -<% content_for :page_title do %> - <%= Spree.t(:editing_tax_category) %> -<% end %> - -<% content_for :page_actions do %> -
  • <%= link_to_with_icon 'icon-arrow-left', Spree.t(:back_to_tax_categories_list), admin_tax_categories_path, :class => 'button' %>
  • -<% end %> - -<%= render :partial => 'spree/shared/error_messages', :locals => { :target => @tax_category } %> - -<%= form_for [:admin, @tax_category] do |f| %> -
    - <%= render :partial => 'form', :locals => { :f => f } %> - <%= render :partial => 'spree/admin/shared/edit_resource_links' %> -
    -<% end %> diff --git a/app/views/spree/admin/tax_categories/edit.html.haml b/app/views/spree/admin/tax_categories/edit.html.haml new file mode 100644 index 00000000000..4d0abacedf0 --- /dev/null +++ b/app/views/spree/admin/tax_categories/edit.html.haml @@ -0,0 +1,14 @@ += render partial: 'spree/admin/shared/configuration_menu' + +- content_for :page_title do + = t("spree.editing_tax_category") + +- content_for :page_actions do + %li= link_to_with_icon 'icon-arrow-left', t("spree.back_to_tax_categories_list"), admin_tax_categories_path, class: 'button' + += render partial: 'spree/shared/error_messages', locals: { target: @tax_category } + += form_for [:admin, @tax_category] do |f| + %fieldset.no-border-top + = render partial: 'form', locals: { f: f } + = render partial: 'spree/admin/shared/edit_resource_links' diff --git a/app/views/spree/admin/tax_categories/index.html.erb b/app/views/spree/admin/tax_categories/index.html.erb deleted file mode 100644 index 135bd56cee0..00000000000 --- a/app/views/spree/admin/tax_categories/index.html.erb +++ /dev/null @@ -1,48 +0,0 @@ -<%= render :partial => 'spree/admin/shared/configuration_menu' %> - -<% content_for :page_title do %> - <%= Spree.t(:listing_tax_categories) %> -<% end %> - -<% content_for :page_actions do %> -
      -
    • - <%= button_link_to Spree.t(:new_tax_category), new_object_url, :icon => 'icon-plus', :id => 'admin_new_tax_categories_link' %> -
    • -
    -<% end %> - - - - - - - - - - - - - - - - - - <% @tax_categories.each do |tax_category| - @edit_url = edit_admin_tax_category_path(tax_category) - @delete_url = admin_tax_category_path(tax_category) - %> - - - - - - <% end %> - <% if @tax_categories.empty? %> - - <% end %> - -
    <%= Spree.t(:name) %><%= Spree.t(:description) %><%= Spree.t(:default) %>
    <%= tax_category.name %><%= tax_category.description %><%= tax_category.is_default.to_s.titleize %> - <%= link_to_edit tax_category, :no_text => true %> - <%= link_to_delete tax_category, :no_text => true %> -
    <%= Spree.t(:none) %>
    \ No newline at end of file diff --git a/app/views/spree/admin/tax_categories/index.html.haml b/app/views/spree/admin/tax_categories/index.html.haml new file mode 100644 index 00000000000..9ee1d1e4c4b --- /dev/null +++ b/app/views/spree/admin/tax_categories/index.html.haml @@ -0,0 +1,38 @@ += render :partial => 'spree/admin/shared/configuration_menu' + +- content_for :page_title do + = t("spree.listing_tax_categories") + +- content_for :page_actions do + %ul.actions.inline-menu + %li + = button_link_to t("spree.new_tax_category"), new_object_url, :icon => 'icon-plus', :id => 'admin_new_tax_categories_link' + +%table#listing_tax_categories.index + %colgroup + %col{style => "width: 30%"}/ + %col{style: "width: 40%"}/ + %col{style: "width: 15%"}/ + %col{style: "width: 15%"}/ + %thead + %tr{"data-hook" => "tax_header"} + %th= t("spree.name") + %th= t("spree.description") + %th= t("spree.default") + %th.actions + %tbody + - @tax_categories.each do |tax_category| + - @edit_url = edit_admin_tax_category_path(tax_category) + - @delete_url = admin_tax_category_path(tax_category) + - tr_class = cycle('odd', 'even') + - tr_id = spree_dom_id(tax_category) + %tr{class: tr_class, id: tr_id} + %td= tax_category.name + %td= tax_category.description + %td.align-center= tax_category.is_default.to_s.titleize + %td.actions + = link_to_edit tax_category, no_text: true + = link_to_delete tax_category, no_text: true + - if @tax_categories.empty? + %tr + %td{colspan: "4"}= t("spree.none") diff --git a/app/views/spree/admin/tax_categories/new.html.erb b/app/views/spree/admin/tax_categories/new.html.erb deleted file mode 100644 index 7a0be6efac3..00000000000 --- a/app/views/spree/admin/tax_categories/new.html.erb +++ /dev/null @@ -1,19 +0,0 @@ -<%= render :partial => 'spree/admin/shared/configuration_menu' %> - -<% content_for :page_title do %> - <%= Spree.t(:new_tax_category) %> -<% end %> - -<% content_for :page_actions do %> -
  • <%= link_to_with_icon 'icon-arrow-left', Spree.t(:back_to_tax_categories_list), admin_tax_categories_path, :class => 'button' %>
  • -<% end %> - - -<%= render :partial => 'spree/shared/error_messages', :locals => { :target => @tax_category } %> - -<%= form_for [:admin, @tax_category] do |f| %> -
    - <%= render :partial => 'form', :locals => { :f => f } %> - <%= render :partial => 'spree/admin/shared/new_resource_links' %> -
    -<% end %> diff --git a/app/views/spree/admin/tax_categories/new.html.haml b/app/views/spree/admin/tax_categories/new.html.haml new file mode 100644 index 00000000000..3ab47800ae9 --- /dev/null +++ b/app/views/spree/admin/tax_categories/new.html.haml @@ -0,0 +1,14 @@ += render partial: 'spree/admin/shared/configuration_menu' + +- content_for :page_title do + = t("spree.new_tax_category") + +- content_for :page_actions do + %li= link_to_with_icon 'icon-arrow-left', t("spree.back_to_tax_categories_list"), admin_tax_categories_path, class: 'button' + += render partial: 'spree/shared/error_messages', locals: { target: @tax_category } + += form_for [:admin, @tax_category] do |f| + %fieldset.no-border-top + = render partial: 'form', locals: { f: f } + = render partial: 'spree/admin/shared/new_resource_links' diff --git a/app/views/spree/admin/tax_categories/show.html.erb b/app/views/spree/admin/tax_categories/show.html.erb deleted file mode 100644 index 74bb46d5277..00000000000 --- a/app/views/spree/admin/tax_categories/show.html.erb +++ /dev/null @@ -1 +0,0 @@ -<%= render :partial => 'spree/admin/shared/configuration_menu' %> diff --git a/app/views/spree/admin/tax_categories/show.html.haml b/app/views/spree/admin/tax_categories/show.html.haml new file mode 100644 index 00000000000..a84e4abc18e --- /dev/null +++ b/app/views/spree/admin/tax_categories/show.html.haml @@ -0,0 +1 @@ += render partial: 'spree/admin/shared/configuration_menu' From cc0dabcd1e1b4f8117768f5ade55a88dcdc6a7b1 Mon Sep 17 00:00:00 2001 From: luisramos0 Date: Tue, 17 Sep 2019 17:10:21 +0100 Subject: [PATCH 05/11] Convert spree/admin/tax_rates from erb to haml --- .../spree/admin/tax_rates/_form.html.erb | 42 ------------- .../spree/admin/tax_rates/_form.html.haml | 28 +++++++++ app/views/spree/admin/tax_rates/edit.html.erb | 21 ------- .../spree/admin/tax_rates/edit.html.haml | 16 +++++ .../spree/admin/tax_rates/index.html.erb | 59 ------------------- .../spree/admin/tax_rates/index.html.haml | 48 +++++++++++++++ app/views/spree/admin/tax_rates/new.html.erb | 25 -------- app/views/spree/admin/tax_rates/new.html.haml | 16 +++++ 8 files changed, 108 insertions(+), 147 deletions(-) delete mode 100644 app/views/spree/admin/tax_rates/_form.html.erb create mode 100644 app/views/spree/admin/tax_rates/_form.html.haml delete mode 100644 app/views/spree/admin/tax_rates/edit.html.erb create mode 100644 app/views/spree/admin/tax_rates/edit.html.haml delete mode 100644 app/views/spree/admin/tax_rates/index.html.erb create mode 100644 app/views/spree/admin/tax_rates/index.html.haml delete mode 100644 app/views/spree/admin/tax_rates/new.html.erb create mode 100644 app/views/spree/admin/tax_rates/new.html.haml diff --git a/app/views/spree/admin/tax_rates/_form.html.erb b/app/views/spree/admin/tax_rates/_form.html.erb deleted file mode 100644 index dec5a210c76..00000000000 --- a/app/views/spree/admin/tax_rates/_form.html.erb +++ /dev/null @@ -1,42 +0,0 @@ -
    -
    -
    - <%= Spree.t(:general_settings) %> - -
    -
    - <%= f.label :name, Spree.t(:name) %> - <%= f.text_field :name, :class => 'fullwidth' %> -
    -
    - <%= f.label :amount, Spree.t(:rate) %> - <%= f.text_field :amount, :class => 'fullwidth' %> -

    <%= Spree.t(:tax_rate_amount_explanation) %>

    -
    -
    - <%= f.check_box :included_in_price %> - <%= f.label :included_in_price, Spree.t(:included_in_price) %> -
    -
    - -
    -
    - <%= f.label :zone, Spree.t(:zone) %> - <%= f.collection_select(:zone_id, @available_zones, :id, :name, {}, {:class => 'select2 fullwidth'}) %> -
    -
    - <%= f.label :tax_category_id, Spree.t(:tax_category) %> - <%= f.collection_select(:tax_category_id, @available_categories,:id, :name, {}, {:class => 'select2 fullwidth'}) %> -
    -
    - <%= f.check_box :show_rate_in_label %> - <%= f.label :show_rate_in_label, Spree.t(:show_rate_in_label) %> -
    -
    -
    -
    - -
    - - <%= render :partial => 'spree/admin/shared/calculator_fields', :locals => { :f => f } %> -
    diff --git a/app/views/spree/admin/tax_rates/_form.html.haml b/app/views/spree/admin/tax_rates/_form.html.haml new file mode 100644 index 00000000000..20dd74ca719 --- /dev/null +++ b/app/views/spree/admin/tax_rates/_form.html.haml @@ -0,0 +1,28 @@ +%div + .alpha.twelve.columns + %fieldset.no-border-bottom + %legend{align: "center"}= t("spree.general_settings") + .alpha.six.columns + .field + = f.label :name, t("spree.name") + = f.text_field :name, class: 'fullwidth' + .field + = f.label :amount, t("spree.rate") + = f.text_field :amount, class: 'fullwidth' + %p + %em= t("spree.tax_rate_amount_explanation") + .field + = f.check_box :included_in_price + = f.label :included_in_price, t("spree.included_in_price") + .omega.six.columns + .field + = f.label :zone, t("spree.zone") + = f.collection_select(:zone_id, @available_zones, :id, :name, {}, {class: 'select2 fullwidth'}) + .field + = f.label :tax_category_id, t("spree.tax_category") + = f.collection_select(:tax_category_id, @available_categories,:id, :name, {}, {class: 'select2 fullwidth'}) + .field + = f.check_box :show_rate_in_label + = f.label :show_rate_in_label, t("spree.show_rate_in_label") + .clear + = render partial: 'spree/admin/shared/calculator_fields', locals: { f: f } diff --git a/app/views/spree/admin/tax_rates/edit.html.erb b/app/views/spree/admin/tax_rates/edit.html.erb deleted file mode 100644 index 8308a1c802e..00000000000 --- a/app/views/spree/admin/tax_rates/edit.html.erb +++ /dev/null @@ -1,21 +0,0 @@ -<%= render :partial => 'spree/admin/shared/configuration_menu' %> - -<% content_for :page_title do %> - <%= Spree.t(:editing_tax_rate) %> -<% end %> - -<% content_for :page_actions do %> -
  • - <%= button_link_to Spree.t(:back_to_tax_rates_list), spree.admin_tax_rates_path, :icon => 'icon-arrow-left' %> -
  • -<% end %> - -<%= render :partial => 'spree/shared/error_messages', :locals => { :target => @tax_rate } %> - -<%= form_for [:admin, @tax_rate] do |f| %> -
    - <%= render :partial => 'form', :locals => { :f => f } %> -
    - <%= render :partial => 'spree/admin/shared/edit_resource_links' %> -
    -<% end %> diff --git a/app/views/spree/admin/tax_rates/edit.html.haml b/app/views/spree/admin/tax_rates/edit.html.haml new file mode 100644 index 00000000000..191f93b9cbc --- /dev/null +++ b/app/views/spree/admin/tax_rates/edit.html.haml @@ -0,0 +1,16 @@ += render partial: 'spree/admin/shared/configuration_menu' + +- content_for :page_title do + = t("spree.editing_tax_rate") + +- content_for :page_actions do + %li + = button_link_to t("spree.back_to_tax_rates_list"), spree.admin_tax_rates_path, icon: 'icon-arrow-left' + += render partial: 'spree/shared/error_messages', locals: { target: @tax_rate } + += form_for [:admin, @tax_rate] do |f| + %fieldset.no-border-top + = render partial: 'form', locals: { f: f } + .clear + = render partial: 'spree/admin/shared/edit_resource_links' diff --git a/app/views/spree/admin/tax_rates/index.html.erb b/app/views/spree/admin/tax_rates/index.html.erb deleted file mode 100644 index 90e404788c8..00000000000 --- a/app/views/spree/admin/tax_rates/index.html.erb +++ /dev/null @@ -1,59 +0,0 @@ -<%= render :partial => 'spree/admin/shared/configuration_menu' %> - -<% content_for :page_title do %> - <%= Spree.t(:tax_rates) %> -<% end %> - -<% content_for :page_actions do %> -
  • - <%= button_link_to Spree.t(:new_tax_rate), new_object_url, :icon => 'icon-plus' %> -
  • -<% end %> - -<% unless @tax_rates.any? %> -
    - <%= Spree.t(:no_results) %> -
    -<% else %> - - - - - - - - - - - - - - - - - - - - - - - - - <% @tax_rates.each do |tax_rate|%> - - - - - - - - - - - <% end %> - -
    <%= Spree.t(:zone) %><%= Spree.t(:name) %><%= Spree.t(:category) %><%= Spree.t(:amount) %><%= Spree.t(:included_in_price) %><%= Spree.t(:show_rate_in_label) %><%= Spree.t(:calculator) %>
    <%=tax_rate.zone.try(:name) || Spree.t(:not_available) %><%=tax_rate.name %><%=tax_rate.tax_category.try(:name) || Spree.t(:not_available) %><%=tax_rate.amount %><%=tax_rate.included_in_price %><%=tax_rate.show_rate_in_label %><%=tax_rate.calculator.to_s %> - <%= link_to_edit tax_rate, :no_text => true %> - <%= link_to_delete tax_rate, :no_text => true %> -
    -<% end %> diff --git a/app/views/spree/admin/tax_rates/index.html.haml b/app/views/spree/admin/tax_rates/index.html.haml new file mode 100644 index 00000000000..7217e992774 --- /dev/null +++ b/app/views/spree/admin/tax_rates/index.html.haml @@ -0,0 +1,48 @@ += render partial: 'spree/admin/shared/configuration_menu' + +- content_for :page_title do + = t("spree.tax_rates") + +- content_for :page_actions do + %li + = button_link_to t("spree.new_tax_rate"), new_object_url, icon: 'icon-plus' + +- unless @tax_rates.any? + .no-objects-found + = t("spree.no_results") +- else + %table.index + %colgroup + %col{style: "width: 15%"}/ + %col{style: "width: 15%"}/ + %col{style: "width: 10%"}/ + %col{style: "width: 10%"}/ + %col{style: "width: 10%"}/ + %col{style: "width: 10%"}/ + %col{style: "width: 15%"}/ + %col{style: "width: 15%"}/ + %thead + %tr + %th= t("spree.zone") + %th= t("spree.name") + %th= t("spree.category") + %th= t("spree.amount") + %th= t("spree.included_in_price") + %th= t("spree.show_rate_in_label") + %th= t("spree.calculator") + %th.actions + %tbody + - @tax_rates.each do |tax_rate| + - tr_class = cycle('odd', 'even') + - tr_id = spree_dom_id(tax_rate) + %tr{class: tr_class, id: tr_id} + %td= tax_rate.zone.try(:name) || t("spree.not_available") + %td= tax_rate.name + %td= tax_rate.tax_category.try(:name) || t("spree.not_available") + %td.align-center= tax_rate.amount + %td.align-center= tax_rate.included_in_price + %td.align-center= tax_rate.show_rate_in_label + %td.align-center= tax_rate.calculator.to_s + %td.actions + = link_to_edit tax_rate, no_text: true + = link_to_delete tax_rate, no_text: true diff --git a/app/views/spree/admin/tax_rates/new.html.erb b/app/views/spree/admin/tax_rates/new.html.erb deleted file mode 100644 index c3720fcb59a..00000000000 --- a/app/views/spree/admin/tax_rates/new.html.erb +++ /dev/null @@ -1,25 +0,0 @@ -<%= render :partial => 'spree/admin/shared/configuration_menu' %> - -<% content_for :page_title do %> - <%= Spree.t(:new_tax_rate) %> -<% end %> - -<% content_for :page_actions do %> -
  • - <%= button_link_to Spree.t(:back_to_tax_rates_list), spree.admin_tax_rates_path, :icon => 'icon-arrow-left' %> -
  • -<% end %> - -<%= render :partial => 'spree/shared/error_messages', :locals => { :target => @tax_rate } %> - -<%= form_for [:admin, @tax_rate] do |f| %> -
    - - <%= render :partial => 'form', :locals => { :f => f } %> - -
    - - <%= render :partial => 'spree/admin/shared/new_resource_links' %> - -
    -<% end %> diff --git a/app/views/spree/admin/tax_rates/new.html.haml b/app/views/spree/admin/tax_rates/new.html.haml new file mode 100644 index 00000000000..cbf5986a99c --- /dev/null +++ b/app/views/spree/admin/tax_rates/new.html.haml @@ -0,0 +1,16 @@ += render partial: 'spree/admin/shared/configuration_menu' + +- content_for :page_title do + = t("spree.new_tax_rate") + +- content_for :page_actions do + %li + = button_link_to t("spree.back_to_tax_rates_list"), spree.admin_tax_rates_path, icon: 'icon-arrow-left' + += render partial: 'spree/shared/error_messages', locals: { target: @tax_rate } + += form_for [:admin, @tax_rate] do |f| + %fieldset.no-border-top + = render partial: 'form', locals: { f: f } + .clear + = render partial: 'spree/admin/shared/new_resource_links' From 0d18b1a032d520719299fab15928805cb1d3c8f7 Mon Sep 17 00:00:00 2001 From: luisramos0 Date: Tue, 17 Sep 2019 17:45:30 +0100 Subject: [PATCH 06/11] Bring spree/admin configuration routes to ofn --- config/routes/spree.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/config/routes/spree.rb b/config/routes/spree.rb index 94da909f8b1..88a238e85b3 100644 --- a/config/routes/spree.rb +++ b/config/routes/spree.rb @@ -88,6 +88,10 @@ put :clear_api_key end end + + resources :tax_rates + resource :tax_settings + resources :tax_categories end resources :orders do From 44761315c27840583be37a89a2c824a871c23460 Mon Sep 17 00:00:00 2001 From: luisramos0 Date: Tue, 17 Sep 2019 18:21:14 +0100 Subject: [PATCH 07/11] Bring feature specs for configuration pages from spree_backend --- .../configuration/tax_categories_spec.rb | 55 +++++++++++++++++++ .../admin/configuration/tax_rates_spec.rb | 30 ++++++++++ 2 files changed, 85 insertions(+) create mode 100644 spec/features/admin/configuration/tax_categories_spec.rb create mode 100644 spec/features/admin/configuration/tax_rates_spec.rb diff --git a/spec/features/admin/configuration/tax_categories_spec.rb b/spec/features/admin/configuration/tax_categories_spec.rb new file mode 100644 index 00000000000..d4ddfcaa22f --- /dev/null +++ b/spec/features/admin/configuration/tax_categories_spec.rb @@ -0,0 +1,55 @@ +require 'spec_helper' + +describe "Tax Categories" do + stub_authorization! + + before(:each) do + visit spree.admin_path + click_link "Configuration" + end + + context "admin visiting tax categories list" do + it "should display the existing tax categories" do + create(:tax_category, :name => "Clothing", :description => "For Clothing") + click_link "Tax Categories" + page.should have_content("Listing Tax Categories") + within_row(1) do + column_text(1).should == "Clothing" + column_text(2).should == "For Clothing" + column_text(3).should == "False" + end + end + end + + context "admin creating new tax category" do + before(:each) do + click_link "Tax Categories" + click_link "admin_new_tax_categories_link" + end + + it "should be able to create new tax category" do + page.should have_content("New Tax Category") + fill_in "tax_category_name", :with => "sports goods" + fill_in "tax_category_description", :with => "sports goods desc" + click_button "Create" + page.should have_content("successfully created!") + end + + it "should show validation errors if there are any" do + click_button "Create" + page.should have_content("Name can't be blank") + end + end + + context "admin editing a tax category" do + it "should be able to update an existing tax category" do + create(:tax_category) + click_link "Tax Categories" + within_row(1) { click_icon :edit } + fill_in "tax_category_description", :with => "desc 99" + click_button "Update" + page.should have_content("successfully updated!") + page.should have_content("desc 99") + end + end +end diff --git a/spec/features/admin/configuration/tax_rates_spec.rb b/spec/features/admin/configuration/tax_rates_spec.rb new file mode 100644 index 00000000000..51b074b134d --- /dev/null +++ b/spec/features/admin/configuration/tax_rates_spec.rb @@ -0,0 +1,30 @@ +require 'spec_helper' + +describe "Tax Rates" do + stub_authorization! + + let!(:tax_rate) { create(:tax_rate, :calculator => stub_model(Spree::Calculator)) } + + before do + visit spree.admin_path + click_link "Configuration" + end + + # Regression test for #535 + it "can see a tax rate in the list if the tax category has been deleted" do + tax_rate.tax_category.update_column(:deleted_at, Time.now) + lambda { click_link "Tax Rates" }.should_not raise_error + within("table tbody td:nth-child(3)") do + page.should have_content("N/A") + end + end + + # Regression test for #1422 + it "can create a new tax rate" do + click_link "Tax Rates" + click_link "New Tax Rate" + fill_in "Rate", :with => "0.05" + click_button "Create" + page.should have_content("Tax Rate has been successfully created!") + end +end From 4f9eee2682b2285d7f9e6e5cb86d4d6a5e980664 Mon Sep 17 00:00:00 2001 From: luisramos0 Date: Tue, 17 Sep 2019 18:51:10 +0100 Subject: [PATCH 08/11] Fix feature specs added from spree_backend in the configuration area --- app/views/spree/admin/tax_categories/index.html.haml | 2 +- .../admin/configuration/tax_categories_spec.rb | 3 ++- spec/features/admin/configuration/tax_rates_spec.rb | 10 ++++++---- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/app/views/spree/admin/tax_categories/index.html.haml b/app/views/spree/admin/tax_categories/index.html.haml index 9ee1d1e4c4b..44523eb5e8b 100644 --- a/app/views/spree/admin/tax_categories/index.html.haml +++ b/app/views/spree/admin/tax_categories/index.html.haml @@ -10,7 +10,7 @@ %table#listing_tax_categories.index %colgroup - %col{style => "width: 30%"}/ + %col{style: "width: 30%"}/ %col{style: "width: 40%"}/ %col{style: "width: 15%"}/ %col{style: "width: 15%"}/ diff --git a/spec/features/admin/configuration/tax_categories_spec.rb b/spec/features/admin/configuration/tax_categories_spec.rb index d4ddfcaa22f..f3e3ec4f67e 100644 --- a/spec/features/admin/configuration/tax_categories_spec.rb +++ b/spec/features/admin/configuration/tax_categories_spec.rb @@ -1,9 +1,10 @@ require 'spec_helper' describe "Tax Categories" do - stub_authorization! + include AuthenticationWorkflow before(:each) do + quick_login_as_admin visit spree.admin_path click_link "Configuration" end diff --git a/spec/features/admin/configuration/tax_rates_spec.rb b/spec/features/admin/configuration/tax_rates_spec.rb index 51b074b134d..9e64d2cb7a0 100644 --- a/spec/features/admin/configuration/tax_rates_spec.rb +++ b/spec/features/admin/configuration/tax_rates_spec.rb @@ -1,18 +1,20 @@ require 'spec_helper' describe "Tax Rates" do - stub_authorization! + include AuthenticationWorkflow - let!(:tax_rate) { create(:tax_rate, :calculator => stub_model(Spree::Calculator)) } + let!(:calculator) { create(:calculator_per_item, calculable: create(:order)) } + let!(:tax_rate) { create(:tax_rate, calculator: calculator) } before do + quick_login_as_admin visit spree.admin_path click_link "Configuration" end # Regression test for #535 it "can see a tax rate in the list if the tax category has been deleted" do - tax_rate.tax_category.update_column(:deleted_at, Time.now) + tax_rate.tax_category.update_column(:deleted_at, Time.zone.now) lambda { click_link "Tax Rates" }.should_not raise_error within("table tbody td:nth-child(3)") do page.should have_content("N/A") @@ -23,7 +25,7 @@ it "can create a new tax rate" do click_link "Tax Rates" click_link "New Tax Rate" - fill_in "Rate", :with => "0.05" + fill_in "Rate", with: "0.05" click_button "Create" page.should have_content("Tax Rate has been successfully created!") end From a96b56239c06f10a2a23c57baf62df6680a1c137 Mon Sep 17 00:00:00 2001 From: luisramos0 Date: Tue, 17 Sep 2019 18:52:45 +0100 Subject: [PATCH 09/11] Transpec feature specs brought from spre_backend --- .../admin/configuration/tax_categories_spec.rb | 18 +++++++++--------- .../admin/configuration/tax_rates_spec.rb | 6 +++--- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/spec/features/admin/configuration/tax_categories_spec.rb b/spec/features/admin/configuration/tax_categories_spec.rb index f3e3ec4f67e..916811df0c8 100644 --- a/spec/features/admin/configuration/tax_categories_spec.rb +++ b/spec/features/admin/configuration/tax_categories_spec.rb @@ -13,11 +13,11 @@ it "should display the existing tax categories" do create(:tax_category, :name => "Clothing", :description => "For Clothing") click_link "Tax Categories" - page.should have_content("Listing Tax Categories") + expect(page).to have_content("Listing Tax Categories") within_row(1) do - column_text(1).should == "Clothing" - column_text(2).should == "For Clothing" - column_text(3).should == "False" + expect(column_text(1)).to eq("Clothing") + expect(column_text(2)).to eq("For Clothing") + expect(column_text(3)).to eq("False") end end end @@ -29,16 +29,16 @@ end it "should be able to create new tax category" do - page.should have_content("New Tax Category") + expect(page).to have_content("New Tax Category") fill_in "tax_category_name", :with => "sports goods" fill_in "tax_category_description", :with => "sports goods desc" click_button "Create" - page.should have_content("successfully created!") + expect(page).to have_content("successfully created!") end it "should show validation errors if there are any" do click_button "Create" - page.should have_content("Name can't be blank") + expect(page).to have_content("Name can't be blank") end end @@ -49,8 +49,8 @@ within_row(1) { click_icon :edit } fill_in "tax_category_description", :with => "desc 99" click_button "Update" - page.should have_content("successfully updated!") - page.should have_content("desc 99") + expect(page).to have_content("successfully updated!") + expect(page).to have_content("desc 99") end end end diff --git a/spec/features/admin/configuration/tax_rates_spec.rb b/spec/features/admin/configuration/tax_rates_spec.rb index 9e64d2cb7a0..1ed41381da6 100644 --- a/spec/features/admin/configuration/tax_rates_spec.rb +++ b/spec/features/admin/configuration/tax_rates_spec.rb @@ -15,9 +15,9 @@ # Regression test for #535 it "can see a tax rate in the list if the tax category has been deleted" do tax_rate.tax_category.update_column(:deleted_at, Time.zone.now) - lambda { click_link "Tax Rates" }.should_not raise_error + expect { click_link "Tax Rates" }.not_to raise_error within("table tbody td:nth-child(3)") do - page.should have_content("N/A") + expect(page).to have_content("N/A") end end @@ -27,6 +27,6 @@ click_link "New Tax Rate" fill_in "Rate", with: "0.05" click_button "Create" - page.should have_content("Tax Rate has been successfully created!") + expect(page).to have_content("Tax Rate has been successfully created!") end end From 6855e5c8f4a33e64aea4e8a827aabf5c2ec8c8ae Mon Sep 17 00:00:00 2001 From: luisramos0 Date: Tue, 17 Sep 2019 18:56:55 +0100 Subject: [PATCH 10/11] Fix rubocop issues in feature spec --- spec/features/admin/configuration/tax_categories_spec.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spec/features/admin/configuration/tax_categories_spec.rb b/spec/features/admin/configuration/tax_categories_spec.rb index 916811df0c8..4b9714241e0 100644 --- a/spec/features/admin/configuration/tax_categories_spec.rb +++ b/spec/features/admin/configuration/tax_categories_spec.rb @@ -11,7 +11,7 @@ context "admin visiting tax categories list" do it "should display the existing tax categories" do - create(:tax_category, :name => "Clothing", :description => "For Clothing") + create(:tax_category, name: "Clothing", description: "For Clothing") click_link "Tax Categories" expect(page).to have_content("Listing Tax Categories") within_row(1) do @@ -30,8 +30,8 @@ it "should be able to create new tax category" do expect(page).to have_content("New Tax Category") - fill_in "tax_category_name", :with => "sports goods" - fill_in "tax_category_description", :with => "sports goods desc" + fill_in "tax_category_name", with: "sports goods" + fill_in "tax_category_description", with: "sports goods desc" click_button "Create" expect(page).to have_content("successfully created!") end @@ -47,7 +47,7 @@ create(:tax_category) click_link "Tax Categories" within_row(1) { click_icon :edit } - fill_in "tax_category_description", :with => "desc 99" + fill_in "tax_category_description", with: "desc 99" click_button "Update" expect(page).to have_content("successfully updated!") expect(page).to have_content("desc 99") From 0e8765636bf387d45b9fb62e7577202c8c6b4894 Mon Sep 17 00:00:00 2001 From: luisramos0 Date: Fri, 20 Sep 2019 15:46:33 +0100 Subject: [PATCH 11/11] Bring tax_settings from spree_backend to ofn --- .../spree/admin/tax_settings_controller.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 app/controllers/spree/admin/tax_settings_controller.rb diff --git a/app/controllers/spree/admin/tax_settings_controller.rb b/app/controllers/spree/admin/tax_settings_controller.rb new file mode 100644 index 00000000000..a66ad219fff --- /dev/null +++ b/app/controllers/spree/admin/tax_settings_controller.rb @@ -0,0 +1,15 @@ +module Spree + module Admin + class TaxSettingsController < Spree::Admin::BaseController + def update + Spree::Config.set(params[:preferences]) + + respond_to do |format| + format.html { + redirect_to edit_admin_tax_settings_path + } + end + end + end + end +end