WIP: Reassigning posts from the modal

This commit is contained in:
Andrei Prigorshnev 2024-03-29 23:41:25 +04:00
parent a2db458312
commit cf0861d8c8
No known key found for this signature in database
GPG Key ID: 185E0A5F45783902
2 changed files with 14 additions and 4 deletions

View File

@ -18,6 +18,7 @@ export default class AssignUserForm extends Component {
this.args.formApi.submit = this.assign; this.args.formApi.submit = this.assign;
this.selectedTargetId = this.TOPIC_ID; this.selectedTargetId = this.TOPIC_ID;
this.args.model.updatedPostAssignments = new Map();
} }
get assignments() { get assignments() {
@ -81,12 +82,20 @@ export default class AssignUserForm extends Component {
this.assigneeName = name; this.assigneeName = name;
this.assigneeError = false; this.assigneeError = false;
let username, groupName;
if (this.taskActions.allowedGroupsForAssignment.includes(name)) { if (this.taskActions.allowedGroupsForAssignment.includes(name)) {
this.args.model.username = null; username = null;
this.args.model.group_name = name; groupName = name;
} else { } else {
this.args.model.username = name; username = name;
this.args.model.group_name = null; groupName = null;
}
this.args.model.username = username;
this.args.model.group_name = groupName;
if (this.editingTopicAssignments) {
// fixme andrei implement
} }
} }

View File

@ -32,6 +32,7 @@ export default class AssignUser extends Component {
@action @action
async onSubmit() { async onSubmit() {
console.log("this.model.updatedPostAssignments", this.model.updatedPostAssignments);
this.args.closeModal(); this.args.closeModal();
await this.taskActions.assign(this.model); await this.taskActions.assign(this.model);
} }