diff --git a/app/models/problem_check.rb b/app/models/problem_check.rb index 4235ea0759c..5fbe3c38ee4 100644 --- a/app/models/problem_check.rb +++ b/app/models/problem_check.rb @@ -61,6 +61,7 @@ class ProblemCheck # Note: This list must come after the `config_accessor` declarations. # CORE_PROBLEM_CHECKS = [ + ProblemCheck::AdminSidebarDeprecation, ProblemCheck::BadFaviconUrl, ProblemCheck::EmailPollingErroredRecently, ProblemCheck::FacebookConfig, diff --git a/app/services/problem_check/admin_sidebar_deprecation.rb b/app/services/problem_check/admin_sidebar_deprecation.rb new file mode 100644 index 00000000000..637c2253925 --- /dev/null +++ b/app/services/problem_check/admin_sidebar_deprecation.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +class ProblemCheck::AdminSidebarDeprecation < ProblemCheck::ProblemCheck + self.priority = "low" + + def call + return no_problem if SiteSetting.admin_sidebar_enabled_groups.present? + + problem + end +end diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml index 5de705e759a..73002142f0d 100644 --- a/config/locales/server.en.yml +++ b/config/locales/server.en.yml @@ -1722,6 +1722,7 @@ en: google_analytics_version: "Your Discourse is currently using Google Analytics 3, which will no longer be supported after July 2023. Upgrade to Google Analytics 4 now to continue receiving valuable insights and analytics for your website's performance." category_style_deprecated: "Your Discourse is currently using a deprecated category style which will be removed before the final beta release of Discourse 3.2. Please refer to Moving to a Single Category Style Site Setting for instructions on how to keep your selected category style." maxmind_db_configuration: 'The server has been configured to use MaxMind databases for reverse IP lookups but a valid MaxMind account ID has not been configured which may result in MaxMind databases failing to download in the future. See this guide to learn more.' + admin_sidebar_deprecation: "The old admin layout is deprecated in favour of the new sidebar layout and will be removed in the next release. You can configure the new sidebar layout now to opt in before that." back_from_logster_text: "Back to site" site_settings: diff --git a/spec/services/problem_check/admin_sidebar_deprecation_spec.rb b/spec/services/problem_check/admin_sidebar_deprecation_spec.rb new file mode 100644 index 00000000000..feb80773ad9 --- /dev/null +++ b/spec/services/problem_check/admin_sidebar_deprecation_spec.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +RSpec.describe ProblemCheck::AdminSidebarDeprecation do + subject(:check) { described_class.new } + + describe ".call" do + before { SiteSetting.stubs(admin_sidebar_enabled_groups: configured) } + + context "when sidebar is enabled for some group" do + let(:configured) { "1" } + + it { expect(check).to be_chill_about_it } + end + + context "when sidebar is not enabled for any group" do + let(:configured) { "" } + + it do + expect(check).to have_a_problem.with_priority("low").with_message( + "The old admin layout is deprecated in favour of the new sidebar layout and will be removed in the next release. You can configure the new sidebar layout now to opt in before that.", + ) + end + end + end +end