mirror of
https://github.com/zulip/zulip.git
synced 2025-11-09 16:37:23 +00:00
ui_report: Migrate ui_report.message to ui_report.client_error.
This commit is contained in:
@@ -142,22 +142,20 @@ function report_error(msg, stack, opts) {
|
||||
// invoked). In any case, it will pretty clear that
|
||||
// something is wrong with the page and the user will
|
||||
// probably try to reload anyway.
|
||||
ui_report.message(
|
||||
ui_report.client_error(
|
||||
"Oops. It seems something has gone wrong. " +
|
||||
"The error has been reported to the fine " +
|
||||
"folks at Zulip, but, in the mean time, " +
|
||||
"please try reloading the page.",
|
||||
$("#home-error"),
|
||||
"alert-error",
|
||||
);
|
||||
}
|
||||
},
|
||||
error() {
|
||||
if (opts.show_ui_msg && ui_report !== undefined) {
|
||||
ui_report.message(
|
||||
ui_report.client_error(
|
||||
"Oops. It seems something has gone wrong. Please try reloading the page.",
|
||||
$("#home-error"),
|
||||
"alert-error",
|
||||
);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -183,11 +183,7 @@ exports.set_up = function () {
|
||||
}
|
||||
|
||||
if (emoji.name.trim() === "") {
|
||||
ui_report.message(
|
||||
i18n.t("Failed: Emoji name is required."),
|
||||
emoji_status,
|
||||
"alert-error",
|
||||
);
|
||||
ui_report.client_error(i18n.t("Failed: Emoji name is required."), emoji_status);
|
||||
return;
|
||||
}
|
||||
$("#admin_emoji_submit").prop("disabled", true);
|
||||
|
||||
@@ -93,10 +93,9 @@ function do_revoke_invite() {
|
||||
|
||||
if (modal_invite_id !== meta.invite_id || modal_is_multiuse !== meta.is_multiuse) {
|
||||
blueslip.error("Invite revoking canceled due to non-matching fields.");
|
||||
ui_report.message(
|
||||
ui_report.client_error(
|
||||
i18n.t("Resending encountered an error. Please reload and try again."),
|
||||
$("#home-error"),
|
||||
"alert-error",
|
||||
);
|
||||
}
|
||||
$("#revoke_invite_modal").modal("hide");
|
||||
@@ -196,10 +195,9 @@ exports.on_load_success = function (invites_data, initialize_event_handlers) {
|
||||
|
||||
if (modal_invite_id !== meta.invite_id) {
|
||||
blueslip.error("Invite resending canceled due to non-matching fields.");
|
||||
ui_report.message(
|
||||
ui_report.client_error(
|
||||
i18n.t("Resending encountered an error. Please reload and try again."),
|
||||
$("#home-error"),
|
||||
"alert-error",
|
||||
);
|
||||
}
|
||||
$("#resend_invite_modal").modal("hide");
|
||||
|
||||
@@ -146,10 +146,9 @@ function create_stream() {
|
||||
// newline characters (by pressing the Enter key) it would still be possible to copy
|
||||
// and paste over a description with newline characters in it. Prevent that.
|
||||
if (description.includes("\n")) {
|
||||
ui_report.message(
|
||||
ui_report.client_error(
|
||||
i18n.t("The stream description cannot contain newline characters."),
|
||||
$(".stream_create_info"),
|
||||
"alert-error",
|
||||
);
|
||||
return undefined;
|
||||
}
|
||||
|
||||
@@ -815,11 +815,7 @@ exports.initialize = function () {
|
||||
|
||||
const stream_id = get_stream_id(e.target);
|
||||
if (!stream_id) {
|
||||
ui_report.message(
|
||||
i18n.t("Invalid stream id"),
|
||||
$(".stream_change_property_info"),
|
||||
"alert-error",
|
||||
);
|
||||
ui_report.client_error(i18n.t("Invalid stream id"), $(".stream_change_property_info"));
|
||||
return;
|
||||
}
|
||||
const stream_name = stream_data.maybe_get_stream_name(stream_id);
|
||||
@@ -837,11 +833,7 @@ exports.initialize = function () {
|
||||
overlays.close_modal("#deactivation_stream_modal");
|
||||
$("#deactivation_stream_modal").remove();
|
||||
if (!stream_id) {
|
||||
ui_report.message(
|
||||
i18n.t("Invalid stream id"),
|
||||
$(".stream_change_property_info"),
|
||||
"alert-error",
|
||||
);
|
||||
ui_report.client_error(i18n.t("Invalid stream id"), $(".stream_change_property_info"));
|
||||
return;
|
||||
}
|
||||
const row = $(".stream-row.active");
|
||||
|
||||
Reference in New Issue
Block a user