deactivate_users: Change submit button text of confirmation modal.

Change submit button text of both bot and user deactivation confirm
modal from "Confirm" to "Deactivate".
Calling `launch()` function from `dialog_widget.js` because
`confirm_dialog.js` set submit button text to "Confirm".
This commit is contained in:
yogesh sirsat 2022-07-27 00:46:08 +05:30 committed by Tim Abbott
parent 9f21e34592
commit f264795770
3 changed files with 8 additions and 6 deletions

View File

@ -49,7 +49,7 @@ async function test_deactivate_user(page: Page): Promise<void> {
);
assert.strictEqual(
await common.get_text_from_selector(page, "#dialog_widget_modal .dialog_submit_button"),
"Confirm",
"Deactivate",
"Deactivate button has incorrect text.",
);
await page.click("#dialog_widget_modal .dialog_submit_button");
@ -108,7 +108,7 @@ async function test_bot_deactivation_and_reactivation(page: Page): Promise<void>
);
assert.strictEqual(
await common.get_text_from_selector(page, "#dialog_widget_modal .dialog_submit_button"),
"Confirm",
"Deactivate",
"Deactivate button has incorrect text.",
);
await page.click("#dialog_widget_modal .dialog_submit_button");

View File

@ -453,13 +453,14 @@ export function confirm_deactivation(user_id, handle_confirm, loading_spinner) {
};
const html_body = render_settings_deactivation_user_modal(opts);
confirm_dialog.launch({
dialog_widget.launch({
html_heading: $t_html(
{defaultMessage: "Deactivate {name}?"},
{name: user.full_name},
),
help_link: "/help/deactivate-or-reactivate-a-user#deactivate-ban-a-user",
html_body,
html_submit_button: $t_html({defaultMessage: "Deactivate"}),
id: "deactivate-user-modal",
on_click: handle_confirm,
loading_spinner,
@ -491,10 +492,11 @@ function confirm_bot_deactivation(bot_id, handle_confirm, loading_spinner) {
const bot = people.get_by_user_id(bot_id);
const html_body = render_settings_deactivation_bot_modal();
confirm_dialog.launch({
dialog_widget.launch({
html_heading: $t_html({defaultMessage: "Deactivate {name}?"}, {name: bot.full_name}),
help_link: "/help/deactivate-or-reactivate-a-bot",
html_body,
html_submit_button: $t_html({defaultMessage: "Deactivate"}),
on_click: handle_confirm,
loading_spinner,
});

View File

@ -25,7 +25,7 @@ Note that organization administrators cannot deactivate organization owners.
1. Click the **Deactivate user** button at the bottom.
1. Approve by clicking **Confirm**.
1. Approve by clicking **Deactivate**.
{tab|via-organization-settings}
@ -34,7 +34,7 @@ Note that organization administrators cannot deactivate organization owners.
1. Click the **Deactivate** button to the right of the user account that you
want to deactivate.
1. Approve by clicking **Confirm**.
1. Approve by clicking **Deactivate**.
{end_tabs}