mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 22:43:33 +08:00
DEV: Allow HTML in grant admin dialog (#20133)
In a private plugin, we need to show an error message containing HTML when the Grant Admin action fails. This change introduces a new flag (`html_message: true`) that when used will allow the dialog to render the HTML tags in the error message correctly.
This commit is contained in:
@ -232,7 +232,14 @@ export default Controller.extend(CanCheckEmails, {
|
||||
queryParams: { nonce },
|
||||
});
|
||||
} else {
|
||||
popupAjaxError(error);
|
||||
const htmlMessage = error.jqXHR?.responseJSON.html_message;
|
||||
if (htmlMessage) {
|
||||
this.dialog.alert({
|
||||
message: htmlSafe(error.jqXHR?.responseJSON.error),
|
||||
});
|
||||
} else {
|
||||
popupAjaxError(error);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
Reference in New Issue
Block a user