diff --git a/assets/javascripts/discourse/connectors/topic-list-after-columns/assign-buttons.hbr b/assets/javascripts/discourse/connectors/topic-list-after-columns/assign-buttons.hbr index a0ec055b..30e24be0 100644 --- a/assets/javascripts/discourse/connectors/topic-list-after-columns/assign-buttons.hbr +++ b/assets/javascripts/discourse/connectors/topic-list-after-columns/assign-buttons.hbr @@ -1 +1 @@ -{{raw "assign-topic-buttons" topic=context.topic}} \ No newline at end of file +{{!-- has-modern-replacement --}}{{raw "assign-topic-buttons" topic=context.topic}} \ No newline at end of file diff --git a/assets/javascripts/discourse/initializers/assignment-list-actions.gjs b/assets/javascripts/discourse/initializers/assignment-list-actions.gjs new file mode 100644 index 00000000..cd601bdc --- /dev/null +++ b/assets/javascripts/discourse/initializers/assignment-list-actions.gjs @@ -0,0 +1,34 @@ +import { withPluginApi } from "discourse/lib/plugin-api"; +import AssignedTopicListColumn from "../components/assigned-topic-list-column"; + +const ASSIGN_LIST_ROUTES = ["userActivity.assigned", "group.assigned.show"]; + +const AssignActionsCell = ; + +export default { + name: "assignment-list-dropdowns", + + initialize(container) { + const router = container.lookup("service:router"); + + withPluginApi("1.39.0", (api) => { + api.registerValueTransformer( + "topic-list-columns", + ({ value: columns }) => { + if (ASSIGN_LIST_ROUTES.includes(router.currentRouteName)) { + columns.add("assign-actions", { + item: AssignActionsCell, + after: "activity", + }); + } + + return columns; + } + ); + }); + }, +}; diff --git a/assets/javascripts/discourse/raw-templates/assign-topic-buttons.hbr b/assets/javascripts/discourse/raw-templates/assign-topic-buttons.hbr index 82b20e11..dfae14d6 100644 --- a/assets/javascripts/discourse/raw-templates/assign-topic-buttons.hbr +++ b/assets/javascripts/discourse/raw-templates/assign-topic-buttons.hbr @@ -1 +1 @@ -{{{view.html}}} \ No newline at end of file +{{!-- has-modern-replacement --}}{{{view.html}}} \ No newline at end of file