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); super(...arguments);
const topicAssignment = { const topicAssignment = {
type: "Topic", type: "Topic",
username: "", username: this.topic.assigned_to_user?.username,
group_name: "", group_name: this.topic.assigned_to_group?.name,
status: "", status: this.topic.assignment_status,
note: "" note: this.topic.assignment_note
}; };
this.assignments.push(topicAssignment); 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() { get title() {

View File

@ -24,7 +24,10 @@ export default class TopicAssignments extends Component {
if (assignment.type === "Topic") { if (assignment.type === "Topic") {
return { id: this.TOPIC_ID, name: "Topic" }; return { id: this.TOPIC_ID, name: "Topic" };
} else { } 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()]; return [...map.values()];
}, },
// fixme andrei rename to postAssignment()
assignedPosts() { assignedPosts() {
if (!this.indirectly_assigned_to) { if (!this.indirectly_assigned_to) {
return []; return [];