FIX: Auto-populate group field in invite modal on group route (#25431)
This commit is contained in:
parent
76647d3a34
commit
19b86e7ea2
|
@ -35,7 +35,9 @@ export default DiscourseRoute.extend({
|
||||||
@action
|
@action
|
||||||
showInviteModal() {
|
showInviteModal() {
|
||||||
const group = this.modelFor("group");
|
const group = this.modelFor("group");
|
||||||
this.modal.show(CreateInvite, { model: { groupIds: [group.id] } });
|
this.modal.show(CreateInvite, {
|
||||||
|
model: { invite: { groupIds: [group.id] } },
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
@action
|
@action
|
||||||
|
|
|
@ -255,6 +255,11 @@ acceptance(
|
||||||
automatic: false,
|
automatic: false,
|
||||||
name: "Macdonald",
|
name: "Macdonald",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
id: 47, // must match group-fixtures.js because lookup is by ID
|
||||||
|
automatic: false,
|
||||||
|
name: "Discourse",
|
||||||
|
},
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -271,5 +276,11 @@ acceptance(
|
||||||
assert.dom(".invite-to-groups .formatted-selection").hasText("Macdonald");
|
assert.dom(".invite-to-groups .formatted-selection").hasText("Macdonald");
|
||||||
assert.dom("#invite-email").hasValue("cat.com");
|
assert.dom("#invite-email").hasValue("cat.com");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test("shows correct saved data in group invite form", async function (assert) {
|
||||||
|
await visit("/g/discourse");
|
||||||
|
await click(".group-members-invite");
|
||||||
|
assert.dom(".invite-to-groups .formatted-selection").hasText("Discourse");
|
||||||
|
});
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue