mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 21:43:21 +00:00
js: Convert static/js/ui_report.js to ES6 module.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
76bfa78beb
commit
26710a4370
@@ -216,7 +216,6 @@
|
|||||||
"typing_events": false,
|
"typing_events": false,
|
||||||
"ui": false,
|
"ui": false,
|
||||||
"ui_init": false,
|
"ui_init": false,
|
||||||
"ui_report": false,
|
|
||||||
"ui_util": false,
|
"ui_util": false,
|
||||||
"unread": false,
|
"unread": false,
|
||||||
"unread_ops": false,
|
"unread_ops": false,
|
||||||
|
|||||||
@@ -2,21 +2,28 @@
|
|||||||
|
|
||||||
const {strict: assert} = require("assert");
|
const {strict: assert} = require("assert");
|
||||||
|
|
||||||
|
const rewiremock = require("rewiremock/node");
|
||||||
|
|
||||||
const {set_global, zrequire} = require("../zjsunit/namespace");
|
const {set_global, zrequire} = require("../zjsunit/namespace");
|
||||||
const {run_test} = require("../zjsunit/test");
|
const {run_test} = require("../zjsunit/test");
|
||||||
|
|
||||||
const ui_report = set_global("ui_report", {
|
const ui_report = {
|
||||||
|
__esModule: true,
|
||||||
displayed_error: false,
|
displayed_error: false,
|
||||||
|
|
||||||
error: () => {
|
error: () => {
|
||||||
ui_report.displayed_error = true;
|
ui_report.displayed_error = true;
|
||||||
},
|
},
|
||||||
});
|
};
|
||||||
|
rewiremock("../../static/js/ui_report").with(ui_report);
|
||||||
set_global("location", {
|
set_global("location", {
|
||||||
protocol: "https:",
|
protocol: "https:",
|
||||||
host: "example.com",
|
host: "example.com",
|
||||||
pathname: "/",
|
pathname: "/",
|
||||||
});
|
});
|
||||||
|
|
||||||
|
rewiremock.enable();
|
||||||
|
|
||||||
const hash_util = zrequire("hash_util");
|
const hash_util = zrequire("hash_util");
|
||||||
const stream_data = zrequire("stream_data");
|
const stream_data = zrequire("stream_data");
|
||||||
const people = zrequire("people");
|
const people = zrequire("people");
|
||||||
@@ -172,3 +179,4 @@ run_test("test_search_public_streams_notice_url", () => {
|
|||||||
"#narrow/streams/public/sender/15-hamlet",
|
"#narrow/streams/public/sender/15-hamlet",
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
rewiremock.disable();
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ set_global("recent_topics", {
|
|||||||
});
|
});
|
||||||
// Still required for page_params.initial_pointer
|
// Still required for page_params.initial_pointer
|
||||||
set_global("page_params", {});
|
set_global("page_params", {});
|
||||||
set_global("ui_report", {
|
rewiremock("../../static/js/ui_report").with({
|
||||||
hide_error: noop,
|
hide_error: noop,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ rewiremock("../../static/js/reload_state").with({
|
|||||||
// we also directly write to pointer
|
// we also directly write to pointer
|
||||||
set_global("pointer", {});
|
set_global("pointer", {});
|
||||||
|
|
||||||
set_global("ui_report", {
|
rewiremock("../../static/js/ui_report").with({
|
||||||
hide_error() {
|
hide_error() {
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -56,6 +56,8 @@ stub_templates((name, data) => {
|
|||||||
const overlays = set_global("overlays", {});
|
const overlays = set_global("overlays", {});
|
||||||
|
|
||||||
const _ui_report = {
|
const _ui_report = {
|
||||||
|
__esModule: true,
|
||||||
|
|
||||||
success(msg, elem) {
|
success(msg, elem) {
|
||||||
elem.val(msg);
|
elem.val(msg);
|
||||||
},
|
},
|
||||||
@@ -79,7 +81,7 @@ set_global("FormData", _FormData);
|
|||||||
set_global("jQuery", _jQuery);
|
set_global("jQuery", _jQuery);
|
||||||
rewiremock("../../static/js/loading").with(_loading);
|
rewiremock("../../static/js/loading").with(_loading);
|
||||||
set_global("realm_logo", _realm_logo);
|
set_global("realm_logo", _realm_logo);
|
||||||
set_global("ui_report", _ui_report);
|
rewiremock("../../static/js/ui_report").with(_ui_report);
|
||||||
rewiremock("../../static/js/list_widget").with(_ListWidget);
|
rewiremock("../../static/js/list_widget").with(_ListWidget);
|
||||||
|
|
||||||
// setup is only imported to set the
|
// setup is only imported to set the
|
||||||
|
|||||||
@@ -30,7 +30,9 @@ const user_groups = {
|
|||||||
add: noop,
|
add: noop,
|
||||||
};
|
};
|
||||||
rewiremock("../../static/js/user_groups").with(user_groups);
|
rewiremock("../../static/js/user_groups").with(user_groups);
|
||||||
const ui_report = set_global("ui_report", {});
|
const ui_report = {__esModule: true};
|
||||||
|
|
||||||
|
rewiremock("../../static/js/ui_report").with(ui_report);
|
||||||
|
|
||||||
const page_params = set_global("page_params", {});
|
const page_params = set_global("page_params", {});
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ const render_uploaded_files_list = require("../templates/uploaded_files_list.hbs
|
|||||||
const channel = require("./channel");
|
const channel = require("./channel");
|
||||||
const ListWidget = require("./list_widget");
|
const ListWidget = require("./list_widget");
|
||||||
const loading = require("./loading");
|
const loading = require("./loading");
|
||||||
|
const ui_report = require("./ui_report");
|
||||||
|
|
||||||
let attachments;
|
let attachments;
|
||||||
let upload_space_used;
|
let upload_space_used;
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
// execution.
|
// execution.
|
||||||
|
|
||||||
const blueslip_stacktrace = require("./blueslip_stacktrace");
|
const blueslip_stacktrace = require("./blueslip_stacktrace");
|
||||||
|
const ui_report = require("./ui_report");
|
||||||
|
|
||||||
if (Error.stackTraceLimit !== undefined) {
|
if (Error.stackTraceLimit !== undefined) {
|
||||||
Error.stackTraceLimit = 100000;
|
Error.stackTraceLimit = 100000;
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ import "../narrow";
|
|||||||
import "../reload";
|
import "../reload";
|
||||||
import "../compose_actions";
|
import "../compose_actions";
|
||||||
import "../subs";
|
import "../subs";
|
||||||
import "../ui_report";
|
|
||||||
import "../message_scroll";
|
import "../message_scroll";
|
||||||
import "../info_overlay";
|
import "../info_overlay";
|
||||||
import "../ui";
|
import "../ui";
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ import * as settings_config from "./settings_config";
|
|||||||
import * as stream_data from "./stream_data";
|
import * as stream_data from "./stream_data";
|
||||||
import * as stream_edit from "./stream_edit";
|
import * as stream_edit from "./stream_edit";
|
||||||
import * as transmit from "./transmit";
|
import * as transmit from "./transmit";
|
||||||
|
import * as ui_report from "./ui_report";
|
||||||
import * as upload from "./upload";
|
import * as upload from "./upload";
|
||||||
import * as util from "./util";
|
import * as util from "./util";
|
||||||
import * as zcommand from "./zcommand";
|
import * as zcommand from "./zcommand";
|
||||||
|
|||||||
1
static/js/global.d.ts
vendored
1
static/js/global.d.ts
vendored
@@ -87,7 +87,6 @@ declare let timerender: any;
|
|||||||
declare let typeahead_helper: any;
|
declare let typeahead_helper: any;
|
||||||
declare let typing_events: any;
|
declare let typing_events: any;
|
||||||
declare let ui: any;
|
declare let ui: any;
|
||||||
declare let ui_report: any;
|
|
||||||
declare let ui_util: any;
|
declare let ui_util: any;
|
||||||
declare let unread: any;
|
declare let unread: any;
|
||||||
declare let unread_ops: any;
|
declare let unread_ops: any;
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
const narrow_state = require("./narrow_state");
|
const narrow_state = require("./narrow_state");
|
||||||
const people = require("./people");
|
const people = require("./people");
|
||||||
const stream_data = require("./stream_data");
|
const stream_data = require("./stream_data");
|
||||||
|
const ui_report = require("./ui_report");
|
||||||
|
|
||||||
exports.get_hash_category = function (hash) {
|
exports.get_hash_category = function (hash) {
|
||||||
// given "#streams/subscribed", returns "streams"
|
// given "#streams/subscribed", returns "streams"
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import render_settings_dev_env_email_access from "../templates/settings/dev_env_
|
|||||||
import * as channel from "./channel";
|
import * as channel from "./channel";
|
||||||
import * as common from "./common";
|
import * as common from "./common";
|
||||||
import * as stream_data from "./stream_data";
|
import * as stream_data from "./stream_data";
|
||||||
|
import * as ui_report from "./ui_report";
|
||||||
|
|
||||||
function reset_error_messages() {
|
function reset_error_messages() {
|
||||||
$("#invite_status").hide().text("").removeClass(common.status_classes);
|
$("#invite_status").hide().text("").removeClass(common.status_classes);
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import * as message_viewport from "./message_viewport";
|
|||||||
import * as resize from "./resize";
|
import * as resize from "./resize";
|
||||||
import * as rows from "./rows";
|
import * as rows from "./rows";
|
||||||
import * as stream_data from "./stream_data";
|
import * as stream_data from "./stream_data";
|
||||||
|
import * as ui_report from "./ui_report";
|
||||||
import * as upload from "./upload";
|
import * as upload from "./upload";
|
||||||
|
|
||||||
const currently_editing_messages = new Map();
|
const currently_editing_messages = new Map();
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import render_message_edit_history from "../templates/message_edit_history.hbs";
|
|||||||
|
|
||||||
import * as channel from "./channel";
|
import * as channel from "./channel";
|
||||||
import * as people from "./people";
|
import * as people from "./people";
|
||||||
|
import * as ui_report from "./ui_report";
|
||||||
|
|
||||||
const {format, isSameDay} = require("date-fns");
|
const {format, isSameDay} = require("date-fns");
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ const huddle_data = require("./huddle_data");
|
|||||||
const people = require("./people");
|
const people = require("./people");
|
||||||
const pm_list = require("./pm_list");
|
const pm_list = require("./pm_list");
|
||||||
const stream_data = require("./stream_data");
|
const stream_data = require("./stream_data");
|
||||||
|
const ui_report = require("./ui_report");
|
||||||
|
|
||||||
const consts = {
|
const consts = {
|
||||||
backfill_idle_time: 10 * 1000,
|
backfill_idle_time: 10 * 1000,
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import * as compose_state from "./compose_state";
|
|||||||
import {localstorage} from "./localstorage";
|
import {localstorage} from "./localstorage";
|
||||||
import * as narrow_state from "./narrow_state";
|
import * as narrow_state from "./narrow_state";
|
||||||
import * as reload_state from "./reload_state";
|
import * as reload_state from "./reload_state";
|
||||||
|
import * as ui_report from "./ui_report";
|
||||||
import * as util from "./util";
|
import * as util from "./util";
|
||||||
|
|
||||||
// Read https://zulip.readthedocs.io/en/latest/subsystems/hashchange-system.html
|
// Read https://zulip.readthedocs.io/en/latest/subsystems/hashchange-system.html
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ const reload = require("./reload");
|
|||||||
const reload_state = require("./reload_state");
|
const reload_state = require("./reload_state");
|
||||||
const sent_messages = require("./sent_messages");
|
const sent_messages = require("./sent_messages");
|
||||||
const server_events_dispatch = require("./server_events_dispatch");
|
const server_events_dispatch = require("./server_events_dispatch");
|
||||||
|
const ui_report = require("./ui_report");
|
||||||
// Docs: https://zulip.readthedocs.io/en/latest/subsystems/events-system.html
|
// Docs: https://zulip.readthedocs.io/en/latest/subsystems/events-system.html
|
||||||
|
|
||||||
let waiting_on_homeview_load = true;
|
let waiting_on_homeview_load = true;
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ const people = require("./people");
|
|||||||
const pill_typeahead = require("./pill_typeahead");
|
const pill_typeahead = require("./pill_typeahead");
|
||||||
const settings_ui = require("./settings_ui");
|
const settings_ui = require("./settings_ui");
|
||||||
const setup = require("./setup");
|
const setup = require("./setup");
|
||||||
|
const ui_report = require("./ui_report");
|
||||||
const user_pill = require("./user_pill");
|
const user_pill = require("./user_pill");
|
||||||
|
|
||||||
exports.update_email = function (new_email) {
|
exports.update_email = function (new_email) {
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ const emojisets = require("./emojisets");
|
|||||||
const loading = require("./loading");
|
const loading = require("./loading");
|
||||||
const settings_config = require("./settings_config");
|
const settings_config = require("./settings_config");
|
||||||
const settings_ui = require("./settings_ui");
|
const settings_ui = require("./settings_ui");
|
||||||
|
const ui_report = require("./ui_report");
|
||||||
|
|
||||||
const meta = {
|
const meta = {
|
||||||
loaded: false,
|
loaded: false,
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ const channel = require("./channel");
|
|||||||
const ListWidget = require("./list_widget");
|
const ListWidget = require("./list_widget");
|
||||||
const loading = require("./loading");
|
const loading = require("./loading");
|
||||||
const people = require("./people");
|
const people = require("./people");
|
||||||
|
const ui_report = require("./ui_report");
|
||||||
|
|
||||||
const meta = {
|
const meta = {
|
||||||
loaded: false,
|
loaded: false,
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ const channel = require("./channel");
|
|||||||
const ListWidget = require("./list_widget");
|
const ListWidget = require("./list_widget");
|
||||||
const loading = require("./loading");
|
const loading = require("./loading");
|
||||||
const people = require("./people");
|
const people = require("./people");
|
||||||
|
const ui_report = require("./ui_report");
|
||||||
|
|
||||||
const meta = {
|
const meta = {
|
||||||
loaded: false,
|
loaded: false,
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ const ListWidget = require("./list_widget");
|
|||||||
const loading = require("./loading");
|
const loading = require("./loading");
|
||||||
const people = require("./people");
|
const people = require("./people");
|
||||||
const settings_config = require("./settings_config");
|
const settings_config = require("./settings_config");
|
||||||
|
const ui_report = require("./ui_report");
|
||||||
const util = require("./util");
|
const util = require("./util");
|
||||||
|
|
||||||
const meta = {
|
const meta = {
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ const render_admin_filter_list = require("../templates/admin_filter_list.hbs");
|
|||||||
const channel = require("./channel");
|
const channel = require("./channel");
|
||||||
const ListWidget = require("./list_widget");
|
const ListWidget = require("./list_widget");
|
||||||
const loading = require("./loading");
|
const loading = require("./loading");
|
||||||
|
const ui_report = require("./ui_report");
|
||||||
|
|
||||||
const meta = {
|
const meta = {
|
||||||
loaded: false,
|
loaded: false,
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ const loading = require("./loading");
|
|||||||
const settings_config = require("./settings_config");
|
const settings_config = require("./settings_config");
|
||||||
const settings_ui = require("./settings_ui");
|
const settings_ui = require("./settings_ui");
|
||||||
const stream_data = require("./stream_data");
|
const stream_data = require("./stream_data");
|
||||||
|
const ui_report = require("./ui_report");
|
||||||
|
|
||||||
const meta = {
|
const meta = {
|
||||||
loaded: false,
|
loaded: false,
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ const channel = require("./channel");
|
|||||||
const ListWidget = require("./list_widget");
|
const ListWidget = require("./list_widget");
|
||||||
const loading = require("./loading");
|
const loading = require("./loading");
|
||||||
const stream_data = require("./stream_data");
|
const stream_data = require("./stream_data");
|
||||||
|
const ui_report = require("./ui_report");
|
||||||
|
|
||||||
const meta = {
|
const meta = {
|
||||||
loaded: false,
|
loaded: false,
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import * as loading from "./loading";
|
import * as loading from "./loading";
|
||||||
|
import * as ui_report from "./ui_report";
|
||||||
|
|
||||||
export function display_checkmark($elem) {
|
export function display_checkmark($elem) {
|
||||||
const check_mark = document.createElement("img");
|
const check_mark = document.createElement("img");
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ const render_confirm_delete_user = require("../templates/confirm_delete_user.hbs
|
|||||||
const channel = require("./channel");
|
const channel = require("./channel");
|
||||||
const people = require("./people");
|
const people = require("./people");
|
||||||
const pill_typeahead = require("./pill_typeahead");
|
const pill_typeahead = require("./pill_typeahead");
|
||||||
|
const ui_report = require("./ui_report");
|
||||||
const user_groups = require("./user_groups");
|
const user_groups = require("./user_groups");
|
||||||
const user_pill = require("./user_pill");
|
const user_pill = require("./user_pill");
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ const people = require("./people");
|
|||||||
const settings_config = require("./settings_config");
|
const settings_config = require("./settings_config");
|
||||||
const settings_data = require("./settings_data");
|
const settings_data = require("./settings_data");
|
||||||
const settings_ui = require("./settings_ui");
|
const settings_ui = require("./settings_ui");
|
||||||
|
const ui_report = require("./ui_report");
|
||||||
const user_pill = require("./user_pill");
|
const user_pill = require("./user_pill");
|
||||||
|
|
||||||
const section = {
|
const section = {
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import * as loading from "./loading";
|
|||||||
import * as peer_data from "./peer_data";
|
import * as peer_data from "./peer_data";
|
||||||
import * as people from "./people";
|
import * as people from "./people";
|
||||||
import * as stream_data from "./stream_data";
|
import * as stream_data from "./stream_data";
|
||||||
|
import * as ui_report from "./ui_report";
|
||||||
|
|
||||||
let created_stream;
|
let created_stream;
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import * as stream_color from "./stream_color";
|
|||||||
import * as stream_data from "./stream_data";
|
import * as stream_data from "./stream_data";
|
||||||
import * as stream_pill from "./stream_pill";
|
import * as stream_pill from "./stream_pill";
|
||||||
import * as stream_ui_updates from "./stream_ui_updates";
|
import * as stream_ui_updates from "./stream_ui_updates";
|
||||||
|
import * as ui_report from "./ui_report";
|
||||||
import * as user_pill from "./user_pill";
|
import * as user_pill from "./user_pill";
|
||||||
import * as util from "./util";
|
import * as util from "./util";
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ const stream_data = require("./stream_data");
|
|||||||
const stream_edit = require("./stream_edit");
|
const stream_edit = require("./stream_edit");
|
||||||
const stream_muting = require("./stream_muting");
|
const stream_muting = require("./stream_muting");
|
||||||
const stream_ui_updates = require("./stream_ui_updates");
|
const stream_ui_updates = require("./stream_ui_updates");
|
||||||
|
const ui_report = require("./ui_report");
|
||||||
const util = require("./util");
|
const util = require("./util");
|
||||||
|
|
||||||
exports.show_subs_pane = {
|
exports.show_subs_pane = {
|
||||||
|
|||||||
@@ -1,15 +1,14 @@
|
|||||||
"use strict";
|
import _ from "lodash";
|
||||||
|
|
||||||
const _ = require("lodash");
|
import * as common from "./common";
|
||||||
|
|
||||||
const common = require("./common");
|
|
||||||
/* Arguments used in the report_* functions are,
|
/* Arguments used in the report_* functions are,
|
||||||
response- response that we want to display
|
response- response that we want to display
|
||||||
status_box- element being used to display the response
|
status_box- element being used to display the response
|
||||||
cls- class that we want to add/remove to/from the status_box
|
cls- class that we want to add/remove to/from the status_box
|
||||||
*/
|
*/
|
||||||
|
|
||||||
exports.message = function (response, status_box, cls, remove_after) {
|
export function message(response, status_box, cls, remove_after) {
|
||||||
if (cls === undefined) {
|
if (cls === undefined) {
|
||||||
cls = "alert";
|
cls = "alert";
|
||||||
}
|
}
|
||||||
@@ -28,9 +27,9 @@ exports.message = function (response, status_box, cls, remove_after) {
|
|||||||
}, remove_after);
|
}, remove_after);
|
||||||
}
|
}
|
||||||
status_box.addClass("show");
|
status_box.addClass("show");
|
||||||
};
|
}
|
||||||
|
|
||||||
exports.error = function (response, xhr, status_box, remove_after) {
|
export function error(response, xhr, status_box, remove_after) {
|
||||||
if (xhr && xhr.status.toString().charAt(0) === "4") {
|
if (xhr && xhr.status.toString().charAt(0) === "4") {
|
||||||
// Only display the error response for 4XX, where we've crafted
|
// Only display the error response for 4XX, where we've crafted
|
||||||
// a nice response.
|
// a nice response.
|
||||||
@@ -42,27 +41,27 @@ exports.error = function (response, xhr, status_box, remove_after) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.message(response, status_box, "alert-error", remove_after);
|
message(response, status_box, "alert-error", remove_after);
|
||||||
};
|
}
|
||||||
|
|
||||||
exports.client_error = function (response, status_box, remove_after) {
|
export function client_error(response, status_box, remove_after) {
|
||||||
exports.message(response, status_box, "alert-error", remove_after);
|
message(response, status_box, "alert-error", remove_after);
|
||||||
};
|
}
|
||||||
|
|
||||||
exports.success = function (response, status_box, remove_after) {
|
export function success(response, status_box, remove_after) {
|
||||||
exports.message(response, status_box, "alert-success", remove_after);
|
message(response, status_box, "alert-success", remove_after);
|
||||||
};
|
}
|
||||||
|
|
||||||
exports.generic_embed_error = function (error) {
|
export function generic_embed_error(error) {
|
||||||
const $alert = $("<div class='alert home-error-bar'></div>");
|
const $alert = $("<div class='alert home-error-bar'></div>");
|
||||||
const $exit = "<div class='exit'></div>";
|
const $exit = "<div class='exit'></div>";
|
||||||
|
|
||||||
$(".alert-box").append(
|
$(".alert-box").append(
|
||||||
$alert.html($exit + "<div class='content'>" + error + "</div>").addClass("show"),
|
$alert.html($exit + "<div class='content'>" + error + "</div>").addClass("show"),
|
||||||
);
|
);
|
||||||
};
|
}
|
||||||
|
|
||||||
exports.generic_row_button_error = function (xhr, btn) {
|
export function generic_row_button_error(xhr, btn) {
|
||||||
if (xhr.status.toString().charAt(0) === "4") {
|
if (xhr.status.toString().charAt(0) === "4") {
|
||||||
btn.closest("td").html(
|
btn.closest("td").html(
|
||||||
$("<p>").addClass("text-error").text(JSON.parse(xhr.responseText).msg),
|
$("<p>").addClass("text-error").text(JSON.parse(xhr.responseText).msg),
|
||||||
@@ -70,17 +69,15 @@ exports.generic_row_button_error = function (xhr, btn) {
|
|||||||
} else {
|
} else {
|
||||||
btn.text(i18n.t("Failed!"));
|
btn.text(i18n.t("Failed!"));
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
exports.hide_error = function ($target) {
|
export function hide_error($target) {
|
||||||
$target.addClass("fade-out");
|
$target.addClass("fade-out");
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
$target.removeClass("show fade-out");
|
$target.removeClass("show fade-out");
|
||||||
}, 300);
|
}, 300);
|
||||||
};
|
}
|
||||||
|
|
||||||
exports.show_error = function ($target) {
|
export function show_error($target) {
|
||||||
$target.addClass("show");
|
$target.addClass("show");
|
||||||
};
|
}
|
||||||
|
|
||||||
window.ui_report = exports;
|
|
||||||
|
|||||||
Reference in New Issue
Block a user