DEV: Remove legacy topic-list code (#362)

This commit is contained in:
David Taylor 2025-04-14 14:38:48 +01:00 committed by GitHub
parent 4f0234f5be
commit ae01ad30c3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 1 additions and 53 deletions

View File

@ -1,3 +1,4 @@
< 3.5.0.beta3-dev: 4f0234f5be3aaa77db277e0f224cd9750d2713cd
< 3.5.0.beta2-dev: e82c6ae1ca38ccebb34669148f8de93a3028906e
< 3.5.0.beta1-dev: 5450a5ef4e2ae35185320fc6af9678621026e148
< 3.4.0.beta4-dev: 3f724bf3114cc7877fa757bc8035f13a7390c739

View File

@ -1,6 +1,4 @@
import { computed } from "@ember/object";
import discourseComputed from "discourse/lib/decorators";
import { withSilencedDeprecations } from "discourse/lib/deprecated";
import { iconHTML } from "discourse/lib/icon-library";
import { withPluginApi } from "discourse/lib/plugin-api";
import { formatUsername } from "discourse/lib/utilities";
@ -156,57 +154,6 @@ export default {
}),
});
withPluginApi("2.0.0", (api) => {
withSilencedDeprecations("discourse.hbr-topic-list-overrides", () => {
let topicStatusIcons;
try {
topicStatusIcons =
require("discourse/helpers/topic-status-icons").default;
} catch {}
topicStatusIcons?.addObject([
"has_accepted_answer",
"far-square-check",
"solved",
]);
api.modifyClass(
"raw-view:topic-status",
(Superclass) =>
class extends Superclass {
@discourseComputed(
"topic.{has_accepted_answer,accepted_answer,can_have_answer}"
)
statuses() {
const results = super.statuses;
if (
this.topic.has_accepted_answer ||
this.topic.accepted_answer
) {
results.push({
openTag: "span",
closeTag: "span",
title: i18n("topic_statuses.solved.help"),
icon: "far-square-check",
key: "solved",
});
} else if (this.topic.can_have_answer) {
results.push({
openTag: "span",
closeTag: "span",
title: i18n("solved.has_no_accepted_answer"),
icon: "far-square",
});
}
return results;
}
}
);
});
});
withPluginApi("1.34.0", initializeWithApi);
withPluginApi("0.8.10", (api) => {