A platform for community discussion. Free, open, simple.
DEV: Promote dashboard_improvements upcoming change to permanent (#44916)
Osama Sayegh5f0bbffcf5a1
diff --git a/config/site_settings.yml b/config/site_settings.ymlindex f71b6e1aee1..cd528072788 100644--- a/config/site_settings.yml+++ b/config/site_settings.yml@@ -5039,7 +5039,7 @@ experimental:hidden: trueclient: trueupcoming_change:- status: "stable"+ status: "permanent"impact: "feature,admins"learn_more_url: "https://meta.discourse.org/t/-/404528"improved_crawler_detection:diff --git a/plugins/discourse-ai/spec/system/admin_dashboard_spec.rb b/plugins/discourse-ai/spec/system/admin_dashboard_spec.rbdeleted file mode 100644index 6462de7de8c..00000000000--- a/plugins/discourse-ai/spec/system/admin_dashboard_spec.rb+++ /dev/null@@ -1,36 +0,0 @@-# frozen_string_literal: true--RSpec.describe "Admin dashboard" do- fab!(:admin)-- before do- enable_current_plugin- SiteSetting.dashboard_improvements = false- end-- it "displays the sentiment dashboard" do- SiteSetting.ai_sentiment_enabled = true- sign_in(admin)-- visit "/admin/dashboard/sentiment"-- expect(page).to have_css(".section.sentiment")- end-- it "displays the emotion table with links" do- SiteSetting.ai_sentiment_enabled = true- Fabricate(- :sentiment_classification,- target: Fabricate(:post),- model_used: "SamLowe/roberta-base-go_emotions",- classification: {- love: 0.95,- },- )- sign_in(admin)-- visit "/admin/dashboard/sentiment"-- expect(page).to have_css(".admin-report.emotion-love .cell.value.today-count a")- end-enddiff --git a/plugins/discourse-data-explorer/spec/system/admin_dashboard_toggle_spec.rb b/plugins/discourse-data-explorer/spec/system/admin_dashboard_toggle_spec.rbindex 3e9bd18315c..3d867803d45 100644--- a/plugins/discourse-data-explorer/spec/system/admin_dashboard_toggle_spec.rb+++ b/plugins/discourse-data-explorer/spec/system/admin_dashboard_toggle_spec.rb@@ -61,13 +61,4 @@ describe "Data Explorer | Add query to admin dashboard" doexpect(query_runner).to have_disabled_dashboard_toggleend-- it "hides the button when the dashboard improvements are disabled" do- SiteSetting.dashboard_improvements = false-- query_runner.visit_admin_query(query.id)-- expect(page).to have_css(".query-run-split__primary")- expect(query_runner).to have_no_dashboard_toggle- endenddiff --git a/spec/jobs/scheduled/warm_dashboard_reports_spec.rb b/spec/jobs/scheduled/warm_dashboard_reports_spec.rbindex 5570bb84a91..436e95e347f 100644--- a/spec/jobs/scheduled/warm_dashboard_reports_spec.rb+++ b/spec/jobs/scheduled/warm_dashboard_reports_spec.rb@@ -34,14 +34,6 @@ RSpec.describe Jobs::WarmDashboardReports doexpect(warmed_signups).to be_presentend- it "skips warming when the new dashboard is disabled" do- SiteSetting.dashboard_improvements = false-- described_class.new.execute({})-- expect(warmed_signups).to be_nil- end-it "skips warming when no staff member has been seen recently" doadmin.update!(last_seen_at: 30.days.ago)diff --git a/spec/lib/middleware/request_tracker_spec.rb b/spec/lib/middleware/request_tracker_spec.rbindex 6cc82322c23..fcef09d9fbb 100644--- a/spec/lib/middleware/request_tracker_spec.rb+++ b/spec/lib/middleware/request_tracker_spec.rb@@ -727,7 +727,6 @@ RSpec.describe Middleware::RequestTracker doendit "increments browser counters without emitting beacon events" do- SiteSetting.dashboard_improvements = falseDiscourseIpInfo.stubs(:get).returns(country_code: "US")middleware = Middleware::RequestTracker.new(lambda { |env| [200, {}, ["OK"]] })@@ -850,8 +849,7 @@ RSpec.describe Middleware::RequestTracker doexpect(status).to eq(204)end- it "accepts beacon requests when dashboard improvements are disabled" do- SiteSetting.dashboard_improvements = false+ it "handles beacon requests without passing them to the app" doapp_called = falsemiddleware =Middleware::RequestTracker.new(diff --git a/spec/requests/admin/dashboard_controller_spec.rb b/spec/requests/admin/dashboard_controller_spec.rbindex 563e8079d7d..21b3e03397b 100644--- a/spec/requests/admin/dashboard_controller_spec.rb+++ b/spec/requests/admin/dashboard_controller_spec.rb@@ -40,64 +40,6 @@ RSpec.describe Admin::DashboardController doenddescribe "#index" do- shared_examples "version info present" do- before { SiteSetting.dashboard_improvements = false }-- it "returns discourse version info" do- get "/admin/dashboard.json"-- expect(response.status).to eq(200)- expect(response.parsed_body["version_check"]).to be_present- end- end-- shared_examples "version info absent" do- before do- SiteSetting.dashboard_improvements = false- SiteSetting.version_checks = false- end-- it "does not return discourse version info" do- get "/admin/dashboard.json"-- expect(response.status).to eq(200)- json = response.parsed_body- expect(json["version_check"]).not_to be_present- end- end-- context "when logged in as an admin" do- before { sign_in(admin) }-- context "when version checking is enabled" do- before { SiteSetting.version_checks = true }-- include_examples "version info present"- end-- context "when version checking is disabled" do- before { SiteSetting.version_checks = false }-- include_examples "version info absent"- end- end-- context "when logged in as a moderator" do- before { sign_in(moderator) }-- context "when version checking is enabled" do- before { SiteSetting.version_checks = true }-- include_examples "version info present"- end-- context "when version checking is disabled" do- before { SiteSetting.version_checks = false }-- include_examples "version info absent"- end- end-context "when logged in as a non-staff user" dobefore { sign_in(user) }@@ -379,39 +321,6 @@ RSpec.describe Admin::DashboardController doendend- it "is omitted when enabled for no one" do- SiteSetting.dashboard_improvements = false-- get "/admin/dashboard.json"-- expect(response.status).to eq(200)- expect(response.parsed_body["sections"]).to be_nil- expect(response.parsed_body["configuration"]).to be_nil- end-- it "is omitted when enabled for a group the admin is not in" do- group = Fabricate(:group)- Fabricate(:site_setting_group, name: "dashboard_improvements", group_ids: group.id.to_s)-- get "/admin/dashboard.json"-- expect(response.status).to eq(200)- expect(response.parsed_body["sections"]).to be_nil- expect(response.parsed_body["configuration"]).to be_nil- end-- it "is returned when enabled for the admin's group" do- group = Fabricate(:group)- group.add(admin)- Fabricate(:site_setting_group, name: "dashboard_improvements", group_ids: group.id.to_s)-- get "/admin/dashboard.json"-- expect(response.status).to eq(200)- expect(response.parsed_body["sections"]).to be_present- expect(response.parsed_body["configuration"]).to be_present- end-it "falls back to default dates when date params are malformed" doget "/admin/dashboard.json", params: { start_date: "garbage", end_date: "also-garbage" }@@ -559,17 +468,6 @@ RSpec.describe Admin::DashboardController doexpect(response.status).to eq(200)expect(response.parsed_body).not_to have_key("version_check")end-- it "includes version_check when the admin is not included" do- group = Fabricate(:group)- Fabricate(:site_setting_group, name: "dashboard_improvements", group_ids: group.id.to_s)- SiteSetting.version_checks = true-- get "/admin/dashboard.json"-- expect(response.status).to eq(200)- expect(response.parsed_body).to have_key("version_check")- endenddescribe "problems payload" do@@ -691,16 +589,6 @@ RSpec.describe Admin::DashboardController doexpect(response.status).to eq(200)expect(response.parsed_body).not_to have_key("configuration")end-- it "is omitted when the admin is not included" do- group = Fabricate(:group)- Fabricate(:site_setting_group, name: "dashboard_improvements", group_ids: group.id.to_s)- sign_in(admin)-- get "/admin/dashboard.json"-- expect(response.parsed_body).not_to have_key("configuration")- endendend@@ -2071,21 +1959,6 @@ RSpec.describe Admin::DashboardController do},)end-- it "does not allow access while dashboard improvements are disabled" do- sign_in(admin)- SiteSetting.dashboard_improvements = false-- get "/admin/dashboard/site-traffic-explorer.json", params: request_params-- expect(status: response.status, body: response.parsed_body).to eq(- status: 404,- body: {- "errors" => ["The requested URL or resource could not be found."],- "error_type" => "not_found",- },- )- endenddescribe "#available_reports" dodiff --git a/spec/system/admin_dashboard_community_health_spec.rb b/spec/system/admin_dashboard_community_health_spec.rbdeleted file mode 100644index 755746c1a86..00000000000--- a/spec/system/admin_dashboard_community_health_spec.rb+++ /dev/null@@ -1,36 +0,0 @@-# frozen_string_literal: true--describe "Admin Dashboard Community Health" do- fab!(:current_user, :admin)-- before do- SiteSetting.dashboard_improvements = false- sign_in(current_user)- end-- describe "Pageview Report" do- context "when use_legacy_pageviews is true" do- before { SiteSetting.use_legacy_pageviews = true }-- it "shows the 'Consolidated Pageviews' report" do- visit("/admin")- expect(page).to have_css(- ".admin-report.consolidated-page-views",- text: I18n.t("reports.consolidated_page_views.title"),- )- end- end-- context "when use_legacy_pageviews is false" do- before { SiteSetting.use_legacy_pageviews = false }-- it "shows the 'Site Traffic' report" do- visit("/admin")- expect(page).to have_css(- ".admin-report.site-traffic",- text: I18n.t("reports.site_traffic.title"),- )- end- end- end-enddiff --git a/spec/system/admin_dashboard_general_spec.rb b/spec/system/admin_dashboard_general_spec.rbdeleted file mode 100644index 2bc6344385d..00000000000--- a/spec/system/admin_dashboard_general_spec.rb+++ /dev/null@@ -1,23 +0,0 @@-# frozen_string_literal: true--describe "Admin Dashboard General Tab" do- fab!(:admin)- fab!(:user)- fab!(:user_visit) { Fabricate(:user_visit, user: admin) }- fab!(:user_visit_2) { Fabricate(:user_visit, user: user, mobile: true) }- fab!(:user_visit_3) { Fabricate(:user_visit, user: user, visited_at: 1.day.ago) }-- before do- SiteSetting.dashboard_improvements = false- sign_in(admin)- end-- it "displays correct visit counters combining desktop and mobile visits" do- visit("/admin")-- within ".admin-report.visits .admin-report-counters" do- expect(page).to have_css(".today-count", text: "2")- expect(page).to have_css(".yesterday-count", text: "1")- end- end-enddiff --git a/spec/system/admin_notices_spec.rb b/spec/system/admin_notices_spec.rbdeleted file mode 100644index 047f72baa86..00000000000--- a/spec/system/admin_notices_spec.rb+++ /dev/null@@ -1,65 +0,0 @@-# frozen_string_literal: true--describe "Admin Notices" do- let(:admin_dashboard) { PageObjects::Pages::AdminDashboard.new }-- before do- SiteSetting.dashboard_improvements = false- Fabricate(:admin_notice)-- I18n.backend.store_translations(:en, dashboard: { problem: { test_notice: "Houston" } })- end-- context "when signed in as admin" do- fab!(:admin)-- before { sign_in(admin) }-- it "supports dismissing admin notices" do- admin_dashboard.visit-- expect(admin_dashboard).to have_admin_notice(I18n.t("dashboard.problem.test_notice"))-- admin_dashboard.dismiss_notice(I18n.t("dashboard.problem.test_notice"))-- expect(admin_dashboard).to have_no_admin_notice(I18n.t("dashboard.problem.test_notice"))- end-- it "warns the admin when the Sidekiq queue is too large" do- Jobs.stubs(:last_job_performed_at).returns(1.second.ago)- Jobs.stubs(:queued).returns(100_000)-- admin_dashboard.visit-- expect(admin_dashboard).to have_admin_notice(- I18n.t("dashboard.problem.queue_size", queue_size: 100_000),- )- end-- it "warns the admin when Sidekiq is not processing queued jobs" do- Jobs.stubs(:last_job_performed_at).returns(20.minutes.ago)- Jobs.stubs(:queued).returns(1)-- admin_dashboard.visit-- message = Nokogiri::HTML5.fragment(I18n.t("dashboard.problem.sidekiq_check")).text- expect(admin_dashboard).to have_admin_notice(message)- end- end-- context "when signed in as moderator" do- fab!(:moderator)-- before { sign_in(moderator) }-- it "doesn't render dismiss button on admin notices" do- admin_dashboard.visit-- expect(admin_dashboard).to have_admin_notice(I18n.t("dashboard.problem.test_notice"))- expect(admin_dashboard).to have_no_css(- ".dashboard-problem .btn",- text: I18n.t("admin_js.admin.dashboard.dismiss_notice"),- )- end- end-end