From f26479577061fcd599061f90f33c29d87d1e72ab Mon Sep 17 00:00:00 2001 From: yogesh sirsat Date: Wed, 27 Jul 2022 00:46:08 +0530 Subject: [PATCH] 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". --- frontend_tests/puppeteer_tests/user-deactivation.ts | 4 ++-- static/js/settings_users.js | 6 ++++-- templates/zerver/help/deactivate-or-reactivate-a-user.md | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/frontend_tests/puppeteer_tests/user-deactivation.ts b/frontend_tests/puppeteer_tests/user-deactivation.ts index 08c3801f31..4b00d3c081 100644 --- a/frontend_tests/puppeteer_tests/user-deactivation.ts +++ b/frontend_tests/puppeteer_tests/user-deactivation.ts @@ -49,7 +49,7 @@ async function test_deactivate_user(page: Page): Promise { ); 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 ); 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"); diff --git a/static/js/settings_users.js b/static/js/settings_users.js index 76c430e485..9bef636185 100644 --- a/static/js/settings_users.js +++ b/static/js/settings_users.js @@ -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, }); diff --git a/templates/zerver/help/deactivate-or-reactivate-a-user.md b/templates/zerver/help/deactivate-or-reactivate-a-user.md index 743ecf6e8a..a2591fdd78 100644 --- a/templates/zerver/help/deactivate-or-reactivate-a-user.md +++ b/templates/zerver/help/deactivate-or-reactivate-a-user.md @@ -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}