Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove clear cache button #1275

Merged
merged 1 commit into from
Jun 30, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

* Remove unused `user_id` column from PromotionRule. [#1259](https://github.com/solidusio/solidus/pull/1259)

* Removed "Clear cache" button from the admin [#1275](https://github.com/solidusio/solidus/pull/1275)

## Solidus 1.3.0 (unreleased)

* Order now requires a `store_id` in validations
Expand Down

This file was deleted.

1 change: 0 additions & 1 deletion backend/app/assets/javascripts/spree/backend/routes.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
Spree.routes.checkouts_api = Spree.pathFor('api/checkouts')
Spree.routes.classifications_api = Spree.pathFor('api/classifications')
Spree.routes.clear_cache = Spree.pathFor('admin/general_settings/clear_cache')
Spree.routes.option_value_search = Spree.pathFor('api/option_values')
Spree.routes.option_type_search = Spree.pathFor('api/option_types')
Spree.routes.orders_api = Spree.pathFor('api/orders')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,6 @@ def update
end
end

def clear_cache
Rails.cache.clear
invoke_callbacks(:clear_cache, :after)
head :no_content
end

private

def store_params
Expand Down
16 changes: 0 additions & 16 deletions backend/app/views/spree/admin/general_settings/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -59,22 +59,6 @@
</div>
<% end %>

<% if can? :clear_cache, :general_settings %>
<div class="row">
<div class="alpha six columns">
<fieldset class="no-border-bottom">
<legend align="center"><%= Spree.t(:clear_cache)%></legend>
<div>
<%= Spree.t(:clear_cache_warning) %>
</div>
<div class="field" data-hook="general_settings_clear_cache">
<%= button Spree.t(:clear_cache), '', 'button', id: "clear_cache" %>
</div>
</fieldset>
</div>
</div>
<% end %>

<% if can? :update, :general_settings %>
<div class="form-buttons filter-actions actions" data-hook="buttons">
<%= button Spree.t('actions.update'), 'refresh' %>
Expand Down
6 changes: 1 addition & 5 deletions backend/config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,7 @@
end
end

resource :general_settings, only: [:edit, :update] do
collection do
post :clear_cache
end
end
resource :general_settings, only: [:edit, :update]

resources :return_items, only: [:update]

Expand Down

This file was deleted.

11 changes: 0 additions & 11 deletions backend/spec/features/admin/configuration/general_settings_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,4 @@
expect(page).to have_field("Site Name", with: "")
end
end

context "clearing the cache" do
it "should clear the cache" do
expect(page).to_not have_content(Spree.t(:clear_cache_ok))
expect(page).to have_content(Spree.t(:clear_cache_warning))

click_button "Clear Cache"

expect(page).to have_content(Spree.t(:clear_cache_ok))
end
end
end