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
|
// invoked). In any case, it will pretty clear that
|
||||||
// something is wrong with the page and the user will
|
// something is wrong with the page and the user will
|
||||||
// probably try to reload anyway.
|
// probably try to reload anyway.
|
||||||
ui_report.message(
|
ui_report.client_error(
|
||||||
"Oops. It seems something has gone wrong. " +
|
"Oops. It seems something has gone wrong. " +
|
||||||
"The error has been reported to the fine " +
|
"The error has been reported to the fine " +
|
||||||
"folks at Zulip, but, in the mean time, " +
|
"folks at Zulip, but, in the mean time, " +
|
||||||
"please try reloading the page.",
|
"please try reloading the page.",
|
||||||
$("#home-error"),
|
$("#home-error"),
|
||||||
"alert-error",
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
error() {
|
error() {
|
||||||
if (opts.show_ui_msg && ui_report !== undefined) {
|
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.",
|
"Oops. It seems something has gone wrong. Please try reloading the page.",
|
||||||
$("#home-error"),
|
$("#home-error"),
|
||||||
"alert-error",
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -183,11 +183,7 @@ exports.set_up = function () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (emoji.name.trim() === "") {
|
if (emoji.name.trim() === "") {
|
||||||
ui_report.message(
|
ui_report.client_error(i18n.t("Failed: Emoji name is required."), emoji_status);
|
||||||
i18n.t("Failed: Emoji name is required."),
|
|
||||||
emoji_status,
|
|
||||||
"alert-error",
|
|
||||||
);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$("#admin_emoji_submit").prop("disabled", true);
|
$("#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) {
|
if (modal_invite_id !== meta.invite_id || modal_is_multiuse !== meta.is_multiuse) {
|
||||||
blueslip.error("Invite revoking canceled due to non-matching fields.");
|
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."),
|
i18n.t("Resending encountered an error. Please reload and try again."),
|
||||||
$("#home-error"),
|
$("#home-error"),
|
||||||
"alert-error",
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
$("#revoke_invite_modal").modal("hide");
|
$("#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) {
|
if (modal_invite_id !== meta.invite_id) {
|
||||||
blueslip.error("Invite resending canceled due to non-matching fields.");
|
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."),
|
i18n.t("Resending encountered an error. Please reload and try again."),
|
||||||
$("#home-error"),
|
$("#home-error"),
|
||||||
"alert-error",
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
$("#resend_invite_modal").modal("hide");
|
$("#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
|
// 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.
|
// and paste over a description with newline characters in it. Prevent that.
|
||||||
if (description.includes("\n")) {
|
if (description.includes("\n")) {
|
||||||
ui_report.message(
|
ui_report.client_error(
|
||||||
i18n.t("The stream description cannot contain newline characters."),
|
i18n.t("The stream description cannot contain newline characters."),
|
||||||
$(".stream_create_info"),
|
$(".stream_create_info"),
|
||||||
"alert-error",
|
|
||||||
);
|
);
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -815,11 +815,7 @@ exports.initialize = function () {
|
|||||||
|
|
||||||
const stream_id = get_stream_id(e.target);
|
const stream_id = get_stream_id(e.target);
|
||||||
if (!stream_id) {
|
if (!stream_id) {
|
||||||
ui_report.message(
|
ui_report.client_error(i18n.t("Invalid stream id"), $(".stream_change_property_info"));
|
||||||
i18n.t("Invalid stream id"),
|
|
||||||
$(".stream_change_property_info"),
|
|
||||||
"alert-error",
|
|
||||||
);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const stream_name = stream_data.maybe_get_stream_name(stream_id);
|
const stream_name = stream_data.maybe_get_stream_name(stream_id);
|
||||||
@@ -837,11 +833,7 @@ exports.initialize = function () {
|
|||||||
overlays.close_modal("#deactivation_stream_modal");
|
overlays.close_modal("#deactivation_stream_modal");
|
||||||
$("#deactivation_stream_modal").remove();
|
$("#deactivation_stream_modal").remove();
|
||||||
if (!stream_id) {
|
if (!stream_id) {
|
||||||
ui_report.message(
|
ui_report.client_error(i18n.t("Invalid stream id"), $(".stream_change_property_info"));
|
||||||
i18n.t("Invalid stream id"),
|
|
||||||
$(".stream_change_property_info"),
|
|
||||||
"alert-error",
|
|
||||||
);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const row = $(".stream-row.active");
|
const row = $(".stream-row.active");
|
||||||
|
|||||||
Reference in New Issue
Block a user