A platform for community discussion. Free, open, simple.
DEV: Add category style deprecation check warning (#23951)
Blake Erickson60ae69027c2c
diff --git a/app/models/admin_dashboard_data.rb b/app/models/admin_dashboard_data.rbindex a57b4d7c1b4..81e72faacae 100644--- a/app/models/admin_dashboard_data.rb+++ b/app/models/admin_dashboard_data.rb@@ -207,7 +207,8 @@ class AdminDashboardData:unreachable_themes,:watched_words_check,:google_analytics_version_check,- :translation_overrides_check+ :translation_overrides_check,+ :deprecated_category_style_checkregister_default_scheduled_problem_checks@@ -447,6 +448,10 @@ class AdminDashboardDatathemes_html_format(themes, "dashboard.unreachable_themes")end+ def deprecated_category_style_check+ I18n.t("dashboard.category_style_deprecated") if SiteSetting.category_style != "bullet"+ end+privatedef themes_html_format(themes, i18n_key)diff --git a/config/locales/server.en.yml b/config/locales/server.en.ymlindex 154ce119efb..acb212e8b13 100644--- a/config/locales/server.en.yml+++ b/config/locales/server.en.yml@@ -1502,6 +1502,7 @@ en:unreachable_themes: "We were unable to check for updates on the following themes:"watched_word_regexp_error: "The regular expression for '%{action}' watched words is invalid. Please check your <a href='%{base_path}/admin/customize/watched_words'>Watched Word settings</a>, or disable the 'watched words regular expressions' site setting."v3_analytics_deprecated: "Your Discourse is currently using Google Analytics 3, which will no longer be supported after July 2023. <a href='https://meta.discourse.org/t/260498'>Upgrade to Google Analytics 4</a> 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 <a href='https://meta.discourse.org/t/282441'>Moving to a Single Category Style Site Setting</a> for instructions on how to keep your selected category style."site_settings:allow_bulk_invite: "Allow bulk invites by uploading a CSV file"diff --git a/spec/models/admin_dashboard_data_spec.rb b/spec/models/admin_dashboard_data_spec.rbindex 4f93c786fd3..ff156595a33 100644--- a/spec/models/admin_dashboard_data_spec.rb+++ b/spec/models/admin_dashboard_data_spec.rb@@ -367,4 +367,26 @@ RSpec.describe AdminDashboardData doendendend++ describe "#deprecated_category_style_check" do+ subject(:dashboard_data) { described_class.new }++ context "with a non-default category style" do+ before { SiteSetting.set(:category_style, "box") }++ it "outputs the correct message" do+ expect(dashboard_data.deprecated_category_style_check).to eq(+ I18n.t("dashboard.category_style_deprecated"),+ )+ end+ end++ context "with the default category style" do+ before { SiteSetting.set(:category_style, "bullet") }++ it "outputs nothing" do+ expect(dashboard_data.deprecated_category_style_check).to eq(nil)+ end+ end+ endend