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.

custom_profile_fields: Update text of delete options confirmation modal.

Yogesh Sirsat1c2b90eae93d
diff --git a/static/js/settings_profile_fields.js b/static/js/settings_profile_fields.js
index 8acbf594597..d11a906ca3d 100644
--- a/static/js/settings_profile_fields.js
+++ b/static/js/settings_profile_fields.js
@@ -319,8 +319,12 @@ function show_modal_for_deleting_options(field, deleted_values, update_profile_f
field_name: field.name,
});
+ let modal_heading_text = "Delete this option?";
+ if (Object.keys(deleted_values).length !== 1) {
+ modal_heading_text = "Delete these options?";
+ }
confirm_dialog.launch({
- html_heading: $t_html({defaultMessage: "Delete option"}),
+ html_heading: $t_html({defaultMessage: "{modal_heading_text}"}, {modal_heading_text}),
html_body,
on_click: update_profile_field,
});
diff --git a/static/templates/confirm_dialog/confirm_delete_profile_field_option.hbs b/static/templates/confirm_dialog/confirm_delete_profile_field_option.hbs
index a83ea678a1e..e43192e678d 100644
--- a/static/templates/confirm_dialog/confirm_delete_profile_field_option.hbs
+++ b/static/templates/confirm_dialog/confirm_delete_profile_field_option.hbs
@@ -1,11 +1,11 @@
{{#if (eq count 1)}}
{{#tr}}
- Are you sure you want to delete these options? This will clear the <z-field-name></z-field-name> profile field for 1 user.
+ This will clear the <z-field-name></z-field-name> profile field for 1 user.
{{#*inline "z-field-name"}}<strong>{{field_name}}</strong>{{/inline}}
{{/tr}}
{{else}}
{{#tr}}
- Are you sure you want to delete these options? This will clear the <z-field-name></z-field-name> profile field for <z-count></z-count> users.
+ This will clear the <z-field-name></z-field-name> profile field for <z-count></z-count> users.
{{#*inline "z-count"}}{{count}}{{/inline}}
{{#*inline "z-field-name"}}<strong>{{field_name}}</strong>{{/inline}}
{{/tr}}