DEV: Add deprecations for topic-status raw-view modifications (#30496)

This will make the 'auto' glimmer-topic-list feature aware of these modifications, so that the new topic-list will not be enabled until they're resolved.
This commit is contained in:
David Taylor 2024-12-30 11:35:23 +00:00 committed by GitHub
parent 9c83872a4e
commit bf35f7f860
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 31 additions and 4 deletions

View File

@ -302,10 +302,11 @@ class PluginApi {
modifyClass(resolverName, changes, opts) {
if (
resolverName === "component:topic-list" ||
resolverName === "component:topic-list-item"
resolverName === "component:topic-list-item" ||
resolverName === "raw-view:topic-status"
) {
deprecated(
"Modifying topic-list and topic-list-item with `modifyClass` is deprecated. Use the value transformer `topic-list-columns` and other new topic-list plugin APIs instead.",
`Modifying '${resolverName}' with 'modifyClass' is deprecated. Use the value transformer 'topic-list-columns' and other new topic-list plugin APIs instead.`,
{
since: "v3.4.0.beta3-dev",
id: "discourse.hbr-topic-list-overrides",
@ -352,10 +353,11 @@ class PluginApi {
modifyClassStatic(resolverName, changes, opts) {
if (
resolverName === "component:topic-list" ||
resolverName === "component:topic-list-item"
resolverName === "component:topic-list-item" ||
resolverName === "raw-view:topic-status"
) {
deprecated(
"Modifying topic-list and topic-list-item with `modifyClassStatic` is deprecated. Use the value transformer `topic-list-columns` and other new topic-list plugin APIs instead.",
`Modifying '${resolverName}' with 'modifyClass' is deprecated. Use the value transformer 'topic-list-columns' and other new topic-list plugin APIs instead.`,
{
since: "v3.4.0.beta3-dev",
id: "discourse.hbr-topic-list-overrides",

View File

@ -1,8 +1,33 @@
import EmberObject from "@ember/object";
import deprecated from "discourse-common/lib/deprecated";
import discourseComputed from "discourse-common/utils/decorators";
import { i18n } from "discourse-i18n";
export default class TopicStatus extends EmberObject {
static reopen() {
deprecated(
"Modifying raw-view:topic-status with `reopen` is deprecated. Use the value transformer `topic-list-columns` and other new topic-list plugin APIs instead.",
{
since: "v3.4.0.beta3-dev",
id: "discourse.hbr-topic-list-overrides",
}
);
return super.reopen(...arguments);
}
static reopenClass() {
deprecated(
"Modifying raw-view:topic-status with `reopenClass` is deprecated. Use the value transformer `topic-list-columns` and other new topic-list plugin APIs instead.",
{
since: "v3.4.0.beta3-dev",
id: "discourse.hbr-topic-list-overrides",
}
);
return super.reopenClass(...arguments);
}
showDefault = null;
@discourseComputed("defaultIcon")