Skip to content

Commit

Permalink
Merge pull request #2118 from graygilmore/remove-country-editing
Browse files Browse the repository at this point in the history
Remove admin's ability to edit countries and states
  • Loading branch information
tvdeyen authored Aug 17, 2017
2 parents 7b2c0ae + 75e5ae4 commit 9f0a68e
Show file tree
Hide file tree
Showing 24 changed files with 12 additions and 406 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

- Customized responders have been removed. They are available in the `solidus_responders` extension

- Removed the admin functionality to modify countries and states [\#2118](https://github.com/solidusio/solidus/pull/2118) ([graygilmore](https://github.com/graygilmore)). This functionality, if required, is available through the [solidus_countries_backend](https://github.com/solidusio-contrib/solidus_countries_backend) extension.

- The all configuration objects now use static preferences by default. It's no longer necessary to call `use_static_preferences!`, as that is the new default. For the old behaviour of loading preferences from the DB, call `config.use_legacy_db_preferences!`. [\#2112](https://github.com/solidusio/solidus/pull/2112) ([jhawthorn](https://github.com/jhawthorn))

- Remove Skeleton Grid CSS from the admin and complete its transition to Bootstrap. [\#2127](https://github.com/solidusio/solidus/pull/2127) ([graygilmore](https://github.com/graygilmore))
Expand Down
12 changes: 0 additions & 12 deletions backend/app/assets/javascripts/spree/backend/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,18 +69,6 @@ var handle_date_picker_fields = function(){

$(document).ready(function(){
handle_date_picker_fields();
$(".observe_field").on('change', function() {
var target = $(this).data("update");
$(target).hide();
Spree.ajax({ dataType: 'html',
url: $(this).data("base-url")+encodeURIComponent($(this).val()),
type: 'get',
success: function(data){
$(target).html(data);
$(target).show();
}
});
});
var uniqueId = 1;
$('.spree_add_fields').click(function() {
var target = $(this).data("target");
Expand Down
9 changes: 0 additions & 9 deletions backend/app/controllers/spree/admin/countries_controller.rb

This file was deleted.

29 changes: 0 additions & 29 deletions backend/app/controllers/spree/admin/states_controller.rb

This file was deleted.

2 changes: 1 addition & 1 deletion backend/app/models/spree/backend_configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class BackendConfiguration < Preferences::Configuration
:taxons]
REPORT_TABS ||= [:reports]
CONFIGURATION_TABS ||= [:stores, :tax_categories,
:tax_rates, :zones, :countries, :states,
:tax_rates, :zones,
:payment_methods, :shipping_methods,
:shipping_categories, :stock_locations,
:refund_reasons, :reimbursement_types, :return_authorization_reasons]
Expand Down
22 changes: 0 additions & 22 deletions backend/app/views/spree/admin/countries/_form.html.erb

This file was deleted.

19 changes: 0 additions & 19 deletions backend/app/views/spree/admin/countries/edit.html.erb

This file was deleted.

49 changes: 0 additions & 49 deletions backend/app/views/spree/admin/countries/index.html.erb

This file was deleted.

18 changes: 0 additions & 18 deletions backend/app/views/spree/admin/countries/new.html.erb

This file was deleted.

19 changes: 0 additions & 19 deletions backend/app/views/spree/admin/shared/_areas_tabs.html.erb

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@
<%= tab :payments, url: spree.admin_payment_methods_path %>
<% end %>

<% if can?(:display, Spree::Zone) || can?(:display, Spree::Country) || can?(:display, Spree::State) %>
<%= tab :areas, url: spree.admin_zones_path %>
<% end %>

<% if can?(:display, Spree::TaxCategory) || can?(:display, Spree::TaxRate) %>
<%= tab :taxes, url: spree.admin_tax_categories_path %>
<% end %>
Expand All @@ -23,4 +19,8 @@
<% if can?(:display, Spree::ShippingMethod) || can?(:display, Spree::ShippingCategory) || can?(:display, Spree::StockLocation) %>
<%= tab :shipping, url: spree.admin_shipping_methods_path, match_path: %r(shipping_methods|shipping_categories|stock_locations) %>
<% end %>

<% if can?(:display, Spree::Zone) %>
<%= tab :zones, url: spree.admin_zones_path %>
<% end %>
</ul>
14 changes: 0 additions & 14 deletions backend/app/views/spree/admin/states/_form.html.erb

This file was deleted.

33 changes: 0 additions & 33 deletions backend/app/views/spree/admin/states/_state_list.html.erb

This file was deleted.

19 changes: 0 additions & 19 deletions backend/app/views/spree/admin/states/edit.html.erb

This file was deleted.

39 changes: 0 additions & 39 deletions backend/app/views/spree/admin/states/index.html.erb

This file was deleted.

17 changes: 0 additions & 17 deletions backend/app/views/spree/admin/states/new.html.erb

This file was deleted.

3 changes: 0 additions & 3 deletions backend/app/views/spree/admin/zones/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
<%= render 'spree/admin/shared/areas_tabs' %>

<% admin_breadcrumb(Spree.t(:settings)) %>
<% admin_breadcrumb(Spree.t('admin.tab.areas')) %>
<% admin_breadcrumb(link_to plural_resource_name(Spree::Zone), spree.admin_zones_path) %>
<% admin_breadcrumb(@zone.name) %>

Expand Down
4 changes: 0 additions & 4 deletions backend/app/views/spree/admin/zones/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
<%= render 'spree/admin/shared/areas_tabs' %>

<% admin_breadcrumb(Spree.t(:settings)) %>
<% admin_breadcrumb(Spree.t('admin.tab.areas')) %>
<% admin_breadcrumb(plural_resource_name(Spree::Zone)) %>


<% content_for :page_actions do %>
<% if can?(:create, Spree::Zone) %>
<li>
Expand Down
3 changes: 0 additions & 3 deletions backend/app/views/spree/admin/zones/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
<%= render 'spree/admin/shared/areas_tabs' %>

<% admin_breadcrumb(Spree.t(:settings)) %>
<% admin_breadcrumb(Spree.t('admin.tab.areas')) %>
<% admin_breadcrumb(link_to plural_resource_name(Spree::Zone), spree.admin_zones_path) %>
<% admin_breadcrumb(Spree.t(:new_zone)) %>

Expand Down
4 changes: 0 additions & 4 deletions backend/config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@

resources :zones

resources :countries do
resources :states
end
resources :states
resources :tax_categories

resources :products do
Expand Down
Loading

0 comments on commit 9f0a68e

Please sign in to comment.