DEV: Use the new topic-list APIs (#622)
This commit is contained in:
parent
568efb4f27
commit
471cfdff63
|
@ -1 +1 @@
|
||||||
{{raw "assign-topic-buttons" topic=context.topic}}
|
{{!-- has-modern-replacement --}}{{raw "assign-topic-buttons" topic=context.topic}}
|
|
@ -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 = <template>
|
||||||
|
<td class="assign-topic-buttons">
|
||||||
|
<AssignedTopicListColumn @topic={{@topic}} />
|
||||||
|
</td>
|
||||||
|
</template>;
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
};
|
|
@ -1 +1 @@
|
||||||
{{{view.html}}}
|
{{!-- has-modern-replacement --}}{{{view.html}}}
|
Loading…
Reference in New Issue