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.

bots: Customize reactivation confirmation modal for bots.

Barissa-Imran15b9e9c7cc87
diff --git a/static/js/settings_users.js b/static/js/settings_users.js
index fd376955823..0bd2008a412 100644
--- a/static/js/settings_users.js
+++ b/static/js/settings_users.js
@@ -1,6 +1,7 @@
import $ from "jquery";
import render_settings_deactivation_user_modal from "../templates/confirm_dialog/confirm_deactivate_user.hbs";
+import render_settings_reactivation_bot_modal from "../templates/confirm_dialog/confirm_reactivate_bot.hbs";
import render_settings_reactivation_user_modal from "../templates/confirm_dialog/confirm_reactivate_user.hbs";
import render_admin_human_form from "../templates/settings/admin_human_form.hbs";
import render_admin_user_list from "../templates/settings/admin_user_list.hbs";
@@ -524,7 +525,14 @@ export function confirm_reactivation(user_id, handle_confirm, loading_spinner) {
const opts = {
username: user.full_name,
};
- const html_body = render_settings_reactivation_user_modal(opts);
+
+ let html_body;
+ // check if bot or human
+ if (user.is_bot) {
+ html_body = render_settings_reactivation_bot_modal(opts);
+ } else {
+ html_body = render_settings_reactivation_user_modal(opts);
+ }
confirm_dialog.launch({
html_heading: $t_html({defaultMessage: "Reactivate {name}"}, {name: user.full_name}),
diff --git a/static/templates/confirm_dialog/confirm_reactivate_bot.hbs b/static/templates/confirm_dialog/confirm_reactivate_bot.hbs
new file mode 100644
index 00000000000..b9a336d6acf
--- /dev/null
+++ b/static/templates/confirm_dialog/confirm_reactivate_bot.hbs
@@ -0,0 +1,7 @@
+<p>
+ {{#tr}}
+ <z-user></z-user> will have the same properties as it did prior to deactivation,
+ including role, owner and stream subscriptions.
+ {{#*inline "z-user"}}<strong>{{username}}</strong>{{/inline}}
+ {{/tr}}
+</p>
diff --git a/tools/lib/capitalization.py b/tools/lib/capitalization.py
index b81ceaa8eb6..d2e650d32de 100644
--- a/tools/lib/capitalization.py
+++ b/tools/lib/capitalization.py
@@ -52,6 +52,7 @@ IGNORED_PHRASES = [
# BeautifulSoup will remove <z-user> which is horribly confusing,
# so we need more of the sentence.
r"<z-user></z-user> will have the same role",
+ r"<z-user></z-user> will have the same properties",
# Things using "I"
r"I understand",
r"I'm",