FEATURE: Show error if invite to topic is invalid (#15959)
This can happen if the topic to which a user is invited is in a private category and the user was not invited to one of the groups that can see that specific category. This used to be a warning and this commit makes it an error.
This commit is contained in:
@@ -121,7 +121,7 @@ export default Controller.extend(
|
||||
|
||||
return this.invite
|
||||
.save(data)
|
||||
.then((result) => {
|
||||
.then(() => {
|
||||
this.rollbackBuffer();
|
||||
|
||||
if (
|
||||
@@ -131,22 +131,14 @@ export default Controller.extend(
|
||||
this.invites.unshiftObject(this.invite);
|
||||
}
|
||||
|
||||
if (result.warnings) {
|
||||
if (this.isEmail && opts.sendEmail) {
|
||||
this.send("closeModal");
|
||||
} else {
|
||||
this.setProperties({
|
||||
flashText: sanitize(result.warnings.join(",")),
|
||||
flashClass: "warning",
|
||||
flashText: sanitize(I18n.t("user.invited.invite.invite_saved")),
|
||||
flashClass: "success",
|
||||
flashLink: !this.editing,
|
||||
});
|
||||
} else {
|
||||
if (this.isEmail && opts.sendEmail) {
|
||||
this.send("closeModal");
|
||||
} else {
|
||||
this.setProperties({
|
||||
flashText: sanitize(I18n.t("user.invited.invite.invite_saved")),
|
||||
flashClass: "success",
|
||||
flashLink: !this.editing,
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
.catch((e) =>
|
||||
|
||||
@@ -105,7 +105,10 @@ export default Controller.extend(
|
||||
inviteUsers() {
|
||||
this.set("showNotifyUsers", false);
|
||||
const controller = showModal("create-invite");
|
||||
controller.set("inviteToTopic", true);
|
||||
controller.setProperties({
|
||||
inviteToTopic: true,
|
||||
topics: [this.topic],
|
||||
});
|
||||
controller.buffered.setProperties({
|
||||
topicId: this.topic.id,
|
||||
topicTitle: this.topic.title,
|
||||
|
||||
Reference in New Issue
Block a user