From e4c89771fd4c8e0f70b2bac510e6bc5d0031204e Mon Sep 17 00:00:00 2001 From: Shubham Padia Date: Wed, 12 Jun 2024 08:59:52 +0000 Subject: [PATCH] settings: Rename `user-list-admin` to `users`. Renaming the url for better readability on the user's side. We've also added a redirect for this, which will change the `section` from `user-list-admin` to `users` whenever required. See https://github.com/zulip/zulip/pull/30268#discussion_r1631539656 --- help/change-a-users-name.md | 2 +- help/deactivate-or-reactivate-a-user.md | 2 +- help/gdpr-compliance.md | 2 +- help/include/change-a-users-role.md | 2 +- help/include/view-users-by-role.md | 2 +- help/manage-a-user.md | 2 +- web/e2e-tests/user-deactivation.test.ts | 2 +- web/src/hashchange.js | 4 ++++ web/src/settings_sections.js | 2 +- web/templates/buddy_list/view_all_users.hbs | 2 +- web/templates/settings/user_list_admin.hbs | 2 +- web/templates/settings_overlay.hbs | 2 +- web/tests/hashchange.test.js | 19 +++++++++++++++++-- zerver/lib/markdown/help_settings_links.py | 2 +- 14 files changed, 33 insertions(+), 14 deletions(-) diff --git a/help/change-a-users-name.md b/help/change-a-users-name.md index 50e4d65930..e7de951188 100644 --- a/help/change-a-users-name.md +++ b/help/change-a-users-name.md @@ -24,7 +24,7 @@ Organization administrators can always change any user's name. {tab|via-organization-settings} -{settings_tab|user-list-admin} +{settings_tab|users} 1. Find the user you would like to manage. Click the **pencil** () to the right of their name. diff --git a/help/deactivate-or-reactivate-a-user.md b/help/deactivate-or-reactivate-a-user.md index 7ff244496a..7dd68d156d 100644 --- a/help/deactivate-or-reactivate-a-user.md +++ b/help/deactivate-or-reactivate-a-user.md @@ -48,7 +48,7 @@ When you deactivate a user: {tab|via-organization-settings} -{settings_tab|user-list-admin} +{settings_tab|users} 1. In the **Actions** column, click the **deactivate** () icon for the user you want to deactivate. diff --git a/help/gdpr-compliance.md b/help/gdpr-compliance.md index d4cddf5d72..eff5b98e33 100644 --- a/help/gdpr-compliance.md +++ b/help/gdpr-compliance.md @@ -107,7 +107,7 @@ GDPR: * A Zulip user can change their profile information, delete their messages, uploaded files, etc., directly within the Zulip web app. -* You can use the [organization users](/#organization/user-list-admin) +* You can use the [organization users](/#organization/users) panel to deactivate users, edit or delete their account details, etc. * For complying with access requests, you'll want to start with that diff --git a/help/include/change-a-users-role.md b/help/include/change-a-users-role.md index b96e26ce91..6d069a619d 100644 --- a/help/include/change-a-users-role.md +++ b/help/include/change-a-users-role.md @@ -12,7 +12,7 @@ {tab|via-organization-settings} -{settings_tab|user-list-admin} +{settings_tab|users} 1. Find the user you would like to manage. Click the **pencil** () to the right of their name. diff --git a/help/include/view-users-by-role.md b/help/include/view-users-by-role.md index 9cf2f07dd4..17580827e6 100644 --- a/help/include/view-users-by-role.md +++ b/help/include/view-users-by-role.md @@ -1,6 +1,6 @@ {start_tabs} -{settings_tab|user-list-admin} +{settings_tab|users} 1. Select the desired role from the dropdown above the **Users** table. diff --git a/help/manage-a-user.md b/help/manage-a-user.md index 3d64ebe8dc..5b5132a8f8 100644 --- a/help/manage-a-user.md +++ b/help/manage-a-user.md @@ -12,7 +12,7 @@ {tab|via-organization-settings} -{settings_tab|user-list-admin} +{settings_tab|users} 1. Find the user you would like to manage. Click the **pencil** () to the right of their name. diff --git a/web/e2e-tests/user-deactivation.test.ts b/web/e2e-tests/user-deactivation.test.ts index ee313c3e40..912f345e5f 100644 --- a/web/e2e-tests/user-deactivation.test.ts +++ b/web/e2e-tests/user-deactivation.test.ts @@ -14,7 +14,7 @@ async function navigate_to_user_list(page: Page): Promise { await page.click(organization_settings); await page.waitForSelector("#settings_overlay_container.show", {visible: true}); - await page.click("li[data-section='user-list-admin']"); + await page.click("li[data-section='users']"); } async function user_row(page: Page, name: string): Promise { diff --git a/web/src/hashchange.js b/web/src/hashchange.js index 22dcec9416..7a3649fd2c 100644 --- a/web/src/hashchange.js +++ b/web/src/hashchange.js @@ -276,6 +276,10 @@ function do_hashchange_overlay(old_hash) { // #settings/display-settings is being redirected to #settings/preferences. section = "preferences"; } + if (section === "user-list-admin") { + // #settings/user-list-admin is being redirected to #settings/users after it was renamed. + section = "users"; + } if ((base === "settings" || base === "organization") && !section) { let settings_panel_object = settings_panel_menu.normal_settings; if (base === "organization") { diff --git a/web/src/settings_sections.js b/web/src/settings_sections.js index fbedf86f3f..2e5d567ff7 100644 --- a/web/src/settings_sections.js +++ b/web/src/settings_sections.js @@ -34,7 +34,7 @@ export function get_group(section) { case "bot-list-admin": return "org_bots"; - case "user-list-admin": + case "users": case "deactivated-users-admin": return "org_users"; diff --git a/web/templates/buddy_list/view_all_users.hbs b/web/templates/buddy_list/view_all_users.hbs index 538fba27c8..7045d08554 100644 --- a/web/templates/buddy_list/view_all_users.hbs +++ b/web/templates/buddy_list/view_all_users.hbs @@ -1 +1 @@ -{{t "View all users" }} +{{t "View all users" }} diff --git a/web/templates/settings/user_list_admin.hbs b/web/templates/settings/user_list_admin.hbs index 82da327e90..230d20fdc4 100644 --- a/web/templates/settings/user_list_admin.hbs +++ b/web/templates/settings/user_list_admin.hbs @@ -1,4 +1,4 @@ -
+
diff --git a/web/templates/settings_overlay.hbs b/web/templates/settings_overlay.hbs index 465ef860ec..1d50a1de1f 100644 --- a/web/templates/settings_overlay.hbs +++ b/web/templates/settings_overlay.hbs @@ -86,7 +86,7 @@ {{#unless is_guest}} -
  • +
  • {{t "Users" }}
    diff --git a/web/tests/hashchange.test.js b/web/tests/hashchange.test.js index d971341cc8..883291d510 100644 --- a/web/tests/hashchange.test.js +++ b/web/tests/hashchange.test.js @@ -361,7 +361,7 @@ run_test("hash_interactions", ({override, override_rewire}) => { [settings, "launch"], ]); - window.location.hash = "#organization/user-list-admin"; + window.location.hash = "#organization/users"; helper.clear_events(); $window_stub.trigger("hashchange"); @@ -369,7 +369,22 @@ run_test("hash_interactions", ({override, override_rewire}) => { [overlays, "close_for_hash_change"], [settings, "build_page"], [admin, "build_page"], - [admin, "launch", ["user-list-admin"]], + [admin, "launch", ["users"]], + ]); + + window.location.hash = "#organization/user-list-admin"; + + // Check whether `user-list-admin` is redirect to `users`, we + // cannot test the exact hashchange here, since the section url + // takes effect in `admin.launch` and that's why we're checking + // the arguments passed to `admin.launch`. + helper.clear_events(); + $window_stub.trigger("hashchange"); + helper.assert_events([ + [overlays, "close_for_hash_change"], + [settings, "build_page"], + [admin, "build_page"], + [admin, "launch", ["users"]], ]); helper.clear_events(); diff --git a/zerver/lib/markdown/help_settings_links.py b/zerver/lib/markdown/help_settings_links.py index fc5faf7377..f48f1fcd42 100644 --- a/zerver/lib/markdown/help_settings_links.py +++ b/zerver/lib/markdown/help_settings_links.py @@ -58,7 +58,7 @@ link_mapping = { "Authentication methods", "/#organization/auth-methods", ], - "user-list-admin": ["Organization settings", "Users", "/#organization/user-list-admin"], + "users": ["Organization settings", "Users", "/#organization/users"], "deactivated-users-admin": [ "Organization settings", "Deactivated users",