WIP: combobox options

This commit is contained in:
Andrei Prigorshnev 2024-04-03 01:08:42 +04:00
parent 9c07599fc0
commit 83c6bbbf3f
No known key found for this signature in database
GPG Key ID: 185E0A5F45783902
3 changed files with 20 additions and 5 deletions

View File

@ -13,12 +13,23 @@ export default class EditTopicAssignments extends Component {
super(...arguments);
const topicAssignment = {
type: "Topic",
username: "",
group_name: "",
status: "",
note: ""
username: this.topic.assigned_to_user?.username,
group_name: this.topic.assigned_to_group?.name,
status: this.topic.assignment_status,
note: this.topic.assignment_note
};
this.assignments.push(topicAssignment);
this.topic.assignedPosts().forEach((a) => {
this.assignments.push({
type: "Post",
post_number: a.post_number,
username: a.username,
group_name: a.name,
status: a.assignment_status,
note: a.assignment_note,
});
});
}
get title() {

View File

@ -24,7 +24,10 @@ export default class TopicAssignments extends Component {
if (assignment.type === "Topic") {
return { id: this.TOPIC_ID, name: "Topic" };
} else {
return null;
return {
id: assignment.post_number,
name: `Post #${assignment.post_number}`, // fixme andrei string
};
}
}
}

View File

@ -61,6 +61,7 @@ function extendTopicModel(api) {
return [...map.values()];
},
// fixme andrei rename to postAssignment()
assignedPosts() {
if (!this.indirectly_assigned_to) {
return [];