Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DEV: Update for glimmer topic list #66

Merged
merged 1 commit into from
Jan 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .discourse-compatibility
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
< 3.4.0.beta4-dev: a5ff3374335f17b46654c4ae1e5be7b539c2da1a
< 3.4.0.beta1-dev: 93551f55d6e9f8d688f1f9dc0b6a2f14eb08b603
< 3.3.0.beta1-dev: 85dc24d6b58d1b16e6d225ae710633dc20c34d08
3.1.999: 1e5882a1541b932f9512f6a7d667b333c1708f53
18 changes: 14 additions & 4 deletions javascripts/discourse/initializers/init-topic-excerpts.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
import { apiInitializer } from "discourse/lib/api";
import { withSilencedDeprecations } from "discourse-common/lib/deprecated";

export default apiInitializer("0.8", (api) => {
api.modifyClass("component:topic-list-item", {
pluginId: "discourse-air",
expandPinned: true,
});
const transformerExists = api.registerValueTransformer(
"topic-list-item-expand-pinned",
() => true
);

if (!transformerExists) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Transformer was only introduced a couple of days ago, and there hasn't been a version bump since, so the d-compat entry won't work for every case. Adding some conditional logic which falls-back to the modifyClass instead.

withSilencedDeprecations is mostly included for grep-ability when we come to clean up themes/plugins after the topic-list conversion is complete.

withSilencedDeprecations("discourse.hbr-topic-list-overrides", () => {
api.modifyClass("component:topic-list-item", {
pluginId: "discourse-air",
expandPinned: true,
});
});
}
});
Loading