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.

buddy_list: Set html instead of append for view all users link.

Shubham Padia90a1f0f7aa2b
diff --git a/web/src/buddy_list.ts b/web/src/buddy_list.ts
index 040e3a39183..1b76cda59c7 100644
--- a/web/src/buddy_list.ts
+++ b/web/src/buddy_list.ts
@@ -367,7 +367,7 @@ export class BuddyList extends BuddyListConf {
// This must happen after `fill_screen_with_content`
$("#buddy-list-users-matching-view-container .view-all-subscribers-link").remove();
- $("#buddy-list-other-users-container .view-all-users-link").remove();
+ $("#buddy-list-other-users-container .view-all-users-link").empty();
void this.render_view_user_list_links();
this.display_or_hide_sections();
void this.update_empty_list_placeholders();
@@ -758,7 +758,9 @@ export class BuddyList extends BuddyListConf {
// We give a link to view the list of all users to help reduce confusion about
// there being hidden (inactive) "other" users.
if (has_inactive_other_users) {
- $("#buddy-list-other-users-container").append($(render_view_all_users()));
+ $("#buddy-list-other-users-container .view-all-users-link").html(
+ render_view_all_users(),
+ );
}
// Note that we don't show a link for the participants list because we expect
diff --git a/web/templates/buddy_list/view_all_users.hbs b/web/templates/buddy_list/view_all_users.hbs
index 43ca6296b4e..67c3a82befe 100644
--- a/web/templates/buddy_list/view_all_users.hbs
+++ b/web/templates/buddy_list/view_all_users.hbs
@@ -1,7 +1,5 @@
-<div class="buddy-list-user-link view-all-users-link">
- <a class="right-sidebar-wrappable-text-container" href="#organization/users">
- <span class="right-sidebar-wrappable-text-inner">
- {{t "View all users" }}
- </span>
- </a>
-</div>
+<a class="right-sidebar-wrappable-text-container" href="#organization/users">
+ <span class="right-sidebar-wrappable-text-inner">
+ {{t "View all users" }}
+ </span>
+</a>
diff --git a/web/templates/right_sidebar.hbs b/web/templates/right_sidebar.hbs
index f0f0e4e254d..0e6053ad7b6 100644
--- a/web/templates/right_sidebar.hbs
+++ b/web/templates/right_sidebar.hbs
@@ -24,6 +24,7 @@
<div id="buddy-list-other-users-container" class="buddy-list-section-container">
<div class="buddy-list-subsection-header"></div>
<ul id="buddy-list-other-users" class="buddy-list-section"></ul>
+ <div class="buddy-list-user-link view-all-users-link"></div>
</div>
<div id="buddy_list_wrapper_padding"></div>
<div class="invite-user-shortcut">
diff --git a/web/tests/lib/buddy_list.cjs b/web/tests/lib/buddy_list.cjs
index 2f4763a9ddd..a0c5e211997 100644
--- a/web/tests/lib/buddy_list.cjs
+++ b/web/tests/lib/buddy_list.cjs
@@ -42,7 +42,7 @@ exports.stub_buddy_list_elements = () => {
$("#buddy-list-other-users .empty-list-message").length = 0;
$("#buddy-list-other-users-container .view-all-users-link").length = 0;
$("#buddy-list-users-matching-view-container .view-all-subscribers-link").remove = noop;
- $("#buddy-list-other-users-container .view-all-users-link").remove = noop;
+ $("#buddy-list-other-users-container .view-all-users-link").empty = noop;
$(`#buddy-list-users-matching-view .empty-list-message`).remove = noop;
$(`#buddy-list-other-users .empty-list-message`).remove = noop;
$(`#buddy-list-participants .empty-list-message`).remove = noop;