custom_profile_fields: Update text of delete options confirmation modal.

This commit is contained in:
Yogesh Sirsat
2022-09-09 18:23:06 +05:30
committed by Tim Abbott
parent 2328dc0d4e
commit 1c2b90eae9
2 changed files with 7 additions and 3 deletions

View File

@@ -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,
});

View File

@@ -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}}