Skip to content

Commit

Permalink
Deprecate and remove dashboard code
Browse files Browse the repository at this point in the history
As stated by jarednorman (in #4860):
> None of this provides any real value. Adding a custom dashboard is
> trivial and I really don't think we need a custom permission set and
> empty controller/view.
  • Loading branch information
lauriejefferson authored and nvandoorn committed Oct 30, 2024
1 parent b099358 commit c7ce93e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions backend/app/controllers/spree/admin/dashboards_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
module Spree
module Admin
class DashboardsController < BaseController
before_action :deprecate
def deprecate
Spree.deprecator.warn "The #{self.class.name} is deprecated. If you still use dashboards, please copy all controllers and views from solidus_backend to your application."
end
end
end
end
1 change: 1 addition & 0 deletions backend/app/views/spree/admin/dashboards/home.html.erb
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
<%# Placeholder view for a home dashboard %>
<p><%= Spree.deprecator.warn "The Home view is deprecated, If you still use dashboards, please copy all controllers and views from solidus_backend to your application." %></p>
2 changes: 2 additions & 0 deletions core/lib/spree/permission_sets/dashboard_display.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ def category
end

def activate!
Spree.deprecator.warn "The #{self.class.name} module is deprecated. " \
"If you still use dashboards, please copy all controllers and views from #{self.class.name} to your application."
can [:admin, :home], :dashboards
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

context "when activated" do
before do
Spree.deprecator.warn 'The dashboard_display_spec.rb test is being deprecated. Please update your source code.'
described_class.new(ability).activate!
end

Expand All @@ -18,6 +19,7 @@
end

context "when not activated" do
Spree.deprecator.warn 'The dashboard_display_spec.rb test is being deprecated. Please update your source code.'
it { is_expected.not_to be_able_to(:admin, :dashboards) }
it { is_expected.not_to be_able_to(:home, :dashboards) }
end
Expand Down

0 comments on commit c7ce93e

Please sign in to comment.