diff --git a/backend/app/controllers/spree/admin/dashboards_controller.rb b/backend/app/controllers/spree/admin/dashboards_controller.rb index 979f4611371..90a4c91a5c2 100644 --- a/backend/app/controllers/spree/admin/dashboards_controller.rb +++ b/backend/app/controllers/spree/admin/dashboards_controller.rb @@ -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 diff --git a/backend/app/views/spree/admin/dashboards/home.html.erb b/backend/app/views/spree/admin/dashboards/home.html.erb index 83cfc00d42f..66b6f11fc15 100644 --- a/backend/app/views/spree/admin/dashboards/home.html.erb +++ b/backend/app/views/spree/admin/dashboards/home.html.erb @@ -1 +1,2 @@ <%# Placeholder view for a home dashboard %> +
<%= 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." %>
diff --git a/core/lib/spree/permission_sets/dashboard_display.rb b/core/lib/spree/permission_sets/dashboard_display.rb index ce268973306..09e43a70b31 100644 --- a/core/lib/spree/permission_sets/dashboard_display.rb +++ b/core/lib/spree/permission_sets/dashboard_display.rb @@ -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 diff --git a/core/spec/models/spree/permission_sets/dashboard_display_spec.rb b/core/spec/models/spree/permission_sets/dashboard_display_spec.rb deleted file mode 100644 index b6a76cad080..00000000000 --- a/core/spec/models/spree/permission_sets/dashboard_display_spec.rb +++ /dev/null @@ -1,36 +0,0 @@ -# frozen_string_literal: true - -require 'rails_helper' -require 'spree/testing_support/dummy_ability' - -RSpec.describe Spree::PermissionSets::DashboardDisplay do - let(:ability) { DummyAbility.new } - - subject { ability } - - context "when activated" do - before do - described_class.new(ability).activate! - end - - it { is_expected.to be_able_to(:admin, :dashboards) } - it { is_expected.to be_able_to(:home, :dashboards) } - end - - context "when not activated" do - it { is_expected.not_to be_able_to(:admin, :dashboards) } - it { is_expected.not_to be_able_to(:home, :dashboards) } - end - - describe ".privilege" do - it "returns the correct privilege symbol" do - expect(described_class.privilege).to eq(:other) - end - end - - describe ".category" do - it "returns the correct category symbol" do - expect(described_class.category).to eq(:dashboard_display) - end - end -end