diff --git a/assets/javascripts/discourse/components/modal/edit-topic-assignments.js b/assets/javascripts/discourse/components/modal/edit-topic-assignments.js index 206283a..eae6f98 100644 --- a/assets/javascripts/discourse/components/modal/edit-topic-assignments.js +++ b/assets/javascripts/discourse/components/modal/edit-topic-assignments.js @@ -12,6 +12,7 @@ export default class EditTopicAssignments extends Component { constructor() { super(...arguments); const topicAssignment = { + type: "Topic", username: "", group_name: "", status: "", diff --git a/assets/javascripts/discourse/components/topic-assignments.js b/assets/javascripts/discourse/components/topic-assignments.js index c30fe1c..59c858c 100644 --- a/assets/javascripts/discourse/components/topic-assignments.js +++ b/assets/javascripts/discourse/components/topic-assignments.js @@ -12,7 +12,14 @@ export default class TopicAssignments extends Component { } get assignmentOptions() { - const topicAssignment = { id: this.TOPIC_ID, name: "Topic" }; - return [topicAssignment]; + return this.args.assignments.map((a) => this.#toComboBoxOption(a)); + } + + #toComboBoxOption(assignment) { + if (assignment.type === "Topic") { + return { id: this.TOPIC_ID, name: "Topic" }; + } else { + return null; + } } }