Skip to content

A platform for community discussion. Free, open, simple.

DEV: Add a fake upcoming change (#35956)

Martin Brennand9d41d1d60b7
diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml
index c8d81a94925..30838a34977 100644
--- a/config/locales/client.en.yml
+++ b/config/locales/client.en.yml
@@ -1459,6 +1459,8 @@ en:
new_private_message: "New Message"
private_message: "Message"
private_messages: "Messages"
+ upcoming_changes:
+ title: "Upcoming change enabled"
user_notifications:
filters:
filter_by: "Filter By"
diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml
index 80005e3f52d..8a6d94e1e26 100644
--- a/config/locales/server.en.yml
+++ b/config/locales/server.en.yml
@@ -2772,6 +2772,7 @@ en:
content_localization_allowed_groups: "Groups allowed to update localized content. Requires 'content localization enabled'."
content_localization_language_switcher: "Show a language switcher in the header, allowing visitors to switch between translated versions of Discourse and user-contributed content. Uses languages defined in 'content localization supported locales'"
enable_upcoming_changes: "Enable upcoming changes"
+ fake_upcoming_change: "This is a fake upcoming change for testing purposes. No need to translate this string."
errors:
diff --git a/config/site_settings.yml b/config/site_settings.yml
index 276a15a77c3..caf4731595c 100644
--- a/config/site_settings.yml
+++ b/config/site_settings.yml
@@ -4278,3 +4278,12 @@ experimental:
default: false
hidden: true
client: true
+ fake_upcoming_change:
+ default: false
+ hidden: true
+ client: true
+ upcoming_change:
+ status: "alpha"
+ impact: "other,all_members"
+ learn_more_url: "https://meta.discourse.org"
+
diff --git a/frontend/discourse/app/controllers/discovery/list.js b/frontend/discourse/app/controllers/discovery/list.js
index 025bdcb80fa..41812da366a 100644
--- a/frontend/discourse/app/controllers/discovery/list.js
+++ b/frontend/discourse/app/controllers/discovery/list.js
@@ -67,6 +67,14 @@ export default class DiscoveryListController extends Controller {
}
}
+ // NOTE: (martin) Please keep this in tact for now, will remove once we have
+ // some actual upcoming changes to use.
+ //
+ // TODO (martin) (upcoming-changes) Remove this once we have actual upcoming changes to use.
+ get showFakeUpcomingChange() {
+ return this.siteSettings.fake_upcoming_change;
+ }
+
get canBulkSelect() {
return (
this.currentUser?.canManageTopic ||
diff --git a/frontend/discourse/app/templates/discovery/list.gjs b/frontend/discourse/app/templates/discovery/list.gjs
index 57bd95d0d1a..3e86fcda6a5 100644
--- a/frontend/discourse/app/templates/discovery/list.gjs
+++ b/frontend/discourse/app/templates/discovery/list.gjs
@@ -4,6 +4,7 @@ import Layout from "discourse/components/discovery/layout";
import Navigation from "discourse/components/discovery/navigation";
import Topics from "discourse/components/discovery/topics";
import TagInfo from "discourse/components/tag-info";
+import { i18n } from "discourse-i18n";
export default <template>
<Layout
@@ -51,6 +52,10 @@ export default <template>
</:header>
<:list>
+ {{#if @controller.showFakeUpcomingChange}}
+ {{i18n "user.upcoming_changes.title"}}
+ {{/if}}
+
<Topics
@period={{@controller.model.list.for_period}}
@changePeriod={{@controller.changePeriod}}