WIP: combobox options

This commit is contained in:
Andrei Prigorshnev 2024-04-02 20:46:44 +04:00
parent caea32de44
commit 862b44fea9
No known key found for this signature in database
GPG Key ID: 185E0A5F45783902
2 changed files with 10 additions and 2 deletions

View File

@ -12,6 +12,7 @@ export default class EditTopicAssignments extends Component {
constructor() {
super(...arguments);
const topicAssignment = {
type: "Topic",
username: "",
group_name: "",
status: "",

View File

@ -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;
}
}
}