Skip to content
This repository was archived by the owner on Jul 14, 2025. It is now read-only.

Commit 471cfdf

Browse files
authored
DEV: Use the new topic-list APIs (#622)
1 parent 568efb4 commit 471cfdf

File tree

3 files changed

+36
-2
lines changed

3 files changed

+36
-2
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{{raw "assign-topic-buttons" topic=context.topic}}
1+
{{!-- has-modern-replacement --}}{{raw "assign-topic-buttons" topic=context.topic}}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import { withPluginApi } from "discourse/lib/plugin-api";
2+
import AssignedTopicListColumn from "../components/assigned-topic-list-column";
3+
4+
const ASSIGN_LIST_ROUTES = ["userActivity.assigned", "group.assigned.show"];
5+
6+
const AssignActionsCell = <template>
7+
<td class="assign-topic-buttons">
8+
<AssignedTopicListColumn @topic={{@topic}} />
9+
</td>
10+
</template>;
11+
12+
export default {
13+
name: "assignment-list-dropdowns",
14+
15+
initialize(container) {
16+
const router = container.lookup("service:router");
17+
18+
withPluginApi("1.39.0", (api) => {
19+
api.registerValueTransformer(
20+
"topic-list-columns",
21+
({ value: columns }) => {
22+
if (ASSIGN_LIST_ROUTES.includes(router.currentRouteName)) {
23+
columns.add("assign-actions", {
24+
item: AssignActionsCell,
25+
after: "activity",
26+
});
27+
}
28+
29+
return columns;
30+
}
31+
);
32+
});
33+
},
34+
};
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{{{view.html}}}
1+
{{!-- has-modern-replacement --}}{{{view.html}}}

0 commit comments

Comments
 (0)