A platform for community discussion. Free, open, simple.
DEV: Remove Site Traffic Explorer feature setting (#42846)
Alan Guo Xiang Tan61e7cb969ea3
diff --git a/config/locales/server.en.yml b/config/locales/server.en.ymlindex 16e8bfbfb79..92196135bfc 100644--- a/config/locales/server.en.yml+++ b/config/locales/server.en.yml@@ -2922,7 +2922,6 @@ en:dashboard_hidden_reports: "Allow to hide the specified reports from the dashboard."dashboard_visible_tabs: "Choose which dashboard tabs are visible."dashboard_general_tab_activity_metrics: "Choose reports to be displayed as activity metrics on the general tab."- enable_site_traffic_explorer: "Link the admin dashboard's site traffic details action to the Site Traffic Explorer."site_traffic_explorer_event_limit: "Controls the maximum number of recent pageviews the Site Traffic Explorer processes. Higher limits cover more traffic but may take longer to load or time out on lower-resource database servers."gravatar_enabled: "Use the <a href='https://gravatar.com/'>Gravatar</a> service for user avatars. Disabling this will prevent users from switching to Gravatar for their avatars, but will not impact users who already use it."diff --git a/config/site_settings.yml b/config/site_settings.ymlindex 6d546b905bf..08033a466da 100644--- a/config/site_settings.yml+++ b/config/site_settings.yml@@ -4686,10 +4686,6 @@ dashboard:client: trueexperimental:- enable_site_traffic_explorer:- default: false- client: true- area: "experimental"reporting_improvements:default: falseclient: truediff --git a/db/post_migrate/20260824072257_remove_enable_site_traffic_explorer_setting.rb b/db/post_migrate/20260824072257_remove_enable_site_traffic_explorer_setting.rbnew file mode 100644index 00000000000..a93c5d27a41--- /dev/null+++ b/db/post_migrate/20260824072257_remove_enable_site_traffic_explorer_setting.rb@@ -0,0 +1,11 @@+# frozen_string_literal: true++class RemoveEnableSiteTrafficExplorerSetting < ActiveRecord::Migration[8.0]+ def up+ execute "DELETE FROM site_settings WHERE name = 'enable_site_traffic_explorer'"+ end++ def down+ raise ActiveRecord::IrreversibleMigration+ end+enddiff --git a/db/structure.sql b/db/structure.sqlindex 100f2c51506..c910b8086a0 100644--- a/db/structure.sql+++ b/db/structure.sql@@ -23361,6 +23361,7 @@ ALTER TABLE ONLY public.ad_plugin_house_ads_groupsSET search_path TO "$user", public;INSERT INTO "schema_migrations" (version) VALUES+('20260824072257'),('20260820171539'),('20260820143851'),('20260818143417'),diff --git a/frontend/discourse/admin/components/dashboard/traffic.gjs b/frontend/discourse/admin/components/dashboard/traffic.gjsindex 4791c115b61..33badbd9a19 100644--- a/frontend/discourse/admin/components/dashboard/traffic.gjs+++ b/frontend/discourse/admin/components/dashboard/traffic.gjs@@ -32,7 +32,6 @@ const PERIOD_COPY_KEYS = {export default class DashboardTraffic extends Component {@service currentUser;- @service siteSettings;hiddenLabels = ["page_view_crawler"];@@ -168,12 +167,6 @@ export default class DashboardTraffic extends Component {return { range: this.args.period };}- get showTrafficExplorerLink() {- return (- this.currentUser.admin && this.siteSettings.enable_site_traffic_explorer- );- }-formatHeadlineCount(value) {if (value >= 1_000_000) {const formatted = I18n.toNumber(value / 1_000_000, { precision: 1 });@@ -404,7 +397,7 @@ export default class DashboardTraffic extends Component {class="db-section__traffic-chart-canvas"/></div>- {{#if this.showTrafficExplorerLink}}+ {{#if this.currentUser.admin}}<LinkToclass="db-traffic__see-details"@route="adminSiteTraffic"diff --git a/spec/system/admin_dashboard_redesign/site_traffic_section_spec.rb b/spec/system/admin_dashboard_redesign/site_traffic_section_spec.rbindex 4c9e10d13a5..ccc240aa689 100644--- a/spec/system/admin_dashboard_redesign/site_traffic_section_spec.rb+++ b/spec/system/admin_dashboard_redesign/site_traffic_section_spec.rb@@ -138,7 +138,6 @@ describe "Admin Dashboard Redesign | Site Traffic section" doendit "takes an admin to the traffic explorer with the selected period when they click See details" do- SiteSetting.enable_site_traffic_explorer = trueFabricate(:logged_in_browser_application_request, date: "2026-05-05", count: 10)dashboard.visit_with_query(range: "custom", start_date: "2026-05-01", end_date: "2026-05-12")@@ -154,19 +153,7 @@ describe "Admin Dashboard Redesign | Site Traffic section" do)end- it "links to the aggregate traffic report by default" do- Fabricate(:logged_in_browser_application_request, date: "2026-05-05", count: 10)-- dashboard.visit_with_query(range: "custom", start_date: "2026-05-01", end_date: "2026-05-12")- dashboard.site_traffic.click_see_details-- expect(page).to have_current_path(- "/admin/reports/site_traffic?end_date=2026-05-12&start_date=2026-05-01",- )- end-it "keeps the aggregate traffic report available to moderators" do- SiteSetting.enable_site_traffic_explorer = truesign_in(moderator)dashboard.visit_with_query(range: "custom", start_date: "2026-05-01", end_date: "2026-05-12")