Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

ui_report: Add ui_report.client_error.

Ganesh Pawar5802bbfb98d8
diff --git a/static/js/ui_report.js b/static/js/ui_report.js
index 138a884b3e4..206c0760c01 100644
--- a/static/js/ui_report.js
+++ b/static/js/ui_report.js
@@ -43,6 +43,10 @@ exports.error = function (response, xhr, status_box, remove_after) {
exports.message(response, status_box, "alert-error", remove_after);
};
+exports.client_error = function (response, status_box, remove_after) {
+ exports.message(response, status_box, "alert-error", remove_after);
+};
+
exports.success = function (response, status_box, remove_after) {
exports.message(response, status_box, "alert-success", remove_after);
};
diff --git a/tools/linter_lib/custom_check.py b/tools/linter_lib/custom_check.py
index d20ecd491c1..c16ca57521f 100644
--- a/tools/linter_lib/custom_check.py
+++ b/tools/linter_lib/custom_check.py
@@ -139,7 +139,7 @@ js_rules = RuleList(
{'pattern': r'ui.report_success\(',
'description': 'Deprecated function, use ui_report.success.'},
{'pattern': r'''report.success\(["']''',
- 'description': 'Argument to report_success should be a literal string enclosed '
+ 'description': 'Argument to ui_report.success should be a literal string enclosed '
'by i18n.t()'},
{'pattern': r'ui.report_error\(',
'description': 'Deprecated function, use ui_report.error.'},
@@ -148,6 +148,11 @@ js_rules = RuleList(
'by i18n.t()',
'good_lines': ['ui_report.error("")', 'ui_report.error(_("text"))'],
'bad_lines': ['ui_report.error("test")']},
+ {'pattern': r'''report.client_error\(["'][^'"]''',
+ 'description': 'Argument to ui_report.client_error should be a literal string enclosed '
+ 'by i18n.t()',
+ 'good_lines': ['ui_report.client_error("")', 'ui_report.client_error(_("text"))'],
+ 'bad_lines': ['ui_report.client_error("test")']},
{'pattern': r'\$\(document\)\.ready\(',
'description': "`Use $(f) rather than `$(document).ready(f)`",
'good_lines': ['$(function () {foo();}'],