WIP: combobox options
This commit is contained in:
parent
9c07599fc0
commit
83c6bbbf3f
|
@ -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() {
|
||||||
|
|
|
@ -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
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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 [];
|
||||||
|
|
Loading…
Reference in New Issue