mirror of
https://github.com/discourse/discourse.git
synced 2025-02-09 21:04:48 +00:00
DEV: Add category style deprecation check warning (#23951)
The category style site setting is being deprecated. This commit will show a warning on the admin dashboard if a site isn't using the default category style (bullet).
This commit is contained in:
parent
c95ffb98ef
commit
60ae69027c
@ -207,7 +207,8 @@ class AdminDashboardData
|
|||||||
:unreachable_themes,
|
:unreachable_themes,
|
||||||
:watched_words_check,
|
:watched_words_check,
|
||||||
:google_analytics_version_check,
|
:google_analytics_version_check,
|
||||||
:translation_overrides_check
|
:translation_overrides_check,
|
||||||
|
:deprecated_category_style_check
|
||||||
|
|
||||||
register_default_scheduled_problem_checks
|
register_default_scheduled_problem_checks
|
||||||
|
|
||||||
@ -447,6 +448,10 @@ class AdminDashboardData
|
|||||||
themes_html_format(themes, "dashboard.unreachable_themes")
|
themes_html_format(themes, "dashboard.unreachable_themes")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def deprecated_category_style_check
|
||||||
|
I18n.t("dashboard.category_style_deprecated") if SiteSetting.category_style != "bullet"
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def themes_html_format(themes, i18n_key)
|
def themes_html_format(themes, i18n_key)
|
||||||
|
@ -1502,6 +1502,7 @@ en:
|
|||||||
unreachable_themes: "We were unable to check for updates on the following themes:"
|
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."
|
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."
|
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:
|
site_settings:
|
||||||
allow_bulk_invite: "Allow bulk invites by uploading a CSV file"
|
allow_bulk_invite: "Allow bulk invites by uploading a CSV file"
|
||||||
|
@ -367,4 +367,26 @@ RSpec.describe AdminDashboardData do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
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
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user