invite: Migrate email invite success banner to new banner component.

This commit is contained in:
Sayam Samal
2025-11-05 02:01:44 +05:30
committed by Tim Abbott
parent 6125faff05
commit ec18e84ba5

View File

@@ -177,15 +177,23 @@ function submit_invitation_form(): void {
beforeSend, beforeSend,
success() { success() {
const number_of_invites_sent = email_pill_widget.items().length; const number_of_invites_sent = email_pill_widget.items().length;
ui_report.success( banners.open(
$t_html( {
{ intent: "success",
defaultMessage: label: new Handlebars.SafeString(
"{N, plural, one {User invited successfully.} other {Users invited successfully.}}", $t_html(
}, {
{N: number_of_invites_sent}, defaultMessage:
), "{N, plural, one {User invited successfully.} other {Users invited successfully.}}",
$invite_status, },
{N: number_of_invites_sent},
),
),
buttons: [],
close_button: false,
custom_classes: "invite-user-modal-banner",
},
$("#invite-success-banner-container"),
); );
email_pill_widget.clear(); email_pill_widget.clear();
@@ -226,7 +234,7 @@ function submit_invitation_form(): void {
.safeParse(xhr.responseJSON); .safeParse(xhr.responseJSON);
if (!parsed.success) { if (!parsed.success) {
// There was a fatal error, no partial processing occurred. // There was a fatal error, no partial processing occurred.
ui_report.error("", xhr, $invite_status); ui_report.error($t({defaultMessage: "Failed"}), xhr, $invite_status);
} else { } else {
// Some users were not invited. // Some users were not invited.
const invitee_emails_errored = []; const invitee_emails_errored = [];