A platform for community discussion. Free, open, simple.
DEV: Remove the old admin dashboard (#45324)
Osama Sayegh58f631dfb0b0
diff --git a/app/assets/stylesheets/admin/admin_base.scss b/app/assets/stylesheets/admin/admin_base.scssindex 05939c12ed7..e66af7410ef 100644--- a/app/assets/stylesheets/admin/admin_base.scss+++ b/app/assets/stylesheets/admin/admin_base.scss@@ -1112,15 +1112,6 @@ section.details {width: 100%;}- .dashboard-left,- .dashboard-right {- width: 100%;- }-- .dashboard-stats {- margin: 0;- }-.badges {.current-badge {margin: 70px 0 0 0;diff --git a/app/assets/stylesheets/admin/admin_report_counters.scss b/app/assets/stylesheets/admin/admin_report_counters.scssindex 6edbe51f393..a2f66290192 100644--- a/app/assets/stylesheets/admin/admin_report_counters.scss+++ b/app/assets/stylesheets/admin/admin_report_counters.scss@@ -51,25 +51,3 @@}}}--.rtl .counters-list .counters-header .counters-cell {- text-align: left;-}--.rtl .counters-list {- .cell {- text-align: left;-- &.title {- text-align: right;- }- }-}--.mobile-view {- .counters-list {- .counters-header .counters-cell {- font-weight: normal;- }- }-}diff --git a/app/assets/stylesheets/admin/dashboard.scss b/app/assets/stylesheets/admin/dashboard.scssindex 20c054afb77..4e0c7214fc7 100644--- a/app/assets/stylesheets/admin/dashboard.scss+++ b/app/assets/stylesheets/admin/dashboard.scss@@ -1,720 +1,11 @@@use "lib/viewport";-.admin-reports,-.dashboard-next {- &.admin-contents {- nav {- position: relative;- width: calc(100% + 10px);- padding-left: 10px;- margin-left: -10px;- margin-right: -10px;- }- }-}--.dashboard-next {- .nav {- display: flex;- margin: 0 0 2em 0;- border-bottom: 1px solid var(--content-border-color);- font-size: var(--font-up-1);- white-space: nowrap;- flex-wrap: nowrap;- overflow-x: auto;-- // Fade-out for horizontal scroll nav- &::before {- content: "";- position: absolute;- width: 10px;- margin-left: -10px;- height: 100%;- background: linear-gradient(- to left,- rgb(var(--secondary-rgb), 1),- rgb(var(--secondary-rgb), 0)- );- }-- &::after {- content: "";- position: absolute;- right: 0;- width: 30px;- height: 100%;- background: linear-gradient(- to right,- rgb(var(--secondary-rgb), 0),- rgb(var(--secondary-rgb), 1)- );- }-- .navigation-link {- @include viewport.until(sm) {- padding: 0.4em;- font-size: var(--font-down-1);- }-- .emoji {- margin-right: 0.5em;-- @include viewport.until(sm) {- width: 1.3em;- height: 1.3em;- margin-right: 0;- }- }- }- }-- .sections {- display: flex;- flex-direction: column;- }-- .section-columns {- display: flex;- justify-content: space-between;-- @include viewport.until(lg) {- flex-direction: column;- }-- .section-column {- min-width: calc(50% - 0.5em);- max-width: 100%;-- &:last-child {- margin-left: 0.5em;- }-- &:first-child {- margin-right: 0.5em;- }-- @include viewport.until(lg) {- min-width: 100%;-- &:last-child {- order: 1;- }-- &:first-child {- order: 2;- }- }- }-- @include viewport.until(lg) {- .section-column:last-child,- .section-column:first-child {- margin: 0;- }- }- }-- .section {- .section-title {- display: flex;- align-items: center;- justify-content: space-between;- border-bottom: 1px solid var(--content-border-color);- padding-bottom: 0.5em;-- @media screen and (width <= 400px) {- flex-wrap: wrap;- }-- h2 {- margin: 0 0.5em 0 0;-- a {- color: var(--primary);- }- }- }-- .section-body {- margin-top: 1em;-- > p {- margin-top: 0;- }- }- }-- .admin-report .header {- border: 0;- padding: 0;- margin-bottom: 1em;- }-- .admin-report.description-in-tooltip .header {- .d-page-subheader {- .d-page-subheader__title-row {- margin-bottom: 0;- }- }-- .fk-d-tooltip__trigger {- margin-left: 0.5em;- max-width: 20px;- }- }-- .charts {- display: grid;- grid-template-columns: repeat(12, 1fr);- column-gap: 1em;- row-gap: 1em;-- .admin-report {- grid-column: span 4;-- &.consolidated-page-views,- &.site-traffic {- grid-column: span 12;- }-- .header {- display: grid;- grid-template-areas: "title tooltip trend" "description description description";- grid-template-columns: auto 1fr;-- .d-page-subheader {- display: contents;- }-- .d-page-subheader__description {- grid-area: description;- margin-top: 0;- }-- .trend {- grid-area: trend;- white-space: nowrap;- align-self: start;- }- }- }-- @include viewport.until(lg) {- .admin-report {- grid-column: span 12;- }- }-- .chart-canvas-container {- position: relative;- margin-left: -5px;- }-- .site-traffic .chart-canvas-container {- height: 250px;- }-- .chart-canvas {- width: 100%;- height: 100%;- }- }-- .misc {- display: flex;- border: 1px solid var(--content-border-color);-- .storage-stats,- .last-dashboard-update {- flex: 1 1 50%;- box-sizing: border-box;- margin: 1em 0;- padding: 0 1em;- }-- .storage-stats {- display: flex;- flex-wrap: wrap;- justify-content: space-between;- border-right: 1px solid var(--content-border-color);-- .backups,- .uploads {- flex: 1 1 100%;- }-- .uploads p:last-of-type {- margin-bottom: 0;- }- }-- @media screen and (width <= 400px) {- flex-wrap: wrap;-- .storage-stats,- .last-dashboard-update {- flex: 1 1 100%;- text-align: left;- }-- .last-dashboard-update {- display: block;- margin: 0 20px 20px 20px;- padding: 20px 0 0 0;- border-top: 1px solid var(--content-border-color);- border-left: none;- }- }-- .last-dashboard-update {- text-align: center;- display: flex;- flex-direction: column;- justify-content: center;-- div {- align-self: center;-- h4 {- margin-bottom: 0;- }- }- }- }-- .top-referred-topics {- margin-bottom: 2em;- }-- .top-referred-topics,- .trending-search {- th:first-of-type {- text-align: left;- }- }-- .period-chooser .period-chooser-header {- font-size: var(--font-down-2);- }-- .dashboard-problems {- margin-bottom: 2em;-- .problem-messages {- margin-bottom: 1em;-- ul {- margin: 0 0 0 1.25em;-- li.dashboard-problem {- padding: 0.5em 0.5em;-- .notice {- display: flex;- justify-content: space-between;- align-items: center;- }-- .message {- margin-right: var(--space-4);- }- }- }- }-- .d-icon-triangle-exclamation {- color: var(--danger);- }-- .actions {- margin: 1em 0 0 0;- display: flex;- align-items: center;- color: var(--primary-medium);-- .btn {- margin-right: 1em;- }- }- }-}--.counters-list {- display: flex;- flex: 1 0 0px;- flex-direction: column;-- .counters-header {- display: grid;- flex: 1 0 auto;- grid-template-columns: 33% repeat(auto-fit, minmax(20px, 1fr));- border: 1px solid var(--content-border-color);- border-bottom: 0;- font-weight: 700;- text-align: right;- align-items: center;- padding: 0.65em 0.25em;- }-- .admin-report .chart__body {- border: 1px solid var(--content-border-color);-- &:hover {- background-color: var(--primary-very-low);- }- }-- .alert {- margin-bottom: 0;- }-- .admin-report:not(:last-child) {- .chart__body {- border-bottom: 0;- }-- .conditional-loading-section.is-loading {- border-bottom: 0;- }- }-- .admin-report .conditional-loading-section.is-loading {- display: flex;- flex-direction: row;- padding: 0.5em 0.25em;- align-items: flex-start;- justify-content: flex-start;- border: 1px solid var(--content-border-color);-- .title {- font-size: var(--font-0);- }-- .spinner {- margin: 0;- width: 8px;- height: 8px;- margin-left: 0.5em;- }- }-- .admin-report .chart__body .report-alert {- display: flex;- flex-direction: row;- padding: 0.5em 0.25em;- align-items: center;- text-align: left;- border: 0;-- &:hover {- background-color: var(--primary-very-low);- }-- .d-icon {- font-size: var(--font-up-1);- margin: 0 0.25em 0 0;- color: var(--primary-low-mid);- }- }-}--.activity-metrics {- margin-bottom: 2em;-- @include viewport.until(sm) {- .counters-list {- font-size: var(--font-down-1);- }- }-}--.user-metrics {- display: flex;- flex-wrap: wrap;- justify-content: space-between;- flex-direction: column;-- .dashboard-inline-table {- flex: 1 0 auto;- max-width: 95%;- }-- .table-cell {- display: flex;- flex: 0 1 auto;- margin: 0 10px 5px 0;- padding: 1px;- border-radius: 10px;-- .label {- display: flex;- align-items: center;- color: var(--primary);- justify-content: center;- border-radius: 9px 0 0 9px;- padding: 0 5px 0 8px;-- .d-icon {- margin-right: 5px;- font-size: var(--font-down-1);- }- }-- .value {- background: var(--secondary);- border-radius: 0 9px 9px 0;- padding: 0 8px 0 5px;- }-- &.user-newuser {- .label {- color: var(--primary-high);- }- }-- &.user-basic,- &.user-member {- background: var(--bronze);-- .label {- color: var(--secondary);- }- }-- &.user-regular {- background: var(--silver);-- .label {- color: var(--secondary);- }- }-- &.user-leader {- background: var(--gold);-- .label {- color: var(--secondary);- }- }- }-}--.rtl .dashboard-next {- .section-column {- &:last-child {- margin-right: 1em;- margin-left: 0;- }-- &:first-child {- margin-left: 1em;- margin-right: 0;- }- }-- .user-metrics .table-cell {- margin: 0 0 5px 10px;- }-- .table-cell {- .label {- border-radius: 0 9px 9px 0;-- .d-icon {- margin-right: 0;- margin-left: 5px;- }- }-- .value {- border-radius: 9px 0 0 9px;- padding: 0 5px 0 8px;- }- }-}--.users-by-trust-level,-.users-by-type {- margin-bottom: 2em;-}--.community-health.section {- margin-bottom: 2em;-}--.dashboard-moderation,-.dashboard-security {- .section-body {- margin-bottom: 2em;- }-- .main-section {- display: grid;- grid-template-columns: repeat(12, 1fr);- column-gap: 1em;- row-gap: 1em;-- > * {- grid-column: span 12;- }-- .admin-dashboard-security-bottom-outlet,- .admin-dashboard-moderation-bottom-outlet {- display: grid;- grid-template-columns: repeat(12, 1fr);- column-gap: 1em;- row-gap: 1em;- }- }-- .admin-report {- grid-column: span 12;- }-}--.dashboard-moderation {- .admin-dashboard-moderation-top {- display: grid;- grid-template-columns: repeat(12, 1fr);- column-gap: 1em;- row-gap: 1em;- }-}--.version-checks {- display: flex;- flex-wrap: wrap;-- .section-title {- flex: 1 1 100%;- border-bottom: 1px solid var(--content-border-color);- padding-bottom: 0.5em;- }-- h2 {- margin: 0;- }-}--.version-check {- display: flex;- flex: 1 1 50%;- flex-wrap: wrap;- align-items: flex-start;- align-self: flex-start;- justify-content: space-between;- padding-top: 1em;-- .update-header {- flex: 1 1 100%;-- @media screen and (width <= 650px) {- margin: 0;- }-- tr {- border: none;- }-- th {- background: transparent;- padding: 0;- }- }-- h2 {- flex: 1 1 100%;- }-- .version-number {- font-size: var(--font-up-2);- line-height: var(--line-height-small);- box-sizing: border-box;- font-weight: bold;- margin-bottom: 2em;- margin-right: 1em;- flex: 1 1 27%;-- h3 {- flex: 1 0 auto;- margin: 0;- white-space: nowrap;- }-- .commits-ahead {- font-size: var(--font-down-2-rem);- font-weight: normal;- color: var(--primary-medium);- cursor: help;- }-- h4 {- font-size: var(--font-down-2);- margin-bottom: 0.5em;- }-- .version-links {- display: flex;- flex-wrap: wrap;- gap: var(--space-4);- margin-top: var(--space-1);-- a {- display: inline-flex;- align-items: center;- gap: var(--space-1);- font-size: var(--font-down-3);- font-weight: normal;- white-space: nowrap;- }- }- }-- .version-status {- display: flex;- align-items: center;- margin: 0 0 1em 0;- flex: 1 1 24%;- box-sizing: border-box;- padding-right: 20px;- min-width: 250px;-- @include viewport.until(lg) {- max-width: unset;- }-- .face {- margin: 0 0.75em 0 0;- font-size: var(--font-up-3);- }- }-- .face .fa {- font-size: var(--font-up-4);- }-- .up-to-date {- color: var(--success);- }-- .updates-available {- color: var(--danger);- }-- .critical-updates-available {- color: var(--danger);- }-}--.update-nag {- .d-icon {- font-size: var(--font-up-3);- }-}--.dashboard-next.general {- display: flex;- flex-direction: column;+.admin-reports.admin-contents nav {+ position: relative;+ width: calc(100% + 10px);+ padding-left: 10px;+ margin-left: -10px;+ margin-right: -10px;}.dashboard-new-features {diff --git a/app/assets/stylesheets/wcag.scss b/app/assets/stylesheets/wcag.scssindex be35b72235a..485d7ec8860 100644--- a/app/assets/stylesheets/wcag.scss+++ b/app/assets/stylesheets/wcag.scss@@ -267,13 +267,6 @@ html {background: var(--primary-very-low);}- // Dashboard- .user-metrics .table-cell.user-basic .label,- .user-metrics .table-cell.user-member .label,- .user-metrics .table-cell.user-leader .label {- color: dark-light-choose($primary, $secondary);- }-.admin-contents.admin-plugins td.version .commit-hash {color: var(--primary-medium);}diff --git a/app/controllers/admin/dashboard_controller.rb b/app/controllers/admin/dashboard_controller.rbindex 22323bd9a6a..e45ccd204c7 100644--- a/app/controllers/admin/dashboard_controller.rb+++ b/app/controllers/admin/dashboard_controller.rb@@ -13,20 +13,9 @@ class Admin::DashboardController < Admin::StaffControllerupdate_configurationupdate_section_settings]- before_action :ensure_dashboard_improvements_enabled, only: :trafficdef index- if dashboard_improvements?- data = dashboard_sections_payload- else- data = AdminDashboardIndexData.fetch_cached_stats-- if SiteSetting.version_checks?- data.merge!(version_check: DiscourseUpdates.check_version.as_json)- end- end-- render json: data+ render json: dashboard_sections_payloadenddef update_configuration@@ -49,19 +38,6 @@ class Admin::DashboardController < Admin::StaffControllerhead :no_contentend- def moderation- end-- def security- end-- def reports- end-- def general- render json: AdminDashboardGeneralData.fetch_cached_stats- end-def trafficAdminDashboardSiteTrafficExplorer.call(service_params.deep_merge(params: traffic_params)) doon_success { |traffic:| render json: traffic }@@ -104,7 +80,7 @@ class Admin::DashboardController < Admin::StaffControllerdata = {new_features: new_features_with_permanent_uc,has_unseen_features: DiscourseUpdates.has_unseen_features?(current_user.id),- release_notes_link: AdminDashboardGeneralData.fetch_cached_stats["release_notes_link"],+ release_notes_link: release_notes_link,}mark_new_features_as_seen@@ -235,12 +211,10 @@ class Admin::DashboardController < Admin::StaffControllerDiscourseUpdates.mark_new_features_as_seen(current_user.id)end- def ensure_dashboard_improvements_enabled- raise Discourse::NotFound if !dashboard_improvements?- end-- def dashboard_improvements?- UpcomingChanges.enabled_for_user?(:dashboard_improvements, current_user)+ def release_notes_link+ days_since_update =+ Discourse.last_commit_date ? ((DateTime.now - Discourse.last_commit_date) / 1.day).to_i : nil+ "https://meta.discourse.org/c/announcements/67?tags=release-notes&before=#{days_since_update}"enddef parse_reports_items_payloaddiff --git a/app/jobs/scheduled/warm_dashboard_reports.rb b/app/jobs/scheduled/warm_dashboard_reports.rbindex 7a655185e87..694cf6d7337 100644--- a/app/jobs/scheduled/warm_dashboard_reports.rb+++ b/app/jobs/scheduled/warm_dashboard_reports.rb@@ -7,7 +7,6 @@ module JobsSTAFF_ACTIVITY_WINDOW = 7.daysdef execute(_args)- return if !UpcomingChanges.enabled?(:dashboard_improvements)return if !recently_active_staff?AdminDashboardCacheWarmer.calldiff --git a/app/models/admin_dashboard_data.rb b/app/models/admin_dashboard_data.rbdeleted file mode 100644index 34dd629ffac..00000000000--- a/app/models/admin_dashboard_data.rb+++ /dev/null@@ -1,32 +0,0 @@-# frozen_string_literal: true--class AdminDashboardData- include StatsCacheable-- # kept for backward compatibility- GLOBAL_REPORTS = []-- def initialize(opts = {})- @opts = opts- end-- def get_json- {}- end-- def as_json(_options = nil)- @json ||= get_json- end-- def self.fetch_stats- new.as_json- end-- def self.reports(source)- source.map { |type| Report.find(type).as_json }- end-- def self.stats_cache_key- "dashboard-data-#{Report::SCHEMA_VERSION}"- end-enddiff --git a/app/models/admin_dashboard_general_data.rb b/app/models/admin_dashboard_general_data.rbdeleted file mode 100644index eff6304c545..00000000000--- a/app/models/admin_dashboard_general_data.rb+++ /dev/null@@ -1,18 +0,0 @@-# frozen_string_literal: true--class AdminDashboardGeneralData < AdminDashboardData- def get_json- days_since_update =- Discourse.last_commit_date ? ((DateTime.now - Discourse.last_commit_date) / 1.day).to_i : nil- {- updated_at: Time.zone.now.as_json,- discourse_updated_at: Discourse.last_commit_date,- release_notes_link:- "https://meta.discourse.org/c/announcements/67?tags=release-notes&before=#{days_since_update}",- }- end-- def self.stats_cache_key- "general-dashboard-data-#{Report::SCHEMA_VERSION}"- end-enddiff --git a/app/models/admin_dashboard_index_data.rb b/app/models/admin_dashboard_index_data.rbdeleted file mode 100644index b8f92d2dae0..00000000000--- a/app/models/admin_dashboard_index_data.rb+++ /dev/null@@ -1,14 +0,0 @@-# frozen_string_literal: true--class AdminDashboardIndexData < AdminDashboardData- def get_json- { updated_at: Time.zone.now.as_json }- end-- def self.stats_cache_key- "index-dashboard-data-#{Report::SCHEMA_VERSION}"- end-- # TODO: problems should be loaded from this model- # and not from a separate model/route-enddiff --git a/app/services/admin_dashboard_system.rb b/app/services/admin_dashboard_system.rbindex 2779f9b340c..70cd5a3eea9 100644--- a/app/services/admin_dashboard_system.rb+++ b/app/services/admin_dashboard_system.rb@@ -13,12 +13,7 @@ class AdminDashboardSystemenddef build- {- version: version,- storage: storage,- discourse_updated_at: Discourse.last_commit_date,- dashboard_updated_at: AdminDashboardIndexData.fetch_cached_stats["updated_at"],- }+ { version: version, storage: storage, discourse_updated_at: Discourse.last_commit_date }endprivatediff --git a/app/services/topic_timestamp_changer.rb b/app/services/topic_timestamp_changer.rbindex c9f1d8b552f..aaac5bfca77 100644--- a/app/services/topic_timestamp_changer.rb+++ b/app/services/topic_timestamp_changer.rb@@ -37,7 +37,7 @@ class TopicTimestampChangerend# Burst the cache for stats- [AdminDashboardData, About].each { |klass| Discourse.redis.del klass.stats_cache_key }+ Discourse.redis.del About.stats_cache_keyendprivatediff --git a/config/locales/client.en.yml b/config/locales/client.en.ymlindex 7b3eb31d034..78cf42f6917 100644--- a/config/locales/client.en.yml+++ b/config/locales/client.en.yml@@ -7813,27 +7813,17 @@ en:combined: "Results include the most recent %{limit} pageviews, beginning %{pageviewLimitDate} at %{pageviewLimitTime}. Earlier pageviews in the selected date range are not included; pageview data before %{date} is no longer available."dashboard:title: "Dashboard"- last_updated: "Dashboard updated:"- discourse_last_updated: "Discourse updated:"version: "Version"up_to_date: "You're up to date!"up_to_date_newer_commits:one: "You're on the most recent release, but %{count} new change is available."other: "You're on the most recent release, but %{count} new changes are available."updates_available: "Updates are available."- please_update: "Please update!"- no_check_performed: "A check for updates has not been performed. Ensure Sidekiq is running."- stale_data: "A check for updates has not been performed lately. Ensure Sidekiq is running."version_check_pending: "Looks like you updated recently. Fantastic!"- installed_version: "Installed"- latest_version: "Available"- github: "GitHub"commit_on_github: "View commit %{sha} on GitHub"- changelog: "Changelog"commits_ahead:one: "Running %{count} additional change since the start of this release series"other: "Running %{count} additional changes since the start of this release series"- problems_found: "Some advice based on your current site settings"dismiss_notice: "Ignore"site_advice:title:@@ -7846,16 +7836,7 @@ en:no_new_features_error: "There was an error loading the feed. You can see previous new feature announcements on <a href='%{url}' target='_blank'>the Discourse Releases site</a>."learn_more: "Learn more..."- last_checked: "Last checked"refresh_problems: "Refresh"- no_problems: "No problems were found."- moderators: "Moderators:"- admins: "Admins:"- silenced: "Silenced:"- suspended: "Suspended:"- private_messages_short: "Msgs"- private_messages_title: "Messages"- mobile_title: "Mobile"space_used: "%{usedSize} used"space_used_and_free: "%{usedSize} (%{freeSize} free)"uploads: "Uploads"@@ -7864,20 +7845,7 @@ en:one: "%{count} backup on %{location}"other: "%{count} backups on %{location}"lastest_backup: "Latest: %{date}"- traffic_short: "Traffic"- traffic: "Application web requests"- page_views: "Pageviews"- page_views_short: "Pageviews"- show_traffic_report: "Show Detailed Traffic Report"- community_health: Community health- moderators_activity: Moderators activitywhats_new_in_discourse: What’s new in Discourse?- activity_metrics: Activity Metrics- all_reports: "All reports"- general_tab: "General"- moderation_tab: "Moderation"- security_tab: "Security"- reports_tab: "Reports"report_filter_any: "any"disabled: Disabledtimeout_error: Sorry, query is taking too long, please pick a shorter interval@@ -8116,7 +8084,6 @@ en:latest_backup: "Latest backup %{date}"manage_backups: "Manage backups"discourse_updated: "Discourse updated"- dashboard_updated: "Dashboard updated"reports_section:header_action: "Manage"description: "Pin standard reports or Data Explorer queries to track what matters to your community."@@ -8228,12 +8195,6 @@ en:crawlers: "Crawlers"see_details: "See details"crawler_learn_more: "Learn more"- period:- last_7_days: "Last 7 days"- last_30_days: "Last 30 days"- last_3_months: "Last 3 months"- custom: "Custom"- custom_range: "%{start} – %{end}"reports:trend_title: "%{percent} change. Currently %{current}, was %{prev} in previous period."@@ -8281,9 +8242,6 @@ en:other: "%{count} posts"deselect: "Deselect %{name}"fetch_error: "Couldn't load users for this group."- trending_search:- more: '<a href="%{basePath}/admin/logs/search_logs">Search logs</a>'- disabled: 'Trending search report is disabled. Enable <a href="%{basePath}/admin/site_settings/category/all_results?filter=log%20search%20queries">log search queries</a> to collect data.'average_chart_label: Showing averages, not totalssort_button: "Sort by %{column}"sort_button_current: "Sorted by %{column}, %{direction}"diff --git a/config/locales/server.en.yml b/config/locales/server.en.ymlindex 06b66cbb1fc..9ef70980a9a 100644--- a/config/locales/server.en.yml+++ b/config/locales/server.en.yml@@ -3174,9 +3174,6 @@ en:short_title: "The short title will be used on the user's home screen, launcher, or other places where space may be limited. It should be limited to 12 characters. Note that changing this title may send a prompt to users of the PWA asking them to either update or uninstall the app."- 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."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/routes.rb b/config/routes.rbindex 4a238001734..f8db1a77625 100644--- a/config/routes.rb+++ b/config/routes.rb@@ -385,10 +385,6 @@ Discourse::Application.routes.draw doput "dashboard/sections/:section_id/settings/:setting_key" =>"dashboard#update_section_settings",:constraints => AdminConstraint.new- get "dashboard/general" => "dashboard#general"- get "dashboard/moderation" => "dashboard#moderation"- get "dashboard/security" => "dashboard#security"- get "dashboard/reports" => "dashboard#reports"post "dashboard/reports/bulk" => "dashboard#bulk_reports"get "dashboard/reports/available" => "dashboard#available_reports",:constraints => AdminConstraint.newdiff --git a/config/site_settings.yml b/config/site_settings.ymlindex cd528072788..17a1cb04405 100644--- a/config/site_settings.yml+++ b/config/site_settings.yml@@ -4738,40 +4738,6 @@ tags:area: "categories_and_tags|categories"dashboard:- dashboard_hidden_reports:- client: true- type: list- list_type: compact- default: ""- allow_any: true- area: "reports"- dashboard_visible_tabs:- client: true- type: list- list_type: compact- default: "moderation|security|reports|features"- allow_any: false- choices:- - moderation- - security- - reports- - features- area: "reports"- dashboard_general_tab_activity_metrics:- client: true- type: list- list_type: compact- default: "page_view_total_reqs|visits|time_to_first_response|likes|flags|user_to_user_private_messages_with_replies"- allow_any: false- choices:- - page_view_total_reqs- - visits- - time_to_first_response- - likes- - flags- - user_to_user_private_messages_with_replies- - signups- area: "reports"site_traffic_explorer_event_limit:default: 200000type: integerdiff --git a/db/post_migrate/20261029021723_remove_old_dashboard_settings.rb b/db/post_migrate/20261029021723_remove_old_dashboard_settings.rbnew file mode 100644index 00000000000..8ae09f4d862--- /dev/null+++ b/db/post_migrate/20261029021723_remove_old_dashboard_settings.rb@@ -0,0 +1,22 @@+# frozen_string_literal: true+class RemoveOldDashboardSettings < ActiveRecord::Migration[8.1]+ SETTINGS = %w[+ dashboard_hidden_reports+ dashboard_visible_tabs+ dashboard_general_tab_activity_metrics+ ]++ def up+ execute(<<~SQL)+ DELETE FROM site_settings WHERE name IN ('#{SETTINGS.join("','")}')+ SQL++ execute(<<~SQL)+ DELETE FROM site_setting_groups WHERE name IN ('#{SETTINGS.join("','")}')+ SQL+ end++ def down+ raise ActiveRecord::IrreversibleMigration+ end+enddiff --git a/db/structure.sql b/db/structure.sqlindex e0f5b609aac..358424d7d79 100644--- a/db/structure.sql+++ b/db/structure.sql@@ -26164,6 +26164,7 @@ ALTER TABLE ONLY public.ad_plugin_house_ads_groupsSET search_path TO "$user", public;INSERT INTO "schema_migrations" (version) VALUES+('20261029021723'),('20261021063131'),('20261021063122'),('20261021061850'),diff --git a/frontend/discourse/admin/components/admin-report.gjs b/frontend/discourse/admin/components/admin-report.gjsindex 2638ba5c83e..3281d41023f 100644--- a/frontend/discourse/admin/components/admin-report.gjs+++ b/frontend/discourse/admin/components/admin-report.gjs@@ -3,7 +3,6 @@ import { tracked } from "@glimmer/tracking";import EmberObject, { action } from "@ember/object";import didUpdate from "@ember/render-modifiers/modifiers/did-update";import { next } from "@ember/runloop";-import { service } from "@ember/service";import { isPresent } from "@ember/utils";import AdminReportBody from "discourse/admin/components/admin-report-body";import AdminReportChart from "discourse/admin/components/admin-report-chart";@@ -67,8 +66,6 @@ export function updateReportFilters(filters, id, value) {* }} AdminReportOptions*/export default class AdminReport extends Component {- @service siteSettings;-@tracked isLoading = false;/** @type {string | null} */@@ -127,14 +124,6 @@ export default class AdminReport extends Component {get reportClasses() {const builtReportClasses = ["is-enabled"];- if (this.isHidden) {- builtReportClasses.push("hidden");- }-- if (!this.isHidden) {- builtReportClasses.push("is-visible");- }-if (this.isLoading) {builtReportClasses.push("is-loading");}@@ -199,13 +188,6 @@ export default class AdminReport extends Component {return this.args.disabledLabel || i18n("admin.dashboard.disabled");}- get isHidden() {- return (this.siteSettings.dashboard_hidden_reports || "")- .split("|")- .filter(Boolean)- .includes(this.args.dataSourceName);- }-get dasherizedDataSourceName() {return (this.args.dataSourceName || this.model.type || "undefined").replace(/_/g,diff --git a/frontend/discourse/admin/components/admin-reports.gjs b/frontend/discourse/admin/components/admin-reports.gjsindex a391112c84b..1f93fe5ac45 100644--- a/frontend/discourse/admin/components/admin-reports.gjs+++ b/frontend/discourse/admin/components/admin-reports.gjs@@ -1,6 +1,5 @@import Component from "@glimmer/component";import { array } from "@ember/helper";-import { service } from "@ember/service";import AdminSectionLandingItem from "discourse/admin/components/admin-section-landing-item";import AdminSectionLandingWrapper from "discourse/admin/components/admin-section-landing-wrapper";import { ajax } from "discourse/lib/ajax";@@ -67,26 +66,12 @@ const REPORT_GROUPS = {};export default class AdminReports extends Component {- @service siteSettings;-@bindasync loadReports() {const response = await ajax("/admin/reports");return response.reports;}- @bind- filterReports(reports) {- if (!reports) {- return [];- }-- const hiddenReports = (this.siteSettings.dashboard_hidden_reports || "")- .split("|")- .filter(Boolean);- return reports.filter((report) => !hiddenReports.includes(report.type));- }-@bindgroupReports(reports) {if (!reports) {@@ -154,7 +139,7 @@ export default class AdminReports extends Component {@bindgroupDropdownOptions(reports) {- const groups = this.groupReports(this.filterReports(reports));+ const groups = this.groupReports(reports);return [{@@ -174,7 +159,7 @@ export default class AdminReports extends Component {<DAsyncContent @asyncData={{this.loadReports}}><:content as |reports|><DFilterControls- @array={{this.filterReports reports}}+ @array={{reports}}@dropdownFilterQueryParam="group"@dropdownOptions={{this.groupDropdownOptions reports}}@inputPlaceholder={{i18n "admin.filter_reports"}}diff --git a/frontend/discourse/admin/components/dashboard-problems.gjs b/frontend/discourse/admin/components/dashboard-problems.gjsdeleted file mode 100644index dbde0f1ab9a..00000000000--- a/frontend/discourse/admin/components/dashboard-problems.gjs+++ /dev/null@@ -1,79 +0,0 @@-import Component from "@glimmer/component";-import { concat } from "@ember/helper";-import { action } from "@ember/object";-import { compare } from "@ember/utils";-import AdminNotice from "discourse/admin/components/admin-notice";-import { ajax } from "discourse/lib/ajax";-import { popupAjaxError } from "discourse/lib/ajax-error";-import { removeValueFromArray } from "discourse/lib/array-tools";-import DButton from "discourse/ui-kit/d-button";-import DConditionalLoadingSection from "discourse/ui-kit/d-conditional-loading-section";-import dConcatClass from "discourse/ui-kit/helpers/d-concat-class";-import dIcon from "discourse/ui-kit/helpers/d-icon";-import { i18n } from "discourse-i18n";--export default class DashboardProblems extends Component {- get problems() {- return this.args.problems.toSorted((a, b) =>- compare(a?.priority, b?.priority)- );- }-- @action- async dismissProblem(problem) {- try {- await ajax(`/admin/admin_notices/${problem.id}`, { type: "DELETE" });- removeValueFromArray(this.args.problems, problem);- } catch (error) {- popupAjaxError(error);- }- }-- <template>- {{#if @problems.length}}- <div class="section dashboard-problems">- <div class="section-title">- <h2>- {{dIcon "heart"}}- {{i18n "admin.dashboard.problems_found"}}- </h2>- </div>-- <div class="section-body">- <DConditionalLoadingSection @isLoading={{@loadingProblems}}>- <div class="problem-messages">- <ul>- {{#each this.problems as |problem|}}- <li- class={{dConcatClass- "dashboard-problem"- (concat "priority-" problem.priority)- }}- >- <AdminNotice- @dismissCallback={{this.dismissProblem}}- @icon={{if- (eq problem.priority "high")- "triangle-exclamation"- }}- @problem={{problem}}- />- </li>- {{/each}}- </ul>- </div>-- <p class="actions">- <DButton- class="btn-default"- @action={{@refreshProblems}}- @icon="arrows-rotate"- @label="admin.dashboard.refresh_problems"- />- </p>- </DConditionalLoadingSection>- </div>- </div>- {{/if}}- </template>-}diff --git a/frontend/discourse/admin/components/dashboard/system.gjs b/frontend/discourse/admin/components/dashboard/system.gjsindex 90fd6dcf7a7..f92f3f65c45 100644--- a/frontend/discourse/admin/components/dashboard/system.gjs+++ b/frontend/discourse/admin/components/dashboard/system.gjs@@ -135,10 +135,7 @@ export default class DashboardSystem extends Component {}get hasStatus() {- return !!(- this.args.data?.discourse_updated_at ||- this.args.data?.dashboard_updated_at- );+ return !!this.args.data?.discourse_updated_at;}get backupsSummary() {@@ -322,17 +319,6 @@ export default class DashboardSystem extends Component {</div>{{/if}}- {{#if @data.dashboard_updated_at}}- <div class="db-system__headline">- <div class="db-system__value">- {{dFormatDate @data.dashboard_updated_at leaveAgo="true"}}- </div>- <div class="db-system__label">- {{i18n "admin.dashboard.sections.system.dashboard_updated"}}- </div>- </div>- {{/if}}-<div class="db-system__footer"><LinkTo class="db-system__link" @route="admin.whatsNew">{{i18n "admin.dashboard.whats_new_in_discourse"}}diff --git a/frontend/discourse/admin/components/version-checks.gjs b/frontend/discourse/admin/components/version-checks.gjsdeleted file mode 100644index 7e33e7e2525..00000000000--- a/frontend/discourse/admin/components/version-checks.gjs+++ /dev/null@@ -1,193 +0,0 @@-import PluginOutlet from "discourse/components/plugin-outlet";-import dashIfEmpty from "discourse/helpers/dash-if-empty";-import lazyHash from "discourse/helpers/lazy-hash";-import DCustomHtml from "discourse/ui-kit/d-custom-html";-import dIcon from "discourse/ui-kit/helpers/d-icon";-import { i18n } from "discourse-i18n";--const VersionChecks = <template>- <div class="section-title">- <h2>- {{i18n "admin.dashboard.version"}}- </h2>- </div>-- <div class="dashboard-stats version-check">- <div class="version-number">- <h4>- {{i18n "admin.dashboard.installed_version"}}- </h4>- <h3>- {{dashIfEmpty @versionCheck.installed_version}}- {{#if @versionCheck.installedCommitsAhead}}- <span- class="commits-ahead"- title={{i18n- "admin.dashboard.commits_ahead"- }}- >+{{@versionCheck.installedCommitsAhead}}</span>- {{/if}}- </h3>- {{#if @versionCheck.gitLink}}- <div class="version-links">- <a- class="github-link"- href={{@versionCheck.gitLink}}- rel="noopener noreferrer"- target="_blank"- title={{i18n- "admin.dashboard.commit_on_github"- }}- >- {{i18n "admin.dashboard.github"}}- {{dIcon "up-right-from-square"}}- </a>- </div>- {{/if}}- </div>- {{#if @versionCheck.noCheckPerformed}}- <div class="version-number">- <h4>- {{i18n "admin.dashboard.latest_version"}}- </h4>- <h3>- —- </h3>- </div>- <div class="version-status">- <div class="face">- <span class="icon critical-updates-available">- {{dIcon "far-face-frown"}}- </span>- </div>- <div class="version-notes">- <span class="normal-note">- {{i18n "admin.dashboard.no_check_performed"}}- </span>- </div>- </div>- {{else if @versionCheck.stale_data}}- <div class="version-number">- <h4>- {{i18n "admin.dashboard.latest_version"}}- </h4>- <h3>- {{#if @versionCheck.version_check_pending}}- {{dashIfEmpty @versionCheck.installed_version}}- {{/if}}- </h3>- </div>- <div class="version-status">- <div class="face">- {{#if @versionCheck.version_check_pending}}- <span class="icon up-to-date">- {{dIcon "far-face-smile"}}- </span>- {{else}}- <span class="icon critical-updates-available">- {{dIcon "far-face-frown"}}- </span>- {{/if}}- </div>- <div class="version-notes">- <span class="normal-note">- {{#if @versionCheck.version_check_pending}}- {{i18n "admin.dashboard.version_check_pending"}}- {{else}}- {{i18n "admin.dashboard.stale_data"}}- {{/if}}- </span>- </div>- </div>- {{else}}- <div class="version-number">- <h4>- {{i18n "admin.dashboard.latest_version"}}- </h4>- <h3>- {{dashIfEmpty @versionCheck.latest_version}}- {{#if @versionCheck.latestCommitsAhead}}- <span- class="commits-ahead"- title={{i18n- "admin.dashboard.commits_ahead"- }}- >+{{@versionCheck.latestCommitsAhead}}</span>- {{/if}}- </h3>- {{#if @versionCheck.latestGitLink}}- <div class="version-links">- {{#if @versionCheck.changelogLink}}- <a- class="changelog-link"- href={{@versionCheck.changelogLink}}- rel="noopener noreferrer"- target="_blank"- >- {{i18n "admin.dashboard.changelog"}}- {{dIcon "up-right-from-square"}}- </a>- {{/if}}- <a- class="github-link"- href={{@versionCheck.latestGitLink}}- rel="noopener noreferrer"- target="_blank"- title={{i18n- "admin.dashboard.commit_on_github"- }}- >- {{i18n "admin.dashboard.github"}}- {{dIcon "up-right-from-square"}}- </a>- </div>- {{/if}}- </div>- <div class="version-status">- <div class="face">- {{#if @versionCheck.upToDate}}- <span class="icon up-to-date">- {{dIcon "far-face-smile"}}- </span>- {{else}}- <span class="icon updates-available">- {{#if @versionCheck.behindByOneVersion}}- {{dIcon "far-face-meh"}}- {{else}}- {{dIcon "far-face-frown"}}- {{/if}}- </span>- {{/if}}- </div>- <div class="version-notes">- {{#if @versionCheck.upToDate}}- {{#if @versionCheck.newerCommitsAvailable}}- {{i18n- "admin.dashboard.up_to_date_newer_commits"- }}- {{else}}- {{i18n "admin.dashboard.up_to_date"}}- {{/if}}- {{else}}- {{i18n "admin.dashboard.updates_available"}}- {{i18n "admin.dashboard.please_update"}}- {{/if}}- </div>- </div>- {{/if}}-- <DCustomHtml class="update-header" @name="update-header" />-- <PluginOutlet- @name="admin-upgrade-header"- @outletArgs={{lazyHash versionCheck=@versionCheck}}- />- </div>-</template>;--export default VersionChecks;diff --git a/frontend/discourse/admin/controllers/admin-dashboard-tab.js b/frontend/discourse/admin/controllers/admin-dashboard-tab.jsdeleted file mode 100644index 755bebb0b96..00000000000--- a/frontend/discourse/admin/controllers/admin-dashboard-tab.js+++ /dev/null@@ -1,67 +0,0 @@-import { tracked } from "@glimmer/tracking";-import Controller, { inject as controller } from "@ember/controller";-import { action } from "@ember/object";--export default class AdminDashboardTabController extends Controller {- @controller("admin.dashboard") dashboardController;-- @tracked period = "monthly";- queryParams = ["period"];-- get startDate() {- if (this.dashboardController.start_date) {- return moment- .utc(this.dashboardController.start_date)- .locale("en")- .startOf("day");- }- return this.#calculateStartDate();- }-- get endDate() {- if (this.dashboardController.end_date) {- return moment- .utc(this.dashboardController.end_date)- .locale("en")- .endOf("day");- }- return moment().locale("en").utc().endOf("day");- }-- get filters() {- return {- startDate: this.startDate,- endDate: this.endDate,- };- }-- @action- setCustomDateRange(startDate, endDate) {- this.period = "custom";- this.dashboardController.start_date =- moment(startDate).format("YYYY-MM-DD");- this.dashboardController.end_date = moment(endDate).format("YYYY-MM-DD");- }-- @action- setPeriod(period) {- this.period = period;- this.dashboardController.start_date = null;- this.dashboardController.end_date = null;- }-- #calculateStartDate() {- const fullDay = moment().locale("en").utc().endOf("day");-- switch (this.period) {- case "yearly":- return fullDay.subtract(1, "year").startOf("day");- case "quarterly":- return fullDay.subtract(3, "month").startOf("day");- case "weekly":- return fullDay.subtract(6, "days").startOf("day");- default:- return fullDay.subtract(1, "month").startOf("day");- }- }-}diff --git a/frontend/discourse/admin/controllers/admin/dashboard-moderation.js b/frontend/discourse/admin/controllers/admin/dashboard-moderation.jsdeleted file mode 100644index 4e3b937518e..00000000000--- a/frontend/discourse/admin/controllers/admin/dashboard-moderation.js+++ /dev/null@@ -1,43 +0,0 @@-import { computed } from "@ember/object";-import AdminDashboardTabController from "../admin-dashboard-tab.js";--export default class AdminDashboardModerationController extends AdminDashboardTabController {- @computed- get flagsStatusOptions() {- return {- table: {- total: false,- perPage: 10,- },- };- }-- @computed("siteSettings.dashboard_hidden_reports")- get isModeratorsActivityVisible() {- return !(this.siteSettings.dashboard_hidden_reports || "")- .split("|")- .filter(Boolean)- .includes("moderators_activity");- }-- @computed- get userFlaggingRatioOptions() {- return {- table: {- total: false,- perPage: 10,- },- };- }-- @computed("endDate")- get lastWeekFilters() {- const lastWeek = moment()- .locale("en")- .utc()- .endOf("day")- .subtract(1, "week");-- return { lastWeek, endDate: this.endDate };- }-}diff --git a/frontend/discourse/admin/controllers/admin/dashboard.js b/frontend/discourse/admin/controllers/admin/dashboard.jsindex cf1be80c36a..3e742782759 100644--- a/frontend/discourse/admin/controllers/admin/dashboard.js+++ b/frontend/discourse/admin/controllers/admin/dashboard.js@@ -1,6 +1,6 @@import { tracked } from "@glimmer/tracking";import Controller from "@ember/controller";-import { action, computed } from "@ember/object";+import { action } from "@ember/object";import { service } from "@ember/service";import {calculatePresetStartDate,@@ -9,13 +9,10 @@ import {VALID_PERIODS,} from "discourse/admin/lib/dashboard-date-range";import AdminDashboard from "discourse/admin/models/admin-dashboard";-import VersionCheck from "discourse/admin/models/version-check";import { ajax } from "discourse/lib/ajax";import { popupAjaxError } from "discourse/lib/ajax-error";import { autoTrackedArray } from "discourse/lib/tracked-tools";-const PROBLEMS_CHECK_MINUTES = 1;-/*** @typedef {Object} LoadedDashboardSections* @property {string} [period]@@ -25,12 +22,8 @@ const PROBLEMS_CHECK_MINUTES = 1;* @property {{ sections: { id: string, visible: boolean }[] }} [configuration]*/export default class AdminDashboardController extends Controller {- @service siteSettings;- @service exception;@service loadingSlider;- @tracked loadingProblems = false;- @tracked problemsFetchedAt;@tracked range = DEFAULT_PERIOD;/** @type {string | null} */@@ -47,10 +40,6 @@ export default class AdminDashboardController extends Controller {queryParams = ["range", "start_date", "end_date"];- isLoading = false;-- /** @type {Date | null} */- dashboardFetchedAt = null;_sectionsLoadId = 0;_sectionsLoadingCount = 0;_configSaveId = 0;@@ -79,42 +68,6 @@ export default class AdminDashboardController extends Controller {);}- get showRedesign() {- return this.siteSettings.dashboard_improvements;- }-- @computed("siteSettings.version_checks")- get showVersionChecks() {- return this.siteSettings.version_checks;- }-- @computed("siteSettings.dashboard_visible_tabs")- get visibleTabs() {- return (this.siteSettings.dashboard_visible_tabs || "")- .split("|")- .filter(Boolean);- }-- @computed("visibleTabs")- get isModerationTabVisible() {- return this.visibleTabs.includes("moderation");- }-- @computed("visibleTabs")- get isSecurityTabVisible() {- return this.visibleTabs.includes("security");- }-- @computed("visibleTabs")- get isReportsTabVisible() {- return this.visibleTabs.includes("reports");- }-- @computed("problemsFetchedAt")- get problemsTimestamp() {- return moment(this.problemsFetchedAt).format("LLL");- }-@actionsetPeriod(period) {this.range = period;@@ -204,59 +157,6 @@ export default class AdminDashboardController extends Controller {}}- fetchProblems() {- if (this.isLoadingProblems) {- return;- }-- if (- !this.problemsFetchedAt ||- moment().subtract(PROBLEMS_CHECK_MINUTES, "minutes").toDate() >- this.problemsFetchedAt- ) {- this._loadProblems();- }- }-- fetchDashboard() {- const versionChecks = this.siteSettings.version_checks;-- if (this.isLoading || !versionChecks) {- return;- }-- if (- !this.dashboardFetchedAt ||- moment().subtract(30, "minutes").toDate() > this.dashboardFetchedAt- ) {- this.set("isLoading", true);-- AdminDashboard.fetch()- .then((model) => {- let properties = {- dashboardFetchedAt: new Date(),- };-- if (versionChecks) {- properties.versionCheck = new VersionCheck(model.version_check);- }-- this.setProperties(properties);- })- .catch((e) => {- this.exception.show(e.jqXHR);- })- .finally(() => {- this.set("isLoading", false);- });- }- }-- @action- refreshProblems() {- this._loadProblems();- }-@actionasync refreshSiteAdvice() {try {@@ -321,18 +221,4 @@ export default class AdminDashboardController extends Controller {popupAjaxError(e);}}-- async _loadProblems() {- this.setProperties({- loadingProblems: true,- problemsFetchedAt: new Date(),- });-- try {- const model = await AdminDashboard.fetchProblems();- this.problems = model.problems;- } finally {- this.loadingProblems = false;- }- }}diff --git a/frontend/discourse/admin/controllers/admin/dashboard/general.js b/frontend/discourse/admin/controllers/admin/dashboard/general.jsdeleted file mode 100644index 6097999db6b..00000000000--- a/frontend/discourse/admin/controllers/admin/dashboard/general.js+++ /dev/null@@ -1,178 +0,0 @@-import { computed } from "@ember/object";-import { service } from "@ember/service";-import { REPORT_MODES } from "discourse/admin/lib/constants";-import AdminDashboard from "discourse/admin/models/admin-dashboard";-import Report from "discourse/admin/models/report";-import getURL from "discourse/lib/get-url";-import { makeArray } from "discourse/lib/helpers";-import { i18n } from "discourse-i18n";-import AdminDashboardTabController from "../../admin-dashboard-tab.js";--function staticReport(reportType) {- return computed("reports.[]", function () {- return makeArray(this.reports).find((report) => report.type === reportType);- });-}--export default class AdminDashboardGeneralController extends AdminDashboardTabController {- @service siteSettings;- @service exception;-- isLoading = false;-- /** @type {Date | null} */- dashboardFetchedAt = null;-- @staticReport("users_by_type") usersByTypeReport;- @staticReport("users_by_trust_level") usersByTrustLevelReport;- @staticReport("storage_report") storageReport;-- @computed("siteSettings.log_search_queries")- get logSearchQueriesEnabled() {- return this.siteSettings.log_search_queries;- }-- get reportModes() {- return REPORT_MODES;- }-- @computed("siteSettings.dashboard_general_tab_activity_metrics")- get activityMetrics() {- return (this.siteSettings?.dashboard_general_tab_activity_metrics || "")- .split("|")- .filter(Boolean);- }-- @computed("siteSettings.dashboard_hidden_reports")- get hiddenReports() {- return (this.siteSettings.dashboard_hidden_reports || "")- .split("|")- .filter(Boolean);- }-- @computed("activityMetrics", "hiddenReports")- get isActivityMetricsVisible() {- return (- this.activityMetrics.length &&- this.activityMetrics.some((x) => !this.hiddenReports.includes(x))- );- }-- @computed("hiddenReports")- get isSearchReportsVisible() {- return ["top_referred_topics", "trending_search"].some(- (report) => !this.hiddenReports.includes(report)- );- }-- @computed("hiddenReports")- get isCommunityHealthVisible() {- return [- "consolidated_page_views",- "site_traffic",- "signups",- "topics",- "posts",- "dau_by_mau",- "daily_engaged_users",- "new_contributors",- ].some((report) => !this.hiddenReports.includes(report));- }-- @computed- get today() {- return moment().locale("en").utc().endOf("day");- }-- @computed- get activityMetricsFilters() {- const lastMonth = moment()- .locale("en")- .utc()- .startOf("day")- .subtract(1, "month");-- return {- startDate: lastMonth,- endDate: this.today,- };- }-- @computed- get topReferredTopicsOptions() {- return {- table: { total: false, limit: 8 },- };- }-- @computed- get siteTrafficOptions() {- return {- stackedChart: {- hiddenLabels: [- "page_view_other",- "page_view_crawler",- "page_view_embed",- ],- },- };- }-- @computed- get topReferredTopicsFilters() {- return {- startDate: moment().subtract(6, "days").startOf("day"),- endDate: this.today,- };- }-- @computed- get trendingSearchFilters() {- return {- startDate: moment().subtract(1, "month").startOf("day"),- endDate: this.today,- };- }-- @computed- get trendingSearchOptions() {- return {- table: { total: false, limit: 8 },- };- }-- @computed- get trendingSearchDisabledLabel() {- return i18n("admin.dashboard.reports.trending_search.disabled", {- basePath: getURL(""),- });- }-- fetchDashboard() {- if (this.isLoading) {- return;- }-- if (- !this.dashboardFetchedAt ||- moment().subtract(30, "minutes").toDate() > this.dashboardFetchedAt- ) {- this.set("isLoading", true);-- AdminDashboard.fetchGeneral()- .then((adminDashboardModel) => {- this.setProperties({- dashboardFetchedAt: new Date(),- model: adminDashboardModel,- reports: makeArray(adminDashboardModel.reports).map((x) =>- Report.create(x)- ),- });- })- .catch((e) => {- this.exception.show(e.jqXHR);- })- .finally(() => this.set("isLoading", false));- }- }-}diff --git a/frontend/discourse/admin/models/admin-dashboard.js b/frontend/discourse/admin/models/admin-dashboard.jsindex 544a1b15ccb..9c95c8a141e 100644--- a/frontend/discourse/admin/models/admin-dashboard.js+++ b/frontend/discourse/admin/models/admin-dashboard.js@@ -1,12 +1,6 @@import EmberObject from "@ember/object";import { ajax } from "discourse/lib/ajax";-const GENERAL_ATTRIBUTES = [- "updated_at",- "discourse_updated_at",- "release_notes_link",-];-export default class AdminDashboard extends EmberObject {static async fetch({ startDate, endDate } = {}) {const data = {};@@ -21,7 +15,6 @@ export default class AdminDashboard extends EmberObject {const model = AdminDashboard.create();model.setProperties({- version_check: json.version_check,sections: json.sections,configuration: json.configuration,problems: json.problems,@@ -30,22 +23,6 @@ export default class AdminDashboard extends EmberObject {return model;}- static async fetchGeneral() {- const json = await ajax("/admin/dashboard/general.json");- const model = AdminDashboard.create();-- const attributes = {};- GENERAL_ATTRIBUTES.forEach((a) => (attributes[a] = json[a]));-- model.setProperties({- reports: json.reports,- attributes,- loaded: true,- });-- return model;- }-static async fetchProblems() {const json = await ajax("/admin/dashboard/problems.json", { type: "POST" });const model = AdminDashboard.create(json);diff --git a/frontend/discourse/admin/routes/admin-reports/show.js b/frontend/discourse/admin/routes/admin-reports/show.jsindex 6a50e8a060f..2baeaa48475 100644--- a/frontend/discourse/admin/routes/admin-reports/show.js+++ b/frontend/discourse/admin/routes/admin-reports/show.js@@ -19,9 +19,9 @@ export default class AdminReportsShowRoute extends DiscourseRoute {}this.backLink =- transition.from?.name === "admin.dashboard.general"+ transition.from?.name === "admin.dashboard"? {- route: "admin.dashboard.general",+ route: "admin.dashboard",query: transition.from.queryParams,label: "admin.reports.back_to_dashboard",}diff --git a/frontend/discourse/admin/routes/admin-route-map.js b/frontend/discourse/admin/routes/admin-route-map.jsindex 163c2eb46be..abb4d47d3c7 100644--- a/frontend/discourse/admin/routes/admin-route-map.js+++ b/frontend/discourse/admin/routes/admin-route-map.js@@ -1,21 +1,7 @@/* eslint-disable ember/route-path-style */export default function () {this.route("admin", function () {- this.route("dashboard", { path: "/" }, function () {- this.route("general", { path: "/" });- this.route("admin.dashboardModeration", {- path: "/dashboard/moderation",- resetNamespace: true,- });- this.route("admin.dashboardSecurity", {- path: "/dashboard/security",- resetNamespace: true,- });- this.route("admin.dashboardReports", {- path: "/dashboard/reports",- resetNamespace: true,- });- });+ this.route("dashboard", { path: "/" });this.route("adminSiteTraffic", {path: "/dashboard/site-traffic-explorer",resetNamespace: true,diff --git a/frontend/discourse/admin/routes/admin/dashboard-reports.js b/frontend/discourse/admin/routes/admin/dashboard-reports.jsdeleted file mode 100644index 7ecf7b3779d..00000000000--- a/frontend/discourse/admin/routes/admin/dashboard-reports.js+++ /dev/null@@ -1,10 +0,0 @@-import { service } from "@ember/service";-import DiscourseRoute from "discourse/routes/discourse";--export default class AdminDashboardReportsRoute extends DiscourseRoute {- @service router;-- beforeModel() {- this.router.replaceWith("adminReports");- }-}diff --git a/frontend/discourse/admin/routes/admin/dashboard.js b/frontend/discourse/admin/routes/admin/dashboard.jsindex 54e66cf8ec9..a0139f3b1d5 100644--- a/frontend/discourse/admin/routes/admin/dashboard.js+++ b/frontend/discourse/admin/routes/admin/dashboard.js@@ -14,11 +14,6 @@ export default class AdminDashboardRoute extends DiscourseRoute {setupController(controller) {super.setupController(...arguments);- if (controller.showRedesign) {- controller.fetchSections();- } else {- controller.fetchProblems();- controller.fetchDashboard();- }+ controller.fetchSections();}}diff --git a/frontend/discourse/admin/routes/admin/dashboard/general.js b/frontend/discourse/admin/routes/admin/dashboard/general.jsdeleted file mode 100644index ac585f68f12..00000000000--- a/frontend/discourse/admin/routes/admin/dashboard/general.js+++ /dev/null@@ -1,7 +0,0 @@-import DiscourseRoute from "discourse/routes/discourse";--export default class AdminDashboardGeneralRoute extends DiscourseRoute {- activate() {- this.controllerFor("admin.dashboard.general").fetchDashboard();- }-}diff --git a/frontend/discourse/admin/templates/admin/dashboard-moderation.gjs b/frontend/discourse/admin/templates/admin/dashboard-moderation.gjsdeleted file mode 100644index 8c20bd2b9e9..00000000000--- a/frontend/discourse/admin/templates/admin/dashboard-moderation.gjs+++ /dev/null@@ -1,68 +0,0 @@-import AdminReport from "discourse/admin/components/admin-report";-import DashboardPeriodSelector from "discourse/admin/components/dashboard-period-selector";-import PluginOutlet from "discourse/components/plugin-outlet";-import lazyHash from "discourse/helpers/lazy-hash";-import getUrl from "discourse/lib/get-url";-import { i18n } from "discourse-i18n";--export default <template>- <div class="sections">- <PluginOutlet- @connectorTagName="div"- @name="admin-dashboard-moderation-top"- />-- {{#if @controller.isModeratorsActivityVisible}}- <div class="moderators-activity section">- <div class="section-title">- <h2>- <a href={{getUrl "/admin/reports/moderators_activity"}}>- {{i18n "admin.dashboard.moderators_activity"}}- </a>- </h2>-- <DashboardPeriodSelector- @endDate={{@controller.endDate}}- @period={{@controller.period}}- @setCustomDateRange={{@controller.setCustomDateRange}}- @setPeriod={{@controller.setPeriod}}- @startDate={{@controller.startDate}}- />- </div>-- <div class="section-body">- <AdminReport- @dataSourceName="moderators_activity"- @filters={{@controller.filters}}- @showHeader={{false}}- />- </div>- </div>- {{/if}}-- <div class="main-section">- <AdminReport- @dataSourceName="flags_status"- @filters={{@controller.lastWeekFilters}}- @reportOptions={{@controller.flagsStatusOptions}}- />-- <AdminReport- @dataSourceName="post_edits"- @filters={{@controller.lastWeekFilters}}- />-- <AdminReport- @dataSourceName="user_flagging_ratio"- @filters={{@controller.lastWeekFilters}}- @reportOptions={{@controller.userFlaggingRatioOptions}}- />-- <PluginOutlet- @connectorTagName="div"- @name="admin-dashboard-moderation-bottom"- @outletArgs={{lazyHash [email protected]}}- />- </div>- </div>-</template>diff --git a/frontend/discourse/admin/templates/admin/dashboard-security.gjs b/frontend/discourse/admin/templates/admin/dashboard-security.gjsdeleted file mode 100644index 3ad93f181d5..00000000000--- a/frontend/discourse/admin/templates/admin/dashboard-security.gjs+++ /dev/null@@ -1,32 +0,0 @@-import AdminReport from "discourse/admin/components/admin-report";-import PluginOutlet from "discourse/components/plugin-outlet";--export default <template>- <div class="sections">- <PluginOutlet- @connectorTagName="div"- @name="admin-dashboard-security-top"- />-- <div class="main-section">- {{#if @controller.currentUser.can_see_ip}}- <AdminReport- @dataSourceName="suspicious_logins"- @filters={{@controller.lastWeekFilters}}- />- {{/if}}-- {{#if @controller.currentUser.admin}}- <AdminReport- @dataSourceName="admin_logins"- @filters={{@controller.lastWeekFilters}}- />- {{/if}}-- <PluginOutlet- @connectorTagName="div"- @name="admin-dashboard-security-bottom"- />- </div>- </div>-</template>diff --git a/frontend/discourse/admin/templates/admin/dashboard.gjs b/frontend/discourse/admin/templates/admin/dashboard.gjsindex 23c06a2c437..5e9faf392f2 100644--- a/frontend/discourse/admin/templates/admin/dashboard.gjs+++ b/frontend/discourse/admin/templates/admin/dashboard.gjs@@ -1,115 +1,20 @@-import { LinkTo } from "@ember/routing";-import DashboardProblems from "discourse/admin/components/dashboard-problems";import RedesignedAdminDashboard from "discourse/admin/components/redesigned-admin-dashboard";-import VersionChecks from "discourse/admin/components/version-checks";-import PluginOutlet from "discourse/components/plugin-outlet";-import DBreadcrumbsItem from "discourse/ui-kit/d-breadcrumbs-item";-import DPageHeader from "discourse/ui-kit/d-page-header";-import { i18n } from "discourse-i18n";export default <template>- {{#if @controller.showRedesign}}- <RedesignedAdminDashboard- @loadedSections={{@controller.loadedSections}}- @loadingSections={{@controller.loadingSections}}- @onIgnoreProblem={{@controller.ignoreProblem}}- @onRefreshProblems={{@controller.refreshSiteAdvice}}- @problems={{@controller.problems}}- @refreshSections={{@controller.fetchSections}}- @reorderSections={{@controller.reorderSections}}- @requestedEndDate={{@controller.endDate}}- @requestedPeriod={{@controller.safePeriod}}- @requestedStartDate={{@controller.startDate}}- @sectionsFetchError={{@controller.sectionsFetchError}}- @setCustomDateRange={{@controller.setCustomDateRange}}- @setPeriod={{@controller.setPeriod}}- @toggleSection={{@controller.toggleSection}}- />- {{else}}- <PluginOutlet @connectorTagName="div" @name="admin-dashboard-top" />-- <DPageHeader- @descriptionLabel={{i18n "admin.config.dashboard.header_description"}}- @hideTabs={{true}}- @titleLabel={{i18n "admin.dashboard.title"}}- >- <:breadcrumbs>- <DBreadcrumbsItem @label={{i18n "admin_title"}} @path="/admin" />- <DBreadcrumbsItem- @label={{i18n "admin.dashboard.title"}}- @path="/admin"- />- </:breadcrumbs>- </DPageHeader>-- <PluginOutlet- @connectorTagName="div"- @name="admin-dashboard-after-header"- />-- {{#if @controller.showVersionChecks}}- <div class="section-top">- <div class="version-checks">- <VersionChecks @versionCheck={{@controller.versionCheck}} />- </div>- </div>- {{/if}}-- <DashboardProblems- @loadingProblems={{@controller.loadingProblems}}- @problems={{@controller.problems}}- @problemsTimestamp={{@controller.problemsTimestamp}}- @refreshProblems={{@controller.refreshProblems}}- />- <nav>- <ul class="nav nav-pills">- <li class="navigation-item settings">- <LinkTo- class="navigation-link"- @route="adminReports.dashboardSettings"- >- {{i18n "admin.config.reports.sub_pages.settings.title"}}- </LinkTo>- </li>-- <li class="navigation-item general">- <LinkTo class="navigation-link" @route="admin.dashboard.general">- {{i18n "admin.dashboard.general_tab"}}- </LinkTo>- </li>-- {{#if @controller.isModerationTabVisible}}- <li class="navigation-item moderation">- <LinkTo class="navigation-link" @route="admin.dashboardModeration">- {{i18n "admin.dashboard.moderation_tab"}}- </LinkTo>- </li>- {{/if}}-- {{#if @controller.isSecurityTabVisible}}- <li class="navigation-item security">- <LinkTo class="navigation-link" @route="admin.dashboardSecurity">- {{i18n "admin.dashboard.security_tab"}}- </LinkTo>- </li>- {{/if}}-- {{#if @controller.isReportsTabVisible}}- <li class="navigation-item reports">- <LinkTo class="navigation-link" @route="adminReports">- {{i18n "admin.dashboard.reports_tab"}}- </LinkTo>- </li>- {{/if}}-- <PluginOutlet @name="admin-dashboard-tabs-after" />- </ul>- </nav>-- {{outlet}}-- <span>- <PluginOutlet @connectorTagName="div" @name="admin-dashboard-bottom" />- </span>- {{/if}}+ <RedesignedAdminDashboard+ @loadedSections={{@controller.loadedSections}}+ @loadingSections={{@controller.loadingSections}}+ @onIgnoreProblem={{@controller.ignoreProblem}}+ @onRefreshProblems={{@controller.refreshSiteAdvice}}+ @problems={{@controller.problems}}+ @refreshSections={{@controller.fetchSections}}+ @reorderSections={{@controller.reorderSections}}+ @requestedEndDate={{@controller.endDate}}+ @requestedPeriod={{@controller.safePeriod}}+ @requestedStartDate={{@controller.startDate}}+ @sectionsFetchError={{@controller.sectionsFetchError}}+ @setCustomDateRange={{@controller.setCustomDateRange}}+ @setPeriod={{@controller.setPeriod}}+ @toggleSection={{@controller.toggleSection}}+ /></template>diff --git a/frontend/discourse/admin/templates/admin/dashboard/general.gjs b/frontend/discourse/admin/templates/admin/dashboard/general.gjsdeleted file mode 100644index afd645796c8..00000000000--- a/frontend/discourse/admin/templates/admin/dashboard/general.gjs+++ /dev/null@@ -1,223 +0,0 @@-import { LinkTo } from "@ember/routing";-import { trustHTML } from "@ember/template";-import AdminReport from "discourse/admin/components/admin-report";-import DashboardPeriodSelector from "discourse/admin/components/dashboard-period-selector";-import PluginOutlet from "discourse/components/plugin-outlet";-import lazyHash from "discourse/helpers/lazy-hash";-import getUrl from "discourse/lib/get-url";-import DConditionalLoadingSection from "discourse/ui-kit/d-conditional-loading-section";-import DConditionalLoadingSpinner from "discourse/ui-kit/d-conditional-loading-spinner";-import dBasePath from "discourse/ui-kit/helpers/d-base-path";-import dFormatDate from "discourse/ui-kit/helpers/d-format-date";-import { i18n } from "discourse-i18n";--export default <template>- <DConditionalLoadingSpinner @condition={{@controller.isLoading}}>- <PluginOutlet @connectorTagName="div" @name="admin-dashboard-general-top" />-- {{#if @controller.isCommunityHealthVisible}}- <div class="community-health section">- <div class="period-section">- <div class="section-title">- <h2>- <a href={{getUrl "/admin/dashboard/reports"}}>- {{i18n "admin.dashboard.community_health"}}- </a>- </h2>-- <DashboardPeriodSelector- @endDate={{@controller.endDate}}- @period={{@controller.period}}- @setCustomDateRange={{@controller.setCustomDateRange}}- @setPeriod={{@controller.setPeriod}}- @startDate={{@controller.startDate}}- />- </div>-- <div class="section-body">- <div class="charts">- {{#if @controller.siteSettings.use_legacy_pageviews}}- <AdminReport- @dataSourceName="consolidated_page_views"- @filters={{@controller.filters}}- @forcedModes={{@controller.reportModes.stacked_chart}}- />- {{else}}- <AdminReport- @dataSourceName="site_traffic"- @filters={{@controller.filters}}- @forcedModes={{@controller.reportModes.stacked_chart}}- @reportOptions={{@controller.siteTrafficOptions}}- />- {{/if}}-- <AdminReport- @dataSourceName="signups"- @filters={{@controller.filters}}- @forcedModes={{@controller.reportModes.chart}}- @showTrend={{true}}- />-- <AdminReport- @dataSourceName="topics"- @filters={{@controller.filters}}- @forcedModes={{@controller.reportModes.chart}}- @showTrend={{true}}- />-- <AdminReport- @dataSourceName="posts"- @filters={{@controller.filters}}- @forcedModes={{@controller.reportModes.chart}}- @showTrend={{true}}- />-- <AdminReport- @dataSourceName="dau_by_mau"- @filters={{@controller.filters}}- @forcedModes={{@controller.reportModes.chart}}- @showTrend={{true}}- />-- <AdminReport- @dataSourceName="daily_engaged_users"- @filters={{@controller.filters}}- @forcedModes={{@controller.reportModes.chart}}- @showTrend={{true}}- />-- <AdminReport- @dataSourceName="new_contributors"- @filters={{@controller.filters}}- @forcedModes={{@controller.reportModes.chart}}- @showTrend={{true}}- />- </div>- </div>- </div>- </div>- {{/if}}-- <div class="section-columns">- <div class="section-column">- {{#if @controller.isActivityMetricsVisible}}- {{#if @controller.activityMetrics.length}}- <div class="admin-report activity-metrics">- <div class="header">- <ul class="breadcrumb">- <li class="item report">- <LinkTo class="report-url" @route="adminReports">- {{i18n "admin.dashboard.activity_metrics"}}- </LinkTo>- </li>- </ul>- </div>- <div class="report-body">- <div class="counters-list">- <div class="counters-header">- <div class="counters-cell"></div>- <div class="counters-cell">{{i18n- "admin.dashboard.reports.today"- }}</div>- <div class="counters-cell">{{i18n- "admin.dashboard.reports.yesterday"- }}</div>- <div class="counters-cell">{{i18n- "admin.dashboard.reports.last_7_days"- }}</div>- <div class="counters-cell">{{i18n- "admin.dashboard.reports.last_30_days"- }}</div>- </div>-- {{#each @controller.activityMetrics as |metric|}}- <AdminReport- @dataSourceName={{metric}}- @filters={{@controller.activityMetricsFilters}}- @forcedModes={{@controller.reportModes.counters}}- @showHeader={{false}}- />- {{/each}}- </div>- </div>- </div>- {{/if}}- {{/if}}-- <div class="user-metrics">- <DConditionalLoadingSection @isLoading={{@controller.isLoading}}>- <AdminReport- @dataSourceName="users_by_type"- @forcedModes={{@controller.reportModes.inline_table}}- />-- <AdminReport- @dataSourceName="users_by_trust_level"- @forcedModes={{@controller.reportModes.inline_table}}- />- </DConditionalLoadingSection>- </div>-- <div class="misc">- <AdminReport- @dataSourceName="storage_stats"- @forcedModes={{@controller.reportModes.storage_stats}}- @showHeader={{false}}- />-- <div class="last-dashboard-update">- <div>- <h4>{{i18n "admin.dashboard.last_updated"}} </h4>- <p>{{dFormatDate- @controller.model.attributes.updated_at- leaveAgo="true"- }}</p>- </div>- {{#if @controller.model.attributes.discourse_updated_at}}- <div>- <h4>{{i18n "admin.dashboard.discourse_last_updated"}} </h4>- <p>{{dFormatDate- @controller.model.attributes.discourse_updated_at- leaveAgo="true"- }}</p>- <LinkTo class="btn btn-default" @route="admin.whatsNew">- {{i18n "admin.dashboard.whats_new_in_discourse"}}- </LinkTo>- </div>- {{/if}}- </div>- </div>- </div>-- {{#if @controller.isSearchReportsVisible}}- <div class="section-column">- <AdminReport- @dataSourceName="top_referred_topics"- @filters={{@controller.topReferredTopicsFilters}}- @reportOptions={{@controller.topReferredTopicsOptions}}- />-- <AdminReport- @dataSourceName="trending_search"- @disabledLabel={{@controller.trendingSearchDisabledLabel}}- @filters={{@controller.trendingSearchFilters}}- @isEnabled={{@controller.logSearchQueriesEnabled}}- @reportOptions={{@controller.trendingSearchOptions}}- />- {{trustHTML- (i18n- "admin.dashboard.reports.trending_search.more"- basePath=(dBasePath)- )- }}- </div>- {{/if}}- </div>-- <PluginOutlet- @connectorTagName="div"- @name="admin-dashboard-general-bottom"- @outletArgs={{lazyHash [email protected]}}- />- </DConditionalLoadingSpinner>-</template>diff --git a/frontend/discourse/app/lib/plugin-api.gjs b/frontend/discourse/app/lib/plugin-api.gjsindex 06413c231b2..7b6826b41b6 100644--- a/frontend/discourse/app/lib/plugin-api.gjs+++ b/frontend/discourse/app/lib/plugin-api.gjs@@ -3263,9 +3263,8 @@ class _PluginApi {}/**- * Registers a component to render a whole section in the redesigned admin- * dashboard (gated by the `dashboard_improvements` upcoming change). Pair it- * with the server-side `register_admin_dashboard_section`: the `id` here must+ * Registers a component to render a whole section in the admin dashboard.+ * Pair it with the server-side `register_admin_dashboard_section`: the `id` here must* match the one registered there, and the loader block registered there* produces the `@data` this component receives.*diff --git a/frontend/discourse/app/lib/sidebar/admin-nav-map.js b/frontend/discourse/app/lib/sidebar/admin-nav-map.jsindex 2a6fb6df379..dc87af53a64 100644--- a/frontend/discourse/app/lib/sidebar/admin-nav-map.js+++ b/frontend/discourse/app/lib/sidebar/admin-nav-map.js@@ -6,7 +6,7 @@ export const ADMIN_NAV_MAP = [links: [{name: "admin_home",- route: "admin.dashboard.general",+ route: "admin.dashboard",label: "admin.config.dashboard.title",description: "admin.config.dashboard.header_description",icon: "house",diff --git a/frontend/discourse/app/resolver-shims.js b/frontend/discourse/app/resolver-shims.jsindex 7328428f135..ae426235851 100644--- a/frontend/discourse/app/resolver-shims.js+++ b/frontend/discourse/app/resolver-shims.js@@ -6,8 +6,6 @@ export default {"controller:review-index": "controller:review.index","route:admin-dashboard": "route:admin.dashboard","controller:admin-dashboard": "controller:admin.dashboard",- "route:admin-dashboard-general": "route:admin.dashboard.general",- "controller:admin-dashboard-general": "controller:admin.dashboard.general","route:user-private-messages-user": "route:user-private-messages.user","controller:user-private-messages-user":"controller:user-private-messages.user",@@ -91,8 +89,6 @@ export default {"route:gamification-leaderboard.by-name","route:gamification-leaderboard-index":"route:gamification-leaderboard.index",- "controller:admin-dashboard-sentiment":- "controller:admin.dashboard-sentiment","controller:admin-groups-settings": "controller:admin-groups.settings","route:admin-groups-settings": "route:admin-groups.settings","controller:admin-groups-index": "controller:admin-groups.index",@@ -146,9 +142,6 @@ export default {"route:subscribe-show": "route:subscribe.show","controller:subscribe-index": "controller:subscribe.index","route:subscribe-index": "route:subscribe.index",- "controller:admin-dashboard-moderation":- "controller:admin.dashboard-moderation",- "route:admin-dashboard-reports": "route:admin.dashboard-reports","controller:admin-email-logs-sent": "controller:admin-email-logs.sent","route:admin-email-logs-sent": "route:admin-email-logs.sent","controller:admin-email-logs-skipped": "controller:admin-email-logs.skipped",diff --git a/frontend/discourse/tests/acceptance/dashboard-test.js b/frontend/discourse/tests/acceptance/dashboard-test.jsdeleted file mode 100644index bbf223fb7fe..00000000000--- a/frontend/discourse/tests/acceptance/dashboard-test.js+++ /dev/null@@ -1,178 +0,0 @@-import { click, currentURL, visit } from "@ember/test-helpers";-import { test } from "qunit";-import { acceptance } from "discourse/tests/helpers/qunit-helpers";-import selectKit from "discourse/tests/helpers/select-kit-helper";--acceptance("Dashboard", function (needs) {- needs.user();- needs.settings({- dashboard_visible_tabs: "moderation|security|reports|features",- dashboard_general_tab_activity_metrics: "page_view_total_reqs",- });- needs.site({- groups: [- {- id: 88,- name: "tl1",- },- {- id: 89,- name: "tl2",- },- ],- });-- test("tabs", async function (assert) {- await visit("/admin");-- assert.dom(".dashboard .navigation-item.general").exists("general tab");- assert- .dom(".dashboard .navigation-item.moderation")- .exists("moderation tab");- assert.dom(".dashboard .navigation-item.security").exists("security tab");- assert.dom(".dashboard .navigation-item.reports").exists("reports tab");- });-- test("general tab", async function (assert) {- await visit("/admin");-- assert.dom(".custom-date-range-button").exists("custom date range button");- assert.dom(".admin-report.signups").exists("signups report");- assert.dom(".admin-report.posts").exists("posts report");- assert.dom(".admin-report.dau-by-mau").exists("dau-by-mau report");- assert- .dom(".admin-report.daily-engaged-users")- .exists("daily-engaged-users report");- assert- .dom(".admin-report.new-contributors")- .exists("new-contributors report");- });-- test("custom date range updates period display", async function (assert) {- await visit("/admin");-- const periodChooser = selectKit(".period-chooser");-- assert.strictEqual(periodChooser.header().value(), "monthly");-- await click(".custom-date-range-button");- await click(".custom-date-range-modal .d-modal__footer .btn");-- assert.strictEqual(periodChooser.header().value(), "custom");- assert.dom(".period-chooser-header .date-section").hasText("Custom");-- await periodChooser.expand();- await periodChooser.selectRowByValue("yearly");-- assert.strictEqual(periodChooser.header().value(), "yearly");- assert.dom(".period-chooser-header .date-section").hasText("Year");- });-- test("custom date range is reflected in URL query params", async function (assert) {- await visit("/admin");-- await click(".custom-date-range-button");- await click(".custom-date-range-modal .d-modal__footer .btn");-- const url = currentURL();- assert.true(url.includes("period=custom"), "period=custom is in URL");- assert.true(url.includes("start_date="), "start_date is in URL");- assert.true(url.includes("end_date="), "end_date is in URL");- });-- test("URL query params restore custom date range", async function (assert) {- await visit(- "/admin?period=custom&start_date=2024-01-01&end_date=2024-01-31"- );-- const periodChooser = selectKit(".period-chooser");- assert.strictEqual(periodChooser.header().value(), "custom");- assert.dom(".period-chooser-header .date-section").hasText("Custom");- assert- .dom(".period-chooser-header .top-date-string")- .hasText("Jan 1, 2024 – Jan 31, 2024");- });-- test("moderation tab", async function (assert) {- await visit("/admin");- await click(".dashboard .navigation-item.moderation .navigation-link");-- assert.dom(".custom-date-range-button").exists("custom date range button");- assert- .dom(".admin-report.moderators-activity")- .exists("moderators activity report");- });-- test("activity metrics", async function (assert) {- await visit("/admin");-- assert.dom(".admin-report.page-view-total-reqs .today-count").exists();- assert.dom(".admin-report.page-view-total-reqs .yesterday-count").exists();- assert.dom(".admin-report.page-view-total-reqs .sevendays-count").exists();- assert- .dom(".admin-report.page-view-total-reqs .thirty-days-count")- .exists();- });-- test("reports tab navigates to the reports page", async function (assert) {- await visit("/admin");- await click(".dashboard .navigation-item.reports .navigation-link");-- assert.strictEqual(currentURL(), "/admin/reports");- assert.dom(".admin-reports-group").exists("shows the grouped reports");- });-- test("old dashboard reports URL redirects to the reports page", async function (assert) {- await visit("/admin/dashboard/reports");-- assert.strictEqual(currentURL(), "/admin/reports");- });-- test("reports filters", async function (assert) {- await visit(- '/admin/reports/signups_with_groups?end_date=2018-07-16&filters=%7B"group"%3A88%7D&start_date=2018-06-16'- );-- const groupFilter = selectKit(".group-filter .combo-box");-- assert.strictEqual(- groupFilter.header().value(),- "88",- "its set the value of the filter from the query params"- );- });-});--acceptance("Dashboard: dashboard_visible_tabs", function (needs) {- needs.user();- needs.settings({ dashboard_visible_tabs: "general|security|reports" });-- test("visible tabs", async function (assert) {- await visit("/admin");-- assert.dom(".dashboard .navigation-item.general").exists("general tab");- assert- .dom(".dashboard .navigation-item.moderation")- .doesNotExist("moderation tab");- assert.dom(".dashboard .navigation-item.security").exists("security tab");- assert.dom(".dashboard .navigation-item.reports").exists("reports tab");- });-});--acceptance("Dashboard: dashboard_hidden_reports", function (needs) {- needs.user();- needs.settings({- dashboard_visible_tabs: "reports",- dashboard_hidden_reports: "posts|dau_by_mau",- });-- test("hidden reports", async function (assert) {- await visit("/admin");-- assert.dom(".admin-report.signups.is-visible").exists("signups report");- assert.dom(".admin-report.is-visible.posts").doesNotExist("posts report");- assert- .dom(".admin-report.is-visible.dau-by-mau")- .doesNotExist("dau-by-mau report");- });-});diff --git a/frontend/discourse/tests/acceptance/reports-test.js b/frontend/discourse/tests/acceptance/reports-test.jsindex 68497b62b88..d128733dfd5 100644--- a/frontend/discourse/tests/acceptance/reports-test.js+++ b/frontend/discourse/tests/acceptance/reports-test.js@@ -2,6 +2,7 @@ import { click, currentURL, fillIn, select, visit } from "@ember/test-helpers";import { test } from "qunit";import reportsBulkFixtures from "discourse/tests/fixtures/reports-bulk";import { acceptance } from "discourse/tests/helpers/qunit-helpers";+import selectKit from "discourse/tests/helpers/select-kit-helper";acceptance("Reports", function (needs) {needs.user();@@ -253,3 +254,30 @@ acceptance("Reports | Filter query params", function (needs) {assert.dom(".admin-section-landing-item__content").exists({ count: 3 });});});++acceptance("Reports: filters", function (needs) {+ needs.user();+ needs.site({+ groups: [+ {+ id: 88,+ name: "tl1",+ },+ {+ id: 89,+ name: "tl2",+ },+ ],+ });++ test("sets the group filter from the query params", async function (assert) {+ await visit(+ '/admin/reports/signups_with_groups?end_date=2018-07-16&filters=%7B"group"%3A88%7D&start_date=2018-06-16'+ );++ assert.strictEqual(+ selectKit(".group-filter .combo-box").header().value(),+ "88"+ );+ });+});diff --git a/frontend/discourse/tests/acceptance/sidebar-user-community-section-test.js b/frontend/discourse/tests/acceptance/sidebar-user-community-section-test.jsindex d28ec87fb5c..d790a4b04f3 100644--- a/frontend/discourse/tests/acceptance/sidebar-user-community-section-test.js+++ b/frontend/discourse/tests/acceptance/sidebar-user-community-section-test.js@@ -466,7 +466,7 @@ acceptance("Sidebar - Logged on user - Community Section", function (needs) {".sidebar-section[data-section-name='community'] .sidebar-section-link[data-link-name='admin']");- assert.strictEqual(currentRouteName(), "admin.dashboard.general");+ assert.strictEqual(currentRouteName(), "admin.dashboard");});test("admin section link is not shown to non-staff users", async function (assert) {diff --git a/frontend/discourse/tests/fixtures/dashboard-general.js b/frontend/discourse/tests/fixtures/dashboard-general.jsdeleted file mode 100644index 0ff4294af59..00000000000--- a/frontend/discourse/tests/fixtures/dashboard-general.js+++ /dev/null@@ -1,13 +0,0 @@-/**- * Recorded server responses, keyed by request URL.- *- * @type {Record<string, Record<string, unknown>>}- */-const dashboardGeneralFixtures = {- "/admin/dashboard/general.json": {- reports: [],- updated_at: "2018-04-25T08:06:11.292Z",- },-};--export default dashboardGeneralFixtures;diff --git a/frontend/discourse/tests/fixtures/dashboard.js b/frontend/discourse/tests/fixtures/dashboard.jsindex 6985f718227..ccf2b0278ef 100644--- a/frontend/discourse/tests/fixtures/dashboard.js+++ b/frontend/discourse/tests/fixtures/dashboard.js@@ -1,7 +1,8 @@const dashboardFixtures = {"/admin/dashboard.json": {- updated_at: "2018-04-25T08:06:11.292Z",- has_unseen_features: true+ sections: [],+ configuration: { sections: [] },+ problems: [],},};diff --git a/frontend/discourse/tests/integration/components/header-icons-test.gjs b/frontend/discourse/tests/integration/components/header-icons-test.gjsindex 703db58dfbf..bd4ea38a5bc 100644--- a/frontend/discourse/tests/integration/components/header-icons-test.gjs+++ b/frontend/discourse/tests/integration/components/header-icons-test.gjs@@ -40,7 +40,7 @@ module("Integration | Component | Header | Icons", function (hooks) {"it does not display when the search_experience setting is search_field");- routerStub.value("admin.dashboard.general");+ routerStub.value("admin.dashboard");await render(<template>diff --git a/frontend/discourse/tests/unit/services/admin-search-data-source-test.js b/frontend/discourse/tests/unit/services/admin-search-data-source-test.jsindex 39c238b74b0..2d823c1b734 100644--- a/frontend/discourse/tests/unit/services/admin-search-data-source-test.js+++ b/frontend/discourse/tests/unit/services/admin-search-data-source-test.js@@ -321,7 +321,7 @@ module(name: "root",};let link = {- route: "admin.dashboard.general",+ route: "admin.dashboard",};let formatter = new PageLinkFormatter(this.router, navMapSection, link);assert.deepEqual(formatter.format().url, "/admin");@@ -393,7 +393,7 @@ module(let link = {label: "admin.config.flags.title",description: "admin.config.flags.header_description",- route: "admin.dashboard.general",+ route: "admin.dashboard",keywords: "admin.config.flags.keywords",};diff --git a/lib/plugin/instance.rb b/lib/plugin/instance.rbindex bedba50a6d2..73f55e07993 100644--- a/lib/plugin/instance.rb+++ b/lib/plugin/instance.rb@@ -1446,9 +1446,8 @@ class Plugin::InstanceDiscoursePluginRegistry.register_stat(stat, self)end- # Registers a KPI tile in the admin dashboard "Highlights" section- # (gated by the dashboard_improvements upcoming change). The KPI is rendered- # as a tile linking to /admin/reports/:report.+ # Registers a KPI tile in the admin dashboard "Highlights" section. The KPI+ # is rendered as a tile linking to /admin/reports/:report.## @param type [Symbol] unique identifier for the KPI. Used as the i18n key# (admin.dashboard.highlights.kpi.<type>.label / .tooltip) and to@@ -1463,9 +1462,9 @@ class Plugin::Instance)end- # Registers a whole section in the redesigned admin dashboard (gated by the- # dashboard_improvements upcoming change). The matching client-side section- # component must be registered via the JS `api.registerAdminDashboardSection`.+ # Registers a whole section in the admin dashboard. The matching client-side+ # section component must be registered via the JS+ # `api.registerAdminDashboardSection`.## @param id [String] unique section id. Matched against the persisted# configuration and the client-side component registry.diff --git a/plugins/discourse-ai/admin/assets/javascripts/discourse/controllers/admin/dashboard-sentiment.js b/plugins/discourse-ai/admin/assets/javascripts/discourse/controllers/admin/dashboard-sentiment.jsdeleted file mode 100644index 9362d4f944c..00000000000--- a/plugins/discourse-ai/admin/assets/javascripts/discourse/controllers/admin/dashboard-sentiment.js+++ /dev/null@@ -1,51 +0,0 @@-import { computed } from "@ember/object";-import AdminDashboardTabController from "discourse/admin/controllers/admin-dashboard-tab";--export default class AdminDashboardSentiment extends AdminDashboardTabController {- /** @returns {AdminDashboardTabController["filters"]} */- @computed("startDate", "endDate")- get filters() {- return { startDate: this.startDate, endDate: this.endDate };- }-- get emotionFilters() {- return {- startDate: moment().subtract(2, "month").format("YYYY-MM-DD"),- endDate: moment().format("YYYY-MM-DD"),- };- }-- get emotions() {- const emotions = [- "admiration",- "amusement",- "anger",- "annoyance",- "approval",- "caring",- "confusion",- "curiosity",- "desire",- "disappointment",- "disapproval",- "disgust",- "embarrassment",- "excitement",- "fear",- "gratitude",- "grief",- "joy",- "love",- "nervousness",- "neutral",- "optimism",- "pride",- "realization",- "relief",- "remorse",- "sadness",- "surprise",- ];- return emotions;- }-}diff --git a/plugins/discourse-ai/admin/assets/javascripts/discourse/templates/admin/dashboard-sentiment.gjs b/plugins/discourse-ai/admin/assets/javascripts/discourse/templates/admin/dashboard-sentiment.gjsdeleted file mode 100644index d8d7f44ac6e..00000000000--- a/plugins/discourse-ai/admin/assets/javascripts/discourse/templates/admin/dashboard-sentiment.gjs+++ /dev/null@@ -1,82 +0,0 @@-import { LinkTo } from "@ember/routing";-import AdminReport from "discourse/admin/components/admin-report";-import DashboardPeriodSelector from "discourse/admin/components/dashboard-period-selector";-import DTooltip from "discourse/float-kit/components/d-tooltip";-import dIcon from "discourse/ui-kit/helpers/d-icon";-import { i18n } from "discourse-i18n";--export default <template>- <div class="sentiment section">- <div class="period-section">- <div class="section-title">- <h2 id="sentiment-heading">- {{i18n "discourse_ai.sentiments.dashboard.title"}}- </h2>-- <DashboardPeriodSelector- @endDate={{@controller.endDate}}- @period={{@controller.period}}- @setCustomDateRange={{@controller.setCustomDateRange}}- @setPeriod={{@controller.setPeriod}}- @startDate={{@controller.startDate}}- />- </div>- </div>-- <div class="section-body">- <div class="charts">- <AdminReport- @dataSourceName="overall_sentiment"- @filters={{@controller.filters}}- @showHeader={{true}}- />- <div class="admin-report activity-metrics">- <div class="header">- <ul class="breadcrumb">- <li class="item report">- <LinkTo class="report-url" @route="adminReports">- {{i18n "admin.dashboard.emotion.title"}}- </LinkTo>- <DTooltip @interactive="true">- <:trigger>- {{dIcon "circle-question"}}- </:trigger>- <:content>- <span>{{i18n "admin.dashboard.emotion.description"}}</span>- </:content>- </DTooltip>- </li>- </ul>- </div>- <div class="report-body">- <div class="counters-list">- <div class="counters-header">- <div class="counters-cell"></div>- <div class="counters-cell">{{i18n- "admin.dashboard.reports.today"- }}</div>- <div class="counters-cell">{{i18n- "admin.dashboard.reports.yesterday"- }}</div>- <div class="counters-cell">{{i18n- "admin.dashboard.reports.last_7_days"- }}</div>- <div class="counters-cell">{{i18n- "admin.dashboard.reports.last_30_days"- }}</div>- </div>- {{#each @controller.emotions as |metric|}}- <AdminReport- @dataSourceName="emotion_{{metric}}"- @filters={{@controller.emotionFilters}}- @forcedModes="emotion"- @showHeader={{false}}- />- {{/each}}- </div>- </div>- </div>- </div>- </div>- </div>-</template>diff --git a/plugins/discourse-ai/app/controllers/discourse_ai/admin/dashboard_controller.rb b/plugins/discourse-ai/app/controllers/discourse_ai/admin/dashboard_controller.rbdeleted file mode 100644index 25a64a93a0a..00000000000--- a/plugins/discourse-ai/app/controllers/discourse_ai/admin/dashboard_controller.rb+++ /dev/null@@ -1,12 +0,0 @@-# frozen_string_literal: true--module DiscourseAi- module Admin- class DashboardController < ::Admin::StaffController- requires_plugin PLUGIN_NAME-- def sentiment- end- end- end-enddiff --git a/plugins/discourse-ai/assets/javascripts/discourse/admin-discourse-ai-route-map.js b/plugins/discourse-ai/assets/javascripts/discourse/admin-discourse-ai-route-map.jsdeleted file mode 100644index 9643cfbc70f..00000000000--- a/plugins/discourse-ai/assets/javascripts/discourse/admin-discourse-ai-route-map.js+++ /dev/null@@ -1,10 +0,0 @@-export default {- resource: "admin.dashboard",- path: "/dashboard",- map() {- this.route("admin.dashboardSentiment", {- path: "/dashboard/sentiment",- resetNamespace: true,- });- },-};diff --git a/plugins/discourse-ai/assets/javascripts/discourse/connectors/admin-dashboard-tabs-after/admin-sentiment-dashbboard.gjs b/plugins/discourse-ai/assets/javascripts/discourse/connectors/admin-dashboard-tabs-after/admin-sentiment-dashbboard.gjsdeleted file mode 100644index 97af714df6a..00000000000--- a/plugins/discourse-ai/assets/javascripts/discourse/connectors/admin-dashboard-tabs-after/admin-sentiment-dashbboard.gjs+++ /dev/null@@ -1,20 +0,0 @@-import Component from "@glimmer/component";-import { LinkTo } from "@ember/routing";-import { i18n } from "discourse-i18n";--export default class AISentimentDashboard extends Component {- static shouldRender(args, context) {- return (- context.siteSettings.ai_sentiment_enabled ||- context.siteSettings.ai_sentiment_emotion_enabled- );- }-- <template>- <li class="navigation-item sentiment">- <LinkTo class="navigation-link" @route="admin.dashboardSentiment">- {{i18n "discourse_ai.sentiments.dashboard.title"}}- </LinkTo>- </li>- </template>-}diff --git a/plugins/discourse-ai/assets/javascripts/discourse/initializers/ai-sentiment-admin-nav.js b/plugins/discourse-ai/assets/javascripts/discourse/initializers/ai-sentiment-admin-nav.jsindex 89005cfdfa1..effa4be72a7 100644--- a/plugins/discourse-ai/assets/javascripts/discourse/initializers/ai-sentiment-admin-nav.js+++ b/plugins/discourse-ai/assets/javascripts/discourse/initializers/ai-sentiment-admin-nav.js@@ -11,13 +11,6 @@ export default apiInitializer((api) => {return;}- api.addAdminSidebarSectionLink("reports", {- name: "sentiment_overview",- route: "admin.dashboardSentiment",- label: "discourse_ai.sentiments.sidebar.overview",- icon: "chart-column",- moderator: true,- });api.addAdminSidebarSectionLink("reports", {name: "sentiment_analysis",route: "adminReports.show",diff --git a/plugins/discourse-ai/assets/stylesheets/modules/sentiment/common/dashboard.scss b/plugins/discourse-ai/assets/stylesheets/modules/sentiment/common/dashboard.scssindex c8c38903dc2..57ceda9ce64 100644--- a/plugins/discourse-ai/assets/stylesheets/modules/sentiment/common/dashboard.scss+++ b/plugins/discourse-ai/assets/stylesheets/modules/sentiment/common/dashboard.scss@@ -1,18 +1,5 @@@use "lib/viewport";-.dashboard.dashboard-sentiment {- .charts {- display: grid;- grid-template-columns: repeat(12, 1fr);- column-gap: 1em;- row-gap: 1em;-- .admin-report {- grid-column: span 12;- }- }-}-.admin-report.sentiment-analysis {--d-sentiment-report-positive-rgb: 46, 204, 112;--d-sentiment-report-neutral-rgb: 149, 166, 167;diff --git a/plugins/discourse-ai/config/locales/client.en.yml b/plugins/discourse-ai/config/locales/client.en.ymlindex 6e6600bb380..35d77f721ad 100644--- a/plugins/discourse-ai/config/locales/client.en.yml+++ b/plugins/discourse-ai/config/locales/client.en.yml@@ -1878,10 +1878,7 @@ en:streaming_below: "New content below"editing_post: "Editing post"sentiments:- dashboard:- title: "Sentiment"sidebar:- overview: "Sentiment overview"analysis: "Sentiment analysis"sentiment_analysis:share_chart: "Copy link to chart"diff --git a/plugins/discourse-ai/config/routes.rb b/plugins/discourse-ai/config/routes.rbindex 7c5be50bdcd..fb4f67fb71e 100644--- a/plugins/discourse-ai/config/routes.rb+++ b/plugins/discourse-ai/config/routes.rb@@ -115,9 +115,6 @@ endDiscourse::Application.routes.draw domount DiscourseAi::Engine, at: "discourse-ai"- get "admin/dashboard/sentiment" => "discourse_ai/admin/dashboard#sentiment",- :constraints => StaffConstraint.new-scope "/admin/plugins/discourse-ai", constraints: AdminConstraint.new doget "/ask-ai-reports/:report_id/subjects/:subject_id/asks" =>"discourse_ai/admin/ask_ai_reports#asks",diff --git a/plugins/discourse-ai/spec/requests/admin/ask_ai_dashboard_spec.rb b/plugins/discourse-ai/spec/requests/admin/ask_ai_dashboard_spec.rbindex e886d93d479..19dc465fafd 100644--- a/plugins/discourse-ai/spec/requests/admin/ask_ai_dashboard_spec.rb+++ b/plugins/discourse-ai/spec/requests/admin/ask_ai_dashboard_spec.rb@@ -6,7 +6,6 @@ describe Admin::DashboardController dobefore doenable_current_plugin- SiteSetting.dashboard_improvements = trueSiteSetting.ai_ask_ai_enabled = trueAdminDashboardSectionConfiguration.all_known_section_ids.each_with_index do |id, index|AdminDashboardSection.find_or_initialize_by(section_id: id).update!(diff --git a/plugins/discourse-ai/test/javascripts/unit/connectors/admin-sentiment-dashboard-test.js b/plugins/discourse-ai/test/javascripts/unit/connectors/admin-sentiment-dashboard-test.jsdeleted file mode 100644index f2450df949b..00000000000--- a/plugins/discourse-ai/test/javascripts/unit/connectors/admin-sentiment-dashboard-test.js+++ /dev/null@@ -1,27 +0,0 @@-import { module, test } from "qunit";-import AISentimentDashboard from "discourse/plugins/discourse-ai/discourse/connectors/admin-dashboard-tabs-after/admin-sentiment-dashbboard";--module("Unit | Connector | admin-sentiment-dashboard", function () {- test("offers reports when either capability is enabled", function (assert) {- for (const [sentiment, emotion, expected] of [- [false, false, false],- [true, false, true],- [false, true, true],- [true, true, true],- ]) {- assert.strictEqual(- AISentimentDashboard.shouldRender(- {},- {- siteSettings: {- ai_sentiment_enabled: sentiment,- ai_sentiment_emotion_enabled: emotion,- },- }- ),- expected,- `reports follow independent flags: sentiment=${sentiment}, emotion=${emotion}`- );- }- });-});diff --git a/plugins/discourse-data-explorer/assets/javascripts/discourse/controllers/admin-plugins/show/explorer/edit.js b/plugins/discourse-data-explorer/assets/javascripts/discourse/controllers/admin-plugins/show/explorer/edit.jsindex e9d72db371e..ed82e4ed2da 100644--- a/plugins/discourse-data-explorer/assets/javascripts/discourse/controllers/admin-plugins/show/explorer/edit.js+++ b/plugins/discourse-data-explorer/assets/javascripts/discourse/controllers/admin-plugins/show/explorer/edit.js@@ -147,7 +147,7 @@ export default class PluginsExplorerController extends Controller {}get showDashboardToggle() {- return this.siteSettings.dashboard_improvements && !this.model.destroyed;+ return !this.model.destroyed;}get dashboardToggleIcon() {diff --git a/plugins/discourse-data-explorer/spec/system/admin_dashboard_manage_reports_hint_spec.rb b/plugins/discourse-data-explorer/spec/system/admin_dashboard_manage_reports_hint_spec.rbindex 881fec27b97..0780252e9e1 100644--- a/plugins/discourse-data-explorer/spec/system/admin_dashboard_manage_reports_hint_spec.rb+++ b/plugins/discourse-data-explorer/spec/system/admin_dashboard_manage_reports_hint_spec.rb@@ -8,7 +8,6 @@ describe "Data Explorer | Manage Reports footer hint" dolet(:hint) { PageObjects::Components::AdminDashboardManageReportsHint.new }before do- SiteSetting.dashboard_improvements = trueSiteSetting.data_explorer_enabled = trueAdminDashboardSectionConfiguration.update([diff --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 3d867803d45..f4c02d19ade 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@@ -9,7 +9,6 @@ describe "Data Explorer | Add query to admin dashboard" dolet(:toasts) { PageObjects::Components::Toasts.new }before do- SiteSetting.dashboard_improvements = trueSiteSetting.data_explorer_enabled = trueSiteSetting.data_explorer_ai_queries_enabled = falseAdminDashboardSectionConfiguration.update(diff --git a/plugins/discourse-solved/spec/system/admin_dashboard_support_section_spec.rb b/plugins/discourse-solved/spec/system/admin_dashboard_support_section_spec.rbindex 8b55025aa3f..5a3c3567c6a 100644--- a/plugins/discourse-solved/spec/system/admin_dashboard_support_section_spec.rb+++ b/plugins/discourse-solved/spec/system/admin_dashboard_support_section_spec.rb@@ -12,7 +12,6 @@ describe "Admin dashboard Support section" dobefore doSiteSetting.solved_enabled = true- SiteSetting.dashboard_improvements = true# Resolved: staff makes the first reply, which is accepted as the solution.resolved = Fabricate(:topic, category: support_category, user: author)diff --git a/plugins/discourse-user-notes/admin/assets/javascripts/discourse/connectors/admin-dashboard-moderation-bottom/recent-user-notes-report-table.gjs b/plugins/discourse-user-notes/admin/assets/javascripts/discourse/connectors/admin-dashboard-moderation-bottom/recent-user-notes-report-table.gjsdeleted file mode 100644index f8fe76dc1b4..00000000000--- a/plugins/discourse-user-notes/admin/assets/javascripts/discourse/connectors/admin-dashboard-moderation-bottom/recent-user-notes-report-table.gjs+++ /dev/null@@ -1,17 +0,0 @@-import Component from "@glimmer/component";-import { service } from "@ember/service";-import AdminReport from "discourse/admin/components/admin-report";--export default class RecentUserNotesReportTable extends Component {- @service siteSettings;-- <template>- <div- class="admin-dashboard-moderation-bottom-outlet recent-user-notes-report-table"- >- {{#if this.siteSettings.user_notes_enabled}}- <AdminReport @dataSourceName="user_notes" @filters={{@filters}} />- {{/if}}- </div>- </template>-}diff --git a/spec/jobs/scheduled/warm_dashboard_reports_spec.rb b/spec/jobs/scheduled/warm_dashboard_reports_spec.rbindex 436e95e347f..470088ce276 100644--- a/spec/jobs/scheduled/warm_dashboard_reports_spec.rb+++ b/spec/jobs/scheduled/warm_dashboard_reports_spec.rb@@ -5,7 +5,6 @@ RSpec.describe Jobs::WarmDashboardReports dobefore doDiscourse.cache.clear- SiteSetting.dashboard_improvements = trueadmin.update!(last_seen_at: 1.hour.ago)enddiff --git a/spec/models/admin_dashboard_data_spec.rb b/spec/models/admin_dashboard_data_spec.rbdeleted file mode 100644index 4a26f3ddca0..00000000000--- a/spec/models/admin_dashboard_data_spec.rb+++ /dev/null@@ -1,9 +0,0 @@-# frozen_string_literal: true--RSpec.describe AdminDashboardData do- after { Discourse.redis.flushdb }-- describe "stats cache" do- include_examples "stats cacheable"- end-enddiff --git a/spec/requests/admin/dashboard_controller_spec.rb b/spec/requests/admin/dashboard_controller_spec.rbindex 21b3e03397b..f970da9d571 100644--- a/spec/requests/admin/dashboard_controller_spec.rb+++ b/spec/requests/admin/dashboard_controller_spec.rb@@ -5,10 +5,7 @@ RSpec.describe Admin::DashboardController dofab!(:moderator)fab!(:user)- before do- AdminDashboardData.stubs(:fetch_cached_stats).returns(reports: [])- Jobs::CallDiscourseHub.any_instance.stubs(:execute).returns(true)- end+ before { Jobs::CallDiscourseHub.any_instance.stubs(:execute).returns(true) }def configure_dashboard_sections(visible_ids)hidden = AdminDashboardSectionConfiguration::KNOWN_SECTIONS - visible_ids@@ -62,7 +59,6 @@ RSpec.describe Admin::DashboardController dodescribe "sections payload" dobefore do- SiteSetting.dashboard_improvements = trueDiscourse.cache.clearsign_in(admin)end@@ -232,11 +228,6 @@ RSpec.describe Admin::DashboardController donormalized_referrer = "sensitive-referrer.example"entry_url = "/sensitive-entry"event_date = Time.zone.local(2026, 5, 2, 12)- UpcomingChangeEvent.create!(- upcoming_change_name: "dashboard_improvements",- event_type: :manual_opt_in,- created_at: Time.zone.local(2026, 5, 1, 9),- )2.times doFabricate(@@ -471,10 +462,7 @@ RSpec.describe Admin::DashboardController doenddescribe "problems payload" do- before do- SiteSetting.dashboard_improvements = true- Discourse.cache.clear- end+ before { Discourse.cache.clear }fab!(:starttls_problem) doFabricate(:admin_notice, identifier: "starttls_disabled", priority: "high")@@ -534,10 +522,7 @@ RSpec.describe Admin::DashboardController doenddescribe "configuration payload" do- before do- SiteSetting.dashboard_improvements = true- Discourse.cache.clear- end+ before { Discourse.cache.clear }it "is included for admins and lists every known section with a visibility flag" doconfigure_dashboard_sections(%w[highlights reports])@@ -593,8 +578,6 @@ RSpec.describe Admin::DashboardController doenddescribe "#update_configuration" do- before { SiteSetting.dashboard_improvements = true }-it "persists the configuration and returns 204 for admins" dosign_in(admin)@@ -715,8 +698,6 @@ RSpec.describe Admin::DashboardController dofab!(:category_2, :category)fab!(:category_3, :category)- before { SiteSetting.dashboard_improvements = true }-after doDiscoursePluginRegistry._raw_admin_dashboard_sections.reject! do |entry|entry[:value][:id] == "support"@@ -1322,7 +1303,6 @@ RSpec.describe Admin::DashboardController dobefore dofreeze_time(Time.zone.local(2026, 5, 14, 12, 0, 0))- SiteSetting.dashboard_improvements = trueSiteSetting.improved_crawler_detection = trueSiteSetting.use_legacy_pageviews = falseDiscourse.stubs(:current_hostname).returns("test.localhost")diff --git a/spec/services/topic_timestamp_changer_spec.rb b/spec/services/topic_timestamp_changer_spec.rbindex 1fce728244a..194ef1ce6f8 100644--- a/spec/services/topic_timestamp_changer_spec.rb+++ b/spec/services/topic_timestamp_changer_spec.rb@@ -57,12 +57,10 @@ RSpec.describe TopicTimestampChanger doendit "deletes the stats cache" do- Discourse.redis.set AdminDashboardData.stats_cache_key, "X"Discourse.redis.set About.stats_cache_key, "X"TopicTimestampChanger.new(topic: topic, timestamp: Time.zone.now.to_f).change!- expect(Discourse.redis.get(AdminDashboardData.stats_cache_key)).to eq(nil)expect(Discourse.redis.get(About.stats_cache_key)).to eq(nil)endenddiff --git a/spec/system/admin_dashboard_configure_spec.rb b/spec/system/admin_dashboard_configure_spec.rbindex e26464fd43e..049c02268a8 100644--- a/spec/system/admin_dashboard_configure_spec.rb+++ b/spec/system/admin_dashboard_configure_spec.rb@@ -6,8 +6,6 @@ describe "Admin Dashboard Configure menu" dolet(:dashboard) { PageObjects::Pages::AdminDashboard.new }- before { SiteSetting.dashboard_improvements = true }-context "as an admin" dobefore { sign_in(admin) }diff --git a/spec/system/admin_dashboard_redesign/engagement_section_spec.rb b/spec/system/admin_dashboard_redesign/engagement_section_spec.rbindex 86fc426fe00..c62bf5c18d1 100644--- a/spec/system/admin_dashboard_redesign/engagement_section_spec.rb+++ b/spec/system/admin_dashboard_redesign/engagement_section_spec.rb@@ -16,7 +16,6 @@ describe "Admin Dashboard Redesign | Engagement section" dolet(:engagement) { dashboard.engagement }before do- SiteSetting.dashboard_improvements = trueAdminDashboardSectionConfiguration.update([{ id: "engagement", visible: true },diff --git a/spec/system/admin_dashboard_redesign/reports_section_spec.rb b/spec/system/admin_dashboard_redesign/reports_section_spec.rbindex 592f4237683..5662bcac591 100644--- a/spec/system/admin_dashboard_redesign/reports_section_spec.rb+++ b/spec/system/admin_dashboard_redesign/reports_section_spec.rb@@ -12,7 +12,6 @@ describe "Admin Dashboard Redesign | Reports section" doendbefore do- SiteSetting.dashboard_improvements = trueAdminDashboardSectionConfiguration.update([{ id: "reports", visible: true },diff --git a/spec/system/admin_dashboard_redesign/search_section_spec.rb b/spec/system/admin_dashboard_redesign/search_section_spec.rbindex ed283a60d20..9e5d4081ad2 100644--- a/spec/system/admin_dashboard_redesign/search_section_spec.rb+++ b/spec/system/admin_dashboard_redesign/search_section_spec.rb@@ -8,7 +8,6 @@ describe "Admin Dashboard Redesign | Search section" dolet(:dashboard) { PageObjects::Pages::AdminDashboard.new }before do- SiteSetting.dashboard_improvements = trueSiteSetting.improved_crawler_detection = trueAdminDashboardSectionConfiguration.update([diff --git a/spec/system/admin_dashboard_redesign/site_advice_section_spec.rb b/spec/system/admin_dashboard_redesign/site_advice_section_spec.rbindex b5a2954d9b1..a343a341b31 100644--- a/spec/system/admin_dashboard_redesign/site_advice_section_spec.rb+++ b/spec/system/admin_dashboard_redesign/site_advice_section_spec.rb@@ -3,8 +3,6 @@describe "Admin Dashboard Redesign | Site Advice section" dolet(:dashboard) { PageObjects::Pages::AdminDashboard.new }- before { SiteSetting.dashboard_improvements = true }-context "when signed in as an admin" dofab!(:current_user, :admin)diff --git a/spec/system/admin_dashboard_redesign/site_traffic_explorer_spec.rb b/spec/system/admin_dashboard_redesign/site_traffic_explorer_spec.rbindex 79bd0bde2af..f0cf9e2879b 100644--- a/spec/system/admin_dashboard_redesign/site_traffic_explorer_spec.rb+++ b/spec/system/admin_dashboard_redesign/site_traffic_explorer_spec.rb@@ -6,7 +6,6 @@ RSpec.describe "Admin Dashboard Redesign | Site Traffic Explorer" dolet(:traffic) { PageObjects::Pages::AdminSiteTrafficExplorer.new }before do- SiteSetting.dashboard_improvements = trueSiteSetting.improved_crawler_detection = trueSiteSetting.use_legacy_pageviews = falseDiscourse.stubs(:current_hostname).returns("test.localhost")diff --git a/spec/system/admin_dashboard_redesign/site_traffic_section_spec.rb b/spec/system/admin_dashboard_redesign/site_traffic_section_spec.rbindex e3a764c49b1..90809a086c7 100644--- a/spec/system/admin_dashboard_redesign/site_traffic_section_spec.rb+++ b/spec/system/admin_dashboard_redesign/site_traffic_section_spec.rb@@ -7,7 +7,6 @@ describe "Admin Dashboard Redesign | Site Traffic section" dolet(:dashboard) { PageObjects::Pages::AdminDashboard.new }before do- SiteSetting.dashboard_improvements = trueAdminDashboardSectionConfiguration.update([{ id: "traffic", visible: true },@@ -177,11 +176,6 @@ describe "Admin Dashboard Redesign | Site Traffic section" docontext "with top countries, top referrers, and top entry URLs cards" dobefore do- UpcomingChangeEvent.create!(- upcoming_change_name: "dashboard_improvements",- event_type: :manual_opt_in,- created_at: Time.zone.local(2026, 4, 30, 9),- )Discourse.stubs(:current_hostname).returns("test.localhost")Discourse.cache.clearenddiff --git a/spec/system/admin_dashboard_redesign_spec.rb b/spec/system/admin_dashboard_redesign_spec.rbindex 2a455c41a0b..b835222de13 100644--- a/spec/system/admin_dashboard_redesign_spec.rb+++ b/spec/system/admin_dashboard_redesign_spec.rb@@ -7,10 +7,7 @@ describe "Admin Dashboard Redesign" dolet(:dashboard_reports) { PageObjects::Pages::AdminDashboardReports.new }let(:admin_report) { PageObjects::Pages::AdminReport.new }- before do- SiteSetting.dashboard_improvements = true- sign_in(current_user)- end+ before { sign_in(current_user) }it "allows a user to use a preset range or select a custom range",time: Time.utc(2026, 5, 26, 12, 0, 0) dodiff --git a/spec/system/detect_human_activity_spec.rb b/spec/system/detect_human_activity_spec.rbindex 3ebb67110c0..57043b8f4b9 100644--- a/spec/system/detect_human_activity_spec.rb+++ b/spec/system/detect_human_activity_spec.rb@@ -4,8 +4,6 @@ describe "Detect human activity" dofab!(:topics) { Fabricate.times(5, :post).map(&:topic) }let(:discovery) { PageObjects::Pages::Discovery.new }- before { SiteSetting.dashboard_improvements = true }-def flush_engagementpage.driver.with_playwright_page do |pw_page|pw_page.evaluate("window.dispatchEvent(new Event('pagehide'))")diff --git a/spec/system/page_objects/pages/admin_dashboard.rb b/spec/system/page_objects/pages/admin_dashboard.rbindex 81d5d4a2776..80ce2ddf088 100644--- a/spec/system/page_objects/pages/admin_dashboard.rb+++ b/spec/system/page_objects/pages/admin_dashboard.rb@@ -252,7 +252,6 @@ module PageObjectsenddef ensure_redesigned_dashboard- page.refresh unless has_css?(".db-main", wait: 0)has_css?(".db-main [data-section-id], .db-main__empty")selfenddiff --git a/spec/system/reordering_screenshots_spec.rb b/spec/system/reordering_screenshots_spec.rbindex 82c207dd5e4..874ac6949ad 100644--- a/spec/system/reordering_screenshots_spec.rb+++ b/spec/system/reordering_screenshots_spec.rb@@ -23,10 +23,7 @@ describe "Reordering surfaces" dolet(:section_modal) { PageObjects::Modals::SidebarSectionForm.new }let(:sidebar) { PageObjects::Components::NavigationMenu::Sidebar.new }- before do- SiteSetting.dashboard_improvements = true- sign_in(admin)- end+ before { sign_in(admin) }[false, true].each do |enabled|suffix = enabled ? "on" : "off"